xref: /openbmc/u-boot/include/configs/nitrogen6x.h (revision 60570df1)
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 #define CONFIG_MX6
15 #define CONFIG_DISPLAY_CPUINFO
16 #define CONFIG_DISPLAY_BOARDINFO
17 
18 #define CONFIG_MACH_TYPE	3769
19 
20 #include <asm/arch/imx-regs.h>
21 #include <asm/imx-common/gpio.h>
22 
23 #define CONFIG_CMDLINE_TAG
24 #define CONFIG_SETUP_MEMORY_TAGS
25 #define CONFIG_INITRD_TAG
26 #define CONFIG_REVISION_TAG
27 #define CONFIG_SYS_GENERIC_BOARD
28 
29 /* Size of malloc() pool */
30 #define CONFIG_SYS_MALLOC_LEN		(10 * 1024 * 1024)
31 
32 #define CONFIG_BOARD_EARLY_INIT_F
33 #define CONFIG_MISC_INIT_R
34 #define CONFIG_MXC_GPIO
35 #define CONFIG_CMD_GPIO
36 #define CONFIG_CI_UDC
37 #define CONFIG_USBD_HS
38 #define CONFIG_USB_GADGET_DUALSPEED
39 #define CONFIG_USB_ETHER
40 #define CONFIG_USB_ETH_CDC
41 #define CONFIG_NETCONSOLE
42 
43 #define CONFIG_CMD_FUSE
44 #ifdef CONFIG_CMD_FUSE
45 #define CONFIG_MXC_OCOTP
46 #endif
47 
48 #define CONFIG_MXC_UART
49 #define CONFIG_MXC_UART_BASE	       UART2_BASE
50 
51 #define CONFIG_CMD_SF
52 #ifdef CONFIG_CMD_SF
53 #define CONFIG_SPI_FLASH
54 #define CONFIG_SPI_FLASH_SST
55 #define CONFIG_MXC_SPI
56 #define CONFIG_SF_DEFAULT_BUS  0
57 #define CONFIG_SF_DEFAULT_CS   0
58 #define CONFIG_SF_DEFAULT_SPEED 25000000
59 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
60 #endif
61 
62 /* I2C Configs */
63 #define CONFIG_CMD_I2C
64 #define CONFIG_SYS_I2C
65 #define CONFIG_SYS_I2C_MXC
66 #define CONFIG_SYS_I2C_MXC_I2C3		/* enable I2C bus 3 */
67 #define CONFIG_SYS_I2C_SPEED		100000
68 #define CONFIG_I2C_EDID
69 
70 /* MMC Configs */
71 #define CONFIG_FSL_ESDHC
72 #define CONFIG_FSL_USDHC
73 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
74 #define CONFIG_SYS_FSL_USDHC_NUM       2
75 
76 #define CONFIG_MMC
77 #define CONFIG_CMD_MMC
78 #define CONFIG_GENERIC_MMC
79 #define CONFIG_BOUNCE_BUFFER
80 #define CONFIG_CMD_EXT2
81 #define CONFIG_CMD_EXT4
82 #define CONFIG_CMD_EXT4_WRITE
83 #define CONFIG_CMD_FAT
84 #define CONFIG_DOS_PARTITION
85 
86 #ifdef CONFIG_MX6Q
87 #define CONFIG_CMD_SATA
88 #endif
89 
90 /*
91  * SATA Configs
92  */
93 #ifdef CONFIG_CMD_SATA
94 #define CONFIG_DWC_AHSATA
95 #define CONFIG_SYS_SATA_MAX_DEVICE	1
96 #define CONFIG_DWC_AHSATA_PORT_ID	0
97 #define CONFIG_DWC_AHSATA_BASE_ADDR	SATA_ARB_BASE_ADDR
98 #define CONFIG_LBA48
99 #define CONFIG_LIBATA
100 #endif
101 
102 #define CONFIG_CMD_PING
103 #define CONFIG_CMD_DHCP
104 #define CONFIG_CMD_MII
105 #define CONFIG_CMD_NET
106 #define CONFIG_FEC_MXC
107 #define CONFIG_MII
108 #define IMX_FEC_BASE			ENET_BASE_ADDR
109 #define CONFIG_FEC_XCV_TYPE		RGMII
110 #define CONFIG_ETHPRIME			"FEC"
111 #define CONFIG_FEC_MXC_PHYADDR		6
112 #define CONFIG_PHYLIB
113 #define CONFIG_PHY_MICREL
114 #define CONFIG_PHY_MICREL_KSZ9021
115 
116 /* USB Configs */
117 #define CONFIG_CMD_USB
118 #define CONFIG_CMD_FAT
119 #define CONFIG_USB_EHCI
120 #define CONFIG_USB_EHCI_MX6
121 #define CONFIG_USB_STORAGE
122 #define CONFIG_USB_HOST_ETHER
123 #define CONFIG_USB_ETHER_ASIX
124 #define CONFIG_USB_ETHER_MCS7830
125 #define CONFIG_USB_ETHER_SMSC95XX
126 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
127 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET	/* For OTG port */
128 #define CONFIG_MXC_USB_PORTSC	(PORT_PTS_UTMI | PORT_PTS_PTW)
129 #define CONFIG_MXC_USB_FLAGS	0
130 #define CONFIG_USB_KEYBOARD
131 #define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
132 
133 /* Miscellaneous commands */
134 #define CONFIG_CMD_BMODE
135 #define CONFIG_CMD_SETEXPR
136 
137 /* Framebuffer and LCD */
138 #define CONFIG_VIDEO
139 #define CONFIG_VIDEO_IPUV3
140 #define CONFIG_CFB_CONSOLE
141 #define CONFIG_VGA_AS_SINGLE_DEVICE
142 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
143 #define CONFIG_SYS_CONSOLE_OVERWRITE_ROUTINE
144 #define CONFIG_VIDEO_BMP_RLE8
145 #define CONFIG_SPLASH_SCREEN
146 #define CONFIG_SPLASH_SCREEN_ALIGN
147 #define CONFIG_VIDEO_BMP_GZIP
148 #define CONFIG_SYS_VIDEO_LOGO_MAX_SIZE (6 * 1024 * 1024)
149 #define CONFIG_BMP_16BPP
150 #define CONFIG_IPUV3_CLK 260000000
151 #define CONFIG_CMD_HDMIDETECT
152 #define CONFIG_CONSOLE_MUX
153 #define CONFIG_IMX_HDMI
154 #define CONFIG_IMX_VIDEO_SKIP
155 
156 /* allow to overwrite serial and ethaddr */
157 #define CONFIG_ENV_OVERWRITE
158 #define CONFIG_CONS_INDEX	       1
159 #define CONFIG_BAUDRATE			       115200
160 
161 /* Command definition */
162 #include <config_cmd_default.h>
163 
164 #undef CONFIG_CMD_IMLS
165 
166 #define CONFIG_BOOTDELAY	       1
167 
168 #define CONFIG_PREBOOT                 ""
169 
170 #define CONFIG_LOADADDR			       0x12000000
171 #define CONFIG_SYS_TEXT_BASE	       0x17800000
172 
173 #ifdef CONFIG_CMD_SATA
174 #define CONFIG_DRIVE_SATA "sata "
175 #else
176 #define CONFIG_DRIVE_SATA
177 #endif
178 
179 #ifdef CONFIG_CMD_MMC
180 #define CONFIG_DRIVE_MMC "mmc "
181 #else
182 #define CONFIG_DRIVE_MMC
183 #endif
184 
185 #ifdef CONFIG_USB_STORAGE
186 #define CONFIG_DRIVE_USB "usb "
187 #else
188 #define CONFIG_DRIVE_USB
189 #endif
190 
191 #define CONFIG_DRIVE_TYPES CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC CONFIG_DRIVE_USB
192 #define CONFIG_UMSDEVS CONFIG_DRIVE_SATA CONFIG_DRIVE_MMC
193 
194 #if defined(CONFIG_SABRELITE)
195 #define CONFIG_EXTRA_ENV_SETTINGS \
196 	"script=boot.scr\0" \
197 	"uimage=uImage\0" \
198 	"console=ttymxc1\0" \
199 	"fdt_high=0xffffffff\0" \
200 	"initrd_high=0xffffffff\0" \
201 	"fdt_file=imx6q-sabrelite.dtb\0" \
202 	"fdt_addr=0x18000000\0" \
203 	"boot_fdt=try\0" \
204 	"ip_dyn=yes\0" \
205 	"mmcdevs=0 1\0" \
206 	"mmcpart=1\0" \
207 	"mmcroot=/dev/mmcblk0p2 rootwait rw\0" \
208 	"mmcargs=setenv bootargs console=${console},${baudrate} " \
209 		"root=${mmcroot}\0" \
210 	"loadbootscript=" \
211 		"load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${script};\0" \
212 	"bootscript=echo Running bootscript from mmc ...; " \
213 		"source\0" \
214 	"loaduimage=load mmc ${mmcdev}:${mmcpart} ${loadaddr} ${uimage}\0" \
215 	"loadfdt=load mmc ${mmcdev}:${mmcpart} ${fdt_addr} ${fdt_file}\0" \
216 	"mmcboot=echo Booting from mmc ...; " \
217 		"run mmcargs; " \
218 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
219 			"if run loadfdt; then " \
220 				"bootm ${loadaddr} - ${fdt_addr}; " \
221 			"else " \
222 				"if test ${boot_fdt} = try; then " \
223 					"bootm; " \
224 				"else " \
225 					"echo WARN: Cannot load the DT; " \
226 				"fi; " \
227 			"fi; " \
228 		"else " \
229 			"bootm; " \
230 		"fi;\0" \
231 	"netargs=setenv bootargs console=${console},${baudrate} " \
232 		"root=/dev/nfs " \
233 	"ip=dhcp nfsroot=${serverip}:${nfsroot},v3,tcp\0" \
234 		"netboot=echo Booting from net ...; " \
235 		"run netargs; " \
236 		"if test ${ip_dyn} = yes; then " \
237 			"setenv get_cmd dhcp; " \
238 		"else " \
239 			"setenv get_cmd tftp; " \
240 		"fi; " \
241 		"${get_cmd} ${uimage}; " \
242 		"if test ${boot_fdt} = yes || test ${boot_fdt} = try; then " \
243 			"if ${get_cmd} ${fdt_addr} ${fdt_file}; then " \
244 				"bootm ${loadaddr} - ${fdt_addr}; " \
245 			"else " \
246 				"if test ${boot_fdt} = try; then " \
247 					"bootm; " \
248 				"else " \
249 					"echo WARN: Cannot load the DT; " \
250 				"fi; " \
251 			"fi; " \
252 		"else " \
253 			"bootm; " \
254 		"fi;\0"
255 
256 #define CONFIG_BOOTCOMMAND \
257 	"for mmcdev in ${mmcdevs}; do " \
258 		"mmc dev ${mmcdev}; " \
259 		"if mmc rescan; then " \
260 			"if run loadbootscript; then " \
261 				"run bootscript; " \
262 			"else " \
263 				"if run loaduimage; then " \
264 					"run mmcboot; " \
265 				"fi; " \
266 			"fi; " \
267 		"fi; " \
268 	"done; " \
269 	"run netboot; "
270 #else
271 #define CONFIG_EXTRA_ENV_SETTINGS \
272 	"bootdevs=" CONFIG_DRIVE_TYPES "\0" \
273 	"umsdevs=" CONFIG_UMSDEVS "\0" \
274 	"console=ttymxc1\0" \
275 	"clearenv=if sf probe || sf probe || sf probe 1 ; then " \
276 		"sf erase 0xc0000 0x2000 && " \
277 		"echo restored environment to factory default ; fi\0" \
278 	"bootcmd=for dtype in ${bootdevs}" \
279 		"; do " \
280 			"if itest.s \"xusb\" == \"x${dtype}\" ; then " \
281 				"usb start ;" \
282 			"fi; " \
283 			"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
284 				"load " \
285 					"${dtype} ${disk}:1 " \
286 					"10008000 " \
287 					"/6x_bootscript" \
288 					"&& source 10008000 ; " \
289 			"done ; " \
290 		"done; " \
291 		"setenv stdout serial,vga ; " \
292 		"echo ; echo 6x_bootscript not found ; " \
293 		"echo ; echo serial console at 115200, 8N1 ; echo ; " \
294 		"echo details at http://boundarydevices.com/6q_bootscript ; " \
295 		"setenv stdout serial;" \
296 		"setenv stdin serial,usbkbd;" \
297 		"for dtype in ${umsdevs} ; do " \
298 			"if itest.s sata == ${dtype}; then " \
299 				"initcmd='sata init' ;" \
300 			"else " \
301 				"initcmd='mmc rescan' ;" \
302 			"fi; " \
303 			"for disk in 0 1 ; do " \
304 				"if $initcmd && $dtype dev $disk ; then " \
305 					"setenv stdout serial,vga; " \
306 					"echo expose ${dtype} ${disk} " \
307 						"over USB; " \
308 					"ums 0 $dtype $disk ;" \
309 				"fi; " \
310 		"	done; " \
311 		"done ;" \
312 		"setenv stdout serial,vga; " \
313 		"echo no block devices found;" \
314 		"\0" \
315 	"initrd_high=0xffffffff\0" \
316 	"upgradeu=for dtype in ${bootdevs}" \
317 		"; do " \
318 		"for disk in 0 1 ; do ${dtype} dev ${disk} ;" \
319 			"load ${dtype} ${disk}:1 10008000 " \
320 				"/6x_upgrade " \
321 				"&& source 10008000 ; " \
322 		"done ; " \
323 	"done\0" \
324 
325 #endif
326 /* Miscellaneous configurable options */
327 #define CONFIG_SYS_LONGHELP
328 #define CONFIG_SYS_HUSH_PARSER
329 #define CONFIG_SYS_PROMPT	       "U-Boot > "
330 #define CONFIG_AUTO_COMPLETE
331 #define CONFIG_SYS_CBSIZE	       1024
332 #define CONFIG_SYS_MAXARGS	       48
333 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
334 
335 #define CONFIG_SYS_MEMTEST_START       0x10000000
336 #define CONFIG_SYS_MEMTEST_END	       0x10010000
337 #define CONFIG_SYS_MEMTEST_SCRATCH     0x10800000
338 
339 #define CONFIG_SYS_LOAD_ADDR	       CONFIG_LOADADDR
340 
341 #define CONFIG_CMDLINE_EDITING
342 
343 /* Physical Memory Map */
344 #define CONFIG_NR_DRAM_BANKS	       1
345 #define PHYS_SDRAM		       MMDC0_ARB_BASE_ADDR
346 
347 #define CONFIG_SYS_SDRAM_BASE	       PHYS_SDRAM
348 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
349 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
350 
351 #define CONFIG_SYS_INIT_SP_OFFSET \
352 	(CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
353 #define CONFIG_SYS_INIT_SP_ADDR \
354 	(CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
355 
356 /* FLASH and environment organization */
357 #define CONFIG_SYS_NO_FLASH
358 
359 #define CONFIG_ENV_SIZE			(8 * 1024)
360 
361 #if defined(CONFIG_SABRELITE)
362 #define CONFIG_ENV_IS_IN_MMC
363 #else
364 #define CONFIG_ENV_IS_IN_SPI_FLASH
365 #endif
366 
367 #if defined(CONFIG_ENV_IS_IN_MMC)
368 #define CONFIG_ENV_OFFSET		(6 * 64 * 1024)
369 #define CONFIG_SYS_MMC_ENV_DEV		0
370 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
371 #define CONFIG_ENV_OFFSET		(768 * 1024)
372 #define CONFIG_ENV_SECT_SIZE		(8 * 1024)
373 #define CONFIG_ENV_SPI_BUS		CONFIG_SF_DEFAULT_BUS
374 #define CONFIG_ENV_SPI_CS		CONFIG_SF_DEFAULT_CS
375 #define CONFIG_ENV_SPI_MODE		CONFIG_SF_DEFAULT_MODE
376 #define CONFIG_ENV_SPI_MAX_HZ		CONFIG_SF_DEFAULT_SPEED
377 #endif
378 
379 #define CONFIG_OF_LIBFDT
380 #define CONFIG_CMD_BOOTZ
381 
382 #ifndef CONFIG_SYS_DCACHE_OFF
383 #define CONFIG_CMD_CACHE
384 #endif
385 
386 #define CONFIG_CMD_BMP
387 
388 #define CONFIG_CMD_TIME
389 #define CONFIG_CMD_MEMTEST
390 #define CONFIG_SYS_ALT_MEMTEST
391 
392 #define CONFIG_CMD_BOOTZ
393 #define CONFIG_SUPPORT_RAW_INITRD
394 #define CONFIG_CMD_FS_GENERIC
395 
396 /*
397  * PCI express
398  */
399 #ifdef CONFIG_CMD_PCI
400 #define CONFIG_PCI
401 #define CONFIG_PCI_PNP
402 #define CONFIG_PCI_SCAN_SHOW
403 #define CONFIG_PCIE_IMX
404 #endif
405 
406 #define CONFIG_CMD_ELF
407 
408 #define CONFIG_USB_GADGET
409 #define CONFIG_CMD_USB_MASS_STORAGE
410 #define CONFIG_USB_GADGET_MASS_STORAGE
411 #define CONFIG_USBDOWNLOAD_GADGET
412 #define CONFIG_USB_GADGET_VBUS_DRAW	2
413 
414 /* Netchip IDs */
415 #define CONFIG_G_DNL_VENDOR_NUM 0x0525
416 #define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5
417 #define CONFIG_G_DNL_MANUFACTURER "Boundary"
418 
419 #define CONFIG_CMD_FASTBOOT
420 #define CONFIG_ANDROID_BOOT_IMAGE
421 #define CONFIG_USB_FASTBOOT_BUF_ADDR   CONFIG_SYS_LOAD_ADDR
422 #define CONFIG_USB_FASTBOOT_BUF_SIZE   0x07000000
423 
424 #endif	       /* __CONFIG_H */
425