blob: 06f5ceb008deb4054e9fbbc3bbf0d42b7b1ad652 [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
57#ifdef CONFIG_NAND
Yegor Yefremov51c4ccb2015-07-06 17:28:36 +020058#define CONFIG_SYS_NAND_U_BOOT_OFFS 0x00080000
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020059#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; " \
Yegor Yefremov51c4ccb2015-07-06 17:28:36 +020081 "bootm ${loadaddr}#conf${board_name}; " \
82 "if test $? -ne 0; then echo Using default FIT config; " \
83 "bootm ${loadaddr}; fi;\0"
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +020084#else
85#define NANDARGS ""
86#endif
87
88#define CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG
89
90#ifndef CONFIG_SPL_BUILD
91#define CONFIG_EXTRA_ENV_SETTINGS \
92 DEFAULT_LINUX_BOOT_ENV \
93 "boot_fdt=try\0" \
94 "bootpart=0:2\0" \
95 "bootdir=/boot\0" \
96 "bootfile=zImage\0" \
97 "fdtfile=undefined\0" \
98 "console=ttyO0,115200n8\0" \
99 "partitions=" \
100 "uuid_disk=${uuid_gpt_disk};" \
101 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
102 "optargs=\0" \
103 "mmcdev=0\0" \
104 "mmcroot=/dev/mmcblk0p2 ro\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100105 "usbroot=/dev/sda2 ro\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200106 "mmcrootfstype=ext4 rootwait\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100107 "usbrootfstype=ext4 rootwait\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200108 "rootpath=/export/rootfs\0" \
109 "nfsopts=nolock\0" \
110 "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
111 "::off\0" \
112 "ramroot=/dev/ram0 rw\0" \
113 "ramrootfstype=ext2\0" \
114 "mmcargs=setenv bootargs console=${console} " \
115 "${optargs} " \
116 "${mtdparts} " \
117 "root=${mmcroot} " \
118 "rootfstype=${mmcrootfstype}\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100119 "usbargs=setenv bootargs console=${console} " \
120 "${optargs} " \
121 "${mtdparts} " \
122 "root=${usbroot} " \
123 "rootfstype=${usbrootfstype}\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200124 "spiroot=/dev/mtdblock4 rw\0" \
125 "spirootfstype=jffs2\0" \
126 "spisrcaddr=0xe0000\0" \
127 "spiimgsize=0x362000\0" \
128 "spibusno=0\0" \
129 "spiargs=setenv bootargs console=${console} " \
130 "${optargs} " \
131 "root=${spiroot} " \
132 "rootfstype=${spirootfstype}\0" \
133 "netargs=setenv bootargs console=${console} " \
134 "${optargs} " \
135 "root=/dev/nfs " \
136 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
137 "ip=dhcp\0" \
138 "bootenv=uEnv.txt\0" \
139 "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100140 "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200141 "importbootenv=echo Importing environment from mmc ...; " \
142 "env import -t $loadaddr $filesize\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100143 "usbimportbootenv=echo Importing environment from USB ...; " \
144 "env import -t $loadaddr $filesize\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200145 "ramargs=setenv bootargs console=${console} " \
146 "${optargs} " \
147 "root=${ramroot} " \
148 "rootfstype=${ramrootfstype}\0" \
149 "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
150 "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100151 "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200152 "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100153 "usbloados=run usbargs; " \
154 "bootm ${loadaddr}#conf${board_name}; " \
155 "if test $? -ne 0; then " \
156 "echo Using default FIT configuration; " \
157 "bootm ${loadaddr}; " \
158 "fi;\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200159 "mmcloados=run mmcargs; " \
160 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
161 "if run loadfdt; then " \
162 "bootz ${loadaddr} - ${fdtaddr}; " \
163 "else " \
164 "if test ${boot_fdt} = try; then " \
165 "bootz; " \
166 "else " \
167 "echo WARN: Cannot load the DT; " \
168 "fi; " \
169 "fi; " \
170 "else " \
171 "bootz; " \
172 "fi;\0" \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100173 "usbboot=usb reset; " \
174 "if usb storage; then " \
175 "echo USB drive found;" \
176 "if run usbloadbootenv; then " \
177 "echo Loaded environment from ${bootenv};" \
178 "run usbimportbootenv;" \
179 "fi;" \
180 "if test -n $uenvcmd; then " \
181 "echo Running uenvcmd ...;" \
182 "run uenvcmd;" \
183 "fi;" \
184 "if run usbloadimage; then " \
185 "run usbloados;" \
186 "fi;" \
187 "fi;\0" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200188 "mmcboot=mmc dev ${mmcdev}; " \
189 "if mmc rescan; then " \
190 "echo SD/MMC found on device ${mmcdev};" \
191 "if run loadbootenv; then " \
192 "echo Loaded environment from ${bootenv};" \
193 "run importbootenv;" \
194 "fi;" \
195 "if test -n $uenvcmd; then " \
196 "echo Running uenvcmd ...;" \
197 "run uenvcmd;" \
198 "fi;" \
199 "if run loadimage; then " \
200 "run mmcloados;" \
201 "fi;" \
202 "fi;\0" \
203 "spiboot=echo Booting from spi ...; " \
204 "run spiargs; " \
205 "sf probe ${spibusno}:0; " \
206 "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
207 "bootz ${loadaddr}\0" \
208 "netboot=echo Booting from network ...; " \
209 "setenv autoload no; " \
210 "dhcp; " \
211 "tftp ${loadaddr} ${bootfile}; " \
212 "tftp ${fdtaddr} ${fdtfile}; " \
213 "run netargs; " \
214 "bootz ${loadaddr} - ${fdtaddr}\0" \
215 "ramboot=echo Booting from ramdisk ...; " \
216 "run ramargs; " \
217 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
218 "findfdt=setenv fdtfile am335x-baltos.dtb\0" \
219 NANDARGS
220 /*DFUARGS*/
221#endif
222
223#define CONFIG_BOOTCOMMAND \
224 "run findfdt; " \
Yegor Yefremov2f5697e2016-12-01 12:52:18 +0100225 "run usbboot;" \
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200226 "run mmcboot;" \
227 "setenv mmcdev 1; " \
228 "setenv bootpart 1:2; " \
229 "run mmcboot;" \
230 "run nandboot;"
231
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200232/* NS16550 Configuration */
233#define CONFIG_SYS_NS16550_COM1 0x44e09000 /* Base EVM has UART0 */
234#define CONFIG_SYS_NS16550_COM2 0x48022000 /* UART1 */
235#define CONFIG_SYS_NS16550_COM3 0x48024000 /* UART2 */
236#define CONFIG_SYS_NS16550_COM4 0x481a6000 /* UART3 */
237#define CONFIG_SYS_NS16550_COM5 0x481a8000 /* UART4 */
238#define CONFIG_SYS_NS16550_COM6 0x481aa000 /* UART5 */
239#define CONFIG_BAUDRATE 115200
240
241#define CONFIG_CMD_EEPROM
242#define CONFIG_ENV_EEPROM_IS_ON_I2C
243#define CONFIG_SYS_I2C_EEPROM_ADDR 0x50 /* Main EEPROM */
244#define CONFIG_SYS_I2C_EEPROM_ADDR_LEN 2
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200245
246/* PMIC support */
247#define CONFIG_POWER_TPS65910
248
249/* SPL */
250#ifndef CONFIG_NOR_BOOT
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200251/* Bootcount using the RTC block */
252#define CONFIG_BOOTCOUNT_LIMIT
253#define CONFIG_BOOTCOUNT_AM33XX
254
255/* USB gadget RNDIS */
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200256
257/* General network SPL, both CPSW and USB gadget RNDIS */
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200258#define CONFIG_SPL_NET_VCI_STRING "AM335x U-Boot SPL"*/
259
Tom Rini28eec372016-11-07 21:34:54 -0500260#define CONFIG_SPL_LDSCRIPT "arch/arm/mach-omap2/am33xx/u-boot-spl.lds"
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200261
262#ifdef CONFIG_NAND
263#define CONFIG_NAND_OMAP_GPMC
Yegor Yefremov51c4ccb2015-07-06 17:28:36 +0200264#define CONFIG_NAND_OMAP_GPMC_PREFETCH
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200265#define CONFIG_NAND_OMAP_ELM
266#define CONFIG_SYS_NAND_5_ADDR_CYCLE
267#define CONFIG_SYS_NAND_PAGE_COUNT (CONFIG_SYS_NAND_BLOCK_SIZE / \
268 CONFIG_SYS_NAND_PAGE_SIZE)
269#define CONFIG_SYS_NAND_PAGE_SIZE 2048
270#define CONFIG_SYS_NAND_OOBSIZE 64
271#define CONFIG_SYS_NAND_BLOCK_SIZE (128*1024)
272#define CONFIG_SYS_NAND_BAD_BLOCK_POS NAND_LARGE_BADBLOCK_POS
273#define CONFIG_SYS_NAND_ECCPOS { 2, 3, 4, 5, 6, 7, 8, 9, \
274 10, 11, 12, 13, 14, 15, 16, 17, \
275 18, 19, 20, 21, 22, 23, 24, 25, \
276 26, 27, 28, 29, 30, 31, 32, 33, \
277 34, 35, 36, 37, 38, 39, 40, 41, \
278 42, 43, 44, 45, 46, 47, 48, 49, \
279 50, 51, 52, 53, 54, 55, 56, 57, }
280
281#define CONFIG_SYS_NAND_ECCSIZE 512
282#define CONFIG_SYS_NAND_ECCBYTES 14
283#define CONFIG_SYS_NAND_ONFI_DETECTION
284#define CONFIG_NAND_OMAP_ECCSCHEME OMAP_ECC_BCH8_CODE_HW
285#define CONFIG_SYS_NAND_U_BOOT_START CONFIG_SYS_TEXT_BASE
286#endif
287#endif
288
289/*
290 * USB configuration. We enable MUSB support, both for host and for
291 * gadget. We set USB0 as peripheral and USB1 as host, based on the
292 * board schematic and physical port wired to each. Then for host we
293 * add mass storage support and for gadget we add both RNDIS ethernet
294 * and DFU.
295 */
296#define CONFIG_USB_MUSB_DSPS
297#define CONFIG_ARCH_MISC_INIT
Paul Kocialkowskif34dfcb2015-08-04 17:04:06 +0200298#define CONFIG_USB_MUSB_PIO_ONLY
299#define CONFIG_USB_MUSB_DISABLE_BULK_COMBINE_SPLIT
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200300#define CONFIG_AM335X_USB0
Yegor Yefremovd7bd6cb2015-07-09 13:34:24 +0200301#define CONFIG_AM335X_USB0_MODE MUSB_HOST
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200302#define CONFIG_AM335X_USB1
Yegor Yefremovd7bd6cb2015-07-09 13:34:24 +0200303#define CONFIG_AM335X_USB1_MODE MUSB_OTG
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200304
Paul Kocialkowskif34dfcb2015-08-04 17:04:06 +0200305#ifdef CONFIG_USB_MUSB_GADGET
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200306#define CONFIG_USB_ETHER
307#define CONFIG_USB_ETH_RNDIS
308#define CONFIG_USBNET_HOST_ADDR "de:ad:be:af:00:00"
Paul Kocialkowskif34dfcb2015-08-04 17:04:06 +0200309#endif /* CONFIG_USB_MUSB_GADGET */
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200310
311#if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
312/* disable host part of MUSB in SPL */
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200313/* disable EFI partitions and partition UUID support */
314#undef CONFIG_PARTITION_UUIDS
315#undef CONFIG_EFI_PARTITION
316/*
317 * Disable CPSW SPL support so we fit within the 101KiB limit.
318 */
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200319#endif
320
321/* Network. */
322#define CONFIG_PHY_GIGE
323#define CONFIG_PHYLIB
324#define CONFIG_PHY_ADDR 0
325#define CONFIG_PHY_SMSC
326#define CONFIG_MII
Yegor Yefremovfa8b71b2015-05-29 19:27:29 +0200327#define CONFIG_PHY_ATHEROS
328
329/* NAND support */
330#ifdef CONFIG_NAND
331#define CONFIG_CMD_NAND
332#define GPMC_NAND_ECC_LP_x8_LAYOUT 1
333#if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
334#define MTDIDS_DEFAULT "nand0=omap2-nand.0"
335#define MTDPARTS_DEFAULT "mtdparts=omap2-nand.0:128k(SPL)," \
336 "128k(SPL.backup1)," \
337 "128k(SPL.backup2)," \
338 "128k(SPL.backup3)," \
339 "1920k(u-boot)," \
340 "-(UBI)"
341#define CONFIG_ENV_IS_NOWHERE
342#endif
343#endif
344
345#endif /* ! __CONFIG_BALTOS_H */