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