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
6 Add mfg firmware support for imx25
8 Signed-off-by:Yan Wang<r65094@freescale.com>
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(-)
15 diff --git a/Makefile b/Makefile
16 index aa0317a..6424606 100644
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
23 +mx25_3stack_mfg_config \
24 mx25_3stack_config : unconfig
25 @$(MKCONFIG) $(@:_config=) arm arm926ejs mx25_3stack freescale mx25
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)
37 +/* MFG firmware need reset usb to avoid host crash firstly */
39 + int val = readl(USB_BASE + USBCMD);
40 + val &= ~0x1; /*RS bit*/
41 + writel(val, USB_BASE + USBCMD);
46 /* setup pins for UART1 */
47 diff --git a/include/configs/mx25_3stack_mfg.h b/include/configs/mx25_3stack_mfg.h
49 index 0000000..a907d06
51 +++ b/include/configs/mx25_3stack_mfg.h
54 + * (C) Copyright 2009-2010 Freescale Semiconductor
56 + * (C) Copyright 2004
57 + * Texas Instruments.
58 + * Richard Woodruff <r-woodruff2@ti.com>
59 + * Kshitij Gupta <kshitij@ti.com>
61 + * Configuration settings for the Freescale i.MX31 PDK board.
63 + * See file CREDITS for list of people who contributed to this
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.
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.
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,
85 +#include <asm/arch/mx25.h>
86 +#include <asm/arch/mx25-regs.h>
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
95 +#define CONFIG_IMX_CSPI 1
96 +#define IMX_CSPI_VER_0_7 1
97 +#define CONFIG_IMX_SPI_CPLD
99 +/* IF iMX25 3DS V-1.0 define it */
100 +/* #define CONFIG_MX25_3DS_V10 */
102 +#ifdef CONFIG_MX25_3DS_V10
103 +#define MXC_MEMORY_MDDR
106 +#define CONFIG_DISPLAY_CPUINFO
107 +#define CONFIG_DISPLAY_BOARDINFO
109 +#define CONFIG_SYS_64BIT_VSPRINTF
110 +#define BOARD_LATE_INIT
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
117 +/* No support for NAND boot for i.MX31 PDK yet, so we rely on some other
118 + * program to initialize the SDRAM.
120 +#define CONFIG_SKIP_RELOCATE_UBOOT
123 + * Size of malloc() pool
125 +#define CONFIG_SYS_MALLOC_LEN (CONFIG_ENV_SIZE + 512 * 1024)
126 +#define CONFIG_SYS_GBL_DATA_SIZE 128 /* bytes reserved initial data */
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
137 +#define CONFIG_MX25_UART 1
138 +#define CONFIG_MX25_UART1 1
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}
146 +/***********************************************************
147 + * Command definition
148 + ***********************************************************/
150 +#include <config_cmd_default.h>
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
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
176 +/* Disabled due to compilation errors in cmd_bootm.c (IMLS seems to require
177 + * that CONFIG_NO_FLASH is undefined).
179 +#undef CONFIG_CMD_IMLS
181 +#define CONFIG_BOOTDELAY 0
183 +#define CONFIG_LOADADDR 0x80100000 /* loadaddr env var */
185 +#define CONFIG_BOOTAGS "console=ttymxc0,115200 "\
187 +#define CONFIG_BOOTCOMMAND "bootm ${loadaddr} 0x80800000"
188 +#define CONFIG_ENV_IS_EMBEDDED
191 +#define CONFIG_EXTRA_ENV_SETTINGS \
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"
207 +#define CONFIG_SMC911X
208 +#define CONFIG_SMC911X_CPLD
209 +#define CONFIG_SMC911X_BASE 0
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
221 +#define CONFIG_MXC_FEC
223 +#define CONFIG_MII_GASKET
224 +#define CONFIG_DISCOVER_PHY
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
232 + * Miscellaneous configurable options
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 */
243 +#define CONFIG_SYS_MEMTEST_START PHYS_SDRAM_1 /* memtest works on */
244 +#define CONFIG_SYS_MEMTEST_END 0x10000
246 +#define CONFIG_SYS_LOAD_ADDR CONFIG_LOADADDR /* default load address */
248 +#define CONFIG_SYS_HZ 1000
250 +#define UBOOT_IMAGE_SIZE 0x40000
252 +#define CONFIG_CMDLINE_EDITING 1
254 +/*-----------------------------------------------------------------------
257 + * The stack sizes are set up in start.S using the settings below
259 +#define CONFIG_STACKSIZE (128 * 1024) /* regular stack */
261 +/*-----------------------------------------------------------------------
262 + * Physical Memory Map
264 +#define CONFIG_NR_DRAM_BANKS 1
265 +#define PHYS_SDRAM_1 CSD0_BASE
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)
271 +#define PHYS_SDRAM_1_SIZE (64 * 1024 * 1024)
274 +/* Monitor at beginning of flash */
275 +/* #define CONFIG_FSL_ENV_IN_MMC */
276 +/*#define CONFIG_FSL_ENV_IN_NAND*/
278 +/*-----------------------------------------------------------------------
279 + * FLASH and environment organization
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)
289 + #define CONFIG_ENV_IS_NOWHERE 1
293 +#define CONFIG_ENV_IS_NOWHERE
295 +#define CONFIG_ENV_SECT_SIZE (256 * 1024)
296 +#define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
298 +/*-----------------------------------------------------------------------
299 + * NAND FLASH driver setup
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
307 + * JFFS2 partitions TODO:
310 +#undef CONFIG_JFFS2_CMDLINE
311 +#define CONFIG_JFFS2_DEV "nand0"
313 +#endif /* __CONFIG_H */