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