xref: /openbmc/u-boot/include/configs/baltos.h (revision 089fddfd)
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 #define CONFIG_SYS_I2C_MULTI_EEPROMS
217 
218 /* PMIC support */
219 #define CONFIG_POWER_TPS65910
220 
221 /* SPL */
222 #ifndef CONFIG_NOR_BOOT
223 #define CONFIG_SPL_POWER_SUPPORT
224 #define CONFIG_SPL_YMODEM_SUPPORT
225 
226 /* Bootcount using the RTC block */
227 #define CONFIG_BOOTCOUNT_LIMIT
228 #define CONFIG_BOOTCOUNT_AM33XX
229 
230 /* USB gadget RNDIS */
231 /*#define CONFIG_SPL_MUSB_NEW_SUPPORT*/
232 
233 /* General network SPL, both CPSW and USB gadget RNDIS */
234 /*#define CONFIG_SPL_NET_SUPPORT
235 #define CONFIG_SPL_ENV_SUPPORT
236 #define CONFIG_SPL_NET_VCI_STRING	"AM335x U-Boot SPL"*/
237 
238 #define CONFIG_SPL_LDSCRIPT		"$(CPUDIR)/am33xx/u-boot-spl.lds"
239 
240 #ifdef CONFIG_NAND
241 #define CONFIG_NAND_OMAP_GPMC
242 #define CONFIG_NAND_OMAP_GPMC_PREFETCH
243 #define CONFIG_NAND_OMAP_ELM
244 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
245 #define CONFIG_SYS_NAND_PAGE_COUNT	(CONFIG_SYS_NAND_BLOCK_SIZE / \
246 					 CONFIG_SYS_NAND_PAGE_SIZE)
247 #define CONFIG_SYS_NAND_PAGE_SIZE	2048
248 #define CONFIG_SYS_NAND_OOBSIZE		64
249 #define CONFIG_SYS_NAND_BLOCK_SIZE	(128*1024)
250 #define CONFIG_SYS_NAND_BAD_BLOCK_POS	NAND_LARGE_BADBLOCK_POS
251 #define CONFIG_SYS_NAND_ECCPOS		{ 2, 3, 4, 5, 6, 7, 8, 9, \
252 					 10, 11, 12, 13, 14, 15, 16, 17, \
253 					 18, 19, 20, 21, 22, 23, 24, 25, \
254 					 26, 27, 28, 29, 30, 31, 32, 33, \
255 					 34, 35, 36, 37, 38, 39, 40, 41, \
256 					 42, 43, 44, 45, 46, 47, 48, 49, \
257 					 50, 51, 52, 53, 54, 55, 56, 57, }
258 
259 #define CONFIG_SYS_NAND_ECCSIZE		512
260 #define CONFIG_SYS_NAND_ECCBYTES	14
261 #define CONFIG_SYS_NAND_ONFI_DETECTION
262 #define CONFIG_NAND_OMAP_ECCSCHEME	OMAP_ECC_BCH8_CODE_HW
263 #define CONFIG_SYS_NAND_U_BOOT_START	CONFIG_SYS_TEXT_BASE
264 #endif
265 #endif
266 
267 /*
268  * USB configuration.  We enable MUSB support, both for host and for
269  * gadget.  We set USB0 as peripheral and USB1 as host, based on the
270  * board schematic and physical port wired to each.  Then for host we
271  * add mass storage support and for gadget we add both RNDIS ethernet
272  * and DFU.
273  */
274 #define CONFIG_USB_MUSB_DSPS
275 #define CONFIG_ARCH_MISC_INIT
276 #define CONFIG_MUSB_GADGET
277 #define CONFIG_MUSB_PIO_ONLY
278 #define CONFIG_MUSB_DISABLE_BULK_COMBINE_SPLIT
279 #define CONFIG_USB_GADGET
280 #define CONFIG_USBDOWNLOAD_GADGET
281 #define CONFIG_USB_GADGET_DUALSPEED
282 #define CONFIG_USB_GADGET_VBUS_DRAW	2
283 #define CONFIG_MUSB_HOST
284 #define CONFIG_AM335X_USB0
285 #define CONFIG_AM335X_USB0_MODE	MUSB_HOST
286 #define CONFIG_AM335X_USB1
287 #define CONFIG_AM335X_USB1_MODE MUSB_OTG
288 
289 #ifdef CONFIG_MUSB_HOST
290 #define CONFIG_CMD_USB
291 #define CONFIG_USB_STORAGE
292 #endif
293 
294 #ifdef CONFIG_MUSB_GADGET
295 #define CONFIG_USB_ETHER
296 #define CONFIG_USB_ETH_RNDIS
297 #define CONFIG_USBNET_HOST_ADDR	"de:ad:be:af:00:00"
298 
299 /* USB TI's IDs */
300 #define CONFIG_G_DNL_VENDOR_NUM 0x0403
301 #define CONFIG_G_DNL_PRODUCT_NUM 0xBD00
302 #define CONFIG_G_DNL_MANUFACTURER "Texas Instruments"
303 #endif /* CONFIG_MUSB_GADGET */
304 
305 #if defined(CONFIG_SPL_BUILD) && defined(CONFIG_SPL_USBETH_SUPPORT)
306 /* disable host part of MUSB in SPL */
307 #undef CONFIG_MUSB_HOST
308 /* disable EFI partitions and partition UUID support */
309 #undef CONFIG_PARTITION_UUIDS
310 #undef CONFIG_EFI_PARTITION
311 /*
312  * Disable CPSW SPL support so we fit within the 101KiB limit.
313  */
314 #undef CONFIG_SPL_ETH_SUPPORT
315 #endif
316 
317 /* Network. */
318 #define CONFIG_PHY_GIGE
319 #define CONFIG_PHYLIB
320 #define CONFIG_PHY_ADDR			0
321 #define CONFIG_PHY_SMSC
322 #define CONFIG_MII
323 #define CONFIG_CMD_MII
324 #define CONFIG_PHY_ATHEROS
325 
326 /* NAND support */
327 #ifdef CONFIG_NAND
328 #define CONFIG_CMD_NAND
329 #define GPMC_NAND_ECC_LP_x8_LAYOUT	1
330 #if !defined(CONFIG_SPI_BOOT) && !defined(CONFIG_NOR_BOOT)
331 #define MTDIDS_DEFAULT			"nand0=omap2-nand.0"
332 #define MTDPARTS_DEFAULT		"mtdparts=omap2-nand.0:128k(SPL)," \
333 					"128k(SPL.backup1)," \
334 					"128k(SPL.backup2)," \
335 					"128k(SPL.backup3)," \
336 					"1920k(u-boot)," \
337 					"-(UBI)"
338 #define CONFIG_ENV_IS_NOWHERE
339 #endif
340 #endif
341 
342 #endif	/* ! __CONFIG_BALTOS_H */
343