4 * Copyright (C) 2011 Texas Instruments Incorporated - http://www.ti.com/
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.
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.
16 #ifndef __CONFIG_BALTOS_H
17 #define __CONFIG_BALTOS_H
19 #include <linux/sizes.h>
20 #include <configs/ti_am335x_common.h>
22 #define CONFIG_MACH_TYPE MACH_TYPE_AM335XEVM
25 #define V_OSCK 24000000 /* Clock output from T2 */
26 #define V_SCLK (V_OSCK)
28 /* Custom script for NOR */
29 #define CONFIG_SYS_LDSCRIPT "board/vscom/baltos/u-boot.lds"
31 /* Always 128 KiB env size */
32 #define CONFIG_ENV_SIZE (128 << 10)
35 #define CONFIG_SYS_BOOTM_LEN SZ_64M
38 #define CONFIG_MTD_PARTITIONS
39 #define CONFIG_MTD_DEVICE
41 /* I2C configuration */
42 #undef CONFIG_SYS_OMAP24_I2C_SPEED
43 #define CONFIG_SYS_OMAP24_I2C_SPEED 1000
46 #define CONFIG_SYS_NAND_U_BOOT_OFFS 0x00080000
47 #ifdef CONFIG_SPL_OS_BOOT
48 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */
49 #define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
52 "mtdids=" MTDIDS_DEFAULT "\0" \
53 "mtdparts=" MTDPARTS_DEFAULT "\0" \
54 "nandargs=setenv bootargs console=${console} " \
58 "rootfstype=${nandrootfstype}\0" \
59 "nandroot=ubi0:rootfs rw ubi.mtd=5\0" \
60 "nandrootfstype=ubifs rootwait=1\0" \
61 "nandboot=echo Booting from nand ...; " \
63 "setenv loadaddr 0x84000000; " \
65 "ubifsmount ubi0:kernel; " \
66 "ubifsload $loadaddr kernel-fit.itb;" \
68 "bootm ${loadaddr}#conf${board_name}; " \
69 "if test $? -ne 0; then echo Using default FIT config; " \
70 "bootm ${loadaddr}; fi;\0"
75 #define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
77 #ifndef CONFIG_SPL_BUILD
78 #define CONFIG_EXTRA_ENV_SETTINGS \
79 DEFAULT_LINUX_BOOT_ENV \
84 "fdtfile=undefined\0" \
85 "console=ttyO0,115200n8\0" \
87 "uuid_disk=${uuid_gpt_disk};" \
88 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
91 "mmcroot=/dev/mmcblk0p2 ro\0" \
92 "usbroot=/dev/sda2 ro\0" \
93 "mmcrootfstype=ext4 rootwait\0" \
94 "usbrootfstype=ext4 rootwait\0" \
95 "rootpath=/export/rootfs\0" \
97 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
99 "ramroot=/dev/ram0 rw\0" \
100 "ramrootfstype=ext2\0" \
101 "mmcargs=setenv bootargs console=${console} " \
105 "rootfstype=${mmcrootfstype}\0" \
106 "usbargs=setenv bootargs console=${console} " \
110 "rootfstype=${usbrootfstype}\0" \
111 "spiroot=/dev/mtdblock4 rw\0" \
112 "spirootfstype=jffs2\0" \
113 "spisrcaddr=0xe0000\0" \
114 "spiimgsize=0x362000\0" \
116 "spiargs=setenv bootargs console=${console} " \
119 "rootfstype=${spirootfstype}\0" \
120 "netargs=setenv bootargs console=${console} " \
123 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
125 "bootenv=uEnv.txt\0" \
126 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
127 "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
128 "importbootenv=echo Importing environment from mmc ...; " \
129 "env import -t $loadaddr $filesize\0" \
130 "usbimportbootenv=echo Importing environment from USB ...; " \
131 "env import -t $loadaddr $filesize\0" \
132 "ramargs=setenv bootargs console=${console} " \
135 "rootfstype=${ramrootfstype}\0" \
136 "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
137 "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
138 "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
139 "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
140 "usbloados=run usbargs; " \
141 "bootm ${loadaddr}#conf${board_name}; " \
142 "if test $? -ne 0; then " \
143 "echo Using default FIT configuration; " \
144 "bootm ${loadaddr}; " \
146 "mmcloados=run mmcargs; " \
147 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
148 "if run loadfdt; then " \
149 "bootz ${loadaddr} - ${fdtaddr}; " \
151 "if test ${boot_fdt} = try; then " \
154 "echo WARN: Cannot load the DT; " \
160 "usbboot=usb reset; " \
161 "if usb storage; then " \
162 "echo USB drive found;" \
163 "if run usbloadbootenv; then " \
164 "echo Loaded environment from ${bootenv};" \
165 "run usbimportbootenv;" \
167 "if test -n $uenvcmd; then " \
168 "echo Running uenvcmd ...;" \
171 "if run usbloadimage; then " \
175 "mmcboot=mmc dev ${mmcdev}; " \
176 "if mmc rescan; then " \
177 "echo SD/MMC found on device ${mmcdev};" \
178 "if run loadbootenv; then " \
179 "echo Loaded environment from ${bootenv};" \
180 "run importbootenv;" \
182 "if test -n $uenvcmd; then " \
183 "echo Running uenvcmd ...;" \
186 "if run loadimage; then " \
190 "spiboot=echo Booting from spi ...; " \
192 "sf probe ${spibusno}:0; " \
193 "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
194 "bootz ${loadaddr}\0" \
195 "netboot=echo Booting from network ...; " \
196 "setenv autoload no; " \
198 "tftp ${loadaddr} ${bootfile}; " \
199 "tftp ${fdtaddr} ${fdtfile}; " \
201 "bootz ${loadaddr} - ${fdtaddr}\0" \
202 "ramboot=echo Booting from ramdisk ...; " \
204 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
205 "findfdt=setenv fdtfile am335x-baltos.dtb\0" \
210 #define CONFIG_BOOTCOMMAND \
214 "setenv mmcdev 1; " \
215 "setenv bootpart 1:2; " \
219 /* NS16550 Configuration */
220 #define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
221 #define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
222 #define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
223 #define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
224 #define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
225 #define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
227 #define CONFIG_ENV_EEPROM_IS_ON_I2C
228 #define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
229 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
232 #define CONFIG_POWER_TPS65910
235 #ifndef CONFIG_NOR_BOOT
236 /* Bootcount using the RTC block */
237 #define CONFIG_BOOTCOUNT_LIMIT
238 #define CONFIG_BOOTCOUNT_AM33XX
240 /* USB gadget RNDIS */
242 /* General network SPL, both CPSW and USB gadget RNDIS */
243 #define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"*/
245 #define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/u-boot-spl.lds"
248 #define CONFIG_NAND_OMAP_GPMC
249 #define CONFIG_NAND_OMAP_GPMC_PREFETCH
250 #define CONFIG_NAND_OMAP_ELM
251 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
252 #define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
253 CONFIG_SYS_NAND_PAGE_SIZE)
254 #define CONFIG_SYS_NAND_PAGE_SIZE 2048
255 #define CONFIG_SYS_NAND_OOBSIZE 64
256 #define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
257 #define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
258 #define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
259 10, 11, 12, 13, 14, 15, 16, 17, \
260 18, 19, 20, 21, 22, 23, 24, 25, \
261 26, 27, 28, 29, 30, 31, 32, 33, \
262 34, 35, 36, 37, 38, 39, 40, 41, \
263 42, 43, 44, 45, 46, 47, 48, 49, \
264 50, 51, 52, 53, 54, 55, 56, 57, }
266 #define CONFIG_SYS_NAND_ECCSIZE 512
267 #define CONFIG_SYS_NAND_ECCBYTES 14
268 #define CONFIG_SYS_NAND_ONFI_DETECTION
269 #define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
270 #define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
275 * USB configuration. We enable MUSB support, both for host and for
276 * gadget. We set USB0 as peripheral and USB1 as host, based on the
277 * board schematic and physical port wired to each. Then for host we
278 * add mass storage support and for gadget we add both RNDIS ethernet
281 #define CONFIG_USB_MUSB_DSPS
282 #define CONFIG_USB_MUSB_PIO_ONLY
283 #define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
284 #define CONFIG_AM335X_USB0
285 #define CONFIG_AM335X_USB0_MODE MUSB_HOST
286 #define CONFIG_AM335X_USB1
287 #define CONFIG_AM335X_USB1_MODE MUSB_OTG
289 #ifdef CONFIG_USB_MUSB_GADGET
290 #define CONFIG_USB_ETHER
291 #define CONFIG_USB_ETH_RNDIS
292 #define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
293 #endif /* CONFIG_USB_MUSB_GADGET */
295 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
296 /* disable host part of MUSB in SPL */
297 /* disable EFI partitions and partition UUID support */
299 * Disable CPSW SPL support so we fit within the 101KiB limit.
304 #define CONFIG_PHY_ADDR 0
305 #define CONFIG_PHY_SMSC
307 #define CONFIG_PHY_ATHEROS
311 #define GPMC_NAND_ECC_LP_x8_LAYOUT 1
312 #if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
313 #define MTDIDS_DEFAULT "nand0=omap2-nand.0"
314 #define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:128k(SPL)," \
315 "128k(SPL.backup1)," \
316 "128k(SPL.backup2)," \
317 "128k(SPL.backup3)," \
323 #endif /* ! __CONFIG_BALTOS_H */