xref: /rk3399_rockchip-uboot/include/configs/bav335x.h (revision bd42a94268b165a6f298b9ab13be7003e8d96b02)
1 /*
2  * bav335x.h
3  *
4  * Copyright (c) 2012-2014 Birdland Audio - http://birdland.com/oem
5  * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation version 2.
10  *
11  * This program is distributed "as is" WITHOUT ANY WARRANTY of any
12  * kind, whether express or implied; without even the implied warranty
13  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
14  * GNU General Public License for more details.
15  */
16 
17 #ifndef __CONFIG_BAV335X_H
18 #define __CONFIG_BAV335X_H
19 
20 #include <configs/ti_am335x_common.h>
21 #define CONFIG_ENV_IS_NOWHERE
22 
23 #ifndef CONFIG_SPL_BUILD
24 # define CONFIG_TIMESTAMP
25 # define CONFIG_LZO
26 # ifdef CONFIG_ENABLE_VBOOT
27 # endif
28 #endif
29 
30 #define CONFIG_SYS_BOOTM_LEN		(16 << 20)
31 
32 #define MACH_TYPE_TIAM335EVM		3589	/* Until the next sync */
33 #define CONFIG_MACH_TYPE		MACH_TYPE_TIAM335EVM
34 
35 /* Clock Defines */
36 #define V_OSCK				24000000  /* Clock output from T2 */
37 #define V_SCLK				(V_OSCK)
38 
39 /* Custom script for NOR */
40 #define CONFIG_SYS_LDSCRIPT		"board/birdland/bav335x/u-boot.lds"
41 
42 /* Always 128 KiB env size */
43 #define CONFIG_ENV_SIZE			(128 << 10)
44 
45 /* Enhance our eMMC support / experience. */
46 #define CONFIG_CMD_GPT
47 
48 #ifdef CONFIG_NAND
49 #define NANDARGS \
50 	"mtdids=" MTDIDS_DEFAULT "\0" \
51 	"mtdparts=" MTDPARTS_DEFAULT "\0" \
52 	"nandargs=setenv bootargs console=${console} " \
53 		"${optargs} " \
54 		"root=${nandroot} " \
55 		"rootfstype=${nandrootfstype}\0" \
56 	"nandroot=ubi0:rootfs rw ubi.mtd=9,2048\0" \
57 	"nandrootfstype=ubifs rootwait=1\0" \
58 	"nandboot=echo Booting from nand ...; " \
59 		"run nandargs; " \
60 		"nand read ${fdtaddr} u-boot-spl-os; " \
61 		"nand read ${loadaddr} kernel; " \
62 		"bootz ${loadaddr} - ${fdtaddr}\0"
63 #else
64 #define NANDARGS ""
65 #endif
66 
67 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
68 
69 #ifndef CONFIG_SPL_BUILD
70 #define CONFIG_EXTRA_ENV_SETTINGS \
71 DEFAULT_LINUX_BOOT_ENV \
72 "boot_fdt=try\0" \
73 "bootpart=0:2\0" \
74 "bootdir=\0" \
75 "fdtdir=/dtbs\0" \
76 "bootfile=zImage\0" \
77 "fdtfile=undefined\0" \
78 "console=ttyO0,115200n8\0" \
79 "loadaddr=0x82000000\0" \
80 "fdtaddr=0x88000000\0" \
81 "rdaddr=0x88080000\0" \
82 "initrd_high=0xffffffff\0" \
83 "fdt_high=0xffffffff\0" \
84 "partitions=" \
85 	"uuid_disk=${uuid_gpt_disk};" \
86 	"name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
87 "optargs=\0" \
88 "cmdline=\0" \
89 "mmcdev=0\0" \
90 "mmcpart=1\0" \
91 "mmcroot=/dev/mmcblk0p2 ro\0" \
92 "mmcrootfstype=ext4 rootwait fixrtc\0" \
93 "rootpath=/export/rootfs\0" \
94 "nfsopts=nolock\0" \
95 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}::off\0" \
96 "ramroot=/dev/ram0 rw\0" \
97 "ramrootfstype=ext2\0" \
98 "mmcargs=setenv bootargs console=${console} ${optargs} " \
99 	"root=${mmcroot} rootfstype=${mmcrootfstype} ${cmdline}\0" \
100 "server_ip=192.168.1.100\0" \
101 "gw_ip=192.168.1.1\0" \
102 "netmask=255.255.255.0\0" \
103 "hostname=\0" \
104 "device=eth0\0" \
105 "autoconf=off\0" \
106 "root_dir=/home/userid/targetNFS\0" \
107 "nfs_options=,vers=3\0" \
108 "nfsrootfstype=ext4 rootwait fixrtc\0" \
109 "nfsargs=setenv bootargs console=${console} ${optargs} " \
110 	"root=/dev/nfs rw rootfstype=${nfsrootfstype} " \
111 	"nfsroot=${nfsroot} ip=${ip} ${cmdline}\0" \
112 "netargs=setenv bootargs console=${console} " \
113 	"${optargs} root=/dev/nfs " \
114 	"nfsroot=${serverip}:${rootpath},${nfsopts} rw ip=dhcp\0" \
115 "bootenv=uEnv.txt\0" \
116 "script=boot.scr\0" \
117 "scriptfile=${script}\0" \
118 "loadbootscript=load mmc ${bootpart} ${loadaddr} ${scriptfile};\0" \
119 "bootscript=echo Running bootscript from mmc${bootpart} ...; " \
120 	"source ${loadaddr}\0" \
121 	"loadbootenv=load mmc ${bootpart} ${loadaddr} ${bootenv}\0" \
122 "importbootenv=echo Importing environment from mmc ...; " \
123 	"env import -t -r $loadaddr $filesize\0" \
124 "ramargs=setenv bootargs console=${console} " \
125 	"${optargs} root=${ramroot} rootfstype=${ramrootfstype}\0" \
126 "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
127 "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
128 	"loadrd=load mmc ${bootpart} ${rdaddr} " \
129 	"${bootdir}/${rdfile}; setenv rdsize ${filesize}\0" \
130 "loadfdt=echo loading ${fdtdir}/${fdtfile} ...; " \
131 	"load mmc ${bootpart} ${fdtaddr} ${fdtdir}/${fdtfile}\0" \
132 "mmcboot=mmc dev ${mmcdev}; " \
133 	"if mmc rescan; then " \
134 		"gpio set 54;" \
135 		"setenv bootpart ${mmcdev}:1; " \
136 		"if test -e mmc ${bootpart} /etc/fstab; then " \
137 			"setenv mmcpart 1;" \
138 		"fi; " \
139 		"echo Checking for: /uEnv.txt ...;" \
140 		"if test -e mmc ${bootpart} /uEnv.txt; then " \
141 			"if run loadbootenv; then " \
142 				"gpio set 55;" \
143 				"echo Loaded environment from ${bootenv};" \
144 				"run importbootenv;" \
145 			"fi;" \
146 			"echo Checking if uenvcmd is set ...;" \
147 			"if test -n ${uenvcmd}; then " \
148 				"gpio set 56; " \
149 				"echo Running uenvcmd ...;" \
150 				"run uenvcmd;" \
151 			"fi;" \
152 			"echo Checking if client_ip is set ...;" \
153 			"if test -n ${client_ip}; then " \
154 				"if test -n ${dtb}; then " \
155 					"setenv fdtfile ${dtb};" \
156 					"echo using ${fdtfile} ...;" \
157 				"fi;" \
158 				"gpio set 56; " \
159 				"if test -n ${uname_r}; then " \
160 					"echo Running nfsboot_uname_r ...;" \
161 					"run nfsboot_uname_r;" \
162 				"fi;" \
163 				"echo Running nfsboot ...;" \
164 				"run nfsboot;" \
165 			"fi;" \
166 		"fi; " \
167 		"echo Checking for: /${script} ...;" \
168 		"if test -e mmc ${bootpart} /${script}; then " \
169 			"gpio set 55;" \
170 			"setenv scriptfile ${script};" \
171 			"run loadbootscript;" \
172 			"echo Loaded script from ${scriptfile};" \
173 			"gpio set 56; " \
174 			"run bootscript;" \
175 		"fi; " \
176 		"echo Checking for: /boot/${script} ...;" \
177 		"if test -e mmc ${bootpart} /boot/${script}; then " \
178 			"gpio set 55;" \
179 			"setenv scriptfile /boot/${script};" \
180 			"run loadbootscript;" \
181 			"echo Loaded script from ${scriptfile};" \
182 			"gpio set 56; " \
183 			"run bootscript;" \
184 		"fi; " \
185 		"echo Checking for: /boot/uEnv.txt ...;" \
186 		"for i in 1 2 3 4 5 6 7 ; do " \
187 			"setenv mmcpart ${i};" \
188 			"setenv bootpart ${mmcdev}:${mmcpart};" \
189 			"if test -e mmc ${bootpart} /boot/uEnv.txt; then " \
190 				"gpio set 55;" \
191 				"load mmc ${bootpart} ${loadaddr} " \
192 						"/boot/uEnv.txt;" \
193 				"env import -t ${loadaddr} ${filesize};" \
194 				"echo Loaded environment from /boot/uEnv.txt;" \
195 				"if test -n ${dtb}; then " \
196 					"setenv fdtfile ${dtb};" \
197 					"echo Using: dtb=${fdtfile} ...;" \
198 				"fi;" \
199 				"echo Checking if uname_r is set in " \
200 						"/boot/uEnv.txt...;" \
201 				"if test -n ${uname_r}; then " \
202 					"gpio set 56; " \
203 					"echo Running uname_boot ...;" \
204 					"setenv mmcroot /dev/mmcblk${mmcdev}" \
205 							"p${mmcpart} ro;" \
206 					"run uname_boot;" \
207 				"fi;" \
208 			"fi;" \
209 		"done;" \
210 	"fi;\0" \
211 "netboot=echo Booting from network ...; " \
212 	"setenv autoload no; " \
213 	"dhcp; " \
214 	"tftp ${loadaddr} ${bootfile}; " \
215 	"tftp ${fdtaddr} ${fdtfile}; " \
216 	"run netargs; " \
217 	"bootz ${loadaddr} - ${fdtaddr}\0" \
218 "nfsboot=echo Booting from ${server_ip} ...; " \
219 	"setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
220 	"setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}" \
221 	":${device}:${autoconf}; " \
222 	"setenv autoload no; " \
223 	"setenv serverip ${server_ip}; " \
224 	"setenv ipaddr ${client_ip}; " \
225 	"tftp ${loadaddr} ${bootfile}; " \
226 	"tftp ${fdtaddr} dtbs/${fdtfile}; " \
227 	"run nfsargs; " \
228 	"bootz ${loadaddr} - ${fdtaddr}\0" \
229 "nfsboot_uname_r=echo Booting from ${server_ip} ...; " \
230 	"setenv nfsroot ${server_ip}:${root_dir}${nfs_options}; " \
231 	"setenv ip ${client_ip}:${server_ip}:${gw_ip}:${netmask}:${hostname}" \
232 			":${device}:${autoconf}; " \
233 	"setenv autoload no; " \
234 	"setenv serverip ${server_ip}; " \
235 	"setenv ipaddr ${client_ip}; " \
236 	"tftp ${loadaddr} vmlinuz-${uname_r}; " \
237 	"tftp ${fdtaddr} dtbs/${uname_r}/${fdtfile}; " \
238 	"run nfsargs; " \
239 	"bootz ${loadaddr} - ${fdtaddr}\0" \
240 "ramboot=echo Booting from ramdisk ...; " \
241 	"run ramargs; " \
242 	"bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
243 "findfdt="\
244 	"if test $board_rev = B; then " \
245 		"setenv fdtfile birdland_bav335b.dtb; " \
246 		"setenv fdtbase am335x-boneblack; fi; " \
247 	"if test $board_rev = A; then " \
248 		"setenv fdtfile birdland_bav335a.dtb; " \
249 		"setenv fdtbase am335x-boneblack; fi; " \
250 	"if test $fdtfile = undefined; then " \
251 		"echo WARNING: Could not determine device tree to use; fi; \0" \
252 "uname_boot="\
253 	"setenv bootdir /boot; " \
254 	"setenv bootfile vmlinuz-${uname_r}; " \
255 	"if test -e mmc ${bootpart} ${bootdir}/${bootfile}; then " \
256 		"echo loading ${bootdir}/${bootfile} ...; "\
257 		"run loadimage;" \
258 		"setenv fdtdir /boot/dtbs/${uname_r}; " \
259 		"if test -e mmc ${bootpart} ${fdtdir}/${fdtfile}; then " \
260 			"run loadfdt;" \
261 		"else " \
262 			"setenv fdtdir /lib/firmware/${uname_r}/device-tree; " \
263 			"if test -e mmc ${bootpart} ${fdtdir}/" \
264 					"${fdtfile}; then " \
265 				"run loadfdt;" \
266 			"else " \
267 				"setenv fdtdir /boot/dtb-${uname_r}; " \
268 				"if test -e mmc ${bootpart} ${fdtdir}" \
269 						"/${fdtfile}; then " \
270 					"run loadfdt;" \
271 				"else " \
272 					"setenv fdtdir /boot/dtbs; " \
273 					"if test -e mmc ${bootpart} ${fdtdir}" \
274 							"/${fdtfile}; then " \
275 						"run loadfdt;" \
276 					"else " \
277 						"echo; echo unable to find " \
278 							"[${fdtfile}] " \
279 						"did you name it correctly?" \
280 						"echo booting fallback " \
281 							"[/boot/dtbs/" \
282 							"${uname_r}" \
283 							"/${fdtbase}.dtb]...;" \
284 						"setenv fdtdir /boot/dtbs/" \
285 							"${uname_r}; " \
286 						"setenv fdtfile " \
287 							"${fdtbase}.dtb; " \
288 						"run loadfdt;" \
289 					"fi;" \
290 				"fi;" \
291 			"fi;" \
292 		"fi;" \
293 	"fi; " \
294 	"setenv rdfile initrd.img-${uname_r}; " \
295 	"if test -e mmc ${bootpart} ${bootdir}/${rdfile}; then " \
296 		"echo loading ${bootdir}/${rdfile} ...; "\
297 		"run loadrd;" \
298 		"if test -n ${uuid}; then " \
299 			"setenv mmcroot UUID=${uuid} ro;" \
300 		"fi;" \
301 		"run mmcargs;" \
302 		"echo debug: [${bootargs}] ... ;" \
303 		"echo debug: [bootz ${loadaddr} ${rdaddr}:${rdsize} " \
304 					"${fdtaddr}] ... ;" \
305 		"bootz ${loadaddr} ${rdaddr}:${rdsize} ${fdtaddr}; " \
306 	"else " \
307 		"run mmcargs;" \
308 		"echo debug: [${bootargs}] ... ;" \
309 		"echo debug: [bootz ${loadaddr} - ${fdtaddr}] ... ;" \
310 		"bootz ${loadaddr} - ${fdtaddr}; " \
311 	"fi;" \
312 "fi;\0" \
313 	NANDARGS \
314 	DFUARGS
315 #endif
316 
317 #define CONFIG_BOOTCOMMAND \
318 	"gpio set 53; " \
319 	"i2c mw 0x24 1 0x3e; " \
320 	"run findfdt; " \
321 	"setenv mmcdev 0; " \
322 	"setenv bootpart 0:1; " \
323 	"run mmcboot;" \
324 	"gpio clear 56; " \
325 	"gpio clear 55; " \
326 	"gpio clear 54; " \
327 	"setenv mmcdev 1; " \
328 	"setenv bootpart 1:1; " \
329 	"run mmcboot;"
330 
331 /* NS16550 Configuration */
332 #define CONFIG_SYS_NS16550_COM1		0x44e09000	/* UART0 */
333 #define CONFIG_SYS_NS16550_COM2		0x48022000	/* UART1 */
334 #define CONFIG_SYS_NS16550_COM3		0x48024000	/* UART2 */
335 #define CONFIG_SYS_NS16550_COM4		0x481a6000	/* UART3 */
336 #define CONFIG_SYS_NS16550_COM5		0x481a8000	/* UART4 */
337 #define CONFIG_SYS_NS16550_COM6		0x481aa000	/* UART5 */
338 #define CONFIG_BAUDRATE			115200
339 
340 #define CONFIG_CMD_EEPROM
341 #define CONFIG_ENV_EEPROM_IS_ON_I2C
342 #define CONFIG_SYS_I2C_EEPROM_ADDR	0x50	/* Main EEPROM */
343 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN	2
344 
345 /* PMIC support */
346 #define CONFIG_POWER_TPS65217
347 #define CONFIG_POWER_TPS65910
348 
349 /* SPL */
350 #ifndef CONFIG_NOR_BOOT
351 /* Bootcount using the RTC block */
352 #define CONFIG_BOOTCOUNT_LIMIT
353 #define CONFIG_BOOTCOUNT_AM33XX
354 #define CONFIG_SYS_BOOTCOUNT_BE
355 
356 /* USB gadget RNDIS */
357 
358 #define CONFIG_SPL_LDSCRIPT		"arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
359 #endif
360 
361 #ifdef CONFIG_NAND
362 /* NAND: device related configs */
363 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
364 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
365 					 CONFIG_SYS_NAND_PAGE_SIZE)
366 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
367 #define CONFIG_SYS_NAND_OOBSIZE		64
368 #define CONFIG_SYS_NAND_BLOCK_SIZE	(128*1024)
369 /* NAND: driver related configs */
370 #define CONFIG_NAND_OMAP_GPMC
371 #define CONFIG_NAND_OMAP_ELM
372 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
373 #define CONFIG_SYS_NAND_ECCPOS	{ \
374 	2, 3, 4, 5, 6, 7, 8, 9, \
375 	10, 11, 12, 13, 14, 15, 16, 17, \
376 	18, 19, 20, 21, 22, 23, 24, 25, \
377 	26, 27, 28, 29, 30, 31, 32, 33, \
378 	34, 35, 36, 37, 38, 39, 40, 41, \
379 	42, 43, 44, 45, 46, 47, 48, 49, \
380 	50, 51, 52, 53, 54, 55, 56, 57, }
381 
382 #define CONFIG_SYS_NAND_ECCSIZE		512
383 #define CONFIG_SYS_NAND_ECCBYTES	14
384 #define CONFIG_SYS_NAND_ONFI_DETECTION
385 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
386 #define MTDIDS_DEFAULT			"nand0=nand.0"
387 #define MTDPARTS_DEFAULT  \
388 	"mtdparts=nand.0:" \
389 	"128k(NAND.SPL)," \
390 	"128k(NAND.SPL.backup1)," \
391 	"128k(NAND.SPL.backup2)," \
392 	"128k(NAND.SPL.backup3)," \
393 	"256k(NAND.u-boot-spl-os)," \
394 	"1m(NAND.u-boot)," \
395 	"128k(NAND.u-boot-env)," \
396 	"128k(NAND.u-boot-env.backup1)," \
397 	"8m(NAND.kernel)," \
398 	"-(NAND.rootfs)"
399 #define CONFIG_SYS_NAND_U_BOOT_OFFS	0x000c0000
400 #undef CONFIG_ENV_IS_NOWHERE
401 #define CONFIG_ENV_IS_IN_NAND
402 #define CONFIG_ENV_OFFSET		0x001c0000
403 #define CONFIG_ENV_OFFSET_REDUND	0x001e0000
404 #define CONFIG_SYS_ENV_SECT_SIZE	CONFIG_SYS_NAND_BLOCK_SIZE
405 /* NAND: SPL related configs */
406 #ifdef CONFIG_SPL_NAND_SUPPORT
407 #define CONFIG_SPL_NAND_AM33XX_BCH
408 #endif
409 #ifdef CONFIG_SPL_OS_BOOT
410 #define CONFIG_CMD_SPL_NAND_OFS	0x00080000 /* os parameters */
411 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS	0x00200000 /* kernel offset */
412 #define CONFIG_CMD_SPL_WRITE_SIZE	0x2000
413 #endif
414 #endif /* !CONFIG_NAND */
415 
416 /*
417  * For NOR boot, we must set this to the start of where NOR is mapped
418  * in memory.
419  */
420 #ifdef CONFIG_NOR_BOOT
421 #define CONFIG_SYS_TEXT_BASE		0x08000000
422 #endif
423 
424 /*
425  * USB configuration.  We enable MUSB support, both for host and for
426  * gadget.  We set USB0 as peripheral and USB1 as host, based on the
427  * board schematic and physical port wired to each.  Then for host we
428  * add mass storage support and for gadget we add both RNDIS ethernet
429  * and DFU.
430  */
431 #define CONFIG_USB_MUSB_DSPS
432 #define CONFIG_USB_MUSB_PIO_ONLY
433 #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
434 #define CONFIG_AM335X_USB0
435 #define CONFIG_AM335X_USB0_MODE	MUSB_PERIPHERAL
436 #define CONFIG_AM335X_USB1
437 #define CONFIG_AM335X_USB1_MODE MUSB_HOST
438 
439 #ifndef CONFIG_SPL_USBETH_SUPPORT
440 /* Fastboot */
441 #define CONFIG_USB_FUNCTION_FASTBOOT
442 #define CONFIG_CMD_FASTBOOT
443 #define CONFIG_ANDROID_BOOT_IMAGE
444 #define CONFIG_FASTBOOT_BUF_ADDR	CONFIG_SYS_LOAD_ADDR
445 #define CONFIG_FASTBOOT_BUF_SIZE	0x07000000
446 
447 #define CONFIG_FASTBOOT_FLASH_MMC_DEV   1
448 #endif
449 
450 #ifdef CONFIG_USB_MUSB_GADGET
451 #define CONFIG_USB_FUNCTION_MASS_STORAGE
452 #endif /* CONFIG_USB_MUSB_GADGET */
453 
454 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
455 /* disable host part of MUSB in SPL */
456 /* disable EFI partitions and partition UUID support */
457 #undef CONFIG_PARTITION_UUIDS
458 #endif
459 
460 /* USB Device Firmware Update support */
461 #ifndef CONFIG_SPL_BUILD
462 #define DFU_ALT_INFO_MMC \
463 	"dfu_alt_info_mmc=" \
464 	"boot part 0 1;" \
465 	"rootfs part 0 2;" \
466 	"MLO fat 0 1;" \
467 	"MLO.raw raw 0x100 0x100;" \
468 	"u-boot.img.raw raw 0x300 0x400;" \
469 	"spl-os-args.raw raw 0x80 0x80;" \
470 	"spl-os-image.raw raw 0x900 0x2000;" \
471 	"spl-os-args fat 0 1;" \
472 	"spl-os-image fat 0 1;" \
473 	"u-boot.img fat 0 1;" \
474 	"uEnv.txt fat 0 1\0"
475 #ifdef CONFIG_NAND
476 #define DFU_ALT_INFO_NAND \
477 	"dfu_alt_info_nand=" \
478 	"SPL part 0 1;" \
479 	"SPL.backup1 part 0 2;" \
480 	"SPL.backup2 part 0 3;" \
481 	"SPL.backup3 part 0 4;" \
482 	"u-boot part 0 5;" \
483 	"u-boot-spl-os part 0 6;" \
484 	"kernel part 0 8;" \
485 	"rootfs part 0 9\0"
486 #else
487 #define DFU_ALT_INFO_NAND ""
488 #endif
489 #define DFU_ALT_INFO_RAM \
490 	"dfu_alt_info_ram=" \
491 	"kernel ram 0x80200000 0xD80000;" \
492 	"fdt ram 0x80F80000 0x80000;" \
493 	"ramdisk ram 0x81000000 0x4000000\0"
494 #define DFUARGS \
495 	"dfu_alt_info_emmc=rawemmc raw 0 3751936\0" \
496 	DFU_ALT_INFO_MMC \
497 	DFU_ALT_INFO_RAM \
498 	DFU_ALT_INFO_NAND
499 #endif
500 
501 /*
502  * Default to using SPI for environment, etc.
503  * 0x000000 - 0x020000 : SPL (128KiB)
504  * 0x020000 - 0x0A0000 : U-Boot (512KiB)
505  * 0x0A0000 - 0x0BFFFF : First copy of U-Boot Environment (128KiB)
506  * 0x0C0000 - 0x0DFFFF : Second copy of U-Boot Environment (128KiB)
507  * 0x0E0000 - 0x442000 : Linux Kernel
508  * 0x442000 - 0x800000 : Userland
509  */
510 #if defined(CONFIG_SPI_BOOT)
511 /* SPL related */
512 #define CONFIG_SPL_SPI_LOAD
513 #define CONFIG_SYS_SPI_U_BOOT_OFFS	0x20000
514 
515 #define CONFIG_ENV_IS_IN_SPI_FLASH
516 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
517 #define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
518 #define CONFIG_ENV_SECT_SIZE		(4 << 10) /* 4 KB sectors */
519 #define CONFIG_ENV_OFFSET		(768 << 10) /* 768 KiB in */
520 #define CONFIG_ENV_OFFSET_REDUND	(896 << 10) /* 896 KiB in */
521 #define MTDIDS_DEFAULT			"nor0=m25p80-flash.0"
522 #define MTDPARTS_DEFAULT		"mtdparts=m25p80-flash.0:128k(SPL)," \
523 					"512k(u-boot),128k(u-boot-env1)," \
524 					"128k(u-boot-env2),3464k(kernel)," \
525 					"-(rootfs)"
526 #elif defined(CONFIG_EMMC_BOOT)
527 #undef CONFIG_ENV_IS_NOWHERE
528 #define CONFIG_ENV_IS_IN_MMC
529 #define CONFIG_SYS_MMC_ENV_DEV		1
530 #define CONFIG_SYS_MMC_ENV_PART		2
531 #define CONFIG_ENV_OFFSET		0x0
532 #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + CONFIG_ENV_SIZE)
533 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
534 #endif
535 
536 /* SPI flash. */
537 #define CONFIG_SF_DEFAULT_SPEED		24000000
538 
539 /* Network. */
540 #define CONFIG_PHY_GIGE
541 #define CONFIG_PHYLIB
542 #define CONFIG_PHY_SMSC
543 
544 /*
545  * NOR Size = 16 MiB
546  * Number of Sectors/Blocks = 128
547  * Sector Size = 128 KiB
548  * Word length = 16 bits
549  * Default layout:
550  * 0x000000 - 0x07FFFF : U-Boot (512 KiB)
551  * 0x080000 - 0x09FFFF : First copy of U-Boot Environment (128 KiB)
552  * 0x0A0000 - 0x0BFFFF : Second copy of U-Boot Environment (128 KiB)
553  * 0x0C0000 - 0x4BFFFF : Linux Kernel (4 MiB)
554  * 0x4C0000 - 0xFFFFFF : Userland (11 MiB + 256 KiB)
555  */
556 #if defined(CONFIG_NOR)
557 #undef CONFIG_SYS_NO_FLASH
558 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
559 #define CONFIG_SYS_FLASH_PROTECTION
560 #define CONFIG_SYS_FLASH_CFI
561 #define CONFIG_FLASH_CFI_DRIVER
562 #define CONFIG_FLASH_CFI_MTD
563 #define CONFIG_SYS_MAX_FLASH_SECT	128
564 #define CONFIG_SYS_MAX_FLASH_BANKS	1
565 #define CONFIG_SYS_FLASH_BASE		(0x08000000)
566 #define CONFIG_SYS_FLASH_CFI_WIDTH	FLASH_CFI_16BIT
567 #define CONFIG_SYS_FLASH_SIZE		0x01000000
568 #define CONFIG_SYS_MONITOR_BASE		CONFIG_SYS_FLASH_BASE
569 /* Reduce SPL size by removing unlikey targets */
570 #ifdef CONFIG_NOR_BOOT
571 #define CONFIG_ENV_IS_IN_FLASH
572 #define CONFIG_ENV_SECT_SIZE		(128 << 10)	/* 128 KiB */
573 #define CONFIG_ENV_OFFSET		(512 << 10)	/* 512 KiB */
574 #define CONFIG_ENV_OFFSET_REDUND	(768 << 10)	/* 768 KiB */
575 #define MTDIDS_DEFAULT			"nor0=physmap-flash.0"
576 #define MTDPARTS_DEFAULT \
577 	"mtdparts=physmap-flash.0:" \
578 	"512k(u-boot)," \
579 	"128k(u-boot-env1)," \
580 	"128k(u-boot-env2)," \
581 	"4m(kernel),-(rootfs)"
582 #endif
583 #endif  /* NOR support */
584 
585 #endif	/* ! __CONFIG_AM335X_EVM_H */
586