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