blob: d236a89601f05902e72d4ffc7fe7d54c32a9e0c1 [file] [log] [blame]
Chandan Nath7d744102011-10-14 02:58:26 +00001/*
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
Chandan Nath68e382b2012-01-09 20:38:55 +000019#define CONFIG_AM33XX
SRICHARAN R3f30b0a2013-04-24 00:41:24 +000020#define CONFIG_OMAP
Lokesh Vutla56055052013-07-30 11:36:30 +053021#define CONFIG_OMAP_COMMON
Chandan Nath7d744102011-10-14 02:58:26 +000022
Tom Rini8eb48ff2013-03-14 11:15:25 +000023#include <asm/arch/omap.h>
Chandan Nath7d744102011-10-14 02:58:26 +000024
Chandan Nath5b9896d2012-07-24 12:22:20 +000025#define CONFIG_DMA_COHERENT
26#define CONFIG_DMA_COHERENT_SIZE (1 << 20)
27
Tom Rini142184e2012-06-12 14:54:32 -070028#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 */
Chandan Nath5c668742012-01-09 20:38:57 +000032#define CONFIG_SYS_PROMPT "U-Boot# "
Tom Rini40271852012-10-24 07:28:17 +000033#define CONFIG_BOARD_LATE_INIT
Chandan Nath7d744102011-10-14 02:58:26 +000034#define CONFIG_SYS_NO_FLASH
Tom Rini077a6a62011-10-21 12:23:06 +000035#define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */
Chandan Nath7d744102011-10-14 02:58:26 +000036#define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM
37
Tom Rini142184e2012-06-12 14:54:32 -070038#define CONFIG_OF_LIBFDT
Tom Rinic64ea612013-02-19 11:18:15 +000039#define CONFIG_CMD_BOOTZ
Tom Rini142184e2012-06-12 14:54:32 -070040#define CONFIG_CMDLINE_TAG /* enable passing of ATAGs */
Justin Watersab3884a2013-07-11 09:54:59 -040041#define CONFIG_CMDLINE_EDITING
42#define CONFIG_STACKSIZE (128 * 1024)
43#define CONFIG_AUTO_COMPLETE
Tom Rini142184e2012-06-12 14:54:32 -070044#define CONFIG_SETUP_MEMORY_TAGS
45#define CONFIG_INITRD_TAG
46
Steve Kipiszc1399b42013-07-18 15:13:04 -040047/* Custom script for NOR */
48#define CONFIG_SYS_LDSCRIPT "board/ti/am335x/u-boot.lds"
49
Pantelis Antoniou005ed122013-03-14 05:32:53 +000050#define CONFIG_SYS_CACHELINE_SIZE 64
51
Tom Rini142184e2012-06-12 14:54:32 -070052/* commands to include */
53#include <config_cmd_default.h>
54
Chandan Nath7d744102011-10-14 02:58:26 +000055#define CONFIG_CMD_ASKENV
56#define CONFIG_VERSION_VARIABLE
57
Justin Waters735a6272013-07-11 09:54:58 -040058#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
Chandan Nath7d744102011-10-14 02:58:26 +000079/* set to negative value for no autoboot */
Koen Kooi18534e22012-09-26 07:19:43 +000080#define CONFIG_BOOTDELAY 1
Tom Rini40271852012-10-24 07:28:17 +000081#define CONFIG_ENV_VARS_UBOOT_CONFIG
82#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
Tom Rini73e0dac2013-02-26 13:08:53 -050083#ifndef CONFIG_SPL_BUILD
Chandan Nath7d744102011-10-14 02:58:26 +000084#define CONFIG_EXTRA_ENV_SETTINGS \
Tom Rini142184e2012-06-12 14:54:32 -070085 "loadaddr=0x80200000\0" \
86 "fdtaddr=0x80F80000\0" \
hvaibhav@ti.com8f12c7c2012-09-18 09:26:05 +000087 "fdt_high=0xffffffff\0" \
Tom Rini6ff0b7b2013-08-09 11:22:16 -040088 "boot_fdt=try\0" \
Tom Rini142184e2012-06-12 14:54:32 -070089 "rdaddr=0x81000000\0" \
Koen Kooi02bb11f2013-03-14 05:55:21 +000090 "bootdir=/boot\0" \
91 "bootfile=uImage\0" \
Dan Murphyff302722013-06-06 13:27:06 -050092 "fdtfile=undefined\0" \
Tom Rini142184e2012-06-12 14:54:32 -070093 "console=ttyO0,115200n8\0" \
94 "optargs=\0" \
Pantelis Antoniou66449482013-03-14 05:32:55 +000095 "dfu_alt_info_mmc=" DFU_ALT_INFO_MMC "\0" \
96 "dfu_alt_info_emmc=rawemmc mmc 0 3751936\0" \
Tom Rini142184e2012-06-12 14:54:32 -070097 "mmcdev=0\0" \
Koen Kooi18534e22012-09-26 07:19:43 +000098 "mmcroot=/dev/mmcblk0p2 ro\0" \
Tom Rini142184e2012-06-12 14:54:32 -070099 "mmcrootfstype=ext4 rootwait\0" \
Koen Kooid5d12bf2013-03-14 05:55:20 +0000100 "bootpart=0:2\0" \
Chase Maupindfdaff72013-02-08 11:20:13 +0000101 "rootpath=/export/rootfs\0" \
102 "nfsopts=nolock\0" \
103 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
104 "::off\0" \
Tom Rini142184e2012-06-12 14:54:32 -0700105 "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" \
Chase Maupin5292c562013-02-08 11:20:12 +0000111 "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" \
Chase Maupindfdaff72013-02-08 11:20:13 +0000120 "netargs=setenv bootargs console=${console} " \
121 "${optargs} " \
122 "root=/dev/nfs " \
123 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
124 "ip=dhcp\0" \
Tom Rini142184e2012-06-12 14:54:32 -0700125 "bootenv=uEnv.txt\0" \
Koen Kooid5d12bf2013-03-14 05:55:20 +0000126 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
Tom Rini142184e2012-06-12 14:54:32 -0700127 "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" \
Koen Kooid5d12bf2013-03-14 05:55:20 +0000133 "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
Koen Kooi02bb11f2013-03-14 05:55:21 +0000134 "loaduimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
135 "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Tom Rini6ff0b7b2013-08-09 11:22:16 -0400136 "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" \
Justin Waters8c52edb2013-07-11 09:55:00 -0400150 "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;" \
Tom Rini6ff0b7b2013-08-09 11:22:16 -0400161 "run mmcloados;" \
Justin Waters8c52edb2013-07-11 09:55:00 -0400162 "fi;\0" \
Chase Maupin5292c562013-02-08 11:20:12 +0000163 "spiboot=echo Booting from spi ...; " \
164 "run spiargs; " \
165 "sf probe ${spibusno}:0; " \
166 "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
167 "bootm ${loadaddr}\0" \
Chase Maupindfdaff72013-02-08 11:20:13 +0000168 "netboot=echo Booting from network ...; " \
169 "setenv autoload no; " \
170 "dhcp; " \
171 "tftp ${loadaddr} ${bootfile}; " \
Koen Kooi02bb11f2013-03-14 05:55:21 +0000172 "tftp ${fdtaddr} ${fdtfile}; " \
Chase Maupindfdaff72013-02-08 11:20:13 +0000173 "run netargs; " \
Koen Kooi02bb11f2013-03-14 05:55:21 +0000174 "bootm ${loadaddr} - ${fdtaddr}\0" \
Tom Rini142184e2012-06-12 14:54:32 -0700175 "ramboot=echo Booting from ramdisk ...; " \
176 "run ramargs; " \
Koen Kooi02bb11f2013-03-14 05:55:21 +0000177 "bootm ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
Tom Rini40271852012-10-24 07:28:17 +0000178 "findfdt="\
179 "if test $board_name = A335BONE; then " \
180 "setenv fdtfile am335x-bone.dtb; fi; " \
Koen Kooib4aa5272013-03-14 05:55:19 +0000181 "if test $board_name = A335BNLT; then " \
182 "setenv fdtfile am335x-boneblack.dtb; fi; " \
Tom Rini40271852012-10-24 07:28:17 +0000183 "if test $board_name = A33515BB; then " \
184 "setenv fdtfile am335x-evm.dtb; fi; " \
185 "if test $board_name = A335X_SK; then " \
Tom Rini7b199752013-06-27 09:55:39 -0400186 "setenv fdtfile am335x-evmsk.dtb; fi; " \
Dan Murphyff302722013-06-06 13:27:06 -0500187 "if test $fdtfile = undefined; then " \
Justin Waters735a6272013-07-11 09:54:58 -0400188 "echo WARNING: Could not determine device tree to use; fi; \0" \
189 NANDARGS
Tom Rini73e0dac2013-02-26 13:08:53 -0500190#endif
191
Tom Rini142184e2012-06-12 14:54:32 -0700192#define CONFIG_BOOTCOMMAND \
Koen Kooi02bb11f2013-03-14 05:55:21 +0000193 "run findfdt; " \
Justin Waters8c52edb2013-07-11 09:55:00 -0400194 "run mmcboot;" \
195 "setenv mmcdev 1; " \
196 "setenv bootpart 1:2; " \
197 "run mmcboot;" \
198 "run nandboot;"
Chandan Nath7d744102011-10-14 02:58:26 +0000199
200/* Clock Defines */
201#define V_OSCK 24000000 /* Clock output from T2 */
Chandan Nath5c668742012-01-09 20:38:57 +0000202#define V_SCLK (V_OSCK)
Chandan Nath7d744102011-10-14 02:58:26 +0000203
Chandan Nath7d744102011-10-14 02:58:26 +0000204#define CONFIG_CMD_ECHO
205
Pantelis Antoniou66449482013-03-14 05:32:55 +0000206/* We set the max number of command args high to avoid HUSH bugs. */
207#define CONFIG_SYS_MAXARGS 64
Chandan Nath7d744102011-10-14 02:58:26 +0000208
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
Chandan Nath7d744102011-10-14 02:58:26 +0000227#define CONFIG_SYS_LOAD_ADDR 0x81000000 /* Default load address */
Chandan Nath7d744102011-10-14 02:58:26 +0000228
Chandan Nathd6e97f82012-01-09 20:38:58 +0000229#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
Pantelis Antoniou66449482013-03-14 05:32:55 +0000235#define CONFIG_FAT_WRITE
Chandan Nathd6e97f82012-01-09 20:38:58 +0000236#define CONFIG_CMD_EXT2
Koen Kooid5d12bf2013-03-14 05:55:20 +0000237#define CONFIG_CMD_EXT4
238#define CONFIG_CMD_FS_GENERIC
Chandan Nathd6e97f82012-01-09 20:38:58 +0000239
Tom Rini883401e2012-08-08 14:35:55 -0700240#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
Pantelis Antoniou66449482013-03-14 05:32:55 +0000248/* 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
Pantelis Antoniou66449482013-03-14 05:32:55 +0000261#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;" \
Tom Rini9dae10c2013-07-08 12:15:15 -0400267 "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;" \
Pantelis Antoniou66449482013-03-14 05:32:55 +0000272 "u-boot.img fat 0 1;" \
273 "uEnv.txt fat 0 1"
Justin Waters735a6272013-07-11 09:54:58 -0400274#ifdef CONFIG_NAND
275#define CONFIG_DFU_NAND
Pantelis Antoniou66449482013-03-14 05:32:55 +0000276#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;" \
Tom Rini9dae10c2013-07-08 12:15:15 -0400282 "u-boot-spl-os part 0 6;" \
283 "kernel part 0 8;" \
284 "rootfs part 0 9"
Justin Waters735a6272013-07-11 09:54:58 -0400285#endif
Pantelis Antoniou66449482013-03-14 05:32:55 +0000286
Chandan Nath7d744102011-10-14 02:58:26 +0000287 /* Physical Memory Map */
288#define CONFIG_NR_DRAM_BANKS 1 /* 1 bank of DRAM */
289#define PHYS_DRAM_1 0x80000000 /* DRAM Bank #1 */
Chandan Nath7d744102011-10-14 02:58:26 +0000290#define CONFIG_MAX_RAM_BANK_SIZE (1024 << 20) /* 1GB */
291
292#define CONFIG_SYS_SDRAM_BASE PHYS_DRAM_1
Tom Riniee5bce42012-08-08 17:03:10 -0700293#define CONFIG_SYS_INIT_SP_ADDR (NON_SECURE_SRAM_END - \
Chandan Nath7d744102011-10-14 02:58:26 +0000294 GENERATED_GBL_DATA_SIZE)
295 /* Platform/Board specific defs */
Chandan Nath7d744102011-10-14 02:58:26 +0000296#define CONFIG_SYS_TIMERBASE 0x48040000 /* Use Timer2 */
297#define CONFIG_SYS_PTV 2 /* Divisor: 2^(PTV+1) => 8 */
Mark Jackson99fd5f62013-04-17 08:22:47 +0000298#define CONFIG_SYS_HZ 1000 /* 1ms clock */
Chandan Nath7d744102011-10-14 02:58:26 +0000299
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 */
Andrew Bradford99162792012-10-25 08:21:32 -0400306#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 */
Chandan Nath7d744102011-10-14 02:58:26 +0000311
Patil, Rachna5f70c512012-01-22 23:47:01 +0000312/* 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
Steve Sakoman695b1fe2012-06-22 07:45:57 +0000318#define CONFIG_I2C_MULTI_BUS
Patil, Rachna5f70c512012-01-22 23:47:01 +0000319#define CONFIG_DRIVER_OMAP24XX_I2C
Tom Rini132b6db2012-07-31 09:37:08 -0700320#define CONFIG_CMD_EEPROM
Tom Rini883401e2012-08-08 14:35:55 -0700321#define CONFIG_ENV_EEPROM_IS_ON_I2C
Tom Rini132b6db2012-07-31 09:37:08 -0700322#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
Patil, Rachna5f70c512012-01-22 23:47:01 +0000325
Marek Vasutaede1882012-07-21 05:02:23 +0000326#define CONFIG_OMAP_GPIO
327
Chandan Nath7d744102011-10-14 02:58:26 +0000328#define CONFIG_BAUDRATE 115200
Chandan Nath7d744102011-10-14 02:58:26 +0000329
SRICHARAN R669b3372013-04-24 00:41:25 +0000330/* CPU */
331#define CONFIG_ARCH_CPU_INIT
332
Andrew Bradford99162792012-10-25 08:21:32 -0400333#define CONFIG_ENV_OVERWRITE 1
Chandan Nath7d744102011-10-14 02:58:26 +0000334#define CONFIG_SYS_CONSOLE_INFO_QUIET
335
Steve Kipiszc1399b42013-07-18 15:13:04 -0400336#ifndef CONFIG_NOR_BOOT
Chandan Nath77a73fe2012-01-09 20:38:59 +0000337/* Defines for SPL */
338#define CONFIG_SPL
Tom Rini28591df2012-08-13 12:03:19 -0700339#define CONFIG_SPL_FRAMEWORK
Tom Rini3a300832013-05-31 10:48:03 -0400340/*
Tom Rinic513b612013-06-06 08:57:45 -0400341 * Place the image at the start of the ROM defined image space.
Tom Rini3a300832013-05-31 10:48:03 -0400342 * We limit our size to the ROM-defined downloaded image area, and use the
343 * rest of the space for stack.
344 */
Tom Rinic513b612013-06-06 08:57:45 -0400345#define CONFIG_SPL_TEXT_BASE 0x402F0400
Tom Rini3a300832013-05-31 10:48:03 -0400346#define CONFIG_SPL_MAX_SIZE (0x4030C000 - CONFIG_SPL_TEXT_BASE)
Tom Riniee5bce42012-08-08 17:03:10 -0700347#define CONFIG_SPL_STACK CONFIG_SYS_INIT_SP_ADDR
Chandan Nath77a73fe2012-01-09 20:38:59 +0000348
Peter Korsgaardeb204db2013-05-13 08:36:30 +0000349#define CONFIG_SPL_OS_BOOT
350
351#define CONFIG_SPL_BSS_START_ADDR 0x80a00000
Chandan Nath77a73fe2012-01-09 20:38:59 +0000352#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"
Peter Korsgaardeb204db2013-05-13 08:36:30 +0000358
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 */
Tom Rinie10075d2013-07-08 12:15:16 -0400366#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 */
Peter Korsgaardeb204db2013-05-13 08:36:30 +0000369
370/* nand */
Justin Waters735a6272013-07-11 09:54:58 -0400371#ifdef CONFIG_NAND
Peter Korsgaardeb204db2013-05-13 08:36:30 +0000372#define CONFIG_CMD_SPL_NAND_OFS 0x240000 /* end of u-boot */
373#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x280000
Tom Rinie4e72d52013-07-08 12:15:17 -0400374#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
Justin Waters735a6272013-07-11 09:54:58 -0400375#endif
Peter Korsgaardeb204db2013-05-13 08:36:30 +0000376
377/* spl export command */
378#define CONFIG_CMD_SPL
379#endif
380
Chandan Nath77a73fe2012-01-09 20:38:59 +0000381#define CONFIG_SPL_MMC_SUPPORT
382#define CONFIG_SPL_FAT_SUPPORT
Patil, Rachna5f70c512012-01-22 23:47:01 +0000383#define CONFIG_SPL_I2C_SUPPORT
Chandan Nath77a73fe2012-01-09 20:38:59 +0000384
385#define CONFIG_SPL_LIBCOMMON_SUPPORT
386#define CONFIG_SPL_LIBDISK_SUPPORT
387#define CONFIG_SPL_LIBGENERIC_SUPPORT
388#define CONFIG_SPL_SERIAL_SUPPORT
Marek Vasutff0ebb82012-07-21 05:02:27 +0000389#define CONFIG_SPL_GPIO_SUPPORT
Matt Portere3283762012-01-31 12:03:58 +0000390#define CONFIG_SPL_YMODEM_SUPPORT
Ilya Yanoka1560ec2012-09-17 10:26:28 +0000391#define CONFIG_SPL_NET_SUPPORT
Ying Zhang602f7d32013-05-20 14:07:25 +0800392#define CONFIG_SPL_ENV_SUPPORT
Ilya Yanoka1560ec2012-09-17 10:26:28 +0000393#define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"
394#define CONFIG_SPL_ETH_SUPPORT
Tom Rini0c1c9232012-10-16 13:06:07 +0000395#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
Tom Rinib7691242013-07-18 15:12:59 -0400400#define CONFIG_SYS_SPI_U_BOOT_OFFS 0x20000
Ilya Yanok0760a0d2013-02-05 11:36:26 +0000401#define CONFIG_SPL_MUSB_NEW_SUPPORT
Albert ARIBAUD6277b192013-02-25 00:58:58 +0000402#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
Chandan Nath77a73fe2012-01-09 20:38:59 +0000403
Ilya Yanok2688dac2012-11-06 13:06:35 +0000404#define CONFIG_SPL_BOARD_INIT
Justin Waters735a6272013-07-11 09:54:58 -0400405
406#ifdef CONFIG_NAND
Ilya Yanok2688dac2012-11-06 13:06:35 +0000407#define CONFIG_SPL_NAND_AM33XX_BCH
408#define CONFIG_SPL_NAND_SUPPORT
Albert ARIBAUDb56eeed2013-01-08 13:15:45 +0100409#define CONFIG_SPL_NAND_BASE
410#define CONFIG_SPL_NAND_DRIVERS
411#define CONFIG_SPL_NAND_ECC
Ilya Yanok2688dac2012-11-06 13:06:35 +0000412#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
Mark Jackson99fd5f62013-04-17 08:22:47 +0000430#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
Ilya Yanok2688dac2012-11-06 13:06:35 +0000431
432#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x80000
Justin Waters735a6272013-07-11 09:54:58 -0400433#endif
434#endif
Ilya Yanok2688dac2012-11-06 13:06:35 +0000435
Chandan Nath77a73fe2012-01-09 20:38:59 +0000436/*
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 */
Steve Kipiszc1399b42013-07-18 15:13:04 -0400442#ifdef CONFIG_NOR_BOOT
443#define CONFIG_SYS_TEXT_BASE 0x08000000
444#else
Chandan Nath77a73fe2012-01-09 20:38:59 +0000445#define CONFIG_SYS_TEXT_BASE 0x80800000
Steve Kipiszc1399b42013-07-18 15:13:04 -0400446#endif
Peter Korsgaardeb204db2013-05-13 08:36:30 +0000447#define CONFIG_SYS_SPL_MALLOC_START 0x80a08000
Chandan Nath77a73fe2012-01-09 20:38:59 +0000448#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 */
Steve Kipiszc1399b42013-07-18 15:13:04 -0400453#if !defined(CONFIG_SPL_BUILD) && !defined(CONFIG_NOR_BOOT)
Chandan Nath77a73fe2012-01-09 20:38:59 +0000454#define CONFIG_SKIP_LOWLEVEL_INIT
455#endif
Chandan Nath7d744102011-10-14 02:58:26 +0000456
Ilya Yanok44a2c072012-11-06 13:48:24 +0000457/*
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
Bin Liu7a363d42013-03-21 05:27:48 +0000464#define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
Ilya Yanok44a2c072012-11-06 13:48:24 +0000465#define CONFIG_USB_GADGET_DUALSPEED
Pantelis Antoniou66449482013-03-14 05:32:55 +0000466#define CONFIG_USB_GADGET_VBUS_DRAW 2
Ilya Yanok44a2c072012-11-06 13:48:24 +0000467#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
Ilya Yanok0760a0d2013-02-05 11:36:26 +0000481#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
Ilya Yanok44a2c072012-11-06 13:48:24 +0000482#endif /* CONFIG_MUSB_GADGET */
483
Ilya Yanok0760a0d2013-02-05 11:36:26 +0000484#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
485/* disable host part of MUSB in SPL */
486#undef CONFIG_MUSB_HOST
487/*
Tom Rini35eafab2013-02-26 15:43:22 -0500488 * Disable CPSW SPL support so we fit within the 101KiB limit.
Ilya Yanok0760a0d2013-02-05 11:36:26 +0000489 */
490#undef CONFIG_SPL_ETH_SUPPORT
Ilya Yanok0760a0d2013-02-05 11:36:26 +0000491#endif
492
Tom Rinia33c7972013-02-08 11:20:15 +0000493/*
Tom Rinib7691242013-07-18 15:12:59 -0400494 * 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
Tom Rinia33c7972013-02-08 11:20:15 +0000500 * 0x442000 - 0x800000 : Userland
501 */
502#if defined(CONFIG_SPI_BOOT)
Tom Rinib7691242013-07-18 15:12:59 -0400503#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)"
Justin Waters7370a102013-07-11 09:55:02 -0400515#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
Tom Rinia33c7972013-02-08 11:20:15 +0000521
Ilya Yanok44a2c072012-11-06 13:48:24 +0000522/* Unsupported features */
523#undef CONFIG_USE_IRQ
524
Chandan Nath5b9896d2012-07-24 12:22:20 +0000525#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
Yegor Yefremov062bbac2012-11-26 04:03:16 +0000540#define CONFIG_PHY_ADDR 0
Ilya Yanok115fb802012-08-07 00:50:08 +0000541#define CONFIG_PHY_SMSC
Chandan Nath5b9896d2012-07-24 12:22:20 +0000542
Ilya Yanok3d9725e2012-11-06 13:06:31 +0000543/* NAND support */
544#ifdef CONFIG_NAND
545#define CONFIG_CMD_NAND
Tom Rini24716292013-03-14 05:32:54 +0000546#define CONFIG_CMD_MTDPARTS
Ilya Yanok3d9725e2012-11-06 13:06:31 +0000547#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 */
Ilya Yanok2688dac2012-11-06 13:06:35 +0000552#define CONFIG_SYS_MAX_NAND_DEVICE 1 /* Max number of NAND
553 devices */
Steve Kipiszc1399b42013-07-18 15:13:04 -0400554#if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
Tom Rinib7691242013-07-18 15:12:59 -0400555#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)"
Ilya Yanok2688dac2012-11-06 13:06:35 +0000562#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
Tom Rinia33c7972013-02-08 11:20:15 +0000566#endif
Ilya Yanok3d9725e2012-11-06 13:06:31 +0000567
Steve Kipiszbe9b6f82013-07-18 15:13:03 -0400568/*
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
Steve Kipiszc1399b42013-07-18 15:13:04 -0400592#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
Steve Kipiszbe9b6f82013-07-18 15:13:03 -0400605#define CONFIG_MTD_DEVICE
606#define CONFIG_CMD_FLASH
607#endif /* NOR support */
608
Chandan Nath7d744102011-10-14 02:58:26 +0000609#endif /* ! __CONFIG_AM335X_EVM_H */