blob: b20b3388ef62d1c28eca608810fd606adb456967 [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 */
Tim Harveyb115f2d2015-05-08 18:28:25 -070011#define CONFIG_SPL_BOARD_INIT
Tim Harveybfa2dae2014-06-02 16:13:27 -070012#define CONFIG_SPL_NAND_SUPPORT
13#define CONFIG_SPL_MMC_SUPPORT
14#define CONFIG_SPL_FAT_SUPPORT
15/*
16#define CONFIG_SPL_SATA_SUPPORT
17*/
18/* Location in NAND to read U-Boot from */
19#define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * 1024 * 1024)
20
21#include "imx6_spl.h" /* common IMX6 SPL configuration */
Tim Harvey552c3582014-03-06 07:46:30 -080022#include "mx6_common.h"
23#define CONFIG_MX6
24#define CONFIG_DISPLAY_CPUINFO /* display cpu info */
25#define CONFIG_DISPLAY_BOARDINFO_LATE /* display board info (after reloc) */
26
27#define CONFIG_MACH_TYPE 4520 /* Gateworks Ventana Platform */
28
29#include <asm/arch/imx-regs.h>
30#include <asm/imx-common/gpio.h>
31
32/* ATAGs */
33#define CONFIG_CMDLINE_TAG
34#define CONFIG_SETUP_MEMORY_TAGS
35#define CONFIG_INITRD_TAG
36#define CONFIG_SERIAL_TAG
37#define CONFIG_REVISION_TAG
38
Tim Harveyec4177a2014-04-25 15:17:00 -070039#define CONFIG_SYS_GENERIC_BOARD
40
Tim Harvey552c3582014-03-06 07:46:30 -080041/* Size of malloc() pool */
42#define CONFIG_SYS_MALLOC_LEN (10 * 1024 * 1024)
43
44/* Init Functions */
45#define CONFIG_BOARD_EARLY_INIT_F
46#define CONFIG_MISC_INIT_R
47
Tim Harvey109df452015-05-08 18:28:27 -070048/* Driver Model */
49#ifndef CONFIG_SPL_BUILD
50#define CONFIG_DM
51#define CONFIG_DM_GPIO
Tim Harvey67ed7922015-05-08 18:28:29 -070052#define CONFIG_DM_SERIAL
Tim Harvey230c1672015-05-08 18:28:30 -070053#define CONFIG_DM_THERMAL
Tim Harvey109df452015-05-08 18:28:27 -070054#define CONFIG_CMD_DM
55#endif
56
Tim Harvey552c3582014-03-06 07:46:30 -080057/* GPIO */
58#define CONFIG_MXC_GPIO
Tim Harveyb3084f22015-05-08 18:28:26 -070059#define CONFIG_CMD_GPIO
Tim Harvey552c3582014-03-06 07:46:30 -080060
Tim Harvey230c1672015-05-08 18:28:30 -070061/* Thermal */
62#define CONFIG_IMX6_THERMAL
63
Tim Harvey552c3582014-03-06 07:46:30 -080064/* Serial */
65#define CONFIG_MXC_UART
66#define CONFIG_MXC_UART_BASE UART2_BASE
67
68#ifdef CONFIG_SPI_FLASH
69
70/* SPI */
71#define CONFIG_CMD_SF
72#ifdef CONFIG_CMD_SF
73 #define CONFIG_MXC_SPI
74 #define CONFIG_SPI_FLASH_MTD
75 #define CONFIG_SPI_FLASH_BAR
76 #define CONFIG_SPI_FLASH_WINBOND
77 #define CONFIG_SF_DEFAULT_BUS 0
Nikita Kiryanov00cd7382014-08-20 15:08:50 +030078 #define CONFIG_SF_DEFAULT_CS 0
Tim Harvey552c3582014-03-06 07:46:30 -080079 /* GPIO 3-19 (21248) */
80 #define CONFIG_SF_DEFAULT_SPEED 30000000
81 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
82#endif
83
84#else
85/* Enable NAND support */
86#define CONFIG_CMD_TIME
87#define CONFIG_CMD_NAND
88#define CONFIG_CMD_NAND_TRIMFFS
89#ifdef CONFIG_CMD_NAND
90 #define CONFIG_NAND_MXS
91 #define CONFIG_SYS_MAX_NAND_DEVICE 1
92 #define CONFIG_SYS_NAND_BASE 0x40000000
93 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
94 #define CONFIG_SYS_NAND_ONFI_DETECTION
95
96 /* DMA stuff, needed for GPMI/MXS NAND support */
97 #define CONFIG_APBH_DMA
98 #define CONFIG_APBH_DMA_BURST
99 #define CONFIG_APBH_DMA_BURST8
100#endif
101
102#endif /* CONFIG_SPI_FLASH */
103
104/* Flattened Image Tree Suport */
105#define CONFIG_FIT
106#define CONFIG_FIT_VERBOSE
107
108/* I2C Configs */
109#define CONFIG_CMD_I2C
110#define CONFIG_SYS_I2C
111#define CONFIG_SYS_I2C_MXC
York Sunf1a52162015-03-20 10:20:40 -0700112#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
Tim Harvey0da2c522014-08-07 22:35:45 -0700113#define CONFIG_SYS_I2C_SPEED 100000
114#define CONFIG_I2C_GSC 0
115#define CONFIG_I2C_PMIC 1
Tim Harvey4f1a2a12015-04-08 12:54:41 -0700116#define CONFIG_I2C_EDID
Tim Harvey552c3582014-03-06 07:46:30 -0800117
118/* MMC Configs */
119#define CONFIG_FSL_ESDHC
120#define CONFIG_FSL_USDHC
121#define CONFIG_SYS_FSL_ESDHC_ADDR 0
122#define CONFIG_SYS_FSL_USDHC_NUM 1
123#define CONFIG_MMC
124#define CONFIG_CMD_MMC
125#define CONFIG_GENERIC_MMC
126#define CONFIG_BOUNCE_BUFFER
127
128/* Filesystem support */
129#define CONFIG_CMD_EXT2
Tim Harvey0037d642015-04-08 12:54:42 -0700130#define CONFIG_CMD_EXT4
131#define CONFIG_CMD_EXT4_WRITE
Tim Harvey552c3582014-03-06 07:46:30 -0800132#define CONFIG_CMD_FAT
133#define CONFIG_CMD_UBIFS
134#define CONFIG_DOS_PARTITION
135
Tim Harvey552c3582014-03-06 07:46:30 -0800136/*
137 * SATA Configs
138 */
139#define CONFIG_CMD_SATA
140#ifdef CONFIG_CMD_SATA
141 #define CONFIG_DWC_AHSATA
142 #define CONFIG_SYS_SATA_MAX_DEVICE 1
143 #define CONFIG_DWC_AHSATA_PORT_ID 0
144 #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
145 #define CONFIG_LBA48
146 #define CONFIG_LIBATA
147#endif
148
149/*
150 * PCI express
151 */
152#define CONFIG_CMD_PCI
153#ifdef CONFIG_CMD_PCI
154#define CONFIG_PCI
155#define CONFIG_PCI_PNP
156#define CONFIG_PCI_SCAN_SHOW
Tim Harvey33791d52014-08-07 22:49:57 -0700157#define CONFIG_PCI_FIXUP_DEV
Tim Harvey552c3582014-03-06 07:46:30 -0800158#define CONFIG_PCIE_IMX
159#endif
160
161/*
162 * PMIC
163 */
164#define CONFIG_POWER
165#define CONFIG_POWER_I2C
166#define CONFIG_POWER_PFUZE100
167#define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
Tim Harvey0dff16f2014-05-05 08:22:25 -0700168#define CONFIG_POWER_LTC3676
169#define CONFIG_POWER_LTC3676_I2C_ADDR 0x3c
Tim Harvey552c3582014-03-06 07:46:30 -0800170
171/* Various command support */
172#include <config_cmd_default.h>
173#undef CONFIG_CMD_IMLS
174#define CONFIG_CMD_PING
175#define CONFIG_CMD_DHCP
176#define CONFIG_CMD_MII
177#define CONFIG_CMD_NET
178#define CONFIG_CMD_BMODE /* set eFUSE shadow for a boot dev and reset */
179#define CONFIG_CMD_HDMIDETECT /* detect HDMI output device */
180#define CONFIG_CMD_SETEXPR
181#define CONFIG_CMD_BOOTZ
182#define CONFIG_CMD_GSC
Tim Harvey0da2c522014-08-07 22:35:45 -0700183#define CONFIG_CMD_EECONFIG /* Gateworks EEPROM config cmd */
Tim Harvey552c3582014-03-06 07:46:30 -0800184#define CONFIG_CMD_UBI
185#define CONFIG_RBTREE
186#define CONFIG_LZO
187#define CONFIG_CMD_FUSE /* eFUSE read/write support */
188#ifdef CONFIG_CMD_FUSE
189#define CONFIG_MXC_OCOTP
190#endif
191
192
193/* Ethernet support */
194#define CONFIG_FEC_MXC
Tim Harvey472884d2015-04-08 12:54:32 -0700195#define CONFIG_E1000
Tim Harvey552c3582014-03-06 07:46:30 -0800196#define CONFIG_MII
197#define IMX_FEC_BASE ENET_BASE_ADDR
198#define CONFIG_FEC_XCV_TYPE RGMII
Tim Harvey552c3582014-03-06 07:46:30 -0800199#define CONFIG_FEC_MXC_PHYADDR 0
200#define CONFIG_PHYLIB
201#define CONFIG_ARP_TIMEOUT 200UL
202
203/* USB Configs */
204#define CONFIG_CMD_USB
205#define CONFIG_USB_EHCI
206#define CONFIG_USB_EHCI_MX6
207#define CONFIG_USB_STORAGE
208#define CONFIG_USB_HOST_ETHER
209#define CONFIG_USB_ETHER_ASIX
210#define CONFIG_USB_ETHER_SMSC95XX
211#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
212#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
213#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
214#define CONFIG_MXC_USB_FLAGS 0
215#define CONFIG_USB_KEYBOARD
216#define CONFIG_CI_UDC
217#define CONFIG_USBD_HS
218#define CONFIG_USB_GADGET_DUALSPEED
219#define CONFIG_USB_ETHER
220#define CONFIG_USB_ETH_CDC
221#define CONFIG_NETCONSOLE
222#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
Tim Harvey552c3582014-03-06 07:46:30 -0800223
Tim Harvey202d16b2015-04-08 12:54:39 -0700224/* USB Mass Storage Gadget */
225#define CONFIG_USB_GADGET
226#define CONFIG_CMD_USB_MASS_STORAGE
227#define CONFIG_USB_GADGET_MASS_STORAGE
228#define CONFIG_USBDOWNLOAD_GADGET
229#define CONFIG_USB_GADGET_VBUS_DRAW 2
230
231/* Netchip IDs */
232#define CONFIG_G_DNL_VENDOR_NUM 0x0525
233#define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5
234#define CONFIG_G_DNL_MANUFACTURER "Gateworks"
235
Tim Harveyfb64cc72014-04-25 15:39:07 -0700236/* Framebuffer and LCD */
237#define CONFIG_VIDEO
238#define CONFIG_VIDEO_IPUV3
239#define CONFIG_CFB_CONSOLE
240#define CONFIG_VGA_AS_SINGLE_DEVICE
241#define CONFIG_SYS_CONSOLE_IS_IN_ENV
242#define CONFIG_VIDEO_BMP_RLE8
243#define CONFIG_SPLASH_SCREEN
244#define CONFIG_BMP_16BPP
245#define CONFIG_VIDEO_LOGO
246#define CONFIG_IPUV3_CLK 260000000
247#define CONFIG_CMD_HDMIDETECT
248#define CONFIG_CONSOLE_MUX
249#define CONFIG_IMX_HDMI
250#define CONFIG_IMX_VIDEO_SKIP
251
Tim Harvey552c3582014-03-06 07:46:30 -0800252/* serial console (ttymxc1,115200) */
253#define CONFIG_CONS_INDEX 1
254#define CONFIG_BAUDRATE 115200
255
256/* Miscellaneous configurable options */
257#define CONFIG_SYS_LONGHELP
258#define CONFIG_SYS_HUSH_PARSER
259#define CONFIG_SYS_PROMPT "Ventana > "
260#define CONFIG_SYS_CBSIZE 1024
261#define CONFIG_AUTO_COMPLETE
262#define CONFIG_CMDLINE_EDITING
263#define CONFIG_HWCONFIG
264
265/* Print Buffer Size */
266#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
267#define CONFIG_SYS_MAXARGS 16
268#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
269
270/* Memory configuration */
271#define CONFIG_SYS_MEMTEST_START 0x10000000
272#define CONFIG_SYS_MEMTEST_END 0x10010000
273#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
274#define CONFIG_SYS_TEXT_BASE 0x17800000
275#define CONFIG_SYS_LOAD_ADDR 0x12000000
276
277/* Physical Memory Map */
278#define CONFIG_NR_DRAM_BANKS 1
279#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
280#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
281#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
282#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
283
284#define CONFIG_SYS_INIT_SP_OFFSET \
285 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
286#define CONFIG_SYS_INIT_SP_ADDR \
287 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
288
289/* FLASH and environment organization */
290#define CONFIG_SYS_NO_FLASH /* no NOR flash */
291
292/*
293 * MTD Command for mtdparts
294 */
295#define CONFIG_CMD_MTDPARTS
296#define CONFIG_MTD_DEVICE
297#define CONFIG_MTD_PARTITIONS
298#ifdef CONFIG_SPI_FLASH
299#define MTDIDS_DEFAULT "nor0=nor"
300#define MTDPARTS_DEFAULT \
301 "mtdparts=nor:512k(uboot),64k(env),2m(kernel),-(rootfs)"
302#else
303#define MTDIDS_DEFAULT "nand0=nand"
304#define MTDPARTS_DEFAULT "mtdparts=nand:16m(uboot),1m(env),-(rootfs)"
305#endif
306
307/* Persistent Environment Config */
308#define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
309#ifdef CONFIG_SPI_FLASH
310#define CONFIG_ENV_IS_IN_SPI_FLASH
311#else
312#define CONFIG_ENV_IS_IN_NAND
313#endif
314#if defined(CONFIG_ENV_IS_IN_MMC)
315 #define CONFIG_ENV_OFFSET (6 * 64 * 1024)
316 #define CONFIG_ENV_SIZE (8 * 1024)
317 #define CONFIG_SYS_MMC_ENV_DEV 0
318#elif defined(CONFIG_ENV_IS_IN_NAND)
319 #define CONFIG_ENV_OFFSET (16 << 20)
320 #define CONFIG_ENV_SECT_SIZE (128 << 10)
321 #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
322 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 << 10))
323 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
324#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
325 #define CONFIG_ENV_OFFSET (512 * 1024)
326 #define CONFIG_ENV_SECT_SIZE (64 * 1024)
327 #define CONFIG_ENV_SIZE (8 * 1024)
328 #define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
329 #define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
330 #define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
331 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
332#endif
333
334/* Environment */
335#define CONFIG_BOOTDELAY 3
336#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
337#define CONFIG_IPADDR 192.168.1.1
338#define CONFIG_SERVERIP 192.168.1.146
339#define HWCONFIG_DEFAULT \
340 "hwconfig=rs232;" \
341 "dio0:mode=gpio;dio1:mode=gpio;dio2:mode=gpio;dio3:mode=gpio\0" \
342
343#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
Tim Harvey68eaffd2015-04-08 12:54:46 -0700344 "usb_pgood_delay=2000\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800345 "console=ttymxc1\0" \
346 "bootdevs=usb mmc sata flash\0" \
347 HWCONFIG_DEFAULT \
348 "video=\0" \
349 \
350 "mtdparts=" MTDPARTS_DEFAULT "\0" \
351 "mtdids=" MTDIDS_DEFAULT "\0" \
352 \
353 "fdt_high=0xffffffff\0" \
354 "fdt_addr=0x18000000\0" \
Tim Harvey8fddf8c2015-04-08 12:54:40 -0700355 "initrd_high=0xffffffff\0" \
Tim Harvey87f46312015-04-08 12:54:49 -0700356 "bootdir=boot\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800357 "loadfdt=" \
Tim Harvey87f46312015-04-08 12:54:49 -0700358 "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
359 "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
360 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
361 "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
362 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
363 "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
Tim Harvey552c3582014-03-06 07:46:30 -0800364 "fi\0" \
365 \
Tim Harvey87f46312015-04-08 12:54:49 -0700366 "script=6x_bootscript-ventana\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800367 "loadscript=" \
Tim Harvey87f46312015-04-08 12:54:49 -0700368 "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800369 "source; " \
370 "fi\0" \
371 \
Tim Harvey87f46312015-04-08 12:54:49 -0700372 "uimage=uImage\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800373 "mmc_root=/dev/mmcblk0p1 rootfstype=ext4 rootwait rw\0" \
374 "mmc_boot=" \
375 "setenv fsload 'ext2load mmc 0:1'; " \
376 "mmc dev 0 && mmc rescan && " \
Tim Harvey27280582015-05-08 18:28:24 -0700377 "setenv dtype mmc; run loadscript; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700378 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800379 "setenv bootargs console=${console},${baudrate} " \
380 "root=/dev/mmcblk0p1 rootfstype=ext4 " \
381 "rootwait rw ${video} ${extra}; " \
382 "if run loadfdt && fdt addr ${fdt_addr}; then " \
383 "bootm ${loadaddr} - ${fdt_addr}; " \
384 "else " \
385 "bootm; " \
386 "fi; " \
387 "fi\0" \
388 \
389 "sata_boot=" \
390 "setenv fsload 'ext2load sata 0:1'; sata init && " \
Tim Harvey27280582015-05-08 18:28:24 -0700391 "setenv dtype sata; run loadscript; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700392 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800393 "setenv bootargs console=${console},${baudrate} " \
394 "root=/dev/sda1 rootfstype=ext4 " \
395 "rootwait rw ${video} ${extra}; " \
396 "if run loadfdt && fdt addr ${fdt_addr}; then " \
397 "bootm ${loadaddr} - ${fdt_addr}; " \
398 "else " \
399 "bootm; " \
400 "fi; " \
401 "fi\0" \
402 "usb_boot=" \
403 "setenv fsload 'ext2load usb 0:1'; usb start && usb dev 0 && " \
Tim Harvey27280582015-05-08 18:28:24 -0700404 "setenv dtype usb; run loadscript; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700405 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800406 "setenv bootargs console=${console},${baudrate} " \
407 "root=/dev/sda1 rootfstype=ext4 " \
408 "rootwait rw ${video} ${extra}; " \
409 "if run loadfdt && fdt addr ${fdt_addr}; then " \
410 "bootm ${loadaddr} - ${fdt_addr}; " \
411 "else " \
412 "bootm; " \
413 "fi; " \
414 "fi\0"
415
416#ifdef CONFIG_SPI_FLASH
417 #define CONFIG_EXTRA_ENV_SETTINGS \
418 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
419 "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
420 "image_uboot=ventana/u-boot_spi.imx\0" \
421 \
422 "spi_koffset=0x90000\0" \
423 "spi_klen=0x200000\0" \
424 \
425 "spi_updateuboot=echo Updating uboot from " \
426 "${serverip}:${image_uboot}...; " \
427 "tftpboot ${loadaddr} ${image_uboot} && " \
428 "sf probe && sf erase 0 80000 && " \
429 "sf write ${loadaddr} 400 ${filesize}\0" \
430 "spi_update=echo Updating OS from ${serverip}:${image_os} " \
431 "to ${spi_koffset} ...; " \
432 "tftp ${loadaddr} ${image_os} && " \
433 "sf probe && " \
434 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
435 \
436 "flash_boot=" \
437 "if sf probe && " \
438 "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
439 "setenv bootargs console=${console},${baudrate} " \
440 "root=/dev/mtdblock3 " \
441 "rootfstype=squashfs,jffs2 " \
442 "${video} ${extra}; " \
443 "bootm; " \
444 "fi\0"
445#else
446 #define CONFIG_EXTRA_ENV_SETTINGS \
447 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
Tim Harvey552c3582014-03-06 07:46:30 -0800448 \
Tim Harvey87f46312015-04-08 12:54:49 -0700449 "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
Tim Harvey552c3582014-03-06 07:46:30 -0800450 "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
451 "tftp ${loadaddr} ${image_rootfs} && " \
452 "nand erase.part rootfs && " \
453 "nand write ${loadaddr} rootfs ${filesize}\0" \
454 \
455 "flash_boot=" \
456 "setenv fsload 'ubifsload'; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700457 "ubi part rootfs; " \
458 "if ubi check boot; then " \
459 "ubifsmount ubi0:boot; " \
460 "setenv root ubi0:rootfs ubi.mtd=2 " \
461 "rootfstype=squashfs,ubifs; " \
462 "setenv bootdir; " \
463 "elif ubi check rootfs; then " \
464 "ubifsmount ubi0:rootfs; " \
465 "setenv root ubi0:rootfs ubi.mtd=2 " \
466 "rootfstype=ubifs; " \
467 "fi; " \
Tim Harvey27280582015-05-08 18:28:24 -0700468 "setenv dtype nand; run loadscript; " \
Tim Harvey87f46312015-04-08 12:54:49 -0700469 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey552c3582014-03-06 07:46:30 -0800470 "setenv bootargs console=${console},${baudrate} " \
Tim Harvey87f46312015-04-08 12:54:49 -0700471 "root=${root} ${video} ${extra}; " \
Tim Harvey552c3582014-03-06 07:46:30 -0800472 "if run loadfdt && fdt addr ${fdt_addr}; then " \
473 "ubifsumount; " \
474 "bootm ${loadaddr} - ${fdt_addr}; " \
475 "else " \
476 "ubifsumount; bootm; " \
477 "fi; " \
478 "fi\0"
479#endif
480
481#define CONFIG_BOOTCOMMAND \
482 "for btype in ${bootdevs}; do " \
483 "echo; echo Attempting ${btype} boot...; " \
484 "if run ${btype}_boot; then; fi; " \
485 "done"
486
487/* Device Tree Support */
488#define CONFIG_OF_BOARD_SETUP
489#define CONFIG_OF_LIBFDT
490#define CONFIG_FDT_FIXUP_PARTITIONS
491
492#ifndef CONFIG_SYS_DCACHE_OFF
493 #define CONFIG_CMD_CACHE
494#endif
495
496#endif /* __CONFIG_H */