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