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