blob: fb939132f9ef5d49d94fab7e8db55246bae3d366 [file] [log] [blame]
Tim Harvey552c3582014-03-06 07:46:30 -08001/*
2 * Copyright (C) 2013 Gateworks Corporation
3 *
4 * SPDX-License-Identifier: GPL-2.0+
5 */
6
7#ifndef __CONFIG_H
8#define __CONFIG_H
9
Tim Harveybfa2dae2014-06-02 16:13:27 -070010/* SPL */
11#define CONFIG_SPL_NAND_SUPPORT
12#define CONFIG_SPL_MMC_SUPPORT
13#define CONFIG_SPL_FAT_SUPPORT
14/*
15#define CONFIG_SPL_SATA_SUPPORT
16*/
17/* Location in NAND to read U-Boot from */
18#define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * 1024 * 1024)
19
20#include "imx6_spl.h" /* common IMX6 SPL configuration */
Tim Harvey552c3582014-03-06 07:46:30 -080021#include "mx6_common.h"
22#define CONFIG_MX6
23#define CONFIG_DISPLAY_CPUINFO /* display cpu info */
24#define CONFIG_DISPLAY_BOARDINFO_LATE /* display board info (after reloc) */
25
26#define CONFIG_MACH_TYPE 4520 /* Gateworks Ventana Platform */
27
28#include <asm/arch/imx-regs.h>
29#include <asm/imx-common/gpio.h>
30
31/* ATAGs */
32#define CONFIG_CMDLINE_TAG
33#define CONFIG_SETUP_MEMORY_TAGS
34#define CONFIG_INITRD_TAG
35#define CONFIG_SERIAL_TAG
36#define CONFIG_REVISION_TAG
37
Tim Harveyec4177a2014-04-25 15:17:00 -070038#define CONFIG_SYS_GENERIC_BOARD
39
Tim Harvey552c3582014-03-06 07:46:30 -080040/* Size of malloc() pool */
41#define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024)
42
43/* Init Functions */
44#define CONFIG_BOARD_EARLY_INIT_F
45#define CONFIG_MISC_INIT_R
46
47/* GPIO */
48#define CONFIG_MXC_GPIO
49
50/* Serial */
51#define CONFIG_MXC_UART
52#define CONFIG_MXC_UART_BASE UART2_BASE
53
54#ifdef CONFIG_SPI_FLASH
55
56/* SPI */
57#define CONFIG_CMD_SF
58#ifdef CONFIG_CMD_SF
59 #define CONFIG_MXC_SPI
60 #define CONFIG_SPI_FLASH_MTD
61 #define CONFIG_SPI_FLASH_BAR
62 #define CONFIG_SPI_FLASH_WINBOND
63 #define CONFIG_SF_DEFAULT_BUS 0
64 #define CONFIG_SF_DEFAULT_CS (0|(IMX_GPIO_NR(3, 19)<<8))
65 /* GPIO 3-19 (21248) */
66 #define CONFIG_SF_DEFAULT_SPEED 30000000
67 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
68#endif
69
70#else
71/* Enable NAND support */
72#define CONFIG_CMD_TIME
73#define CONFIG_CMD_NAND
74#define CONFIG_CMD_NAND_TRIMFFS
75#ifdef CONFIG_CMD_NAND
76 #define CONFIG_NAND_MXS
77 #define CONFIG_SYS_MAX_NAND_DEVICE 1
78 #define CONFIG_SYS_NAND_BASE 0x40000000
79 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
80 #define CONFIG_SYS_NAND_ONFI_DETECTION
81
82 /* DMA stuff, needed for GPMI/MXS NAND support */
83 #define CONFIG_APBH_DMA
84 #define CONFIG_APBH_DMA_BURST
85 #define CONFIG_APBH_DMA_BURST8
86#endif
87
88#endif /* CONFIG_SPI_FLASH */
89
90/* Flattened Image Tree Suport */
91#define CONFIG_FIT
92#define CONFIG_FIT_VERBOSE
93
94/* I2C Configs */
95#define CONFIG_CMD_I2C
96#define CONFIG_SYS_I2C
97#define CONFIG_SYS_I2C_MXC
98#define CONFIG_SYS_I2C_SPEED 100000
99
100/* MMC Configs */
101#define CONFIG_FSL_ESDHC
102#define CONFIG_FSL_USDHC
103#define CONFIG_SYS_FSL_ESDHC_ADDR 0
104#define CONFIG_SYS_FSL_USDHC_NUM 1
105#define CONFIG_MMC
106#define CONFIG_CMD_MMC
107#define CONFIG_GENERIC_MMC
108#define CONFIG_BOUNCE_BUFFER
109
110/* Filesystem support */
111#define CONFIG_CMD_EXT2
112#define CONFIG_CMD_FAT
113#define CONFIG_CMD_UBIFS
114#define CONFIG_DOS_PARTITION
115
116/* Network config - Allow larger/faster download for TFTP/NFS */
117#define CONFIG_IP_DEFRAG
118#define CONFIG_TFTP_BLOCKSIZE 4096
119#define CONFIG_NFS_READ_SIZE 4096
120
121/*
122 * SATA Configs
123 */
124#define CONFIG_CMD_SATA
125#ifdef CONFIG_CMD_SATA
126 #define CONFIG_DWC_AHSATA
127 #define CONFIG_SYS_SATA_MAX_DEVICE 1
128 #define CONFIG_DWC_AHSATA_PORT_ID 0
129 #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
130 #define CONFIG_LBA48
131 #define CONFIG_LIBATA
132#endif
133
134/*
135 * PCI express
136 */
137#define CONFIG_CMD_PCI
138#ifdef CONFIG_CMD_PCI
139#define CONFIG_PCI
140#define CONFIG_PCI_PNP
141#define CONFIG_PCI_SCAN_SHOW
142#define CONFIG_PCIE_IMX
143#endif
144
145/*
146 * PMIC
147 */
148#define CONFIG_POWER
149#define CONFIG_POWER_I2C
150#define CONFIG_POWER_PFUZE100
151#define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
Tim Harvey0dff16f2014-05-05 08:22:25 -0700152#define CONFIG_POWER_LTC3676
153#define CONFIG_POWER_LTC3676_I2C_ADDR 0x3c
Tim Harvey552c3582014-03-06 07:46:30 -0800154
155/* Various command support */
156#include <config_cmd_default.h>
157#undef CONFIG_CMD_IMLS
158#define CONFIG_CMD_PING
159#define CONFIG_CMD_DHCP
160#define CONFIG_CMD_MII
161#define CONFIG_CMD_NET
162#define CONFIG_CMD_BMODE /* set eFUSE shadow for a boot dev and reset */
163#define CONFIG_CMD_HDMIDETECT /* detect HDMI output device */
164#define CONFIG_CMD_SETEXPR
165#define CONFIG_CMD_BOOTZ
166#define CONFIG_CMD_GSC
167#define CONFIG_CMD_UBI
168#define CONFIG_RBTREE
169#define CONFIG_LZO
170#define CONFIG_CMD_FUSE /* eFUSE read/write support */
171#ifdef CONFIG_CMD_FUSE
172#define CONFIG_MXC_OCOTP
173#endif
174
175
176/* Ethernet support */
177#define CONFIG_FEC_MXC
178#define CONFIG_MII
179#define IMX_FEC_BASE ENET_BASE_ADDR
180#define CONFIG_FEC_XCV_TYPE RGMII
181#define CONFIG_ETHPRIME "FEC"
182#define CONFIG_FEC_MXC_PHYADDR 0
183#define CONFIG_PHYLIB
184#define CONFIG_ARP_TIMEOUT 200UL
185
186/* USB Configs */
187#define CONFIG_CMD_USB
188#define CONFIG_USB_EHCI
189#define CONFIG_USB_EHCI_MX6
190#define CONFIG_USB_STORAGE
191#define CONFIG_USB_HOST_ETHER
192#define CONFIG_USB_ETHER_ASIX
193#define CONFIG_USB_ETHER_SMSC95XX
194#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
195#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
196#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
197#define CONFIG_MXC_USB_FLAGS 0
198#define CONFIG_USB_KEYBOARD
199#define CONFIG_CI_UDC
200#define CONFIG_USBD_HS
201#define CONFIG_USB_GADGET_DUALSPEED
202#define CONFIG_USB_ETHER
203#define CONFIG_USB_ETH_CDC
204#define CONFIG_NETCONSOLE
205#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
206#define CONFIG_USB_HUB_MIN_POWER_ON_DELAY 1200
207
Tim Harveyfb64cc72014-04-25 15:39:07 -0700208/* Framebuffer and LCD */
209#define CONFIG_VIDEO
210#define CONFIG_VIDEO_IPUV3
211#define CONFIG_CFB_CONSOLE
212#define CONFIG_VGA_AS_SINGLE_DEVICE
213#define CONFIG_SYS_CONSOLE_IS_IN_ENV
214#define CONFIG_VIDEO_BMP_RLE8
215#define CONFIG_SPLASH_SCREEN
216#define CONFIG_BMP_16BPP
217#define CONFIG_VIDEO_LOGO
218#define CONFIG_IPUV3_CLK 260000000
219#define CONFIG_CMD_HDMIDETECT
220#define CONFIG_CONSOLE_MUX
221#define CONFIG_IMX_HDMI
222#define CONFIG_IMX_VIDEO_SKIP
223
Tim Harvey552c3582014-03-06 07:46:30 -0800224/* serial console (ttymxc1,115200) */
225#define CONFIG_CONS_INDEX 1
226#define CONFIG_BAUDRATE 115200
227
228/* Miscellaneous configurable options */
229#define CONFIG_SYS_LONGHELP
230#define CONFIG_SYS_HUSH_PARSER
231#define CONFIG_SYS_PROMPT "Ventana > "
232#define CONFIG_SYS_CBSIZE 1024
233#define CONFIG_AUTO_COMPLETE
234#define CONFIG_CMDLINE_EDITING
235#define CONFIG_HWCONFIG
236
237/* Print Buffer Size */
238#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
239#define CONFIG_SYS_MAXARGS 16
240#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
241
242/* Memory configuration */
243#define CONFIG_SYS_MEMTEST_START 0x10000000
244#define CONFIG_SYS_MEMTEST_END 0x10010000
245#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
246#define CONFIG_SYS_TEXT_BASE 0x17800000
247#define CONFIG_SYS_LOAD_ADDR 0x12000000
248
249/* Physical Memory Map */
250#define CONFIG_NR_DRAM_BANKS 1
251#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
252#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
253#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
254#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
255
256#define CONFIG_SYS_INIT_SP_OFFSET \
257 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
258#define CONFIG_SYS_INIT_SP_ADDR \
259 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
260
261/* FLASH and environment organization */
262#define CONFIG_SYS_NO_FLASH /* no NOR flash */
263
264/*
265 * MTD Command for mtdparts
266 */
267#define CONFIG_CMD_MTDPARTS
268#define CONFIG_MTD_DEVICE
269#define CONFIG_MTD_PARTITIONS
270#ifdef CONFIG_SPI_FLASH
271#define MTDIDS_DEFAULT "nor0=nor"
272#define MTDPARTS_DEFAULT \
273 "mtdparts=nor:512k(uboot),64k(env),2m(kernel),-(rootfs)"
274#else
275#define MTDIDS_DEFAULT "nand0=nand"
276#define MTDPARTS_DEFAULT "mtdparts=nand:16m(uboot),1m(env),-(rootfs)"
277#endif
278
279/* Persistent Environment Config */
280#define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
281#ifdef CONFIG_SPI_FLASH
282#define CONFIG_ENV_IS_IN_SPI_FLASH
283#else
284#define CONFIG_ENV_IS_IN_NAND
285#endif
286#if defined(CONFIG_ENV_IS_IN_MMC)
287 #define CONFIG_ENV_OFFSET (6 * 64 * 1024)
288 #define CONFIG_ENV_SIZE (8 * 1024)
289 #define CONFIG_SYS_MMC_ENV_DEV 0
290#elif defined(CONFIG_ENV_IS_IN_NAND)
291 #define CONFIG_ENV_OFFSET (16 << 20)
292 #define CONFIG_ENV_SECT_SIZE (128 << 10)
293 #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
294 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 << 10))
295 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
296#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
297 #define CONFIG_ENV_OFFSET (512 * 1024)
298 #define CONFIG_ENV_SECT_SIZE (64 * 1024)
299 #define CONFIG_ENV_SIZE (8 * 1024)
300 #define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
301 #define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
302 #define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
303 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
304#endif
305
306/* Environment */
307#define CONFIG_BOOTDELAY 3
308#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
309#define CONFIG_IPADDR 192.168.1.1
310#define CONFIG_SERVERIP 192.168.1.146
311#define HWCONFIG_DEFAULT \
312 "hwconfig=rs232;" \
313 "dio0:mode=gpio;dio1:mode=gpio;dio2:mode=gpio;dio3:mode=gpio\0" \
314
315#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
316 "console=ttymxc1\0" \
317 "bootdevs=usb mmc sata flash\0" \
318 HWCONFIG_DEFAULT \
319 "video=\0" \
320 \
321 "mtdparts=" MTDPARTS_DEFAULT "\0" \
322 "mtdids=" MTDIDS_DEFAULT "\0" \
323 \
324 "fdt_high=0xffffffff\0" \
325 "fdt_addr=0x18000000\0" \
326 "loadfdt=" \
327 "if ${fsload} ${fdt_addr} boot/${fdt_file}; then " \
328 "echo Loaded DTB from boot/${fdt_file}; " \
329 "elif ${fsload} ${fdt_addr} boot/${fdt_file1}; then " \
330 "echo Loaded DTB from boot/${fdt_file1}; " \
331 "elif ${fsload} ${fdt_addr} boot/${fdt_file2}; then " \
332 "echo Loaded DTB from boot/${fdt_file2}; " \
333 "fi\0" \
334 \
335 "script=boot/6x_bootscript-ventana\0" \
336 "loadscript=" \
337 "if ${fsload} ${loadaddr} ${script}; then " \
338 "source; " \
339 "fi\0" \
340 \
341 "uimage=boot/uImage\0" \
342 "mmc_root=/dev/mmcblk0p1 rootfstype=ext4 rootwait rw\0" \
343 "mmc_boot=" \
344 "setenv fsload 'ext2load mmc 0:1'; " \
345 "mmc dev 0 && mmc rescan && " \
346 "run loadscript; " \
347 "if ${fsload} ${loadaddr} ${uimage}; then " \
348 "setenv bootargs console=${console},${baudrate} " \
349 "root=/dev/mmcblk0p1 rootfstype=ext4 " \
350 "rootwait rw ${video} ${extra}; " \
351 "if run loadfdt && fdt addr ${fdt_addr}; then " \
352 "bootm ${loadaddr} - ${fdt_addr}; " \
353 "else " \
354 "bootm; " \
355 "fi; " \
356 "fi\0" \
357 \
358 "sata_boot=" \
359 "setenv fsload 'ext2load sata 0:1'; sata init && " \
360 "run loadscript; " \
361 "if ${fsload} ${loadaddr} ${uimage}; then " \
362 "setenv bootargs console=${console},${baudrate} " \
363 "root=/dev/sda1 rootfstype=ext4 " \
364 "rootwait rw ${video} ${extra}; " \
365 "if run loadfdt && fdt addr ${fdt_addr}; then " \
366 "bootm ${loadaddr} - ${fdt_addr}; " \
367 "else " \
368 "bootm; " \
369 "fi; " \
370 "fi\0" \
371 "usb_boot=" \
372 "setenv fsload 'ext2load usb 0:1'; usb start && usb dev 0 && " \
373 "run loadscript; " \
374 "if ${fsload} ${loadaddr} ${uimage}; then " \
375 "setenv bootargs console=${console},${baudrate} " \
376 "root=/dev/sda1 rootfstype=ext4 " \
377 "rootwait rw ${video} ${extra}; " \
378 "if run loadfdt && fdt addr ${fdt_addr}; then " \
379 "bootm ${loadaddr} - ${fdt_addr}; " \
380 "else " \
381 "bootm; " \
382 "fi; " \
383 "fi\0"
384
385#ifdef CONFIG_SPI_FLASH
386 #define CONFIG_EXTRA_ENV_SETTINGS \
387 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
388 "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
389 "image_uboot=ventana/u-boot_spi.imx\0" \
390 \
391 "spi_koffset=0x90000\0" \
392 "spi_klen=0x200000\0" \
393 \
394 "spi_updateuboot=echo Updating uboot from " \
395 "${serverip}:${image_uboot}...; " \
396 "tftpboot ${loadaddr} ${image_uboot} && " \
397 "sf probe && sf erase 0 80000 && " \
398 "sf write ${loadaddr} 400 ${filesize}\0" \
399 "spi_update=echo Updating OS from ${serverip}:${image_os} " \
400 "to ${spi_koffset} ...; " \
401 "tftp ${loadaddr} ${image_os} && " \
402 "sf probe && " \
403 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
404 \
405 "flash_boot=" \
406 "if sf probe && " \
407 "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
408 "setenv bootargs console=${console},${baudrate} " \
409 "root=/dev/mtdblock3 " \
410 "rootfstype=squashfs,jffs2 " \
411 "${video} ${extra}; " \
412 "bootm; " \
413 "fi\0"
414#else
415 #define CONFIG_EXTRA_ENV_SETTINGS \
416 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
417 "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
418 \
419 "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
420 "tftp ${loadaddr} ${image_rootfs} && " \
421 "nand erase.part rootfs && " \
422 "nand write ${loadaddr} rootfs ${filesize}\0" \
423 \
424 "flash_boot=" \
425 "setenv fsload 'ubifsload'; " \
426 "ubi part rootfs && ubifsmount ubi0:rootfs; " \
427 "run loadscript; " \
428 "if ${fsload} ${loadaddr} ${uimage}; then " \
429 "setenv bootargs console=${console},${baudrate} " \
430 "root=ubi0:rootfs ubi.mtd=2 " \
431 "rootfstype=ubifs ${video} ${extra}; " \
432 "if run loadfdt && fdt addr ${fdt_addr}; then " \
433 "ubifsumount; " \
434 "bootm ${loadaddr} - ${fdt_addr}; " \
435 "else " \
436 "ubifsumount; bootm; " \
437 "fi; " \
438 "fi\0"
439#endif
440
441#define CONFIG_BOOTCOMMAND \
442 "for btype in ${bootdevs}; do " \
443 "echo; echo Attempting ${btype} boot...; " \
444 "if run ${btype}_boot; then; fi; " \
445 "done"
446
447/* Device Tree Support */
448#define CONFIG_OF_BOARD_SETUP
449#define CONFIG_OF_LIBFDT
450#define CONFIG_FDT_FIXUP_PARTITIONS
451
452#ifndef CONFIG_SYS_DCACHE_OFF
453 #define CONFIG_CMD_CACHE
454#endif
455
456#endif /* __CONFIG_H */