xref: /rk3399_rockchip-uboot/include/configs/nitrogen6x.h (revision 84f2a5d0a6c4d267ce9aeb5eaab3c4d419a605ac)
1 /*
2  * Copyright (C) 2010-2011 Freescale Semiconductor, Inc.
3  *
4  * Configuration settings for the Boundary Devices Nitrogen6X
5  * and Freescale i.MX6Q Sabre Lite boards.
6  *
7  * SPDX-License-Identifier:	GPL-2.0+
8  */
9 
10 #ifndef __CONFIG_H
11 #define __CONFIG_H
12 
13 #include "mx6_common.h"
14 
15 #define CONFIG_MACH_TYPE	3769
16 
17 /* Size of malloc() pool */
18 #define CONFIG_SYS_MALLOC_LEN		(10 * 1024 * 1024)
19 
20 #define CONFIG_BOARD_EARLY_INIT_F
21 #define CONFIG_MISC_INIT_R
22 #define CONFIG_USBD_HS
23 #define CONFIG_USB_ETHER
24 #define CONFIG_USB_ETH_CDC
25 #define CONFIG_NETCONSOLE
26 
27 #define CONFIG_MXC_UART
28 #define CONFIG_MXC_UART_BASE	       UART2_BASE
29 
30 #ifdef CONFIG_CMD_SF
31 #define CONFIG_MXC_SPI
32 #define CONFIG_SF_DEFAULT_BUS  0
33 #define CONFIG_SF_DEFAULT_CS   0
34 #define CONFIG_SF_DEFAULT_SPEED 25000000
35 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
36 #endif
37 
38 /* I2C Configs */
39 #define CONFIG_SYS_I2C
40 #define CONFIG_SYS_I2C_MXC
41 #define CONFIG_SYS_I2C_MXC_I2C1		/* enable I2C bus 1 */
42 #define CONFIG_SYS_I2C_MXC_I2C2		/* enable I2C bus 2 */
43 #define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
44 #define CONFIG_SYS_I2C_SPEED		100000
45 #define CONFIG_I2C_EDID
46 
47 /* MMC Configs */
48 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
49 #define CONFIG_SYS_FSL_USDHC_NUM       2
50 
51 #ifdef CONFIG_MX6Q
52 #define CONFIG_CMD_SATA
53 #endif
54 
55 /*
56  * SATA Configs
57  */
58 #ifdef CONFIG_CMD_SATA
59 #define CONFIG_DWC_AHSATA
60 #define CONFIG_SYS_SATA_MAX_DEVICE	1
61 #define CONFIG_DWC_AHSATA_PORT_ID	0
62 #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
63 #define CONFIG_LBA48
64 #define CONFIG_LIBATA
65 #endif
66 
67 #define CONFIG_FEC_MXC
68 #define CONFIG_MII
69 #define IMX_FEC_BASE			ENET_BASE_ADDR
70 #define CONFIG_FEC_XCV_TYPE		RGMII
71 #define CONFIG_ETHPRIME			"FEC"
72 #define CONFIG_FEC_MXC_PHYADDR		6
73 #define CONFIG_PHYLIB
74 #define CONFIG_PHY_MICREL
75 #define CONFIG_PHY_MICREL_KSZ9021
76 
77 /* USB Configs */
78 #define CONFIG_USB_EHCI
79 #define CONFIG_USB_EHCI_MX6
80 #define CONFIG_USB_HOST_ETHER
81 #define CONFIG_USB_ETHER_ASIX
82 #define CONFIG_USB_ETHER_MCS7830
83 #define CONFIG_USB_ETHER_SMSC95XX
84 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
85 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
86 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
87 #define CONFIG_MXC_USB_FLAGS	0
88 #define CONFIG_USB_KEYBOARD
89 #define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
90 
91 /* Miscellaneous commands */
92 #define CONFIG_CMD_BMODE
93 
94 /* Framebuffer and LCD */
95 #define CONFIG_VIDEO_IPUV3
96 #define CONFIG_VIDEO_BMP_RLE8
97 #define CONFIG_SPLASH_SCREEN
98 #define CONFIG_SPLASH_SCREEN_ALIGN
99 #define CONFIG_VIDEO_BMP_GZIP
100 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (6 * 1024 * 1024)
101 #define CONFIG_BMP_16BPP
102 #define CONFIG_IPUV3_CLK 260000000
103 #define CONFIG_CMD_HDMIDETECT
104 #define CONFIG_IMX_HDMI
105 #define CONFIG_IMX_VIDEO_SKIP
106 
107 #define CONFIG_PREBOOT                 ""
108 
109 #ifdef CONFIG_CMD_SATA
110 #define CONFIG_DRIVE_SATA "sata "
111 #else
112 #define CONFIG_DRIVE_SATA
113 #endif
114 
115 #ifdef CONFIG_CMD_MMC
116 #define CONFIG_DRIVE_MMC "mmc "
117 #else
118 #define CONFIG_DRIVE_MMC
119 #endif
120 
121 #ifdef CONFIG_USB_STORAGE
122 #define CONFIG_DRIVE_USB "usb "
123 #else
124 #define CONFIG_DRIVE_USB
125 #endif
126 
127 #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
128 #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
129 
130 #if defined(CONFIG_SABRELITE)
131 #define CONFIG_EXTRA_ENV_SETTINGS \
132 	"script=boot.scr\0" \
133 	"uimage=uImage\0" \
134 	"console=ttymxc1\0" \
135 	"fdt_high=0xffffffff\0" \
136 	"initrd_high=0xffffffff\0" \
137 	"fdt_file=imx6q-sabrelite.dtb\0" \
138 	"fdt_addr=0x18000000\0" \
139 	"boot_fdt=try\0" \
140 	"ip_dyn=yes\0" \
141 	"mmcdevs=0 1\0" \
142 	"mmcpart=1\0" \
143 	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
144 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
145 		"root=${mmcroot}\0" \
146 	"loadbootscript=" \
147 		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
148 	"bootscript=echo Running bootscript from mmc ...; " \
149 		"source\0" \
150 	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
151 	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
152 	"mmcboot=echo Booting from mmc ...; " \
153 		"run mmcargs; " \
154 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
155 			"if run loadfdt; then " \
156 				"bootm ${loadaddr} - ${fdt_addr}; " \
157 			"else " \
158 				"if test ${boot_fdt} = try; then " \
159 					"bootm; " \
160 				"else " \
161 					"echo WARN: Cannot load the DT; " \
162 				"fi; " \
163 			"fi; " \
164 		"else " \
165 			"bootm; " \
166 		"fi;\0" \
167 	"netargs=setenv bootargs console=${console},${baudrate} " \
168 		"root=/dev/nfs " \
169 	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
170 		"netboot=echo Booting from net ...; " \
171 		"run netargs; " \
172 		"if test ${ip_dyn} = yes; then " \
173 			"setenv get_cmd dhcp; " \
174 		"else " \
175 			"setenv get_cmd tftp; " \
176 		"fi; " \
177 		"${get_cmd} ${uimage}; " \
178 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
179 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
180 				"bootm ${loadaddr} - ${fdt_addr}; " \
181 			"else " \
182 				"if test ${boot_fdt} = try; then " \
183 					"bootm; " \
184 				"else " \
185 					"echo WARN: Cannot load the DT; " \
186 				"fi; " \
187 			"fi; " \
188 		"else " \
189 			"bootm; " \
190 		"fi;\0"
191 
192 #define CONFIG_BOOTCOMMAND \
193 	"for mmcdev in ${mmcdevs}; do " \
194 		"mmc dev ${mmcdev}; " \
195 		"if mmc rescan; then " \
196 			"if run loadbootscript; then " \
197 				"run bootscript; " \
198 			"else " \
199 				"if run loaduimage; then " \
200 					"run mmcboot; " \
201 				"fi; " \
202 			"fi; " \
203 		"fi; " \
204 	"done; " \
205 	"run netboot; "
206 #else
207 #define CONFIG_EXTRA_ENV_SETTINGS \
208 	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
209 	"umsdevs=" CONFIG_UMSDEVS "\0" \
210 	"console=ttymxc1\0" \
211 	"clearenv=if sf probe || sf probe || sf probe 1 ; then " \
212 		"sf erase 0xc0000 0x2000 && " \
213 		"echo restored environment to factory default ; fi\0" \
214 	"bootcmd=for dtype in ${bootdevs}" \
215 		"; do " \
216 			"if itest.s \"xusb\" == \"x${dtype}\" ; then " \
217 				"usb start ;" \
218 			"fi; " \
219 			"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
220 				"load " \
221 					"${dtype} ${disk}:1 " \
222 					"10008000 " \
223 					"/6x_bootscript" \
224 					"&& source 10008000 ; " \
225 			"done ; " \
226 		"done; " \
227 		"setenv stdout serial,vga ; " \
228 		"echo ; echo 6x_bootscript not found ; " \
229 		"echo ; echo serial console at 115200, 8N1 ; echo ; " \
230 		"echo details at http://boundarydevices.com/6q_bootscript ; " \
231 		"setenv stdout serial;" \
232 		"setenv stdin serial,usbkbd;" \
233 		"for dtype in ${umsdevs} ; do " \
234 			"if itest.s sata == ${dtype}; then " \
235 				"initcmd='sata init' ;" \
236 			"else " \
237 				"initcmd='mmc rescan' ;" \
238 			"fi; " \
239 			"for disk in 0 1 ; do " \
240 				"if $initcmd && $dtype dev $disk ; then " \
241 					"setenv stdout serial,vga; " \
242 					"echo expose ${dtype} ${disk} " \
243 						"over USB; " \
244 					"ums 0 $dtype $disk ;" \
245 				"fi; " \
246 		"	done; " \
247 		"done ;" \
248 		"setenv stdout serial,vga; " \
249 		"echo no block devices found;" \
250 		"\0" \
251 	"initrd_high=0xffffffff\0" \
252 	"upgradeu=for dtype in ${bootdevs}" \
253 		"; do " \
254 		"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
255 			"load ${dtype} ${disk}:1 10008000 " \
256 				"/6x_upgrade " \
257 				"&& source 10008000 ; " \
258 		"done ; " \
259 	"done\0" \
260 
261 #endif
262 /* Miscellaneous configurable options */
263 #define CONFIG_SYS_MEMTEST_START       0x10000000
264 #define CONFIG_SYS_MEMTEST_END	       0x10010000
265 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
266 
267 /* Physical Memory Map */
268 #define CONFIG_NR_DRAM_BANKS	       1
269 #define PHYS_SDRAM		       MMDC0_ARB_BASE_ADDR
270 
271 #define CONFIG_SYS_SDRAM_BASE	       PHYS_SDRAM
272 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
273 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
274 
275 #define CONFIG_SYS_INIT_SP_OFFSET \
276 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
277 #define CONFIG_SYS_INIT_SP_ADDR \
278 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
279 
280 /* Environment organization */
281 #define CONFIG_ENV_SIZE			(8 * 1024)
282 
283 #if defined(CONFIG_SABRELITE)
284 #define CONFIG_ENV_IS_IN_MMC
285 #else
286 #define CONFIG_ENV_IS_IN_SPI_FLASH
287 #endif
288 
289 #if defined(CONFIG_ENV_IS_IN_MMC)
290 #define CONFIG_ENV_OFFSET		(6 * 64 * 1024)
291 #define CONFIG_SYS_MMC_ENV_DEV		0
292 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
293 #define CONFIG_ENV_OFFSET		(768 * 1024)
294 #define CONFIG_ENV_SECT_SIZE		(8 * 1024)
295 #define CONFIG_ENV_SPI_BUS		CONFIG_SF_DEFAULT_BUS
296 #define CONFIG_ENV_SPI_CS		CONFIG_SF_DEFAULT_CS
297 #define CONFIG_ENV_SPI_MODE		CONFIG_SF_DEFAULT_MODE
298 #define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
299 #endif
300 
301 #define CONFIG_CMD_BMP
302 
303 #define CONFIG_SYS_ALT_MEMTEST
304 
305 /*
306  * PCI express
307  */
308 #ifdef CONFIG_CMD_PCI
309 #define CONFIG_PCI
310 #define CONFIG_PCI_PNP
311 #define CONFIG_PCI_SCAN_SHOW
312 #define CONFIG_PCIE_IMX
313 #endif
314 
315 #define CONFIG_USB_FUNCTION_MASS_STORAGE
316 
317 #define CONFIG_USB_FUNCTION_FASTBOOT
318 #define CONFIG_CMD_FASTBOOT
319 #define CONFIG_ANDROID_BOOT_IMAGE
320 #define CONFIG_FASTBOOT_BUF_ADDR   CONFIG_SYS_LOAD_ADDR
321 #define CONFIG_FASTBOOT_BUF_SIZE   0x07000000
322 
323 #endif	       /* __CONFIG_H */
324