Merge https://gitlab.denx.de/u-boot/custodians/u-boot-usb
[platform/kernel/u-boot.git] / include / configs / baltos.h
1 /*
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 <linux/sizes.h>
20 #include <configs/ti_am335x_common.h>
21
22 #define CONFIG_MACH_TYPE                MACH_TYPE_AM335XEVM
23
24 /* Clock Defines */
25 #define V_OSCK                          24000000  /* Clock output from T2 */
26 #define V_SCLK                          (V_OSCK)
27
28 /* FIT support */
29 #define CONFIG_SYS_BOOTM_LEN         SZ_64M
30
31 #ifdef CONFIG_MTD_RAW_NAND
32
33 #define NANDARGS \
34         "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
35         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
36         "nandargs=setenv bootargs console=${console} " \
37                 "${optargs} " \
38                 "${mtdparts} " \
39                 "root=${nandroot} " \
40                 "rootfstype=${nandrootfstype}\0" \
41         "nandroot=ubi0:rootfs rw ubi.mtd=5\0" \
42         "nandrootfstype=ubifs rootwait=1\0" \
43         "nandboot=echo Booting from nand ...; " \
44                 "run nandargs; " \
45                 "setenv loadaddr 0x84000000; " \
46                 "ubi part UBI; " \
47                 "ubifsmount ubi0:kernel; " \
48                 "ubifsload $loadaddr kernel-fit.itb;" \
49                 "ubifsumount; " \
50                 "bootm ${loadaddr}#conf${board_name}; " \
51                 "if test $? -ne 0; then echo Using default FIT config; " \
52                 "bootm ${loadaddr}; fi;\0"
53 #else
54 #define NANDARGS ""
55 #endif
56
57 #ifndef CONFIG_SPL_BUILD
58 #define CONFIG_EXTRA_ENV_SETTINGS \
59         DEFAULT_LINUX_BOOT_ENV \
60         "boot_fdt=try\0" \
61         "bootpart=0:2\0" \
62         "bootdir=/boot\0" \
63         "bootfile=zImage\0" \
64         "fdtfile=undefined\0" \
65         "console=ttyO0,115200n8\0" \
66         "partitions=" \
67                 "uuid_disk=${uuid_gpt_disk};" \
68                 "name=rootfs,start=2MiB,size=-,uuid=${uuid_gpt_rootfs}\0" \
69         "optargs=\0" \
70         "mmcdev=0\0" \
71         "mmcroot=/dev/mmcblk0p2 ro\0" \
72         "usbroot=/dev/sda2 ro\0" \
73         "mmcrootfstype=ext4 rootwait\0" \
74         "usbrootfstype=ext4 rootwait\0" \
75         "rootpath=/export/rootfs\0" \
76         "nfsopts=nolock\0" \
77         "static_ip=${ipaddr}:${serverip}:${gatewayip}:${netmask}:${hostname}" \
78                 "::off\0" \
79         "ramroot=/dev/ram0 rw\0" \
80         "ramrootfstype=ext2\0" \
81         "mmcargs=setenv bootargs console=${console} " \
82                 "${optargs} " \
83                 "${mtdparts} " \
84                 "root=${mmcroot} " \
85                 "rootfstype=${mmcrootfstype}\0" \
86         "usbargs=setenv bootargs console=${console} " \
87                 "${optargs} " \
88                 "${mtdparts} " \
89                 "root=${usbroot} " \
90                 "rootfstype=${usbrootfstype}\0" \
91         "spiroot=/dev/mtdblock4 rw\0" \
92         "spirootfstype=jffs2\0" \
93         "spisrcaddr=0xe0000\0" \
94         "spiimgsize=0x362000\0" \
95         "spibusno=0\0" \
96         "spiargs=setenv bootargs console=${console} " \
97                 "${optargs} " \
98                 "root=${spiroot} " \
99                 "rootfstype=${spirootfstype}\0" \
100         "netargs=setenv bootargs console=${console} " \
101                 "${optargs} " \
102                 "root=/dev/nfs " \
103                 "nfsroot=${serverip}:${rootpath},${nfsopts} rw " \
104                 "ip=dhcp\0" \
105         "bootenv=uEnv.txt\0" \
106         "loadbootenv=load mmc ${mmcdev} ${loadaddr} ${bootenv}\0" \
107         "usbloadbootenv=load usb 0:1 ${loadaddr} ${bootenv}\0" \
108         "importbootenv=echo Importing environment from mmc ...; " \
109                 "env import -t $loadaddr $filesize\0" \
110         "usbimportbootenv=echo Importing environment from USB ...; " \
111                 "env import -t $loadaddr $filesize\0" \
112         "ramargs=setenv bootargs console=${console} " \
113                 "${optargs} " \
114                 "root=${ramroot} " \
115                 "rootfstype=${ramrootfstype}\0" \
116         "loadramdisk=load mmc ${mmcdev} ${rdaddr} ramdisk.gz\0" \
117         "loadimage=load mmc ${bootpart} ${loadaddr} ${bootdir}/${bootfile}\0" \
118         "usbloadimage=load usb 0:1 ${loadaddr} kernel-fit.itb\0" \
119         "loadfdt=load mmc ${bootpart} ${fdtaddr} ${bootdir}/${fdtfile}\0" \
120         "usbloados=run usbargs; " \
121                 "bootm ${loadaddr}#conf${board_name}; " \
122                 "if test $? -ne 0; then " \
123                         "echo Using default FIT configuration; " \
124                         "bootm ${loadaddr}; " \
125                 "fi;\0" \
126         "mmcloados=run mmcargs; " \
127                 "if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
128                         "if run loadfdt; then " \
129                                 "bootz ${loadaddr} - ${fdtaddr}; " \
130                         "else " \
131                                 "if test ${boot_fdt} = try; then " \
132                                         "bootz; " \
133                                 "else " \
134                                         "echo WARN: Cannot load the DT; " \
135                                 "fi; " \
136                         "fi; " \
137                 "else " \
138                         "bootz; " \
139                 "fi;\0" \
140         "usbboot=usb reset; " \
141                 "if usb storage; then " \
142                         "echo USB drive found;" \
143                         "if run usbloadbootenv; then " \
144                                 "echo Loaded environment from ${bootenv};" \
145                                 "run usbimportbootenv;" \
146                         "fi;" \
147                         "if test -n $uenvcmd; then " \
148                                 "echo Running uenvcmd ...;" \
149                                 "run uenvcmd;" \
150                         "fi;" \
151                         "if run usbloadimage; then " \
152                                 "run usbloados;" \
153                         "fi;" \
154                 "fi;\0" \
155         "mmcboot=mmc dev ${mmcdev}; " \
156                 "if mmc rescan; then " \
157                         "echo SD/MMC found on device ${mmcdev};" \
158                         "if run loadbootenv; then " \
159                                 "echo Loaded environment from ${bootenv};" \
160                                 "run importbootenv;" \
161                         "fi;" \
162                         "if test -n $uenvcmd; then " \
163                                 "echo Running uenvcmd ...;" \
164                                 "run uenvcmd;" \
165                         "fi;" \
166                         "if run loadimage; then " \
167                                 "run mmcloados;" \
168                         "fi;" \
169                 "fi;\0" \
170         "spiboot=echo Booting from spi ...; " \
171                 "run spiargs; " \
172                 "sf probe ${spibusno}:0; " \
173                 "sf read ${loadaddr} ${spisrcaddr} ${spiimgsize}; " \
174                 "bootz ${loadaddr}\0" \
175         "netboot=echo Booting from network ...; " \
176                 "setenv autoload no; " \
177                 "dhcp; " \
178                 "tftp ${loadaddr} ${bootfile}; " \
179                 "tftp ${fdtaddr} ${fdtfile}; " \
180                 "run netargs; " \
181                 "bootz ${loadaddr} - ${fdtaddr}\0" \
182         "ramboot=echo Booting from ramdisk ...; " \
183                 "run ramargs; " \
184                 "bootz ${loadaddr} ${rdaddr} ${fdtaddr}\0" \
185         "findfdt=setenv fdtfile am335x-baltos.dtb\0" \
186         NANDARGS
187         /*DFUARGS*/
188 #endif
189
190 #define CONFIG_BOOTCOMMAND \
191         "run findfdt; " \
192         "run usbboot;" \
193         "run mmcboot;" \
194         "setenv mmcdev 1; " \
195         "setenv bootpart 1:2; " \
196         "run mmcboot;" \
197         "run nandboot;"
198
199 /* NS16550 Configuration */
200 #define CONFIG_SYS_NS16550_COM1         0x44e09000      /* Base EVM has UART0 */
201 #define CONFIG_SYS_NS16550_COM2         0x48022000      /* UART1 */
202 #define CONFIG_SYS_NS16550_COM3         0x48024000      /* UART2 */
203 #define CONFIG_SYS_NS16550_COM4         0x481a6000      /* UART3 */
204 #define CONFIG_SYS_NS16550_COM5         0x481a8000      /* UART4 */
205 #define CONFIG_SYS_NS16550_COM6         0x481aa000      /* UART5 */
206
207 #define CONFIG_ENV_EEPROM_IS_ON_I2C
208 #define CONFIG_SYS_I2C_EEPROM_ADDR      0x50    /* Main EEPROM */
209 #define CONFIG_SYS_I2C_EEPROM_ADDR_LEN  2
210
211 /* PMIC support */
212 #define CONFIG_POWER_TPS65910
213
214 /* SPL */
215 #ifndef CONFIG_NOR_BOOT
216
217 #ifdef CONFIG_MTD_RAW_NAND
218 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
219 #define CONFIG_SYS_NAND_PAGE_COUNT      (CONFIG_SYS_NAND_BLOCK_SIZE / \
220                                          CONFIG_SYS_NAND_PAGE_SIZE)
221 #define CONFIG_SYS_NAND_PAGE_SIZE       2048
222 #define CONFIG_SYS_NAND_OOBSIZE         64
223 #define CONFIG_SYS_NAND_BLOCK_SIZE      (128*1024)
224 #define CONFIG_SYS_NAND_BAD_BLOCK_POS   NAND_LARGE_BADBLOCK_POS
225 #define CONFIG_SYS_NAND_ECCPOS          { 2, 3, 4, 5, 6, 7, 8, 9, \
226                                          10, 11, 12, 13, 14, 15, 16, 17, \
227                                          18, 19, 20, 21, 22, 23, 24, 25, \
228                                          26, 27, 28, 29, 30, 31, 32, 33, \
229                                          34, 35, 36, 37, 38, 39, 40, 41, \
230                                          42, 43, 44, 45, 46, 47, 48, 49, \
231                                          50, 51, 52, 53, 54, 55, 56, 57, }
232
233 #define CONFIG_SYS_NAND_ECCSIZE         512
234 #define CONFIG_SYS_NAND_ECCBYTES        14
235 #define CONFIG_SYS_NAND_ONFI_DETECTION
236 #define CONFIG_NAND_OMAP_ECCSCHEME      OMAP_ECC_BCH8_CODE_HW
237 #define CONFIG_SYS_NAND_U_BOOT_START    CONFIG_SYS_TEXT_BASE
238 #endif
239 #endif
240
241 /*
242  * USB configuration.  We enable MUSB support, both for host and for
243  * gadget.  We set USB0 as peripheral and USB1 as host, based on the
244  * board schematic and physical port wired to each.  Then for host we
245  * add mass storage support and for gadget we add both RNDIS ethernet
246  * and DFU.
247  */
248 #define CONFIG_AM335X_USB0
249 #define CONFIG_AM335X_USB0_MODE MUSB_HOST
250 #define CONFIG_AM335X_USB1
251 #define CONFIG_AM335X_USB1_MODE MUSB_OTG
252
253 /* NAND support */
254 #ifdef CONFIG_MTD_RAW_NAND
255 #define GPMC_NAND_ECC_LP_x8_LAYOUT      1
256 #endif
257
258 #endif  /* ! __CONFIG_BALTOS_H */