blob: 7949b125de50213400bab1bd3eae1bf4921fb3f9 [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 Harveya7035632015-05-15 09:17:09 -070010#include <linux/sizes.h>
11
Tim Harveybfa2dae2014-06-02 16:13:27 -070012/* SPL */
Tim Harveyb115f2d2015-05-08 18:28:25 -070013#define CONFIG_SPL_BOARD_INIT
Tim Harveybfa2dae2014-06-02 16:13:27 -070014#define CONFIG_SPL_NAND_SUPPORT
15#define CONFIG_SPL_MMC_SUPPORT
Tim Harvey82e32672015-05-15 09:18:31 -070016#define CONFIG_SPL_POWER_SUPPORT
Tim Harveybfa2dae2014-06-02 16:13:27 -070017/* Location in NAND to read U-Boot from */
Tim Harveya7035632015-05-15 09:17:09 -070018#define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * SZ_1M)
Tim Harveybfa2dae2014-06-02 16:13:27 -070019
Tim Harveyfdb5afa2015-05-08 18:28:42 -070020/* Falcon Mode */
21#define CONFIG_CMD_SPL
22#define CONFIG_SPL_OS_BOOT
23#define CONFIG_SPL_ENV_SUPPORT
24#define CONFIG_SYS_SPL_ARGS_ADDR 0x18000000
25#define CONFIG_CMD_SPL_WRITE_SIZE (128 * SZ_1K)
26
27/* Falcon Mode - NAND support: args@17MB kernel@18MB */
28#define CONFIG_CMD_SPL_NAND_OFS (17 * SZ_1M)
29#define CONFIG_SYS_NAND_SPL_KERNEL_OFFS (18 * SZ_1M)
30
31/* Falcon Mode - MMC support: args@1MB kernel@2MB */
32#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */
33#define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
34#define CONFIG_SYS_MMCSD_RAW_MODE_KERNEL_SECTOR 0x1000 /* 2MB */
35
Tim Harveybfa2dae2014-06-02 16:13:27 -070036#include "imx6_spl.h" /* common IMX6 SPL configuration */
Tim Harvey552c3582014-03-06 07:46:30 -080037#include "mx6_common.h"
38#define CONFIG_MX6
39#define CONFIG_DISPLAY_CPUINFO /* display cpu info */
40#define CONFIG_DISPLAY_BOARDINFO_LATE /* display board info (after reloc) */
41
42#define CONFIG_MACH_TYPE 4520 /* Gateworks Ventana Platform */
43
44#include <asm/arch/imx-regs.h>
45#include <asm/imx-common/gpio.h>
46
47/* ATAGs */
48#define CONFIG_CMDLINE_TAG
49#define CONFIG_SETUP_MEMORY_TAGS
50#define CONFIG_INITRD_TAG
51#define CONFIG_SERIAL_TAG
52#define CONFIG_REVISION_TAG
53
Tim Harveyec4177a2014-04-25 15:17:00 -070054#define CONFIG_SYS_GENERIC_BOARD
55
Tim Harvey552c3582014-03-06 07:46:30 -080056/* Size of malloc() pool */
Tim Harveya7035632015-05-15 09:17:09 -070057#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
Tim Harvey552c3582014-03-06 07:46:30 -080058
59/* Init Functions */
60#define CONFIG_BOARD_EARLY_INIT_F
61#define CONFIG_MISC_INIT_R
62
Tim Harvey109df452015-05-08 18:28:27 -070063/* Driver Model */
64#ifndef CONFIG_SPL_BUILD
65#define CONFIG_DM
66#define CONFIG_DM_GPIO
Tim Harvey67ed7922015-05-08 18:28:29 -070067#define CONFIG_DM_SERIAL
Tim Harvey230c1672015-05-08 18:28:30 -070068#define CONFIG_DM_THERMAL
Tim Harvey109df452015-05-08 18:28:27 -070069#define CONFIG_CMD_DM
70#endif
71
Tim Harvey552c3582014-03-06 07:46:30 -080072/* GPIO */
73#define CONFIG_MXC_GPIO
Tim Harveyb3084f22015-05-08 18:28:26 -070074#define CONFIG_CMD_GPIO
Tim Harvey552c3582014-03-06 07:46:30 -080075
Tim Harvey230c1672015-05-08 18:28:30 -070076/* Thermal */
77#define CONFIG_IMX6_THERMAL
78
Tim Harvey552c3582014-03-06 07:46:30 -080079/* Serial */
80#define CONFIG_MXC_UART
81#define CONFIG_MXC_UART_BASE UART2_BASE
82
83#ifdef CONFIG_SPI_FLASH
84
85/* SPI */
86#define CONFIG_CMD_SF
87#ifdef CONFIG_CMD_SF
88 #define CONFIG_MXC_SPI
89 #define CONFIG_SPI_FLASH_MTD
90 #define CONFIG_SPI_FLASH_BAR
91 #define CONFIG_SPI_FLASH_WINBOND
92 #define CONFIG_SF_DEFAULT_BUS 0
Nikita Kiryanov00cd7382014-08-20 15:08:50 +030093 #define CONFIG_SF_DEFAULT_CS 0
Tim Harvey552c3582014-03-06 07:46:30 -080094 /* GPIO 3-19 (21248) */
95 #define CONFIG_SF_DEFAULT_SPEED 30000000
96 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
97#endif
98
99#else
100/* Enable NAND support */
101#define CONFIG_CMD_TIME
102#define CONFIG_CMD_NAND
103#define CONFIG_CMD_NAND_TRIMFFS
104#ifdef CONFIG_CMD_NAND
105 #define CONFIG_NAND_MXS
106 #define CONFIG_SYS_MAX_NAND_DEVICE 1
107 #define CONFIG_SYS_NAND_BASE 0x40000000
108 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
109 #define CONFIG_SYS_NAND_ONFI_DETECTION
110
111 /* DMA stuff, needed for GPMI/MXS NAND support */
112 #define CONFIG_APBH_DMA
113 #define CONFIG_APBH_DMA_BURST
114 #define CONFIG_APBH_DMA_BURST8
115#endif
116
117#endif /* CONFIG_SPI_FLASH */
118
119/* Flattened Image Tree Suport */
120#define CONFIG_FIT
121#define CONFIG_FIT_VERBOSE
122
123/* I2C Configs */
124#define CONFIG_CMD_I2C
125#define CONFIG_SYS_I2C
126#define CONFIG_SYS_I2C_MXC
York Sunf1a52162015-03-20 10:20:40 -0700127#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
Tim Harvey0da2c522014-08-07 22:35:45 -0700128#define CONFIG_SYS_I2C_SPEED 100000
129#define CONFIG_I2C_GSC 0
130#define CONFIG_I2C_PMIC 1
Tim Harvey4f1a2a12015-04-08 12:54:41 -0700131#define CONFIG_I2C_EDID
Tim Harvey552c3582014-03-06 07:46:30 -0800132
133/* MMC Configs */
134#define CONFIG_FSL_ESDHC
135#define CONFIG_FSL_USDHC
136#define CONFIG_SYS_FSL_ESDHC_ADDR 0
137#define CONFIG_SYS_FSL_USDHC_NUM 1
138#define CONFIG_MMC
139#define CONFIG_CMD_MMC
140#define CONFIG_GENERIC_MMC
141#define CONFIG_BOUNCE_BUFFER
142
143/* Filesystem support */
144#define CONFIG_CMD_EXT2
Tim Harvey0037d642015-04-08 12:54:42 -0700145#define CONFIG_CMD_EXT4
146#define CONFIG_CMD_EXT4_WRITE
Tim Harvey552c3582014-03-06 07:46:30 -0800147#define CONFIG_CMD_FAT
148#define CONFIG_CMD_UBIFS
149#define CONFIG_DOS_PARTITION
150
Tim Harvey552c3582014-03-06 07:46:30 -0800151/*
152 * SATA Configs
153 */
154#define CONFIG_CMD_SATA
155#ifdef CONFIG_CMD_SATA
156 #define CONFIG_DWC_AHSATA
157 #define CONFIG_SYS_SATA_MAX_DEVICE 1
158 #define CONFIG_DWC_AHSATA_PORT_ID 0
159 #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
160 #define CONFIG_LBA48
161 #define CONFIG_LIBATA
162#endif
163
164/*
165 * PCI express
166 */
167#define CONFIG_CMD_PCI
168#ifdef CONFIG_CMD_PCI
169#define CONFIG_PCI
170#define CONFIG_PCI_PNP
171#define CONFIG_PCI_SCAN_SHOW
Tim Harvey33791d52014-08-07 22:49:57 -0700172#define CONFIG_PCI_FIXUP_DEV
Tim Harvey552c3582014-03-06 07:46:30 -0800173#define CONFIG_PCIE_IMX
174#endif
175
176/*
177 * PMIC
178 */
179#define CONFIG_POWER
180#define CONFIG_POWER_I2C
181#define CONFIG_POWER_PFUZE100
182#define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
Tim Harvey0dff16f2014-05-05 08:22:25 -0700183#define CONFIG_POWER_LTC3676
184#define CONFIG_POWER_LTC3676_I2C_ADDR 0x3c
Tim Harvey552c3582014-03-06 07:46:30 -0800185
186/* Various command support */
187#include <config_cmd_default.h>
188#undef CONFIG_CMD_IMLS
189#define CONFIG_CMD_PING
190#define CONFIG_CMD_DHCP
191#define CONFIG_CMD_MII
192#define CONFIG_CMD_NET
193#define CONFIG_CMD_BMODE /* set eFUSE shadow for a boot dev and reset */
194#define CONFIG_CMD_HDMIDETECT /* detect HDMI output device */
195#define CONFIG_CMD_SETEXPR
196#define CONFIG_CMD_BOOTZ
197#define CONFIG_CMD_GSC
Tim Harvey0da2c522014-08-07 22:35:45 -0700198#define CONFIG_CMD_EECONFIG /* Gateworks EEPROM config cmd */
Tim Harvey552c3582014-03-06 07:46:30 -0800199#define CONFIG_CMD_UBI
200#define CONFIG_RBTREE
201#define CONFIG_LZO
202#define CONFIG_CMD_FUSE /* eFUSE read/write support */
203#ifdef CONFIG_CMD_FUSE
204#define CONFIG_MXC_OCOTP
205#endif
206
207
208/* Ethernet support */
209#define CONFIG_FEC_MXC
Tim Harvey472884d2015-04-08 12:54:32 -0700210#define CONFIG_E1000
Tim Harvey552c3582014-03-06 07:46:30 -0800211#define CONFIG_MII
212#define IMX_FEC_BASE ENET_BASE_ADDR
213#define CONFIG_FEC_XCV_TYPE RGMII
Tim Harvey552c3582014-03-06 07:46:30 -0800214#define CONFIG_FEC_MXC_PHYADDR 0
215#define CONFIG_PHYLIB
216#define CONFIG_ARP_TIMEOUT 200UL
217
218/* USB Configs */
219#define CONFIG_CMD_USB
220#define CONFIG_USB_EHCI
221#define CONFIG_USB_EHCI_MX6
222#define CONFIG_USB_STORAGE
223#define CONFIG_USB_HOST_ETHER
224#define CONFIG_USB_ETHER_ASIX
225#define CONFIG_USB_ETHER_SMSC95XX
226#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
227#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
228#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
229#define CONFIG_MXC_USB_FLAGS 0
230#define CONFIG_USB_KEYBOARD
231#define CONFIG_CI_UDC
232#define CONFIG_USBD_HS
233#define CONFIG_USB_GADGET_DUALSPEED
234#define CONFIG_USB_ETHER
235#define CONFIG_USB_ETH_CDC
236#define CONFIG_NETCONSOLE
237#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
Tim Harvey552c3582014-03-06 07:46:30 -0800238
Tim Harvey202d16b2015-04-08 12:54:39 -0700239/* USB Mass Storage Gadget */
240#define CONFIG_USB_GADGET
241#define CONFIG_CMD_USB_MASS_STORAGE
242#define CONFIG_USB_GADGET_MASS_STORAGE
243#define CONFIG_USBDOWNLOAD_GADGET
244#define CONFIG_USB_GADGET_VBUS_DRAW 2
245
246/* Netchip IDs */
247#define CONFIG_G_DNL_VENDOR_NUM 0x0525
248#define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5
249#define CONFIG_G_DNL_MANUFACTURER "Gateworks"
250
Tim Harveyfb64cc72014-04-25 15:39:07 -0700251/* Framebuffer and LCD */
252#define CONFIG_VIDEO
253#define CONFIG_VIDEO_IPUV3
254#define CONFIG_CFB_CONSOLE
255#define CONFIG_VGA_AS_SINGLE_DEVICE
256#define CONFIG_SYS_CONSOLE_IS_IN_ENV
257#define CONFIG_VIDEO_BMP_RLE8
258#define CONFIG_SPLASH_SCREEN
259#define CONFIG_BMP_16BPP
260#define CONFIG_VIDEO_LOGO
261#define CONFIG_IPUV3_CLK 260000000
262#define CONFIG_CMD_HDMIDETECT
263#define CONFIG_CONSOLE_MUX
264#define CONFIG_IMX_HDMI
265#define CONFIG_IMX_VIDEO_SKIP
266
Tim Harvey552c3582014-03-06 07:46:30 -0800267/* serial console (ttymxc1,115200) */
268#define CONFIG_CONS_INDEX 1
269#define CONFIG_BAUDRATE 115200
270
271/* Miscellaneous configurable options */
272#define CONFIG_SYS_LONGHELP
273#define CONFIG_SYS_HUSH_PARSER
274#define CONFIG_SYS_PROMPT "Ventana > "
275#define CONFIG_SYS_CBSIZE 1024
276#define CONFIG_AUTO_COMPLETE
277#define CONFIG_CMDLINE_EDITING
278#define CONFIG_HWCONFIG
279
280/* Print Buffer Size */
281#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
282#define CONFIG_SYS_MAXARGS 16
283#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
284
285/* Memory configuration */
286#define CONFIG_SYS_MEMTEST_START 0x10000000
287#define CONFIG_SYS_MEMTEST_END 0x10010000
288#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
289#define CONFIG_SYS_TEXT_BASE 0x17800000
290#define CONFIG_SYS_LOAD_ADDR 0x12000000
291
292/* Physical Memory Map */
293#define CONFIG_NR_DRAM_BANKS 1
294#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
295#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
296#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
297#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
298
299#define CONFIG_SYS_INIT_SP_OFFSET \
300 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
301#define CONFIG_SYS_INIT_SP_ADDR \
302 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
303
304/* FLASH and environment organization */
305#define CONFIG_SYS_NO_FLASH /* no NOR flash */
306
307/*
308 * MTD Command for mtdparts
309 */
310#define CONFIG_CMD_MTDPARTS
311#define CONFIG_MTD_DEVICE
312#define CONFIG_MTD_PARTITIONS
313#ifdef CONFIG_SPI_FLASH
314#define MTDIDS_DEFAULT "nor0=nor"
315#define MTDPARTS_DEFAULT \
316 "mtdparts=nor:512k(uboot),64k(env),2m(kernel),-(rootfs)"
317#else
318#define MTDIDS_DEFAULT "nand0=nand"
319#define MTDPARTS_DEFAULT "mtdparts=nand:16m(uboot),1m(env),-(rootfs)"
320#endif
321
322/* Persistent Environment Config */
323#define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
324#ifdef CONFIG_SPI_FLASH
325#define CONFIG_ENV_IS_IN_SPI_FLASH
326#else
327#define CONFIG_ENV_IS_IN_NAND
328#endif
329#if defined(CONFIG_ENV_IS_IN_MMC)
Tim Harveya7035632015-05-15 09:17:09 -0700330 #define CONFIG_ENV_OFFSET (384 * SZ_1K)
331 #define CONFIG_ENV_SIZE (8 * SZ_1K)
Tim Harvey552c3582014-03-06 07:46:30 -0800332 #define CONFIG_SYS_MMC_ENV_DEV 0
333#elif defined(CONFIG_ENV_IS_IN_NAND)
Tim Harveya7035632015-05-15 09:17:09 -0700334 #define CONFIG_ENV_OFFSET (16 * SZ_1M)
335 #define CONFIG_ENV_SECT_SIZE (128 * SZ_1K)
Tim Harvey552c3582014-03-06 07:46:30 -0800336 #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
Tim Harveya7035632015-05-15 09:17:09 -0700337 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 * SZ_1K))
Tim Harvey552c3582014-03-06 07:46:30 -0800338 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
339#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
Tim Harveya7035632015-05-15 09:17:09 -0700340 #define CONFIG_ENV_OFFSET (512 * SZ_1K)
341 #define CONFIG_ENV_SECT_SIZE (64 * SZ_1K)
342 #define CONFIG_ENV_SIZE (8 * SZ_1K)
Tim Harvey552c3582014-03-06 07:46:30 -0800343 #define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
344 #define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
345 #define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
346 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
347#endif
348
349/* Environment */
350#define CONFIG_BOOTDELAY 3
351#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
352#define CONFIG_IPADDR 192.168.1.1
353#define CONFIG_SERVERIP 192.168.1.146
354#define HWCONFIG_DEFAULT \
355 "hwconfig=rs232;" \
356 "dio0:mode=gpio;dio1:mode=gpio;dio2:mode=gpio;dio3:mode=gpio\0" \
357
358#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
Tim Harvey68eaffd2015-04-08 12:54:46 -0700359 "usb_pgood_delay=2000\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800360 "console=ttymxc1\0" \
361 "bootdevs=usb mmc sata flash\0" \
362 HWCONFIG_DEFAULT \
363 "video=\0" \
364 \
365 "mtdparts=" MTDPARTS_DEFAULT "\0" \
366 "mtdids=" MTDIDS_DEFAULT "\0" \
367 \
368 "fdt_high=0xffffffff\0" \
369 "fdt_addr=0x18000000\0" \
Tim Harvey8fddf8c2015-04-08 12:54:40 -0700370 "initrd_high=0xffffffff\0" \
Tim Harvey87f46312015-04-08 12:54:49 -0700371 "bootdir=boot\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800372 "loadfdt=" \
Tim Harvey87f46312015-04-08 12:54:49 -0700373 "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
374 "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
375 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
376 "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
377 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
378 "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
Tim Harvey552c3582014-03-06 07:46:30 -0800379 "fi\0" \
380 \
Tim Harvey87f46312015-04-08 12:54:49 -0700381 "script=6x_bootscript-ventana\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800382 "loadscript=" \
Tim Harvey87f46312015-04-08 12:54:49 -0700383 "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800384 "source; " \
385 "fi\0" \
386 \
Tim Harvey87f46312015-04-08 12:54:49 -0700387 "uimage=uImage\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800388 "mmc_root=/dev/mmcblk0p1 rootfstype=ext4 rootwait rw\0" \
389 "mmc_boot=" \
390 "setenv fsload 'ext2load mmc 0:1'; " \
391 "mmc dev 0 && mmc rescan && " \
Tim Harvey27280582015-05-08 18:28:24 -0700392 "setenv dtype mmc; run loadscript; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700393 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800394 "setenv bootargs console=${console},${baudrate} " \
395 "root=/dev/mmcblk0p1 rootfstype=ext4 " \
396 "rootwait rw ${video} ${extra}; " \
397 "if run loadfdt && fdt addr ${fdt_addr}; then " \
398 "bootm ${loadaddr} - ${fdt_addr}; " \
399 "else " \
400 "bootm; " \
401 "fi; " \
402 "fi\0" \
403 \
404 "sata_boot=" \
405 "setenv fsload 'ext2load sata 0:1'; sata init && " \
Tim Harvey27280582015-05-08 18:28:24 -0700406 "setenv dtype sata; run loadscript; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700407 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800408 "setenv bootargs console=${console},${baudrate} " \
409 "root=/dev/sda1 rootfstype=ext4 " \
410 "rootwait rw ${video} ${extra}; " \
411 "if run loadfdt && fdt addr ${fdt_addr}; then " \
412 "bootm ${loadaddr} - ${fdt_addr}; " \
413 "else " \
414 "bootm; " \
415 "fi; " \
416 "fi\0" \
417 "usb_boot=" \
418 "setenv fsload 'ext2load usb 0:1'; usb start && usb dev 0 && " \
Tim Harvey27280582015-05-08 18:28:24 -0700419 "setenv dtype usb; run loadscript; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700420 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800421 "setenv bootargs console=${console},${baudrate} " \
422 "root=/dev/sda1 rootfstype=ext4 " \
423 "rootwait rw ${video} ${extra}; " \
424 "if run loadfdt && fdt addr ${fdt_addr}; then " \
425 "bootm ${loadaddr} - ${fdt_addr}; " \
426 "else " \
427 "bootm; " \
428 "fi; " \
429 "fi\0"
430
431#ifdef CONFIG_SPI_FLASH
432 #define CONFIG_EXTRA_ENV_SETTINGS \
433 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
434 "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
435 "image_uboot=ventana/u-boot_spi.imx\0" \
436 \
437 "spi_koffset=0x90000\0" \
438 "spi_klen=0x200000\0" \
439 \
440 "spi_updateuboot=echo Updating uboot from " \
441 "${serverip}:${image_uboot}...; " \
442 "tftpboot ${loadaddr} ${image_uboot} && " \
443 "sf probe && sf erase 0 80000 && " \
444 "sf write ${loadaddr} 400 ${filesize}\0" \
445 "spi_update=echo Updating OS from ${serverip}:${image_os} " \
446 "to ${spi_koffset} ...; " \
447 "tftp ${loadaddr} ${image_os} && " \
448 "sf probe && " \
449 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
450 \
451 "flash_boot=" \
452 "if sf probe && " \
453 "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
454 "setenv bootargs console=${console},${baudrate} " \
455 "root=/dev/mtdblock3 " \
456 "rootfstype=squashfs,jffs2 " \
457 "${video} ${extra}; " \
458 "bootm; " \
459 "fi\0"
460#else
461 #define CONFIG_EXTRA_ENV_SETTINGS \
462 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
Tim Harvey552c3582014-03-06 07:46:30 -0800463 \
Tim Harvey87f46312015-04-08 12:54:49 -0700464 "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800465 "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
466 "tftp ${loadaddr} ${image_rootfs} && " \
467 "nand erase.part rootfs && " \
468 "nand write ${loadaddr} rootfs ${filesize}\0" \
469 \
470 "flash_boot=" \
471 "setenv fsload 'ubifsload'; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700472 "ubi part rootfs; " \
473 "if ubi check boot; then " \
474 "ubifsmount ubi0:boot; " \
475 "setenv root ubi0:rootfs ubi.mtd=2 " \
476 "rootfstype=squashfs,ubifs; " \
477 "setenv bootdir; " \
478 "elif ubi check rootfs; then " \
479 "ubifsmount ubi0:rootfs; " \
480 "setenv root ubi0:rootfs ubi.mtd=2 " \
481 "rootfstype=ubifs; " \
482 "fi; " \
Tim Harvey27280582015-05-08 18:28:24 -0700483 "setenv dtype nand; run loadscript; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700484 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800485 "setenv bootargs console=${console},${baudrate} " \
Tim Harvey87f46312015-04-08 12:54:49 -0700486 "root=${root} ${video} ${extra}; " \
Tim Harvey552c3582014-03-06 07:46:30 -0800487 "if run loadfdt && fdt addr ${fdt_addr}; then " \
488 "ubifsumount; " \
489 "bootm ${loadaddr} - ${fdt_addr}; " \
490 "else " \
491 "ubifsumount; bootm; " \
492 "fi; " \
493 "fi\0"
494#endif
495
496#define CONFIG_BOOTCOMMAND \
497 "for btype in ${bootdevs}; do " \
498 "echo; echo Attempting ${btype} boot...; " \
499 "if run ${btype}_boot; then; fi; " \
500 "done"
501
502/* Device Tree Support */
503#define CONFIG_OF_BOARD_SETUP
504#define CONFIG_OF_LIBFDT
505#define CONFIG_FDT_FIXUP_PARTITIONS
506
507#ifndef CONFIG_SYS_DCACHE_OFF
508 #define CONFIG_CMD_CACHE
509#endif
510
511#endif /* __CONFIG_H */