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