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