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