blob: 31de97f2860efb2cf292e43a8156d937bfc1a427 [file] [log] [blame]
Yegor Yefremov6ce89322015-05-29 19:27:29 +02001/*
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_BALTOS_H
17#define __CONFIG_BALTOS_H
18
19#include <configs/ti_am335x_common.h>
20
21#define MACH_TYPE_TIAM335EVM 3589 /* Until the next sync */
22#define CONFIG_MACH_TYPE MACH_TYPE_TIAM335EVM
23#define CONFIG_BOARD_LATE_INIT
24
25/* Clock Defines */
26#define V_OSCK 24000000 /* Clock output from T2 */
27#define V_SCLK (V_OSCK)
28
29/* Custom script for NOR */
30#define CONFIG_SYS_LDSCRIPT "board/vscom/baltos/u-boot.lds"
31
32/* Always 128 KiB env size */
33#define CONFIG_ENV_SIZE (128 << 10)
34
35/* Enhance our eMMC support / experience. */
36#define CONFIG_CMD_GPT
37#define CONFIG_EFI_PARTITION
38#define CONFIG_PARTITION_UUIDS
39#define CONFIG_CMD_PART
40
41/* FIT support */
Yegor Yefremov6ce89322015-05-29 19:27:29 +020042#define CONFIG_OF_BOARD_SETUP
43
44/* UBI Support */
45#define CONFIG_CMD_MTDPARTS
46#define CONFIG_MTD_PARTITIONS
47#define CONFIG_MTD_DEVICE
48#define CONFIG_RBTREE
49#define CONFIG_LZO
50#define CONFIG_CMD_UBI
51#define CONFIG_CMD_UBIFS
52
53/* I2C configuration */
54#undef CONFIG_SYS_OMAP24_I2C_SPEED
Yegor Yefremove6b1b582015-07-06 17:28:35 +020055#define CONFIG_SYS_OMAP24_I2C_SPEED 1000
Yegor Yefremov6ce89322015-05-29 19:27:29 +020056
57#ifdef CONFIG_NAND
58#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x000c0000
59#ifdef CONFIG_SPL_OS_BOOT
60#define CONFIG_CMD_SPL_NAND_OFS 0x00080000 /* os parameters */
61#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS 0x00200000 /* kernel offset */
62#define CONFIG_CMD_SPL_WRITE_SIZE 0x2000
63#endif
64#define NANDARGS \
65 "mtdids=" MTDIDS_DEFAULT "\0" \
66 "mtdparts=" MTDPARTS_DEFAULT "\0" \
67 "nandargs=setenv bootargs console=${console} " \
68 "${optargs} " \
69 "${mtdparts} " \
70 "root=${nandroot} " \
71 "rootfstype=${nandrootfstype}\0" \
72 "nandroot=ubi0:rootfs rw ubi.mtd=5\0" \
73 "nandrootfstype=ubifs rootwait=1\0" \
74 "nandboot=echo Booting from nand ...; " \
75 "run nandargs; " \
76 "setenv loadaddr 0x84000000; " \
77 "ubi part UBI; " \
78 "ubifsmount ubi0:kernel; " \
79 "ubifsload $loadaddr kernel-fit.itb;" \
80 "ubifsumount; " \
81 "bootm ${loadaddr}#conf${board_name}\0"
82#else
83#define NANDARGS ""
84#endif
85
86#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
87
88#ifndef CONFIG_SPL_BUILD
89#define CONFIG_EXTRA_ENV_SETTINGS \
90 DEFAULT_LINUX_BOOT_ENV \
91 "boot_fdt=try\0" \
92 "bootpart=0:2\0" \
93 "bootdir=/boot\0" \
94 "bootfile=zImage\0" \
95 "fdtfile=undefined\0" \
96 "console=ttyO0,115200n8\0" \
97 "partitions=" \
98 "uuid_disk=${uuid_gpt_disk};" \
99 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
100 "optargs=\0" \
101 "mmcdev=0\0" \
102 "mmcroot=/dev/mmcblk0p2 ro\0" \
103 "mmcrootfstype=ext4 rootwait\0" \
104 "rootpath=/export/rootfs\0" \
105 "nfsopts=nolock\0" \
106 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
107 "::off\0" \
108 "ramroot=/dev/ram0 rw\0" \
109 "ramrootfstype=ext2\0" \
110 "mmcargs=setenv bootargs console=${console} " \
111 "${optargs} " \
112 "${mtdparts} " \
113 "root=${mmcroot} " \
114 "rootfstype=${mmcrootfstype}\0" \
115 "spiroot=/dev/mtdblock4 rw\0" \
116 "spirootfstype=jffs2\0" \
117 "spisrcaddr=0xe0000\0" \
118 "spiimgsize=0x362000\0" \
119 "spibusno=0\0" \
120 "spiargs=setenv bootargs console=${console} " \
121 "${optargs} " \
122 "root=${spiroot} " \
123 "rootfstype=${spirootfstype}\0" \
124 "netargs=setenv bootargs console=${console} " \
125 "${optargs} " \
126 "root=/dev/nfs " \
127 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
128 "ip=dhcp\0" \
129 "bootenv=uEnv.txt\0" \
130 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
131 "importbootenv=echo Importing environment from mmc ...; " \
132 "env import -t $loadaddr $filesize\0" \
133 "ramargs=setenv bootargs console=${console} " \
134 "${optargs} " \
135 "root=${ramroot} " \
136 "rootfstype=${ramrootfstype}\0" \
137 "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
138 "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
139 "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
140 "mmcloados=run mmcargs; " \
141 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
142 "if run loadfdt; then " \
143 "bootz ${loadaddr} - ${fdtaddr}; " \
144 "else " \
145 "if test ${boot_fdt} = try; then " \
146 "bootz; " \
147 "else " \
148 "echo WARN: Cannot load the DT; " \
149 "fi; " \
150 "fi; " \
151 "else " \
152 "bootz; " \
153 "fi;\0" \
154 "mmcboot=mmc dev ${mmcdev}; " \
155 "if mmc rescan; then " \
156 "echo SD/MMC found on device ${mmcdev};" \
157 "if run loadbootenv; then " \
158 "echo Loaded environment from ${bootenv};" \
159 "run importbootenv;" \
160 "fi;" \
161 "if test -n $uenvcmd; then " \
162 "echo Running uenvcmd ...;" \
163 "run uenvcmd;" \
164 "fi;" \
165 "if run loadimage; then " \
166 "run mmcloados;" \
167 "fi;" \
168 "fi;\0" \
169 "spiboot=echo Booting from spi ...; " \
170 "run spiargs; " \
171 "sf probe ${spibusno}:0; " \
172 "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
173 "bootz ${loadaddr}\0" \
174 "netboot=echo Booting from network ...; " \
175 "setenv autoload no; " \
176 "dhcp; " \
177 "tftp ${loadaddr} ${bootfile}; " \
178 "tftp ${fdtaddr} ${fdtfile}; " \
179 "run netargs; " \
180 "bootz ${loadaddr} - ${fdtaddr}\0" \
181 "ramboot=echo Booting from ramdisk ...; " \
182 "run ramargs; " \
183 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
184 "findfdt=setenv fdtfile am335x-baltos.dtb\0" \
185 NANDARGS
186 /*DFUARGS*/
187#endif
188
189#define CONFIG_BOOTCOMMAND \
190 "run findfdt; " \
191 "run mmcboot;" \
192 "setenv mmcdev 1; " \
193 "setenv bootpart 1:2; " \
194 "run mmcboot;" \
195 "run nandboot;"
196
Yegor Yefremov6ce89322015-05-29 19:27:29 +0200197
198/* NS16550 Configuration */
199#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
200#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
201#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
202#define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
203#define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
204#define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
205#define CONFIG_BAUDRATE 115200
206
207#define CONFIG_CMD_EEPROM
208#define CONFIG_ENV_EEPROM_IS_ON_I2C
209#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
210#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
211#define CONFIG_SYS_I2C_MULTI_EEPROMS
212
213/* PMIC support */
214#define CONFIG_POWER_TPS65910
215
216/* SPL */
217#ifndef CONFIG_NOR_BOOT
218#define CONFIG_SPL_POWER_SUPPORT
219#define CONFIG_SPL_YMODEM_SUPPORT
220
221/* Bootcount using the RTC block */
222#define CONFIG_BOOTCOUNT_LIMIT
223#define CONFIG_BOOTCOUNT_AM33XX
224
225/* USB gadget RNDIS */
226/*#define CONFIG_SPL_MUSB_NEW_SUPPORT*/
227
228/* General network SPL, both CPSW and USB gadget RNDIS */
229/*#define CONFIG_SPL_NET_SUPPORT
230#define CONFIG_SPL_ENV_SUPPORT
231#define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"*/
232
233#define CONFIG_SPL_LDSCRIPT "$(CPUDIR)/am33xx/u-boot-spl.lds"
234
235#ifdef CONFIG_NAND
236#define CONFIG_NAND_OMAP_GPMC
237#define CONFIG_NAND_OMAP_ELM
238#define CONFIG_SYS_NAND_5_ADDR_CYCLE
239#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
240 CONFIG_SYS_NAND_PAGE_SIZE)
241#define CONFIG_SYS_NAND_PAGE_SIZE 2048
242#define CONFIG_SYS_NAND_OOBSIZE 64
243#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
244#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
245#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
246 10, 11, 12, 13, 14, 15, 16, 17, \
247 18, 19, 20, 21, 22, 23, 24, 25, \
248 26, 27, 28, 29, 30, 31, 32, 33, \
249 34, 35, 36, 37, 38, 39, 40, 41, \
250 42, 43, 44, 45, 46, 47, 48, 49, \
251 50, 51, 52, 53, 54, 55, 56, 57, }
252
253#define CONFIG_SYS_NAND_ECCSIZE 512
254#define CONFIG_SYS_NAND_ECCBYTES 14
255#define CONFIG_SYS_NAND_ONFI_DETECTION
256#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
257#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
258#endif
259#endif
260
261/*
262 * USB configuration. We enable MUSB support, both for host and for
263 * gadget. We set USB0 as peripheral and USB1 as host, based on the
264 * board schematic and physical port wired to each. Then for host we
265 * add mass storage support and for gadget we add both RNDIS ethernet
266 * and DFU.
267 */
268#define CONFIG_USB_MUSB_DSPS
269#define CONFIG_ARCH_MISC_INIT
270#define CONFIG_MUSB_GADGET
271#define CONFIG_MUSB_PIO_ONLY
272#define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
273#define CONFIG_USB_GADGET
274#define CONFIG_USBDOWNLOAD_GADGET
275#define CONFIG_USB_GADGET_DUALSPEED
276#define CONFIG_USB_GADGET_VBUS_DRAW 2
277#define CONFIG_MUSB_HOST
278#define CONFIG_AM335X_USB0
279#define CONFIG_AM335X_USB0_MODE MUSB_PERIPHERAL
280#define CONFIG_AM335X_USB1
281#define CONFIG_AM335X_USB1_MODE MUSB_HOST
282
283#ifdef CONFIG_MUSB_HOST
284#define CONFIG_CMD_USB
285#define CONFIG_USB_STORAGE
286#endif
287
288#ifdef CONFIG_MUSB_GADGET
289#define CONFIG_USB_ETHER
290#define CONFIG_USB_ETH_RNDIS
291#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
292
293/* USB TI's IDs */
294#define CONFIG_G_DNL_VENDOR_NUM 0x0403
295#define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
296#define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
297#endif /* CONFIG_MUSB_GADGET */
298
299#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
300/* disable host part of MUSB in SPL */
301#undef CONFIG_MUSB_HOST
302/* disable EFI partitions and partition UUID support */
303#undef CONFIG_PARTITION_UUIDS
304#undef CONFIG_EFI_PARTITION
305/*
306 * Disable CPSW SPL support so we fit within the 101KiB limit.
307 */
308#undef CONFIG_SPL_ETH_SUPPORT
309#endif
310
311/* Network. */
312#define CONFIG_PHY_GIGE
313#define CONFIG_PHYLIB
314#define CONFIG_PHY_ADDR 0
315#define CONFIG_PHY_SMSC
316#define CONFIG_MII
317#define CONFIG_CMD_MII
318#define CONFIG_PHY_ATHEROS
319
320/* NAND support */
321#ifdef CONFIG_NAND
322#define CONFIG_CMD_NAND
323#define GPMC_NAND_ECC_LP_x8_LAYOUT 1
324#if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
325#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
326#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:128k(SPL)," \
327 "128k(SPL.backup1)," \
328 "128k(SPL.backup2)," \
329 "128k(SPL.backup3)," \
330 "1920k(u-boot)," \
331 "-(UBI)"
332#define CONFIG_ENV_IS_NOWHERE
333#endif
334#endif
335
336#endif /* ! __CONFIG_BALTOS_H */