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