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