2 * Copyright (C) 2013 Gateworks Corporation
4 * SPDX-License-Identifier: GPL-2.0+
11 #define CONFIG_SPL_NAND_SUPPORT
12 #define CONFIG_SPL_MMC_SUPPORT
13 #define CONFIG_SPL_FAT_SUPPORT
15 #define CONFIG_SPL_SATA_SUPPORT
17 /* Location in NAND to read U-Boot from */
18 #define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * 1024 * 1024)
20 #include "imx6_spl.h" /* common IMX6 SPL configuration */
21 #include "mx6_common.h"
23 #define CONFIG_DISPLAY_CPUINFO /* display cpu info */
24 #define CONFIG_DISPLAY_BOARDINFO_LATE /* display board info (after reloc) */
26 #define CONFIG_MACH_TYPE 4520 /* Gateworks Ventana Platform */
28 #include <asm/arch/imx-regs.h>
29 #include <asm/imx-common/gpio.h>
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
38 #define CONFIG_SYS_GENERIC_BOARD
40 /* Size of malloc() pool */
41 #define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024)
42 #define CONFIG_SYS_MALLOC_F_LEN (1 << 10)
45 #define CONFIG_BOARD_EARLY_INIT_F
46 #define CONFIG_MISC_INIT_R
49 #define CONFIG_MXC_GPIO
52 #define CONFIG_MXC_UART
53 #define CONFIG_MXC_UART_BASE UART2_BASE
55 #ifdef CONFIG_SPI_FLASH
60 #define CONFIG_MXC_SPI
61 #define CONFIG_SPI_FLASH_MTD
62 #define CONFIG_SPI_FLASH_BAR
63 #define CONFIG_SPI_FLASH_WINBOND
64 #define CONFIG_SF_DEFAULT_BUS 0
65 #define CONFIG_SF_DEFAULT_CS 0
66 /* GPIO 3-19 (21248) */
67 #define CONFIG_SF_DEFAULT_SPEED 30000000
68 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
72 /* Enable NAND support */
73 #define CONFIG_CMD_TIME
74 #define CONFIG_CMD_NAND
75 #define CONFIG_CMD_NAND_TRIMFFS
76 #ifdef CONFIG_CMD_NAND
77 #define CONFIG_NAND_MXS
78 #define CONFIG_SYS_MAX_NAND_DEVICE 1
79 #define CONFIG_SYS_NAND_BASE 0x40000000
80 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
81 #define CONFIG_SYS_NAND_ONFI_DETECTION
83 /* DMA stuff, needed for GPMI/MXS NAND support */
84 #define CONFIG_APBH_DMA
85 #define CONFIG_APBH_DMA_BURST
86 #define CONFIG_APBH_DMA_BURST8
89 #endif /* CONFIG_SPI_FLASH */
91 /* Flattened Image Tree Suport */
93 #define CONFIG_FIT_VERBOSE
96 #define CONFIG_CMD_I2C
97 #define CONFIG_SYS_I2C
98 #define CONFIG_SYS_I2C_MXC
99 #define CONFIG_SYS_I2C_SPEED 100000
100 #define CONFIG_I2C_GSC 0
101 #define CONFIG_I2C_PMIC 1
104 #define CONFIG_FSL_ESDHC
105 #define CONFIG_FSL_USDHC
106 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
107 #define CONFIG_SYS_FSL_USDHC_NUM 1
109 #define CONFIG_CMD_MMC
110 #define CONFIG_GENERIC_MMC
111 #define CONFIG_BOUNCE_BUFFER
113 /* Filesystem support */
114 #define CONFIG_CMD_EXT2
115 #define CONFIG_CMD_FAT
116 #define CONFIG_CMD_UBIFS
117 #define CONFIG_DOS_PARTITION
119 /* Network config - Allow larger/faster download for TFTP/NFS */
120 #define CONFIG_IP_DEFRAG
121 #define CONFIG_TFTP_BLOCKSIZE 4096
122 #define CONFIG_NFS_READ_SIZE 4096
127 #define CONFIG_CMD_SATA
128 #ifdef CONFIG_CMD_SATA
129 #define CONFIG_DWC_AHSATA
130 #define CONFIG_SYS_SATA_MAX_DEVICE 1
131 #define CONFIG_DWC_AHSATA_PORT_ID 0
132 #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
134 #define CONFIG_LIBATA
140 #define CONFIG_CMD_PCI
141 #ifdef CONFIG_CMD_PCI
143 #define CONFIG_PCI_PNP
144 #define CONFIG_PCI_SCAN_SHOW
145 #define CONFIG_PCI_FIXUP_DEV
146 #define CONFIG_PCIE_IMX
153 #define CONFIG_POWER_I2C
154 #define CONFIG_POWER_PFUZE100
155 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
156 #define CONFIG_POWER_LTC3676
157 #define CONFIG_POWER_LTC3676_I2C_ADDR 0x3c
159 /* Various command support */
160 #include <config_cmd_default.h>
161 #undef CONFIG_CMD_IMLS
162 #define CONFIG_CMD_PING
163 #define CONFIG_CMD_DHCP
164 #define CONFIG_CMD_MII
165 #define CONFIG_CMD_NET
166 #define CONFIG_CMD_BMODE /* set eFUSE shadow for a boot dev and reset */
167 #define CONFIG_CMD_HDMIDETECT /* detect HDMI output device */
168 #define CONFIG_CMD_SETEXPR
169 #define CONFIG_CMD_BOOTZ
170 #define CONFIG_CMD_GSC
171 #define CONFIG_CMD_EECONFIG /* Gateworks EEPROM config cmd */
172 #define CONFIG_CMD_UBI
173 #define CONFIG_RBTREE
175 #define CONFIG_CMD_FUSE /* eFUSE read/write support */
176 #ifdef CONFIG_CMD_FUSE
177 #define CONFIG_MXC_OCOTP
181 /* Ethernet support */
182 #define CONFIG_FEC_MXC
184 #define IMX_FEC_BASE ENET_BASE_ADDR
185 #define CONFIG_FEC_XCV_TYPE RGMII
186 #define CONFIG_ETHPRIME "FEC"
187 #define CONFIG_FEC_MXC_PHYADDR 0
188 #define CONFIG_PHYLIB
189 #define CONFIG_ARP_TIMEOUT 200UL
192 #define CONFIG_CMD_USB
193 #define CONFIG_USB_EHCI
194 #define CONFIG_USB_EHCI_MX6
195 #define CONFIG_USB_STORAGE
196 #define CONFIG_USB_HOST_ETHER
197 #define CONFIG_USB_ETHER_ASIX
198 #define CONFIG_USB_ETHER_SMSC95XX
199 #define CONFIG_USB_MAX_CONTROLLER_COUNT 2
200 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
201 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
202 #define CONFIG_MXC_USB_FLAGS 0
203 #define CONFIG_USB_KEYBOARD
204 #define CONFIG_CI_UDC
205 #define CONFIG_USBD_HS
206 #define CONFIG_USB_GADGET_DUALSPEED
207 #define CONFIG_USB_ETHER
208 #define CONFIG_USB_ETH_CDC
209 #define CONFIG_NETCONSOLE
210 #define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
212 /* Framebuffer and LCD */
214 #define CONFIG_VIDEO_IPUV3
215 #define CONFIG_CFB_CONSOLE
216 #define CONFIG_VGA_AS_SINGLE_DEVICE
217 #define CONFIG_SYS_CONSOLE_IS_IN_ENV
218 #define CONFIG_VIDEO_BMP_RLE8
219 #define CONFIG_SPLASH_SCREEN
220 #define CONFIG_BMP_16BPP
221 #define CONFIG_VIDEO_LOGO
222 #define CONFIG_IPUV3_CLK 260000000
223 #define CONFIG_CMD_HDMIDETECT
224 #define CONFIG_CONSOLE_MUX
225 #define CONFIG_IMX_HDMI
226 #define CONFIG_IMX_VIDEO_SKIP
228 /* serial console (ttymxc1,115200) */
229 #define CONFIG_CONS_INDEX 1
230 #define CONFIG_BAUDRATE 115200
232 /* Miscellaneous configurable options */
233 #define CONFIG_SYS_LONGHELP
234 #define CONFIG_SYS_HUSH_PARSER
235 #define CONFIG_SYS_PROMPT "Ventana > "
236 #define CONFIG_SYS_CBSIZE 1024
237 #define CONFIG_AUTO_COMPLETE
238 #define CONFIG_CMDLINE_EDITING
239 #define CONFIG_HWCONFIG
241 /* Print Buffer Size */
242 #define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
243 #define CONFIG_SYS_MAXARGS 16
244 #define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
246 /* Memory configuration */
247 #define CONFIG_SYS_MEMTEST_START 0x10000000
248 #define CONFIG_SYS_MEMTEST_END 0x10010000
249 #define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
250 #define CONFIG_SYS_TEXT_BASE 0x17800000
251 #define CONFIG_SYS_LOAD_ADDR 0x12000000
253 /* Physical Memory Map */
254 #define CONFIG_NR_DRAM_BANKS 1
255 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
256 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
257 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
258 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
260 #define CONFIG_SYS_INIT_SP_OFFSET \
261 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
262 #define CONFIG_SYS_INIT_SP_ADDR \
263 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
265 /* FLASH and environment organization */
266 #define CONFIG_SYS_NO_FLASH /* no NOR flash */
269 * MTD Command for mtdparts
271 #define CONFIG_CMD_MTDPARTS
272 #define CONFIG_MTD_DEVICE
273 #define CONFIG_MTD_PARTITIONS
274 #ifdef CONFIG_SPI_FLASH
275 #define MTDIDS_DEFAULT "nor0=nor"
276 #define MTDPARTS_DEFAULT \
277 "mtdparts=nor:512k(uboot),64k(env),2m(kernel),-(rootfs)"
279 #define MTDIDS_DEFAULT "nand0=nand"
280 #define MTDPARTS_DEFAULT "mtdparts=nand:16m(uboot),1m(env),-(rootfs)"
283 /* Persistent Environment Config */
284 #define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
285 #ifdef CONFIG_SPI_FLASH
286 #define CONFIG_ENV_IS_IN_SPI_FLASH
288 #define CONFIG_ENV_IS_IN_NAND
290 #if defined(CONFIG_ENV_IS_IN_MMC)
291 #define CONFIG_ENV_OFFSET (6 * 64 * 1024)
292 #define CONFIG_ENV_SIZE (8 * 1024)
293 #define CONFIG_SYS_MMC_ENV_DEV 0
294 #elif defined(CONFIG_ENV_IS_IN_NAND)
295 #define CONFIG_ENV_OFFSET (16 << 20)
296 #define CONFIG_ENV_SECT_SIZE (128 << 10)
297 #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
298 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 << 10))
299 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
300 #elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
301 #define CONFIG_ENV_OFFSET (512 * 1024)
302 #define CONFIG_ENV_SECT_SIZE (64 * 1024)
303 #define CONFIG_ENV_SIZE (8 * 1024)
304 #define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
305 #define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
306 #define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
307 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
311 #define CONFIG_BOOTDELAY 3
312 #define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
313 #define CONFIG_IPADDR 192.168.1.1
314 #define CONFIG_SERVERIP 192.168.1.146
315 #define HWCONFIG_DEFAULT \
317 "dio0:mode=gpio;dio1:mode=gpio;dio2:mode=gpio;dio3:mode=gpio\0" \
319 #define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
320 "console=ttymxc1\0" \
321 "bootdevs=usb mmc sata flash\0" \
325 "mtdparts=" MTDPARTS_DEFAULT "\0" \
326 "mtdids=" MTDIDS_DEFAULT "\0" \
328 "fdt_high=0xffffffff\0" \
329 "fdt_addr=0x18000000\0" \
331 "if ${fsload} ${fdt_addr} boot/${fdt_file}; then " \
332 "echo Loaded DTB from boot/${fdt_file}; " \
333 "elif ${fsload} ${fdt_addr} boot/${fdt_file1}; then " \
334 "echo Loaded DTB from boot/${fdt_file1}; " \
335 "elif ${fsload} ${fdt_addr} boot/${fdt_file2}; then " \
336 "echo Loaded DTB from boot/${fdt_file2}; " \
339 "script=boot/6x_bootscript-ventana\0" \
341 "if ${fsload} ${loadaddr} ${script}; then " \
345 "uimage=boot/uImage\0" \
346 "mmc_root=/dev/mmcblk0p1 rootfstype=ext4 rootwait rw\0" \
348 "setenv fsload 'ext2load mmc 0:1'; " \
349 "mmc dev 0 && mmc rescan && " \
351 "if ${fsload} ${loadaddr} ${uimage}; then " \
352 "setenv bootargs console=${console},${baudrate} " \
353 "root=/dev/mmcblk0p1 rootfstype=ext4 " \
354 "rootwait rw ${video} ${extra}; " \
355 "if run loadfdt && fdt addr ${fdt_addr}; then " \
356 "bootm ${loadaddr} - ${fdt_addr}; " \
363 "setenv fsload 'ext2load sata 0:1'; sata init && " \
365 "if ${fsload} ${loadaddr} ${uimage}; then " \
366 "setenv bootargs console=${console},${baudrate} " \
367 "root=/dev/sda1 rootfstype=ext4 " \
368 "rootwait rw ${video} ${extra}; " \
369 "if run loadfdt && fdt addr ${fdt_addr}; then " \
370 "bootm ${loadaddr} - ${fdt_addr}; " \
376 "setenv fsload 'ext2load usb 0:1'; usb start && usb dev 0 && " \
378 "if ${fsload} ${loadaddr} ${uimage}; then " \
379 "setenv bootargs console=${console},${baudrate} " \
380 "root=/dev/sda1 rootfstype=ext4 " \
381 "rootwait rw ${video} ${extra}; " \
382 "if run loadfdt && fdt addr ${fdt_addr}; then " \
383 "bootm ${loadaddr} - ${fdt_addr}; " \
389 #ifdef CONFIG_SPI_FLASH
390 #define CONFIG_EXTRA_ENV_SETTINGS \
391 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
392 "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
393 "image_uboot=ventana/u-boot_spi.imx\0" \
395 "spi_koffset=0x90000\0" \
396 "spi_klen=0x200000\0" \
398 "spi_updateuboot=echo Updating uboot from " \
399 "${serverip}:${image_uboot}...; " \
400 "tftpboot ${loadaddr} ${image_uboot} && " \
401 "sf probe && sf erase 0 80000 && " \
402 "sf write ${loadaddr} 400 ${filesize}\0" \
403 "spi_update=echo Updating OS from ${serverip}:${image_os} " \
404 "to ${spi_koffset} ...; " \
405 "tftp ${loadaddr} ${image_os} && " \
407 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
411 "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
412 "setenv bootargs console=${console},${baudrate} " \
413 "root=/dev/mtdblock3 " \
414 "rootfstype=squashfs,jffs2 " \
415 "${video} ${extra}; " \
419 #define CONFIG_EXTRA_ENV_SETTINGS \
420 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
421 "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
423 "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
424 "tftp ${loadaddr} ${image_rootfs} && " \
425 "nand erase.part rootfs && " \
426 "nand write ${loadaddr} rootfs ${filesize}\0" \
429 "setenv fsload 'ubifsload'; " \
430 "ubi part rootfs && ubifsmount ubi0:rootfs; " \
432 "if ${fsload} ${loadaddr} ${uimage}; then " \
433 "setenv bootargs console=${console},${baudrate} " \
434 "root=ubi0:rootfs ubi.mtd=2 " \
435 "rootfstype=ubifs ${video} ${extra}; " \
436 "if run loadfdt && fdt addr ${fdt_addr}; then " \
438 "bootm ${loadaddr} - ${fdt_addr}; " \
440 "ubifsumount; bootm; " \
445 #define CONFIG_BOOTCOMMAND \
446 "for btype in ${bootdevs}; do " \
447 "echo; echo Attempting ${btype} boot...; " \
448 "if run ${btype}_boot; then; fi; " \
451 /* Device Tree Support */
452 #define CONFIG_OF_BOARD_SETUP
453 #define CONFIG_OF_LIBFDT
454 #define CONFIG_FDT_FIXUP_PARTITIONS
456 #ifndef CONFIG_SYS_DCACHE_OFF
457 #define CONFIG_CMD_CACHE
460 #endif /* __CONFIG_H */