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