]> git.ipfire.org Git - people/ms/u-boot.git/blob - include/configs/am335x_evm.h
am335x_evm: Bring in 'boot_fdt' logic from i.MX
[people/ms/u-boot.git] / include / configs / am335x_evm.h
1 /*
2 * am335x_evm.h
3 *
4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
5 *
6 * This program is free software; you can redistribute it and/or
7 * modify it under the terms of the GNU General Public License as
8 * published by the Free Software Foundation version 2.
9 *
10 * This program is distributed "as is" WITHOUT ANY WARRANTY of any
11 * kind, whether express or implied; without even the implied warranty
12 * of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 */
15
16 #ifndef __CONFIG_AM335X_EVM_H
17 #define __CONFIG_AM335X_EVM_H
18
19 #define CONFIG_AM33XX
20 #define CONFIG_OMAP
21 #define CONFIG_OMAP_COMMON
22
23 #include <asm/arch/omap.h>
24
25 #define CONFIG_DMA_COHERENT
26 #define CONFIG_DMA_COHERENT_SIZE (1 << 20)
27
28 #define CONFIG_ENV_SIZE (128 << 10) /* 128 KiB */
29 #define CONFIG_SYS_MALLOC_LEN (1024 << 10)
30 #define CONFIG_SYS_LONGHELP /* undef to save memory */
31 #define CONFIG_SYS_HUSH_PARSER /* use "hush" command parser */
32 #define CONFIG_SYS_PROMPT "U-Boot# "
33 #define CONFIG_BOARD_LATE_INIT
34 #define CONFIG_SYS_NO_FLASH
35 #define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */
36 #define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM
37
38 #define CONFIG_OF_LIBFDT
39 #define CONFIG_CMD_BOOTZ
40 #define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
41 #define CONFIG_CMDLINE_EDITING
42 #define CONFIG_STACKSIZE (128 * 1024)
43 #define CONFIG_AUTO_COMPLETE
44 #define CONFIG_SETUP_MEMORY_TAGS
45 #define CONFIG_INITRD_TAG
46
47 /* Custom script for NOR */
48 #define CONFIG_SYS_LDSCRIPT "board/ti/am335x/u-boot.lds"
49
50 #define CONFIG_SYS_CACHELINE_SIZE 64
51
52 /* commands to include */
53 #include <config_cmd_default.h>
54
55 #define CONFIG_CMD_ASKENV
56 #define CONFIG_VERSION_VARIABLE
57
58 #ifdef CONFIG_NAND
59 #define NANDARGS \
60 "mtdids=" MTDIDS_DEFAULT "\0" \
61 "mtdparts=" MTDPARTS_DEFAULT "\0" \
62 "nandargs=setenv bootargs console=${console} " \
63 "${optargs} " \
64 "root=${nandroot} " \
65 "rootfstype=${nandrootfstype}\0" \
66 "dfu_alt_info_nand=" DFU_ALT_INFO_NAND "\0" \
67 "nandroot=ubi0:rootfs rw ubi.mtd=7,2048\0" \
68 "nandrootfstype=ubifs rootwait=1\0" \
69 "nandsrcaddr=0x280000\0" \
70 "nandboot=echo Booting from nand ...; " \
71 "run nandargs; " \
72 "nand read ${loadaddr} ${nandsrcaddr} ${nandimgsize}; " \
73 "bootm ${loadaddr}\0" \
74 "nandimgsize=0x500000\0"
75 #else
76 #define NANDARGS ""
77 #endif
78
79 /* set to negative value for no autoboot */
80 #define CONFIG_BOOTDELAY 1
81 #define CONFIG_ENV_VARS_UBOOT_CONFIG
82 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
83 #ifndef CONFIG_SPL_BUILD
84 #define CONFIG_EXTRA_ENV_SETTINGS \
85 "loadaddr=0x80200000\0" \
86 "fdtaddr=0x80F80000\0" \
87 "fdt_high=0xffffffff\0" \
88 "boot_fdt=try\0" \
89 "rdaddr=0x81000000\0" \
90 "bootdir=/boot\0" \
91 "bootfile=uImage\0" \
92 "fdtfile=undefined\0" \
93 "console=ttyO0,115200n8\0" \
94 "optargs=\0" \
95 "dfu_alt_info_mmc=" DFU_ALT_INFO_MMC "\0" \
96 "dfu_alt_info_emmc=rawemmc mmc 0 3751936\0" \
97 "mmcdev=0\0" \
98 "mmcroot=/dev/mmcblk0p2 ro\0" \
99 "mmcrootfstype=ext4 rootwait\0" \
100 "bootpart=0:2\0" \
101 "rootpath=/export/rootfs\0" \
102 "nfsopts=nolock\0" \
103 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
104 "::off\0" \
105 "ramroot=/dev/ram0 rw ramdisk_size=65536 initrd=${rdaddr},64M\0" \
106 "ramrootfstype=ext2\0" \
107 "mmcargs=setenv bootargs console=${console} " \
108 "${optargs} " \
109 "root=${mmcroot} " \
110 "rootfstype=${mmcrootfstype}\0" \
111 "spiroot=/dev/mtdblock4 rw\0" \
112 "spirootfstype=jffs2\0" \
113 "spisrcaddr=0xe0000\0" \
114 "spiimgsize=0x362000\0" \
115 "spibusno=0\0" \
116 "spiargs=setenv bootargs console=${console} " \
117 "${optargs} " \
118 "root=${spiroot} " \
119 "rootfstype=${spirootfstype}\0" \
120 "netargs=setenv bootargs console=${console} " \
121 "${optargs} " \
122 "root=/dev/nfs " \
123 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
124 "ip=dhcp\0" \
125 "bootenv=uEnv.txt\0" \
126 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
127 "importbootenv=echo Importing environment from mmc ...; " \
128 "env import -t $loadaddr $filesize\0" \
129 "ramargs=setenv bootargs console=${console} " \
130 "${optargs} " \
131 "root=${ramroot} " \
132 "rootfstype=${ramrootfstype}\0" \
133 "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
134 "loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
135 "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
136 "mmcloados=run mmcargs; " \
137 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
138 "if run loadfdt; then " \
139 "bootm ${loadaddr} - ${fdtaddr}; " \
140 "else " \
141 "if test ${boot_fdt} = try; then " \
142 "bootm; " \
143 "else " \
144 "echo WARN: Cannot load the DT; " \
145 "fi; " \
146 "fi; " \
147 "else " \
148 "bootm; " \
149 "fi;\0" \
150 "mmcboot=mmc dev ${mmcdev}; " \
151 "if mmc rescan; then " \
152 "echo SD/MMC found on device ${mmcdev};" \
153 "if run loadbootenv; then " \
154 "echo Loaded environment from ${bootenv};" \
155 "run importbootenv;" \
156 "fi;" \
157 "if test -n $uenvcmd; then " \
158 "echo Running uenvcmd ...;" \
159 "run uenvcmd;" \
160 "fi;" \
161 "run mmcloados;" \
162 "fi;\0" \
163 "spiboot=echo Booting from spi ...; " \
164 "run spiargs; " \
165 "sf probe ${spibusno}:0; " \
166 "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
167 "bootm ${loadaddr}\0" \
168 "netboot=echo Booting from network ...; " \
169 "setenv autoload no; " \
170 "dhcp; " \
171 "tftp ${loadaddr} ${bootfile}; " \
172 "tftp ${fdtaddr} ${fdtfile}; " \
173 "run netargs; " \
174 "bootm ${loadaddr} - ${fdtaddr}\0" \
175 "ramboot=echo Booting from ramdisk ...; " \
176 "run ramargs; " \
177 "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
178 "findfdt="\
179 "if test $board_name = A335BONE; then " \
180 "setenv fdtfile am335x-bone.dtb; fi; " \
181 "if test $board_name = A335BNLT; then " \
182 "setenv fdtfile am335x-boneblack.dtb; fi; " \
183 "if test $board_name = A33515BB; then " \
184 "setenv fdtfile am335x-evm.dtb; fi; " \
185 "if test $board_name = A335X_SK; then " \
186 "setenv fdtfile am335x-evmsk.dtb; fi; " \
187 "if test $fdtfile = undefined; then " \
188 "echo WARNING: Could not determine device tree to use; fi; \0" \
189 NANDARGS
190 #endif
191
192 #define CONFIG_BOOTCOMMAND \
193 "run findfdt; " \
194 "run mmcboot;" \
195 "setenv mmcdev 1; " \
196 "setenv bootpart 1:2; " \
197 "run mmcboot;" \
198 "run nandboot;"
199
200 /* Clock Defines */
201 #define V_OSCK 24000000 /* Clock output from T2 */
202 #define V_SCLK (V_OSCK)
203
204 #define CONFIG_CMD_ECHO
205
206 /* We set the max number of command args high to avoid HUSH bugs. */
207 #define CONFIG_SYS_MAXARGS 64
208
209 /* Console I/O Buffer Size */
210 #define CONFIG_SYS_CBSIZE 512
211
212 /* Print Buffer Size */
213 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE \
214 + sizeof(CONFIG_SYS_PROMPT) + 16)
215
216 /* Boot Argument Buffer Size */
217 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
218
219 /*
220 * memtest works on 8 MB in DRAM after skipping 32MB from
221 * start addr of ram disk
222 */
223 #define CONFIG_SYS_MEMTEST_START (PHYS_DRAM_1 + (64 * 1024 * 1024))
224 #define CONFIG_SYS_MEMTEST_END (CONFIG_SYS_MEMTEST_START \
225 + (8 * 1024 * 1024))
226
227 #define CONFIG_SYS_LOAD_ADDR 0x81000000 /* Default load address */
228
229 #define CONFIG_MMC
230 #define CONFIG_GENERIC_MMC
231 #define CONFIG_OMAP_HSMMC
232 #define CONFIG_CMD_MMC
233 #define CONFIG_DOS_PARTITION
234 #define CONFIG_CMD_FAT
235 #define CONFIG_FAT_WRITE
236 #define CONFIG_CMD_EXT2
237 #define CONFIG_CMD_EXT4
238 #define CONFIG_CMD_FS_GENERIC
239
240 #define CONFIG_SPI
241 #define CONFIG_OMAP3_SPI
242 #define CONFIG_MTD_DEVICE
243 #define CONFIG_SPI_FLASH
244 #define CONFIG_SPI_FLASH_WINBOND
245 #define CONFIG_CMD_SF
246 #define CONFIG_SF_DEFAULT_SPEED (24000000)
247
248 /* USB Composite download gadget - g_dnl */
249 #define CONFIG_USB_GADGET
250 #define CONFIG_USBDOWNLOAD_GADGET
251
252 /* USB TI's IDs */
253 #define CONFIG_USBD_HS
254 #define CONFIG_G_DNL_VENDOR_NUM 0x0403
255 #define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
256 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
257
258 /* USB Device Firmware Update support */
259 #define CONFIG_DFU_FUNCTION
260 #define CONFIG_DFU_MMC
261 #define CONFIG_CMD_DFU
262 #define DFU_ALT_INFO_MMC \
263 "boot part 0 1;" \
264 "rootfs part 0 2;" \
265 "MLO fat 0 1;" \
266 "MLO.raw mmc 100 100;" \
267 "u-boot.img.raw mmc 300 400;" \
268 "spl-os-args.raw mmc 80 80;" \
269 "spl-os-image.raw mmc 900 2000;" \
270 "spl-os-args fat 0 1;" \
271 "spl-os-image fat 0 1;" \
272 "u-boot.img fat 0 1;" \
273 "uEnv.txt fat 0 1"
274 #ifdef CONFIG_NAND
275 #define CONFIG_DFU_NAND
276 #define DFU_ALT_INFO_NAND \
277 "SPL part 0 1;" \
278 "SPL.backup1 part 0 2;" \
279 "SPL.backup2 part 0 3;" \
280 "SPL.backup3 part 0 4;" \
281 "u-boot part 0 5;" \
282 "u-boot-spl-os part 0 6;" \
283 "kernel part 0 8;" \
284 "rootfs part 0 9"
285 #endif
286
287 /* Physical Memory Map */
288 #define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
289 #define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */
290 #define CONFIG_MAX_RAM_BANK_SIZE (1024 << 20) /* 1GB */
291
292 #define CONFIG_SYS_SDRAM_BASE PHYS_DRAM_1
293 #define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \
294 GENERATED_GBL_DATA_SIZE)
295 /* Platform/Board specific defs */
296 #define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */
297 #define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
298 #define CONFIG_SYS_HZ 1000 /* 1ms clock */
299
300 /* NS16550 Configuration */
301 #define CONFIG_SYS_NS16550
302 #define CONFIG_SYS_NS16550_SERIAL
303 #define CONFIG_SYS_NS16550_REG_SIZE (-4)
304 #define CONFIG_SYS_NS16550_CLK (48000000)
305 #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
306 #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
307 #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
308 #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
309 #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
310 #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
311
312 /* I2C Configuration */
313 #define CONFIG_I2C
314 #define CONFIG_CMD_I2C
315 #define CONFIG_HARD_I2C
316 #define CONFIG_SYS_I2C_SPEED 100000
317 #define CONFIG_SYS_I2C_SLAVE 1
318 #define CONFIG_I2C_MULTI_BUS
319 #define CONFIG_DRIVER_OMAP24XX_I2C
320 #define CONFIG_CMD_EEPROM
321 #define CONFIG_ENV_EEPROM_IS_ON_I2C
322 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
323 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
324 #define CONFIG_SYS_I2C_MULTI_EEPROMS
325
326 #define CONFIG_OMAP_GPIO
327
328 #define CONFIG_BAUDRATE 115200
329
330 /* CPU */
331 #define CONFIG_ARCH_CPU_INIT
332
333 #define CONFIG_ENV_OVERWRITE 1
334 #define CONFIG_SYS_CONSOLE_INFO_QUIET
335
336 #ifndef CONFIG_NOR_BOOT
337 /* Defines for SPL */
338 #define CONFIG_SPL
339 #define CONFIG_SPL_FRAMEWORK
340 /*
341 * Place the image at the start of the ROM defined image space.
342 * We limit our size to the ROM-defined downloaded image area, and use the
343 * rest of the space for stack.
344 */
345 #define CONFIG_SPL_TEXT_BASE 0x402F0400
346 #define CONFIG_SPL_MAX_SIZE (0x4030C000 - CONFIG_SPL_TEXT_BASE)
347 #define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR
348
349 #define CONFIG_SPL_OS_BOOT
350
351 #define CONFIG_SPL_BSS_START_ADDR 0x80a00000
352 #define CONFIG_SPL_BSS_MAX_SIZE 0x80000 /* 512 KB */
353
354 #define CONFIG_SYS_MMCSD_RAW_MODE_U_BOOT_SECTOR 0x300 /* address 0x60000 */
355 #define CONFIG_SYS_U_BOOT_MAX_SIZE_SECTORS 0x200 /* 256 KB */
356 #define CONFIG_SYS_MMC_SD_FAT_BOOT_PARTITION 1
357 #define CONFIG_SPL_FAT_LOAD_PAYLOAD_NAME "u-boot.img"
358
359 #ifdef CONFIG_SPL_OS_BOOT
360 /* fat */
361 #define CONFIG_SPL_FAT_LOAD_KERNEL_NAME "uImage"
362 #define CONFIG_SPL_FAT_LOAD_ARGS_NAME "args"
363 #define CONFIG_SYS_SPL_ARGS_ADDR (PHYS_DRAM_1 + 0x100)
364
365 /* raw mmc */
366 #define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x900 /* address 0x120000 */
367 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x80 /* address 0x10000 */
368 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS 0x80 /* 64KiB */
369
370 /* nand */
371 #ifdef CONFIG_NAND
372 #define CONFIG_CMD_SPL_NAND_OFS 0x240000 /* end of u-boot */
373 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
374 #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
375 #endif
376
377 /* spl export command */
378 #define CONFIG_CMD_SPL
379 #endif
380
381 #define CONFIG_SPL_MMC_SUPPORT
382 #define CONFIG_SPL_FAT_SUPPORT
383 #define CONFIG_SPL_I2C_SUPPORT
384
385 #define CONFIG_SPL_LIBCOMMON_SUPPORT
386 #define CONFIG_SPL_LIBDISK_SUPPORT
387 #define CONFIG_SPL_LIBGENERIC_SUPPORT
388 #define CONFIG_SPL_SERIAL_SUPPORT
389 #define CONFIG_SPL_GPIO_SUPPORT
390 #define CONFIG_SPL_YMODEM_SUPPORT
391 #define CONFIG_SPL_NET_SUPPORT
392 #define CONFIG_SPL_ENV_SUPPORT
393 #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"
394 #define CONFIG_SPL_ETH_SUPPORT
395 #define CONFIG_SPL_SPI_SUPPORT
396 #define CONFIG_SPL_SPI_FLASH_SUPPORT
397 #define CONFIG_SPL_SPI_LOAD
398 #define CONFIG_SPL_SPI_BUS 0
399 #define CONFIG_SPL_SPI_CS 0
400 #define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
401 #define CONFIG_SPL_MUSB_NEW_SUPPORT
402 #define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
403
404 #define CONFIG_SPL_BOARD_INIT
405
406 #ifdef CONFIG_NAND
407 #define CONFIG_SPL_NAND_AM33XX_BCH
408 #define CONFIG_SPL_NAND_SUPPORT
409 #define CONFIG_SPL_NAND_BASE
410 #define CONFIG_SPL_NAND_DRIVERS
411 #define CONFIG_SPL_NAND_ECC
412 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
413 #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
414 CONFIG_SYS_NAND_PAGE_SIZE)
415 #define CONFIG_SYS_NAND_PAGE_SIZE 2048
416 #define CONFIG_SYS_NAND_OOBSIZE 64
417 #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
418 #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
419 #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
420 10, 11, 12, 13, 14, 15, 16, 17, \
421 18, 19, 20, 21, 22, 23, 24, 25, \
422 26, 27, 28, 29, 30, 31, 32, 33, \
423 34, 35, 36, 37, 38, 39, 40, 41, \
424 42, 43, 44, 45, 46, 47, 48, 49, \
425 50, 51, 52, 53, 54, 55, 56, 57, }
426
427 #define CONFIG_SYS_NAND_ECCSIZE 512
428 #define CONFIG_SYS_NAND_ECCBYTES 14
429
430 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
431
432 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
433 #endif
434 #endif
435
436 /*
437 * 1MB into the SDRAM to allow for SPL's bss at the beginning of SDRAM
438 * 64 bytes before this address should be set aside for u-boot.img's
439 * header. That is 0x800FFFC0--0x80100000 should not be used for any
440 * other needs.
441 */
442 #ifdef CONFIG_NOR_BOOT
443 #define CONFIG_SYS_TEXT_BASE 0x08000000
444 #else
445 #define CONFIG_SYS_TEXT_BASE 0x80800000
446 #endif
447 #define CONFIG_SYS_SPL_MALLOC_START 0x80a08000
448 #define CONFIG_SYS_SPL_MALLOC_SIZE 0x100000
449
450 /* Since SPL did pll and ddr initialization for us,
451 * we don't need to do it twice.
452 */
453 #if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NOR_BOOT)
454 #define CONFIG_SKIP_LOWLEVEL_INIT
455 #endif
456
457 /*
458 * USB configuration
459 */
460 #define CONFIG_USB_MUSB_DSPS
461 #define CONFIG_ARCH_MISC_INIT
462 #define CONFIG_MUSB_GADGET
463 #define CONFIG_MUSB_PIO_ONLY
464 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
465 #define CONFIG_USB_GADGET_DUALSPEED
466 #define CONFIG_USB_GADGET_VBUS_DRAW 2
467 #define CONFIG_MUSB_HOST
468 #define CONFIG_AM335X_USB0
469 #define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
470 #define CONFIG_AM335X_USB1
471 #define CONFIG_AM335X_USB1_MODE MUSB_HOST
472
473 #ifdef CONFIG_MUSB_HOST
474 #define CONFIG_CMD_USB
475 #define CONFIG_USB_STORAGE
476 #endif
477
478 #ifdef CONFIG_MUSB_GADGET
479 #define CONFIG_USB_ETHER
480 #define CONFIG_USB_ETH_RNDIS
481 #define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
482 #endif /* CONFIG_MUSB_GADGET */
483
484 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
485 /* disable host part of MUSB in SPL */
486 #undef CONFIG_MUSB_HOST
487 /*
488 * Disable CPSW SPL support so we fit within the 101KiB limit.
489 */
490 #undef CONFIG_SPL_ETH_SUPPORT
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 #define CONFIG_ENV_IS_IN_SPI_FLASH
504 #define CONFIG_SYS_REDUNDAND_ENVIRONMENT
505 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
506 #define CONFIG_ENV_SECT_SIZE (4 << 10) /* 4 KB sectors */
507 #define CONFIG_ENV_OFFSET (768 << 10) /* 768 KiB in */
508 #define CONFIG_ENV_OFFSET_REDUND (896 << 10) /* 896 KiB in */
509 #define CONFIG_CMD_MTDPARTS
510 #define MTDIDS_DEFAULT "nor0=m25p80-flash.0"
511 #define MTDPARTS_DEFAULT "mtdparts=m25p80-flash.0:128k(SPL)," \
512 "512k(u-boot),128k(u-boot-env1)," \
513 "128k(u-boot-env2),3464k(kernel)," \
514 "-(rootfs)"
515 #elif defined(CONFIG_EMMC_BOOT)
516 #undef CONFIG_ENV_IS_NOWHERE
517 #define CONFIG_ENV_IS_IN_MMC
518 #define CONFIG_SYS_MMC_ENV_DEV 1
519 #define CONFIG_SYS_MMC_ENV_PART 2
520 #endif
521
522 /* Unsupported features */
523 #undef CONFIG_USE_IRQ
524
525 #define CONFIG_CMD_NET
526 #define CONFIG_CMD_DHCP
527 #define CONFIG_CMD_PING
528 #define CONFIG_DRIVER_TI_CPSW
529 #define CONFIG_MII
530 #define CONFIG_BOOTP_DEFAULT
531 #define CONFIG_BOOTP_DNS
532 #define CONFIG_BOOTP_DNS2
533 #define CONFIG_BOOTP_SEND_HOSTNAME
534 #define CONFIG_BOOTP_GATEWAY
535 #define CONFIG_BOOTP_SUBNETMASK
536 #define CONFIG_NET_RETRY_COUNT 10
537 #define CONFIG_NET_MULTI
538 #define CONFIG_PHY_GIGE
539 #define CONFIG_PHYLIB
540 #define CONFIG_PHY_ADDR 0
541 #define CONFIG_PHY_SMSC
542
543 /* NAND support */
544 #ifdef CONFIG_NAND
545 #define CONFIG_CMD_NAND
546 #define CONFIG_CMD_MTDPARTS
547 #define CONFIG_NAND_OMAP_GPMC
548 #define GPMC_NAND_ECC_LP_x16_LAYOUT 1
549 #define CONFIG_SYS_NAND_BASE (0x08000000) /* physical address */
550 /* to access nand at */
551 /* CS0 */
552 #define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND
553 devices */
554 #if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
555 #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
556 #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:128k(SPL)," \
557 "128k(SPL.backup1)," \
558 "128k(SPL.backup2)," \
559 "128k(SPL.backup3),1792k(u-boot)," \
560 "128k(u-boot-spl-os)," \
561 "128k(u-boot-env),5m(kernel),-(rootfs)"
562 #define CONFIG_ENV_IS_IN_NAND
563 #define CONFIG_ENV_OFFSET 0x260000 /* environment starts here */
564 #define CONFIG_SYS_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
565 #endif
566 #endif
567
568 /*
569 * NOR Size = 16 MiB
570 * Number of Sectors/Blocks = 128
571 * Sector Size = 128 KiB
572 * Word length = 16 bits
573 * Default layout:
574 * 0x000000 - 0x07FFFF : U-Boot (512 KiB)
575 * 0x080000 - 0x09FFFF : First copy of U-Boot Environment (128 KiB)
576 * 0x0A0000 - 0x0BFFFF : Second copy of U-Boot Environment (128 KiB)
577 * 0x0C0000 - 0x4BFFFF : Linux Kernel (4 MiB)
578 * 0x4C0000 - 0xFFFFFF : Userland (11 MiB + 256 KiB)
579 */
580 #if defined(CONFIG_NOR)
581 #undef CONFIG_SYS_NO_FLASH
582 #define CONFIG_SYS_FLASH_USE_BUFFER_WRITE
583 #define CONFIG_SYS_FLASH_PROTECTION
584 #define CONFIG_SYS_FLASH_CFI
585 #define CONFIG_FLASH_CFI_DRIVER
586 #define CONFIG_FLASH_CFI_MTD
587 #define CONFIG_SYS_MAX_FLASH_SECT 128
588 #define CONFIG_SYS_MAX_FLASH_BANKS 1
589 #define CONFIG_SYS_FLASH_BASE (0x08000000)
590 #define CONFIG_SYS_FLASH_CFI_WIDTH FLASH_CFI_16BIT
591 #define CONFIG_SYS_MONITOR_BASE CONFIG_SYS_FLASH_BASE
592 #ifdef CONFIG_NOR_BOOT
593 #define CONFIG_ENV_IS_IN_FLASH
594 #define CONFIG_ENV_SECT_SIZE (128 << 10) /* 128 KiB */
595 #define CONFIG_ENV_OFFSET (512 << 10) /* 512 KiB */
596 #define CONFIG_ENV_OFFSET_REDUND (768 << 10) /* 768 KiB */
597 #define CONFIG_CMD_MTDPARTS
598 #define MTDIDS_DEFAULT "nor0=physmap-flash.0"
599 #define MTDPARTS_DEFAULT "mtdparts=physmap-flash.0:" \
600 "512k(u-boot)," \
601 "128k(u-boot-env1)," \
602 "128k(u-boot-env2)," \
603 "4m(kernel),-(rootfs)"
604 #endif
605 #define CONFIG_MTD_DEVICE
606 #define CONFIG_CMD_FLASH
607 #endif /* NOR support */
608
609 #endif /* ! __CONFIG_AM335X_EVM_H */