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