1 /*
2  * Copyright 2008 Extreme Engineering Solutions, Inc.
3  * Copyright 2007-2008 Freescale Semiconductor, Inc.
4  *
5  * SPDX-License-Identifier:	GPL-2.0+
6  */
7 
8 /*
9  * xpedite537x board configuration file
10  */
11 #ifndef __CONFIG_H
12 #define __CONFIG_H
13 
14 /*
15  * High Level Configuration Options
16  */
17 #define CONFIG_BOOKE		1	/* BOOKE */
18 #define CONFIG_E500		1	/* BOOKE e500 family */
19 #define CONFIG_SYS_BOARD_NAME	"XPedite5370"
20 #define CONFIG_SYS_FORM_3U_VPX	1
21 #define CONFIG_BOARD_EARLY_INIT_R	/* Call board_pre_init */
22 
23 #ifndef CONFIG_SYS_TEXT_BASE
24 #define CONFIG_SYS_TEXT_BASE	0xfff80000
25 #endif
26 
27 #define CONFIG_PCI_SCAN_SHOW	1	/* show pci devices on startup */
28 #define CONFIG_PCIE1		1	/* PCIE controller 1 */
29 #define CONFIG_PCIE2		1	/* PCIE controller 2 */
30 #define CONFIG_FSL_PCI_INIT	1	/* Use common FSL init code */
31 #define CONFIG_PCI_INDIRECT_BRIDGE 1	/* indirect PCI bridge support */
32 #define CONFIG_SYS_PCI_64BIT	1	/* enable 64-bit PCI resources */
33 #define CONFIG_FSL_PCIE_RESET	1	/* need PCIe reset errata */
34 #define CONFIG_FSL_LAW		1	/* Use common FSL init code */
35 #define CONFIG_FSL_ELBC		1
36 
37 /*
38  * Multicore config
39  */
40 #define CONFIG_MP
41 #define CONFIG_BPTR_VIRT_ADDR	0xee000000	/* virt boot page address */
42 #define CONFIG_MPC8xxx_DISABLE_BPTR		/* Don't leave BPTR enabled */
43 
44 /*
45  * DDR config
46  */
47 #define CONFIG_SYS_FSL_DDR2
48 #undef CONFIG_FSL_DDR_INTERACTIVE
49 #define CONFIG_SPD_EEPROM		/* Use SPD EEPROM for DDR setup */
50 #define CONFIG_DDR_SPD
51 #define CONFIG_MEM_INIT_VALUE		0xdeadbeef
52 #define SPD_EEPROM_ADDRESS1		0x54	/* Both channels use the */
53 #define SPD_EEPROM_ADDRESS2		0x54	/* same SPD data         */
54 #define SPD_EEPROM_OFFSET		0x200	/* OFFSET of SPD in EEPROM */
55 #define CONFIG_NUM_DDR_CONTROLLERS	2
56 #define CONFIG_DIMM_SLOTS_PER_CTLR	1
57 #define CONFIG_CHIP_SELECTS_PER_CTRL	1
58 #define CONFIG_DDR_ECC
59 #define CONFIG_ECC_INIT_VIA_DDRCONTROLLER
60 #define CONFIG_SYS_DDR_SDRAM_BASE	0x00000000 /* DDR is system memory*/
61 #define CONFIG_SYS_SDRAM_BASE		CONFIG_SYS_DDR_SDRAM_BASE
62 #define CONFIG_VERY_BIG_RAM
63 
64 #ifndef __ASSEMBLY__
65 extern unsigned long get_board_sys_clk(unsigned long dummy);
66 extern unsigned long get_board_ddr_clk(unsigned long dummy);
67 #endif
68 
69 #define CONFIG_SYS_CLK_FREQ	get_board_sys_clk(0) /* sysclk for MPC85xx */
70 #define CONFIG_DDR_CLK_FREQ	get_board_ddr_clk(0) /* ddrclk for MPC85xx */
71 
72 /*
73  * These can be toggled for performance analysis, otherwise use default.
74  */
75 #define CONFIG_L2_CACHE			/* toggle L2 cache */
76 #define CONFIG_BTB			/* toggle branch predition */
77 #define CONFIG_ENABLE_36BIT_PHYS	1
78 
79 #define CONFIG_SYS_CCSRBAR		0xef000000
80 #define CONFIG_SYS_CCSRBAR_PHYS_LOW	CONFIG_SYS_CCSRBAR
81 
82 /*
83  * Diagnostics
84  */
85 #define CONFIG_SYS_ALT_MEMTEST
86 #define CONFIG_SYS_MEMTEST_START	0x10000000
87 #define CONFIG_SYS_MEMTEST_END		0x20000000
88 #define CONFIG_POST			(CONFIG_SYS_POST_MEMORY | \
89 					 CONFIG_SYS_POST_I2C)
90 #define I2C_ADDR_LIST			{CONFIG_SYS_I2C_DS1621_ADDR,	\
91 					 CONFIG_SYS_I2C_DS4510_ADDR,	\
92 					 CONFIG_SYS_I2C_EEPROM_ADDR,	\
93 					 CONFIG_SYS_I2C_LM90_ADDR,	\
94 					 CONFIG_SYS_I2C_PCA953X_ADDR0,	\
95 					 CONFIG_SYS_I2C_PCA953X_ADDR1,	\
96 					 CONFIG_SYS_I2C_PCA953X_ADDR2,	\
97 					 CONFIG_SYS_I2C_PCA953X_ADDR3,	\
98 					 CONFIG_SYS_I2C_PEX8518_ADDR,	\
99 					 CONFIG_SYS_I2C_RTC_ADDR}
100 /* The XPedite5370 can host an XMC which has an EEPROM at address 0x50 */
101 #define I2C_ADDR_IGNORE_LIST		{0x50}
102 
103 /*
104  * Memory map
105  * 0x0000_0000	0x7fff_ffff	DDR			2G Cacheable
106  * 0x8000_0000	0xbfff_ffff	PCIe1 Mem		1G non-cacheable
107  * 0xc000_0000	0xcfff_ffff	PCIe2 Mem		256M non-cacheable
108  * 0xe000_0000	0xe7ff_ffff	SRAM/SSRAM/L1 Cache	128M non-cacheable
109  * 0xe800_0000	0xe87f_ffff	PCIe1 IO		8M non-cacheable
110  * 0xe880_0000	0xe8ff_ffff	PCIe2 IO		8M non-cacheable
111  * 0xee00_0000	0xee00_ffff	Boot page translation	4K non-cacheable
112  * 0xef00_0000	0xef0f_ffff	CCSR/IMMR		1M non-cacheable
113  * 0xef80_0000	0xef8f_ffff	NAND Flash		1M non-cacheable
114  * 0xf000_0000	0xf7ff_ffff	NOR Flash 2		128M non-cacheable
115  * 0xf800_0000	0xffff_ffff	NOR Flash 1		128M non-cacheable
116  */
117 
118 #define CONFIG_SYS_LBC_LCRR	(LCRR_CLKDIV_8 | LCRR_EADC_3)
119 
120 /*
121  * NAND flash configuration
122  */
123 #define CONFIG_SYS_NAND_BASE		0xef800000
124 #define CONFIG_SYS_NAND_BASE2		0xef840000 /* Unused at this time */
125 #define CONFIG_SYS_NAND_BASE_LIST	{CONFIG_SYS_NAND_BASE, \
126 					 CONFIG_SYS_NAND_BASE2}
127 #define CONFIG_SYS_MAX_NAND_DEVICE	2
128 #define CONFIG_NAND_FSL_ELBC
129 
130 /*
131  * NOR flash configuration
132  */
133 #define CONFIG_SYS_FLASH_BASE		0xf8000000
134 #define CONFIG_SYS_FLASH_BASE2		0xf0000000
135 #define CONFIG_SYS_FLASH_BANKS_LIST	{CONFIG_SYS_FLASH_BASE, CONFIG_SYS_FLASH_BASE2}
136 #define CONFIG_SYS_MAX_FLASH_BANKS	2		/* number of banks */
137 #define CONFIG_SYS_MAX_FLASH_SECT	1024		/* sectors per device */
138 #define CONFIG_SYS_FLASH_ERASE_TOUT	60000		/* Flash Erase Timeout (ms) */
139 #define CONFIG_SYS_FLASH_WRITE_TOUT	500		/* Flash Write Timeout (ms) */
140 #define CONFIG_FLASH_CFI_DRIVER
141 #define CONFIG_SYS_FLASH_CFI
142 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
143 #define CONFIG_SYS_FLASH_AUTOPROTECT_LIST	{ {0xfff40000, 0xc0000}, \
144 						  {0xf7f40000, 0xc0000} }
145 #define CONFIG_SYS_MONITOR_BASE	CONFIG_SYS_TEXT_BASE	/* start of monitor */
146 
147 /*
148  * Chip select configuration
149  */
150 /* NOR Flash 0 on CS0 */
151 #define CONFIG_SYS_BR0_PRELIM	(CONFIG_SYS_FLASH_BASE	| \
152 				 BR_PS_16		| \
153 				 BR_V)
154 #define CONFIG_SYS_OR0_PRELIM	(OR_AM_128MB		| \
155 				 OR_GPCM_CSNT		| \
156 				 OR_GPCM_XACS		| \
157 				 OR_GPCM_ACS_DIV2	| \
158 				 OR_GPCM_SCY_8		| \
159 				 OR_GPCM_TRLX		| \
160 				 OR_GPCM_EHTR		| \
161 				 OR_GPCM_EAD)
162 
163 /* NOR Flash 1 on CS1 */
164 #define CONFIG_SYS_BR1_PRELIM	(CONFIG_SYS_FLASH_BASE2	| \
165 				 BR_PS_16		| \
166 				 BR_V)
167 #define CONFIG_SYS_OR1_PRELIM	CONFIG_SYS_OR0_PRELIM
168 
169 /* NAND flash on CS2 */
170 #define CONFIG_SYS_BR2_PRELIM	(CONFIG_SYS_NAND_BASE	| \
171 				 (2<<BR_DECC_SHIFT)	| \
172 				 BR_PS_8		| \
173 				 BR_MS_FCM		| \
174 				 BR_V)
175 
176 /* NAND flash on CS2 */
177 #define CONFIG_SYS_OR2_PRELIM	(OR_AM_256KB	| \
178 				 OR_FCM_PGS	| \
179 				 OR_FCM_CSCT	| \
180 				 OR_FCM_CST	| \
181 				 OR_FCM_CHT	| \
182 				 OR_FCM_SCY_1	| \
183 				 OR_FCM_TRLX	| \
184 				 OR_FCM_EHTR)
185 
186 /* NAND flash on CS3 */
187 #define CONFIG_SYS_BR3_PRELIM	(CONFIG_SYS_NAND_BASE2	| \
188 				 (2<<BR_DECC_SHIFT)	| \
189 				 BR_PS_8		| \
190 				 BR_MS_FCM		| \
191 				 BR_V)
192 #define CONFIG_SYS_OR3_PRELIM	CONFIG_SYS_OR2_PRELIM
193 
194 /*
195  * Use L1 as initial stack
196  */
197 #define CONFIG_SYS_INIT_RAM_LOCK	1
198 #define CONFIG_SYS_INIT_RAM_ADDR	0xe0000000
199 #define CONFIG_SYS_INIT_RAM_SIZE		0x00004000
200 
201 #define CONFIG_SYS_GBL_DATA_OFFSET	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
202 #define CONFIG_SYS_INIT_SP_OFFSET	CONFIG_SYS_GBL_DATA_OFFSET
203 
204 #define CONFIG_SYS_MONITOR_LEN		(512 * 1024)	/* Reserve 512 KB for Mon */
205 #define CONFIG_SYS_MALLOC_LEN		(1024 * 1024)	/* Reserved for malloc */
206 
207 /*
208  * Serial Port
209  */
210 #define CONFIG_CONS_INDEX		1
211 #define CONFIG_SYS_NS16550_SERIAL
212 #define CONFIG_SYS_NS16550_REG_SIZE	1
213 #define CONFIG_SYS_NS16550_CLK		get_bus_freq(0)
214 #define CONFIG_SYS_NS16550_COM1	(CONFIG_SYS_CCSRBAR+0x4500)
215 #define CONFIG_SYS_NS16550_COM2	(CONFIG_SYS_CCSRBAR+0x4600)
216 #define CONFIG_SYS_BAUDRATE_TABLE	\
217 	{300, 600, 1200, 2400, 4800, 9600, 19200, 38400, 115200}
218 #define CONFIG_BAUDRATE			115200
219 #define CONFIG_LOADS_ECHO		1	/* echo on for serial download */
220 #define CONFIG_SYS_LOADS_BAUD_CHANGE	1	/* allow baudrate change */
221 
222 /*
223  * I2C
224  */
225 #define CONFIG_SYS_I2C
226 #define CONFIG_SYS_I2C_FSL
227 #define CONFIG_SYS_FSL_I2C_SPEED	400000
228 #define CONFIG_SYS_FSL_I2C_SLAVE	0x7F
229 #define CONFIG_SYS_FSL_I2C_OFFSET	0x3000
230 #define CONFIG_SYS_FSL_I2C2_SPEED	400000
231 #define CONFIG_SYS_FSL_I2C2_SLAVE	0x7F
232 #define CONFIG_SYS_FSL_I2C2_OFFSET	0x3100
233 #define CONFIG_SYS_I2C_NOPROBES		{ {0, 0x69} }
234 
235 /* PEX8518 slave I2C interface */
236 #define CONFIG_SYS_I2C_PEX8518_ADDR	0x70
237 
238 /* I2C DS1631 temperature sensor */
239 #define CONFIG_SYS_I2C_DS1621_ADDR	0x48
240 #define CONFIG_DTT_DS1621
241 #define CONFIG_DTT_SENSORS		{ 0 }
242 #define CONFIG_SYS_I2C_LM90_ADDR	0x4c
243 
244 /* I2C EEPROM - AT24C128B */
245 #define CONFIG_SYS_I2C_EEPROM_ADDR		0x54
246 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN		2
247 #define CONFIG_SYS_EEPROM_PAGE_WRITE_BITS	6	/* 64 byte pages */
248 #define CONFIG_SYS_EEPROM_PAGE_WRITE_DELAY_MS	10	/* take up to 10 msec */
249 
250 /* I2C RTC */
251 #define CONFIG_RTC_M41T11		1
252 #define CONFIG_SYS_I2C_RTC_ADDR		0x68
253 #define CONFIG_SYS_M41T11_BASE_YEAR	2000
254 
255 /* GPIO/EEPROM/SRAM */
256 #define CONFIG_DS4510
257 #define CONFIG_SYS_I2C_DS4510_ADDR	0x51
258 
259 /* GPIO */
260 #define CONFIG_PCA953X
261 #define CONFIG_SYS_I2C_PCA953X_ADDR0	0x18
262 #define CONFIG_SYS_I2C_PCA953X_ADDR1	0x1c
263 #define CONFIG_SYS_I2C_PCA953X_ADDR2	0x1e
264 #define CONFIG_SYS_I2C_PCA953X_ADDR3	0x1f
265 #define CONFIG_SYS_I2C_PCA953X_ADDR	CONFIG_SYS_I2C_PCA953X_ADDR0
266 
267 /*
268  * PU = pulled high, PD = pulled low
269  * I = input, O = output, IO = input/output
270  */
271 /* PCA9557 @ 0x18*/
272 #define CONFIG_SYS_PCA953X_C0_SER0_EN		0x01 /* PU; UART0 enable (1: enabled) */
273 #define CONFIG_SYS_PCA953X_C0_SER0_MODE		0x02 /* PU; UART0 serial mode select */
274 #define CONFIG_SYS_PCA953X_C0_SER1_EN		0x04 /* PU; UART1 enable (1: enabled) */
275 #define CONFIG_SYS_PCA953X_C0_SER1_MODE		0x08 /* PU; UART1 serial mode select */
276 #define CONFIG_SYS_PCA953X_C0_FLASH_PASS_CS	0x10 /* PU; Boot flash CS select */
277 #define CONFIG_SYS_PCA953X_NVM_WP		0x20 /* PU; Set to 0 to enable NVM writing */
278 #define CONFIG_SYS_PCA953X_C0_VCORE_VID2	0x40 /* VID2 of ISL6262 */
279 #define CONFIG_SYS_PCA953X_C0_VCORE_VID3	0x80 /* VID3 of ISL6262 */
280 
281 /* PCA9557 @ 0x1c*/
282 #define CONFIG_SYS_PCA953X_XMC0_ROOT0		0x01 /* PU; Low if XMC is RC */
283 #define CONFIG_SYS_PCA953X_XMC0_MVMR0		0x02 /* XMC EEPROM write protect */
284 #define CONFIG_SYS_PCA953X_XMC0_WAKE		0x04 /* PU; XMC wake */
285 #define CONFIG_SYS_PCA953X_XMC0_BIST		0x08 /* PU; XMC built in self test */
286 #define CONFIG_SYS_PCA953X_XMC_PRESENT		0x10 /* PU; Low if XMC module installed */
287 #define CONFIG_SYS_PCA953X_PMC_PRESENT		0x20 /* PU; Low if PMC module installed */
288 #define CONFIG_SYS_PCA953X_PMC0_MONARCH		0x40 /* PMC monarch mode enable */
289 #define CONFIG_SYS_PCA953X_PMC0_EREADY		0x80 /* PU; PMC PCI eready */
290 
291 /* PCA9557 @ 0x1e*/
292 #define CONFIG_SYS_PCA953X_P0_GA0		0x01 /* PU; VPX Geographical address */
293 #define CONFIG_SYS_PCA953X_P0_GA1		0x02 /* PU; VPX Geographical address */
294 #define CONFIG_SYS_PCA953X_P0_GA2		0x04 /* PU; VPX Geographical address */
295 #define CONFIG_SYS_PCA953X_P0_GA3		0x08 /* PU; VPX Geographical address */
296 #define CONFIG_SYS_PCA953X_P0_GA4		0x10 /* PU; VPX Geographical address */
297 #define CONFIG_SYS_PCA953X_P0_GAP		0x20 /* PU; tied to VPX P0.GAP */
298 #define CONFIG_SYS_PCA953X_P1_SYSEN		0x80 /* PU; Pulled high; tied to VPX P1.SYSCON */
299 
300 /* PCA9557 @ 0x1f */
301 #define CONFIG_SYS_PCA953X_GPIO_VPX0		0x01 /* PU */
302 #define CONFIG_SYS_PCA953X_GPIO_VPX1		0x02 /* PU */
303 #define CONFIG_SYS_PCA953X_GPIO_VPX2		0x04 /* PU */
304 #define CONFIG_SYS_PCA953X_GPIO_VPX3		0x08 /* PU */
305 #define CONFIG_SYS_PCA953X_VPX_FRU_WRCTL	0x10 /* PD; I2C master source for FRU SEEPROM */
306 
307 /*
308  * General PCI
309  * Memory space is mapped 1-1, but I/O space must start from 0.
310  */
311 /* PCIE1 - VPX P1 */
312 #define CONFIG_SYS_PCIE1_MEM_BUS	0x80000000
313 #define CONFIG_SYS_PCIE1_MEM_PHYS	CONFIG_SYS_PCIE1_MEM_BUS
314 #define CONFIG_SYS_PCIE1_MEM_SIZE	0x40000000	/* 1G */
315 #define CONFIG_SYS_PCIE1_IO_BUS		0x00000000
316 #define CONFIG_SYS_PCIE1_IO_PHYS	0xe8000000
317 #define CONFIG_SYS_PCIE1_IO_SIZE	0x00800000	/* 8M */
318 
319 /* PCIE2 - PEX8518 */
320 #define CONFIG_SYS_PCIE2_MEM_BUS	0xc0000000
321 #define CONFIG_SYS_PCIE2_MEM_PHYS	CONFIG_SYS_PCIE2_MEM_BUS
322 #define CONFIG_SYS_PCIE2_MEM_SIZE	0x10000000	/* 256M */
323 #define CONFIG_SYS_PCIE2_IO_BUS		0x00000000
324 #define CONFIG_SYS_PCIE2_IO_PHYS	0xe8800000
325 #define CONFIG_SYS_PCIE2_IO_SIZE	0x00800000	/* 8M */
326 
327 /*
328  * Networking options
329  */
330 #define CONFIG_TSEC_ENET		/* tsec ethernet support */
331 #define CONFIG_PHY_GIGE		1	/* Include GbE speed/duplex detection */
332 #define CONFIG_TSEC_TBI
333 #define CONFIG_MII		1	/* MII PHY management */
334 #define CONFIG_MII_DEFAULT_TSEC	1	/* Allow unregistered phys */
335 #define CONFIG_ETHPRIME		"eTSEC2"
336 
337 /*
338  * In-band SGMII auto-negotiation between TBI and BCM5482S PHY fails, force
339  * 1000mbps SGMII link
340  */
341 #define CONFIG_TSEC_TBICR_SETTINGS ( \
342 		TBICR_PHY_RESET \
343 		| TBICR_FULL_DUPLEX \
344 		| TBICR_SPEED1_SET \
345 		)
346 
347 #define CONFIG_TSEC1		1
348 #define CONFIG_TSEC1_NAME	"eTSEC1"
349 #define TSEC1_FLAGS		(TSEC_GIGABIT | TSEC_REDUCED)
350 #define TSEC1_PHY_ADDR		1
351 #define TSEC1_PHYIDX		0
352 #define CONFIG_HAS_ETH0
353 
354 #define CONFIG_TSEC2		1
355 #define CONFIG_TSEC2_NAME	"eTSEC2"
356 #define TSEC2_FLAGS		(TSEC_GIGABIT | TSEC_REDUCED)
357 #define TSEC2_PHY_ADDR		2
358 #define TSEC2_PHYIDX		0
359 #define CONFIG_HAS_ETH1
360 
361 /*
362  * Command configuration.
363  */
364 #define CONFIG_CMD_DATE
365 #define CONFIG_CMD_DS4510
366 #define CONFIG_CMD_DS4510_INFO
367 #define CONFIG_CMD_DTT
368 #define CONFIG_CMD_EEPROM
369 #define CONFIG_CMD_JFFS2
370 #define CONFIG_CMD_NAND
371 #define CONFIG_CMD_PCA953X
372 #define CONFIG_CMD_PCA953X_INFO
373 #define CONFIG_CMD_PCI
374 #define CONFIG_CMD_PCI_ENUM
375 #define CONFIG_CMD_REGINFO
376 
377 /*
378  * Miscellaneous configurable options
379  */
380 #define CONFIG_SYS_LONGHELP			/* undef to save memory	*/
381 #define CONFIG_SYS_LOAD_ADDR	0x2000000	/* default load address */
382 #define CONFIG_SYS_CBSIZE	256		/* Console I/O Buffer Size */
383 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE+sizeof(CONFIG_SYS_PROMPT)+16) /* Print Buffer Size */
384 #define CONFIG_SYS_MAXARGS	16		/* max number of command args */
385 #define CONFIG_SYS_BARGSIZE	CONFIG_SYS_CBSIZE	/* Boot Argument Buffer Size */
386 #define CONFIG_CMDLINE_EDITING	1		/* add command line history	*/
387 #define CONFIG_AUTO_COMPLETE	1		/* add autocompletion support */
388 #define CONFIG_LOADADDR		0x1000000	/* default location for tftp and bootm */
389 #define CONFIG_PANIC_HANG			/* do not reset board on panic */
390 #define CONFIG_PREBOOT				/* enable preboot variable */
391 #define CONFIG_INTEGRITY			/* support booting INTEGRITY OS */
392 
393 /*
394  * For booting Linux, the board info and command line data
395  * have to be in the first 16 MB of memory, since this is
396  * the maximum mapped by the Linux kernel during initialization.
397  */
398 #define CONFIG_SYS_BOOTMAPSZ	(16 << 20)	/* Initial Memory map for Linux*/
399 #define CONFIG_SYS_BOOTM_LEN	(16 << 20)	/* Increase max gunzip size */
400 
401 /*
402  * Environment Configuration
403  */
404 #define CONFIG_ENV_IS_IN_FLASH	1
405 #define CONFIG_ENV_SECT_SIZE	0x20000		/* 128k (one sector) for env */
406 #define CONFIG_ENV_SIZE		0x8000
407 #define CONFIG_ENV_ADDR		(CONFIG_SYS_MONITOR_BASE - (256 * 1024))
408 
409 /*
410  * Flash memory map:
411  * fff80000 - ffffffff     Pri U-Boot (512 KB)
412  * fff40000 - fff7ffff     Pri U-Boot Environment (256 KB)
413  * fff00000 - fff3ffff     Pri FDT (256KB)
414  * fef00000 - ffefffff     Pri OS image (16MB)
415  * f8000000 - feefffff     Pri OS Use/Filesystem (111MB)
416  *
417  * f7f80000 - f7ffffff     Sec U-Boot (512 KB)
418  * f7f40000 - f7f7ffff     Sec U-Boot Environment (256 KB)
419  * f7f00000 - f7f3ffff     Sec FDT (256KB)
420  * f6f00000 - f7efffff     Sec OS image (16MB)
421  * f0000000 - f6efffff     Sec OS Use/Filesystem (111MB)
422  */
423 #define CONFIG_UBOOT1_ENV_ADDR	__stringify(0xfff80000)
424 #define CONFIG_UBOOT2_ENV_ADDR	__stringify(0xf7f80000)
425 #define CONFIG_FDT1_ENV_ADDR	__stringify(0xfff00000)
426 #define CONFIG_FDT2_ENV_ADDR	__stringify(0xf7f00000)
427 #define CONFIG_OS1_ENV_ADDR	__stringify(0xfef00000)
428 #define CONFIG_OS2_ENV_ADDR	__stringify(0xf6f00000)
429 
430 #define CONFIG_PROG_UBOOT1						\
431 	"$download_cmd $loadaddr $ubootfile; "				\
432 	"if test $? -eq 0; then "					\
433 		"protect off "CONFIG_UBOOT1_ENV_ADDR" +80000; "		\
434 		"erase "CONFIG_UBOOT1_ENV_ADDR" +80000; "		\
435 		"cp.w $loadaddr "CONFIG_UBOOT1_ENV_ADDR" 40000; "	\
436 		"protect on "CONFIG_UBOOT1_ENV_ADDR" +80000; "		\
437 		"cmp.b $loadaddr "CONFIG_UBOOT1_ENV_ADDR" 80000; "	\
438 		"if test $? -ne 0; then "				\
439 			"echo PROGRAM FAILED; "				\
440 		"else; "						\
441 			"echo PROGRAM SUCCEEDED; "			\
442 		"fi; "							\
443 	"else; "							\
444 		"echo DOWNLOAD FAILED; "				\
445 	"fi;"
446 
447 #define CONFIG_PROG_UBOOT2						\
448 	"$download_cmd $loadaddr $ubootfile; "				\
449 	"if test $? -eq 0; then "					\
450 		"protect off "CONFIG_UBOOT2_ENV_ADDR" +80000; "		\
451 		"erase "CONFIG_UBOOT2_ENV_ADDR" +80000; "		\
452 		"cp.w $loadaddr "CONFIG_UBOOT2_ENV_ADDR" 40000; "	\
453 		"protect on "CONFIG_UBOOT2_ENV_ADDR" +80000; "		\
454 		"cmp.b $loadaddr "CONFIG_UBOOT2_ENV_ADDR" 80000; "	\
455 		"if test $? -ne 0; then "				\
456 			"echo PROGRAM FAILED; "				\
457 		"else; "						\
458 			"echo PROGRAM SUCCEEDED; "			\
459 		"fi; "							\
460 	"else; "							\
461 		"echo DOWNLOAD FAILED; "				\
462 	"fi;"
463 
464 #define CONFIG_BOOT_OS_NET						\
465 	"$download_cmd $osaddr $osfile; "				\
466 	"if test $? -eq 0; then "					\
467 		"if test -n $fdtaddr; then "				\
468 			"$download_cmd $fdtaddr $fdtfile; "		\
469 			"if test $? -eq 0; then "			\
470 				"bootm $osaddr - $fdtaddr; "		\
471 			"else; "					\
472 				"echo FDT DOWNLOAD FAILED; "		\
473 			"fi; "						\
474 		"else; "						\
475 			"bootm $osaddr; "				\
476 		"fi; "							\
477 	"else; "							\
478 		"echo OS DOWNLOAD FAILED; "				\
479 	"fi;"
480 
481 #define CONFIG_PROG_OS1							\
482 	"$download_cmd $osaddr $osfile; "				\
483 	"if test $? -eq 0; then "					\
484 		"erase "CONFIG_OS1_ENV_ADDR" +$filesize; "		\
485 		"cp.b $osaddr "CONFIG_OS1_ENV_ADDR" $filesize; "	\
486 		"cmp.b $osaddr "CONFIG_OS1_ENV_ADDR" $filesize; "	\
487 		"if test $? -ne 0; then "				\
488 			"echo OS PROGRAM FAILED; "			\
489 		"else; "						\
490 			"echo OS PROGRAM SUCCEEDED; "			\
491 		"fi; "							\
492 	"else; "							\
493 		"echo OS DOWNLOAD FAILED; "				\
494 	"fi;"
495 
496 #define CONFIG_PROG_OS2							\
497 	"$download_cmd $osaddr $osfile; "				\
498 	"if test $? -eq 0; then "					\
499 		"erase "CONFIG_OS2_ENV_ADDR" +$filesize; "		\
500 		"cp.b $osaddr "CONFIG_OS2_ENV_ADDR" $filesize; "	\
501 		"cmp.b $osaddr "CONFIG_OS2_ENV_ADDR" $filesize; "	\
502 		"if test $? -ne 0; then "				\
503 			"echo OS PROGRAM FAILED; "			\
504 		"else; "						\
505 			"echo OS PROGRAM SUCCEEDED; "			\
506 		"fi; "							\
507 	"else; "							\
508 		"echo OS DOWNLOAD FAILED; "				\
509 	"fi;"
510 
511 #define CONFIG_PROG_FDT1						\
512 	"$download_cmd $fdtaddr $fdtfile; "				\
513 	"if test $? -eq 0; then "					\
514 		"erase "CONFIG_FDT1_ENV_ADDR" +$filesize;"		\
515 		"cp.b $fdtaddr "CONFIG_FDT1_ENV_ADDR" $filesize; "	\
516 		"cmp.b $fdtaddr "CONFIG_FDT1_ENV_ADDR" $filesize; "	\
517 		"if test $? -ne 0; then "				\
518 			"echo FDT PROGRAM FAILED; "			\
519 		"else; "						\
520 			"echo FDT PROGRAM SUCCEEDED; "			\
521 		"fi; "							\
522 	"else; "							\
523 		"echo FDT DOWNLOAD FAILED; "				\
524 	"fi;"
525 
526 #define CONFIG_PROG_FDT2						\
527 	"$download_cmd $fdtaddr $fdtfile; "				\
528 	"if test $? -eq 0; then "					\
529 		"erase "CONFIG_FDT2_ENV_ADDR" +$filesize;"		\
530 		"cp.b $fdtaddr "CONFIG_FDT2_ENV_ADDR" $filesize; "	\
531 		"cmp.b $fdtaddr "CONFIG_FDT2_ENV_ADDR" $filesize; "	\
532 		"if test $? -ne 0; then "				\
533 			"echo FDT PROGRAM FAILED; "			\
534 		"else; "						\
535 			"echo FDT PROGRAM SUCCEEDED; "			\
536 		"fi; "							\
537 	"else; "							\
538 		"echo FDT DOWNLOAD FAILED; "				\
539 	"fi;"
540 
541 #define	CONFIG_EXTRA_ENV_SETTINGS					\
542 	"autoload=yes\0"						\
543 	"download_cmd=tftp\0"						\
544 	"console_args=console=ttyS0,115200\0"				\
545 	"root_args=root=/dev/nfs rw\0"					\
546 	"misc_args=ip=on\0"						\
547 	"set_bootargs=setenv bootargs ${console_args} ${root_args} ${misc_args}\0" \
548 	"bootfile=/home/user/file\0"					\
549 	"osfile=/home/user/board.uImage\0"				\
550 	"fdtfile=/home/user/board.dtb\0"				\
551 	"ubootfile=/home/user/u-boot.bin\0"				\
552 	"fdtaddr=0x1e00000\0"						\
553 	"osaddr=0x1000000\0"						\
554 	"loadaddr=0x1000000\0"						\
555 	"prog_uboot1="CONFIG_PROG_UBOOT1"\0"				\
556 	"prog_uboot2="CONFIG_PROG_UBOOT2"\0"				\
557 	"prog_os1="CONFIG_PROG_OS1"\0"					\
558 	"prog_os2="CONFIG_PROG_OS2"\0"					\
559 	"prog_fdt1="CONFIG_PROG_FDT1"\0"				\
560 	"prog_fdt2="CONFIG_PROG_FDT2"\0"				\
561 	"bootcmd_net=run set_bootargs; "CONFIG_BOOT_OS_NET"\0"		\
562 	"bootcmd_flash1=run set_bootargs; "				\
563 		"bootm "CONFIG_OS1_ENV_ADDR" - "CONFIG_FDT1_ENV_ADDR"\0"\
564 	"bootcmd_flash2=run set_bootargs; "				\
565 		"bootm "CONFIG_OS2_ENV_ADDR" - "CONFIG_FDT2_ENV_ADDR"\0"\
566 	"bootcmd=run bootcmd_flash1\0"
567 #endif	/* __CONFIG_H */
568