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