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