]> git.kernelconcepts.de Git - karo-tx-uboot.git/blob - patches/0105-ENGR00122030-Mfg-Firmware-support-fot-imx25.patch
imported Ka-Ro specific additions to U-Boot 2009.08 for TX28
[karo-tx-uboot.git] / patches / 0105-ENGR00122030-Mfg-Firmware-support-fot-imx25.patch
1 From 025e700031adf10bafe7e8713385a18b9080111c Mon Sep 17 00:00:00 2001
2 From: Yan Wang <r65094@freescale.com>
3 Date: Wed, 7 Apr 2010 15:35:17 +0800
4 Subject: [PATCH] ENGR00122030 Mfg Firmware support fot imx25
5
6         Add mfg firmware support for imx25
7
8 Signed-off-by:Yan Wang<r65094@freescale.com>
9 ---
10  Makefile                                  |    1 +
11  board/freescale/mx25_3stack/mx25_3stack.c |    9 +
12  include/configs/mx25_3stack_mfg.h         |  262 +++++++++++++++++++++++++++++
13  3 files changed, 272 insertions(+), 0 deletions(-)
14
15 diff --git a/Makefile b/Makefile
16 index aa0317a..6424606 100644
17 --- a/Makefile
18 +++ b/Makefile
19 @@ -3207,6 +3207,7 @@ apollon_config            : unconfig
20         @$(MKCONFIG) $(@:_config=) arm arm1136 apollon NULL omap24xx
21         @echo "CONFIG_ONENAND_U_BOOT = y" >> $(obj)include/config.mk
22  
23 +mx25_3stack_mfg_config \
24  mx25_3stack_config     :       unconfig
25         @$(MKCONFIG) $(@:_config=) arm arm926ejs mx25_3stack freescale mx25
26  
27 diff --git a/board/freescale/mx25_3stack/mx25_3stack.c b/board/freescale/mx25_3stack/mx25_3stack.c
28 index e5624c1..66e4779 100644
29 --- a/board/freescale/mx25_3stack/mx25_3stack.c
30 +++ b/board/freescale/mx25_3stack/mx25_3stack.c
31 @@ -200,6 +200,15 @@ void spi_io_init(struct imx_spi_dev_t *dev)
32  
33  int board_init(void)
34  {
35 +
36 +#ifdef CONFIG_MFG
37 +/* MFG firmware need reset usb to avoid host crash firstly */
38 +#define USBCMD 0x140
39 +       int val = readl(USB_BASE + USBCMD);
40 +       val &= ~0x1; /*RS bit*/
41 +       writel(val, USB_BASE + USBCMD);
42 +#endif
43 +
44         setup_soc_rev();
45  
46         /* setup pins for UART1 */
47 diff --git a/include/configs/mx25_3stack_mfg.h b/include/configs/mx25_3stack_mfg.h
48 new file mode 100644
49 index 0000000..a907d06
50 --- /dev/null
51 +++ b/include/configs/mx25_3stack_mfg.h
52 @@ -0,0 +1,262 @@
53 +/*
54 + * (C) Copyright 2009-2010 Freescale Semiconductor
55 + *
56 + * (C) Copyright 2004
57 + * Texas Instruments.
58 + * Richard Woodruff <r-woodruff2@ti.com>
59 + * Kshitij Gupta <kshitij@ti.com>
60 + *
61 + * Configuration settings for the Freescale i.MX31 PDK board.
62 + *
63 + * See file CREDITS for list of people who contributed to this
64 + * project.
65 + *
66 + * This program is free software; you can redistribute it and/or
67 + * modify it under the terms of the GNU General Public License as
68 + * published by the Free Software Foundation; either version 2 of
69 + * the License, or (at your option) any later version.
70 + *
71 + * This program is distributed in the hope that it will be useful,
72 + * but WITHOUT ANY WARRANTY; without even the implied warranty of
73 + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.         See the
74 + * GNU General Public License for more details.
75 + *
76 + * You should have received a copy of the GNU General Public License
77 + * along with this program; if not, write to the Free Software
78 + * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
79 + * MA 02111-1307 USA
80 + */
81 +
82 +#ifndef __CONFIG_H
83 +#define __CONFIG_H
84 +
85 +#include <asm/arch/mx25.h>
86 +#include <asm/arch/mx25-regs.h>
87 +
88 +/* High Level Configuration Options */
89 +#define CONFIG_ARM926EJS       1       /* This is an arm1136 CPU core */
90 +#define CONFIG_MX25            1       /* in a mx31 */
91 +#define CONFIG_MX25_HCLK_FREQ  24000000
92 +#define CONFIG_MX25_CLK32      32768
93 +
94 +#define CONFIG_MFG             1
95 +#define CONFIG_IMX_CSPI                1
96 +#define IMX_CSPI_VER_0_7       1
97 +#define CONFIG_IMX_SPI_CPLD
98 +
99 +/* IF iMX25 3DS V-1.0 define it */
100 +/* #define CONFIG_MX25_3DS_V10 */
101 +
102 +#ifdef CONFIG_MX25_3DS_V10
103 +#define MXC_MEMORY_MDDR
104 +#endif
105 +
106 +#define CONFIG_DISPLAY_CPUINFO
107 +#define CONFIG_DISPLAY_BOARDINFO
108 +
109 +#define CONFIG_SYS_64BIT_VSPRINTF
110 +#define BOARD_LATE_INIT
111 +
112 +#define CONFIG_CMDLINE_TAG             1       /* enable passing of ATAGs */
113 +#define CONFIG_SETUP_MEMORY_TAGS       1
114 +#define CONFIG_INITRD_TAG              1
115 +#define CONFIG_REVISION_TAG             1
116 +
117 +/* No support for NAND boot for i.MX31 PDK yet, so we rely on some other
118 + * program to initialize the SDRAM.
119 + */
120 +#define CONFIG_SKIP_RELOCATE_UBOOT
121 +
122 +/*
123 + * Size of malloc() pool
124 + */
125 +#define CONFIG_SYS_MALLOC_LEN          (CONFIG_ENV_SIZE + 512 * 1024)
126 +#define CONFIG_SYS_GBL_DATA_SIZE       128 /* bytes reserved initial data */
127 +
128 +/*
129 + * Hardware drivers
130 + */
131 +#define CONFIG_HARD_I2C                1
132 +#define CONFIG_I2C_MXC         1
133 +#define CONFIG_SYS_I2C_PORT            I2C1_BASE
134 +#define CONFIG_SYS_I2C_SPEED           40000
135 +#define CONFIG_SYS_I2C_SLAVE           0xfe
136 +
137 +#define CONFIG_MX25_UART       1
138 +#define CONFIG_MX25_UART1              1
139 +
140 +/* allow to overwrite serial and ethaddr */
141 +#define CONFIG_ENV_OVERWRITE
142 +#define CONFIG_CONS_INDEX      1
143 +#define CONFIG_BAUDRATE                115200
144 +#define CONFIG_SYS_BAUDRATE_TABLE      {9600, 19200, 38400, 57600, 115200}
145 +
146 +/***********************************************************
147 + * Command definition
148 + ***********************************************************/
149 +
150 +#include <config_cmd_default.h>
151 +
152 +#define CONFIG_CMD_I2C
153 +#define CONFIG_CMD_MII
154 +#define CONFIG_CMD_PING
155 +/* #define CONFIG_CMD_SPI */
156 +/* #define CONFIG_CMD_DATE */
157 +#define CONFIG_CMD_NAND
158 +#define CONFIG_CMD_MMC
159 +#define CONFIG_MXC_NAND
160 +
161 +/*
162 + * MMC Configs
163 + * */
164 +#ifdef CONFIG_CMD_MMC
165 +       #define CONFIG_MMC                              1
166 +       #define CONFIG_GENERIC_MMC
167 +       #define CONFIG_IMX_MMC
168 +       #define CONFIG_SYS_FSL_ESDHC_NUM        2
169 +       #define CONFIG_SYS_FSL_ESDHC_ADDR       0
170 +       #define CONFIG_SYS_MMC_ENV_DEV  0
171 +       #define CONFIG_IMX_ESDHC_V1
172 +       #define CONFIG_DOS_PARTITION    1
173 +       #define CONFIG_CMD_FAT          1
174 +#endif
175 +
176 +/* Disabled due to compilation errors in cmd_bootm.c (IMLS seems to require
177 + * that CONFIG_NO_FLASH is undefined).
178 + */
179 +#undef CONFIG_CMD_IMLS
180 +
181 +#define CONFIG_BOOTDELAY       0
182 +
183 +#define CONFIG_LOADADDR                0x80100000      /* loadaddr env var */
184 +
185 +#define CONFIG_BOOTAGS         "console=ttymxc0,115200 "\
186 +                               "rdinit=/linuxrc"
187 +#define CONFIG_BOOTCOMMAND      "bootm ${loadaddr} 0x80800000"
188 +#define CONFIG_ENV_IS_EMBEDDED
189 +
190 +/*
191 +#define        CONFIG_EXTRA_ENV_SETTINGS                                       \
192 +       "netdev=eth0\0"                                                 \
193 +       "ethprime=smc911x-0\0"                                          \
194 +       "uboot=u-boot.bin\0"                                            \
195 +       "uboot_addr=0xa0000000\0"                                       \
196 +       "kernel=uImage\0"                                               \
197 +       "bootargs_base=setenv bootargs console=ttymxc0,115200\0"        \
198 +       "bootargs_nfs=setenv bootargs $(bootargs) root=/dev/nfs "       \
199 +               "ip=dhcp nfsroot=$(serverip):$(nfsrootfs),v3,tcp\0"     \
200 +       "bootcmd=run bootcmd_net\0"                                     \
201 +       "bootcmd_net=run bootargs_base bootargs_nfs; "                  \
202 +               "tftpboot ${loadaddr} ${kernel}; bootm\0"               \
203 +       "load_uboot=tftpboot ${loadaddr} ${uboot}\0"
204 +*/
205 +
206 +/*Support LAN9217*/
207 +#define CONFIG_SMC911X
208 +#define CONFIG_SMC911X_CPLD
209 +#define CONFIG_SMC911X_BASE    0
210 +
211 +#define CONFIG_HAS_ETH1
212 +#define CONFIG_CMD_NET
213 +#define CONFIG_NET_RETRY_COUNT 100
214 +#define CONFIG_CMD_DHCP
215 +#define CONFIG_BOOTP_SUBNETMASK
216 +#define CONFIG_BOOTP_GATEWAY
217 +#define CONFIG_BOOTP_DNS
218 +#define CONFIG_NET_MULTI
219 +#define CONFIG_ETHPRIME
220 +
221 +#define CONFIG_MXC_FEC
222 +#define CONFIG_MII
223 +#define CONFIG_MII_GASKET
224 +#define CONFIG_DISCOVER_PHY
225 +
226 +#define CONFIG_FEC0_IOBASE FEC_BASE
227 +#define CONFIG_FEC0_PINMUX -1
228 +#define CONFIG_FEC0_PHY_ADDR 0x1F
229 +#define CONFIG_FEC0_MIIBASE -1
230 +
231 +/*
232 + * Miscellaneous configurable options
233 + */
234 +#define CONFIG_SYS_LONGHELP    /* undef to save memory */
235 +#define CONFIG_SYS_PROMPT      "MX25 U-Boot > "
236 +#define CONFIG_AUTO_COMPLETE
237 +#define CONFIG_SYS_CBSIZE      256  /* Console I/O Buffer Size */
238 +/* Print Buffer Size */
239 +#define CONFIG_SYS_PBSIZE      (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16)
240 +#define CONFIG_SYS_MAXARGS     16      /* max number of command args */
241 +#define CONFIG_SYS_BARGSIZE    CONFIG_SYS_CBSIZE /* Boot Argument Buf Size */
242 +
243 +#define CONFIG_SYS_MEMTEST_START       PHYS_SDRAM_1    /* memtest works on */
244 +#define CONFIG_SYS_MEMTEST_END 0x10000
245 +
246 +#define CONFIG_SYS_LOAD_ADDR   CONFIG_LOADADDR /* default load address */
247 +
248 +#define CONFIG_SYS_HZ                  1000
249 +
250 +#define UBOOT_IMAGE_SIZE       0x40000
251 +
252 +#define CONFIG_CMDLINE_EDITING 1
253 +
254 +/*-----------------------------------------------------------------------
255 + * Stack sizes
256 + *
257 + * The stack sizes are set up in start.S using the settings below
258 + */
259 +#define CONFIG_STACKSIZE       (128 * 1024) /* regular stack */
260 +
261 +/*-----------------------------------------------------------------------
262 + * Physical Memory Map
263 + */
264 +#define CONFIG_NR_DRAM_BANKS   1
265 +#define PHYS_SDRAM_1           CSD0_BASE
266 +
267 +/* iMX25 V-1.0 has 128MB but V-1.1 has only 64MB */
268 +#ifdef CONFIG_MX25_3DS_V10
269 +#define PHYS_SDRAM_1_SIZE      (128 * 1024 * 1024)
270 +#else
271 +#define PHYS_SDRAM_1_SIZE       (64 * 1024 * 1024)
272 +#endif
273 +
274 +/* Monitor at beginning of flash */
275 +/* #define CONFIG_FSL_ENV_IN_MMC */
276 +/*#define CONFIG_FSL_ENV_IN_NAND*/
277 +
278 +/*-----------------------------------------------------------------------
279 + * FLASH and environment organization
280 + */
281 +/*
282 +#if defined(CONFIG_FSL_ENV_IN_NAND)
283 +       #define CONFIG_ENV_IS_IN_NAND 1
284 +       #define CONFIG_ENV_OFFSET       0x80000
285 +#elif defined(CONFIG_FSL_ENV_IN_MMC)
286 +       #define CONFIG_ENV_IS_IN_MMC    1
287 +       #define CONFIG_ENV_OFFSET       (768 * 1024)
288 +#else
289 +       #define CONFIG_ENV_IS_NOWHERE   1
290 +#endif
291 +*/
292 +
293 +#define CONFIG_ENV_IS_NOWHERE
294 +
295 +#define CONFIG_ENV_SECT_SIZE   (256 * 1024)
296 +#define CONFIG_ENV_SIZE         CONFIG_ENV_SECT_SIZE
297 +
298 +/*-----------------------------------------------------------------------
299 + * NAND FLASH driver setup
300 + */
301 +#define CONFIG_SYS_NO_FLASH
302 +#define NAND_MAX_CHIPS         1
303 +#define CONFIG_SYS_MAX_NAND_DEVICE     1
304 +#define CONFIG_SYS_NAND_BASE           0x40000000
305 +
306 +/*
307 + * JFFS2 partitions TODO:
308 + */
309 +/*
310 +#undef CONFIG_JFFS2_CMDLINE
311 +#define CONFIG_JFFS2_DEV       "nand0"
312 +*/
313 +#endif /* __CONFIG_H */
314 +
315 -- 
316 1.5.4.4
317