xref: /openbmc/u-boot/include/configs/platinum.h (revision 83bf0057)
1 /*
2  * Copyright (C) 2014, Barco (www.barco.com)
3  *
4  * SPDX-License-Identifier:	GPL-2.0+
5  */
6 
7 #ifndef __PLATINUM_CONFIG_H__
8 #define __PLATINUM_CONFIG_H__
9 
10 /* SPL */
11 #define CONFIG_SPL_NAND_SUPPORT
12 #define CONFIG_SPL_MMC_SUPPORT
13 
14 /* Location in NAND to read U-Boot from */
15 #define CONFIG_SYS_NAND_U_BOOT_OFFS     (14 * 1024 * 1024)
16 
17 #include "imx6_spl.h"                  /* common IMX6 SPL configuration */
18 #include "mx6_common.h"
19 
20 /*
21  * Console configuration
22  */
23 
24 #define CONFIG_CMD_BMODE
25 #define CONFIG_CMD_DHCP
26 #define CONFIG_CMD_I2C
27 #define CONFIG_CMD_MII
28 #define CONFIG_CMD_MTDPARTS
29 #define CONFIG_CMD_NAND
30 #define CONFIG_CMD_NAND_TRIMFFS
31 #define CONFIG_CMD_PING
32 #define CONFIG_CMD_TIME
33 #define CONFIG_CMD_UBI
34 #define CONFIG_CMD_UBIFS
35 #define CONFIG_CMD_USB
36 
37 /*
38  * Hardware configuration
39  */
40 
41 /* UART config */
42 #define CONFIG_MXC_UART
43 #define CONFIG_MXC_UART_BASE			UART1_BASE
44 
45 /* I2C config */
46 #define CONFIG_SYS_I2C
47 #define CONFIG_SYS_I2C_MXC
48 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
49 #define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
50 #define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
51 #define CONFIG_SYS_I2C_SPEED			100000
52 
53 /* MMC config */
54 #define CONFIG_SYS_FSL_ESDHC_ADDR		0
55 #define CONFIG_SYS_FSL_USDHC_NUM		1
56 
57 /* Ethernet config */
58 #define CONFIG_FEC_MXC
59 #define CONFIG_MII
60 #define IMX_FEC_BASE				ENET_BASE_ADDR
61 
62 #define CONFIG_PHYLIB
63 
64 /* USB config */
65 #define CONFIG_USB_EHCI
66 #define CONFIG_USB_EHCI_MX6
67 #define CONFIG_USB_STORAGE
68 #define CONFIG_MXC_USB_PORT			1
69 #define CONFIG_MXC_USB_PORTSC			(PORT_PTS_UTMI | PORT_PTS_PTW)
70 #define CONFIG_MXC_USB_FLAGS			0
71 
72 /* Memory config */
73 #define CONFIG_NR_DRAM_BANKS			1
74 #define PHYS_SDRAM				MMDC0_ARB_BASE_ADDR
75 #ifndef PHYS_SDRAM_SIZE
76 #define PHYS_SDRAM_SIZE				(1024 << 20)
77 #endif
78 
79 #define CONFIG_SYS_SDRAM_BASE			PHYS_SDRAM
80 #define CONFIG_SYS_INIT_RAM_ADDR		IRAM_BASE_ADDR
81 #define CONFIG_SYS_INIT_RAM_SIZE		IRAM_SIZE
82 
83 #define CONFIG_SYS_INIT_SP_OFFSET		(CONFIG_SYS_INIT_RAM_SIZE - \
84 						 GENERATED_GBL_DATA_SIZE)
85 #define CONFIG_SYS_INIT_SP_ADDR			(CONFIG_SYS_INIT_RAM_ADDR + \
86 						 CONFIG_SYS_INIT_SP_OFFSET)
87 
88 #define CONFIG_SYS_MALLOC_LEN			(16 * 1024 * 1024)
89 
90 #ifdef CONFIG_CMD_NAND
91 
92 /* NAND config */
93 #define CONFIG_NAND_MXS
94 #ifndef CONFIG_SYS_NAND_MAX_CHIPS
95 #define CONFIG_SYS_NAND_MAX_CHIPS		2
96 #endif
97 #define CONFIG_SYS_MAX_NAND_DEVICE		1
98 #define CONFIG_SYS_NAND_BASE			0x40000000
99 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
100 #define CONFIG_SYS_NAND_ONFI_DETECTION
101 
102 /* DMA config, needed for GPMI/MXS NAND support */
103 #define CONFIG_APBH_DMA
104 #define CONFIG_APBH_DMA_BURST
105 #define CONFIG_APBH_DMA_BURST8
106 
107 /* Environment in NAND */
108 #define CONFIG_ENV_IS_IN_NAND
109 #define CONFIG_ENV_OFFSET		(16 << 20)
110 #define CONFIG_ENV_SECT_SIZE		(128 << 10)
111 #define CONFIG_ENV_SIZE			CONFIG_ENV_SECT_SIZE
112 #define CONFIG_ENV_OFFSET_REDUND	(CONFIG_ENV_OFFSET + (512 << 10))
113 #define CONFIG_ENV_SIZE_REDUND		CONFIG_ENV_SIZE
114 
115 #else /* CONFIG_CMD_NAND */
116 
117 /* Environment in MMC */
118 #define CONFIG_ENV_SIZE			(8 << 10)
119 #define CONFIG_ENV_IS_IN_MMC
120 #define CONFIG_ENV_OFFSET		(6 * 64 * 1024)
121 #define CONFIG_SYS_MMC_ENV_DEV		0
122 
123 #endif /* CONFIG_CMD_NAND */
124 
125 /*
126  * U-Boot configuration
127  */
128 
129 /* Board startup config */
130 #define CONFIG_BOARD_EARLY_INIT_F
131 #define CONFIG_MISC_INIT_R
132 
133 #define CONFIG_SYS_MEMTEST_START		PHYS_SDRAM
134 #define CONFIG_SYS_MEMTEST_END			(CONFIG_SYS_MEMTEST_START + \
135 						 PHYS_SDRAM_SIZE - (12 << 20))
136 
137 #define CONFIG_BOOTCOMMAND			"run bootubi_scr"
138 
139 /* Miscellaneous configurable options */
140 #define CONFIG_PREBOOT
141 
142 /* Print Buffer Size */
143 #define CONFIG_SYS_PBSIZE			(CONFIG_SYS_CBSIZE + \
144 						 sizeof(CONFIG_SYS_PROMPT) + 16)
145 
146 /* MTD/UBI/UBIFS config */
147 #define CONFIG_LZO
148 #define CONFIG_MTD_DEVICE
149 #define CONFIG_MTD_PARTITIONS
150 #define CONFIG_RBTREE
151 
152 #if (CONFIG_SYS_NAND_MAX_CHIPS == 1)
153 #define MTDIDS_DEFAULT		"nand0=gpmi-nand"
154 #define MTDPARTS_DEFAULT	"mtdparts=gpmi-nand:14M(spl),2M(uboot)," \
155 				"512k(env1),512k(env2),-(ubi)"
156 #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2)
157 #define MTDIDS_DEFAULT		"nand0=gpmi-nand"
158 #define MTDPARTS_DEFAULT	"mtdparts=gpmi-nand:14M(spl),2M(uboot)," \
159 				"512k(env1),512k(env2),495M(ubi0)," \
160 				"14M(res0),2M(res1)," \
161 				"512k(res2),512k(res3),-(ubi1)"
162 #endif
163 
164 /*
165  * Environment configuration
166  */
167 
168 #if (CONFIG_SYS_NAND_MAX_CHIPS == 1)
169 #define CONFIG_COMMON_ENV_UBI						\
170 	"setubipartition=env set ubipartition ubi\0"			\
171 	"setubirfs=env set ubirfs $ubipartition:rootfs$boot_vol\0"
172 #elif (CONFIG_SYS_NAND_MAX_CHIPS == 2)
173 #define CONFIG_COMMON_ENV_UBI						\
174 	"setubipartition=env set ubipartition ubi$boot_vol\0"		\
175 	"setubirfs=env set ubirfs ubi0:rootfs\0"
176 #endif
177 
178 #define CONFIG_COMMON_ENV_MISC						\
179 	"user=user\0"							\
180 	"project="CONFIG_PLATINUM_PROJECT"\0"				\
181 	"uimage=uImage\0"						\
182 	"dtb="CONFIG_PLATINUM_CPU"-platinum-"CONFIG_PLATINUM_PROJECT".dtb\0" \
183 	"serverip=serverip\0"						\
184 	"memaddrlinux=0x10800000\0"					\
185 	"memaddrsrc=0x11000000\0"					\
186 	"memaddrdtb=0x12000000\0"					\
187 	"console=ttymxc0\0"						\
188 	"baudrate=115200\0"						\
189 	"boot_scr=boot.uboot\0"						\
190 	"boot_vol=0\0"							\
191 	"mtdids="MTDIDS_DEFAULT"\0"					\
192 	"mtdparts="MTDPARTS_DEFAULT"\0"					\
193 	"mmcfs=ext2\0"							\
194 	"mmcrootpart=1\0"						\
195 	\
196 	"setnfspath=env set nfspath /home/nfs/$user/$project/root\0"	\
197 	"settftpfilelinux=env set tftpfilelinux $user/$project/$uimage\0" \
198 	"settftpfiledtb=env set tftpfiledtb $user/$project/$dtb\0"	\
199 	"setubifilelinux=env set ubifilelinux boot/$uimage\0"		\
200 	"setubipfiledtb=env set ubifiledtb boot/$dtb\0"			\
201 	"setmmcrootdev=env set mmcrootdev /dev/mmcblk0p$mmcrootpart\0"	\
202 	"setmmcfilelinux=env set mmcfilelinux /boot/$uimage\0"		\
203 	"setmmcfiledtb=env set mmcfiledtb /boot/$dtb\0"			\
204 	\
205 	"loadtftpkernel=dhcp $memaddrlinux $tftpfilelinux\0"		\
206 	"loadtftpdtb=dhcp $memaddrdtb $tftpfiledtb\0"			\
207 	"loadubikernel=ubifsload $memaddrlinux $ubifilelinux\0"		\
208 	"loadubidtb=ubifsload $memaddrdtb $ubifiledtb\0"		\
209 	"loadmmckernel=${mmcfs}load mmc 0:$mmcrootpart $memaddrlinux "	\
210 		"$mmcfilelinux\0"					\
211 	"loadmmcdtb=${mmcfs}load mmc 0:$mmcrootpart $memaddrdtb "	\
212 		"$mmcfiledtb\0"						\
213 	\
214 	"ubipart=ubi part $ubipartition\0"				\
215 	"ubimount=ubifsmount $ubirfs\0"					\
216 	\
217 	"setbootargscommon=env set bootargs $bootargs "			\
218 		"console=$console,$baudrate enable_wait_mode=off\0"	\
219 	"setbootargsmtd=env set bootargs $bootargs $mtdparts\0"		\
220 	"setbootargsdhcp=env set bootargs $bootargs ip=dhcp\0"		\
221 	"setbootargsubirfs=env set bootargs $bootargs "			\
222 		"ubi.mtd=$ubipartition root=$ubirfs rootfstype=ubifs\0" \
223 	"setbootargsnfsrfs=env set bootargs $bootargs root=/dev/nfs "	\
224 		"nfsroot=$serverip:$nfspath,v3,tcp\0"			\
225 	"setbootargsmmcrfs=env set bootargs $bootargs "			\
226 		"root=$mmcrootdev rootwait rw\0"			\
227 	\
228 	"bootnet=run settftpfilelinux settftpfiledtb setnfspath "	\
229 		"setbootargscommon setbootargsmtd setbootargsdhcp "	\
230 			"setbootargsnfsrfs;"				\
231 			"run loadtftpkernel loadtftpdtb;"		\
232 			"bootm $memaddrlinux - $memaddrdtb\0"		\
233 	"bootnet_ubirfs=run settftpfilelinux settftpfiledtb;"		\
234 			"run setubipartition setubirfs;"		\
235 			"run setbootargscommon setbootargsmtd "		\
236 				"setbootargsubirfs;"			\
237 			"run loadtftpkernel loadtftpdtb;"		\
238 			"bootm $memaddrlinux - $memaddrdtb\0"		\
239 	"bootubi=run setubipartition setubirfs setubifilelinux "	\
240 				"setubipfiledtb;"			\
241 			"run setbootargscommon setbootargsmtd "		\
242 				"setbootargsubirfs;"			\
243 			"run ubipart ubimount loadubikernel loadubidtb;" \
244 			"bootm $memaddrlinux - $memaddrdtb\0"		\
245 	"bootubi_scr=run setubipartition setubirfs;"			\
246 			"run ubipart ubimount;"				\
247 			"if ubifsload ${memaddrsrc} boot/${boot_scr}; "	\
248 			"then source ${memaddrsrc}; else run bootubi; fi\0" \
249 	"bootmmc=run setmmcrootdev setmmcfilelinux setmmcfiledtb "	\
250 			"setbootargscommon setbootargsmmcrfs;"		\
251 			"run loadmmckernel loadmmcdtb;"			\
252 			"bootm $memaddrlinux - $memaddrdtb\0"		\
253 	\
254 	"bootcmd="CONFIG_BOOTCOMMAND"\0"
255 
256 #define CONFIG_COMMON_ENV_SETTINGS			CONFIG_COMMON_ENV_MISC \
257 							CONFIG_COMMON_ENV_UBI
258 #endif /* __PLATINUM_CONFIG_H__ */
259