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