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