blob: 533cbc36e1a011935d80d983eee38cc88b4aba60 [file] [log] [blame]
Tim Harvey59189a82014-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 Harvey55ff55e2015-05-15 09:17:09 -070010#include <linux/sizes.h>
11
Tim Harvey0cc11de2014-06-02 16:13:27 -070012/* SPL */
Tim Harvey06c35642015-05-08 18:28:25 -070013#define CONFIG_SPL_BOARD_INIT
Tim Harvey0cc11de2014-06-02 16:13:27 -070014#define CONFIG_SPL_NAND_SUPPORT
15#define CONFIG_SPL_MMC_SUPPORT
Tim Harveye06a0362015-05-15 09:18:31 -070016#define CONFIG_SPL_POWER_SUPPORT
Tim Harvey0cc11de2014-06-02 16:13:27 -070017/* Location in NAND to read U-Boot from */
Tim Harvey55ff55e2015-05-15 09:17:09 -070018#define CONFIG_SYS_NAND_U_BOOT_OFFS (14 * SZ_1M)
Tim Harvey0cc11de2014-06-02 16:13:27 -070019
20#include "imx6_spl.h" /* common IMX6 SPL configuration */
Tim Harvey59189a82014-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 Harveyeffb7dc2014-04-25 15:17:00 -070038#define CONFIG_SYS_GENERIC_BOARD
39
Tim Harvey59189a82014-03-06 07:46:30 -080040/* Size of malloc() pool */
Tim Harvey55ff55e2015-05-15 09:17:09 -070041#define CONFIG_SYS_MALLOC_LEN (10 * SZ_1M)
Tim Harvey59189a82014-03-06 07:46:30 -080042
43/* Init Functions */
44#define CONFIG_BOARD_EARLY_INIT_F
45#define CONFIG_MISC_INIT_R
46
Tim Harveye1b47702015-05-08 18:28:27 -070047/* Driver Model */
48#ifndef CONFIG_SPL_BUILD
49#define CONFIG_DM
50#define CONFIG_DM_GPIO
Tim Harveyd41c8c82015-05-08 18:28:29 -070051#define CONFIG_DM_SERIAL
Tim Harvey50de5082015-05-08 18:28:30 -070052#define CONFIG_DM_THERMAL
Tim Harveye1b47702015-05-08 18:28:27 -070053#define CONFIG_CMD_DM
54#endif
55
Tim Harvey59189a82014-03-06 07:46:30 -080056/* GPIO */
57#define CONFIG_MXC_GPIO
Tim Harvey32a6eae2015-05-08 18:28:26 -070058#define CONFIG_CMD_GPIO
Tim Harvey59189a82014-03-06 07:46:30 -080059
Tim Harvey50de5082015-05-08 18:28:30 -070060/* Thermal */
61#define CONFIG_IMX6_THERMAL
62
Tim Harvey59189a82014-03-06 07:46:30 -080063/* Serial */
64#define CONFIG_MXC_UART
65#define CONFIG_MXC_UART_BASE UART2_BASE
66
67#ifdef CONFIG_SPI_FLASH
68
69/* SPI */
70#define CONFIG_CMD_SF
71#ifdef CONFIG_CMD_SF
72 #define CONFIG_MXC_SPI
73 #define CONFIG_SPI_FLASH_MTD
74 #define CONFIG_SPI_FLASH_BAR
75 #define CONFIG_SPI_FLASH_WINBOND
76 #define CONFIG_SF_DEFAULT_BUS 0
Nikita Kiryanov155fa9a2014-08-20 15:08:50 +030077 #define CONFIG_SF_DEFAULT_CS 0
Tim Harvey59189a82014-03-06 07:46:30 -080078 /* GPIO 3-19 (21248) */
79 #define CONFIG_SF_DEFAULT_SPEED 30000000
80 #define CONFIG_SF_DEFAULT_MODE (SPI_MODE_0)
81#endif
82
83#else
84/* Enable NAND support */
85#define CONFIG_CMD_TIME
86#define CONFIG_CMD_NAND
87#define CONFIG_CMD_NAND_TRIMFFS
88#ifdef CONFIG_CMD_NAND
89 #define CONFIG_NAND_MXS
90 #define CONFIG_SYS_MAX_NAND_DEVICE 1
91 #define CONFIG_SYS_NAND_BASE 0x40000000
92 #define CONFIG_SYS_NAND_5_ADDR_CYCLE
93 #define CONFIG_SYS_NAND_ONFI_DETECTION
94
95 /* DMA stuff, needed for GPMI/MXS NAND support */
96 #define CONFIG_APBH_DMA
97 #define CONFIG_APBH_DMA_BURST
98 #define CONFIG_APBH_DMA_BURST8
99#endif
100
101#endif /* CONFIG_SPI_FLASH */
102
103/* Flattened Image Tree Suport */
104#define CONFIG_FIT
105#define CONFIG_FIT_VERBOSE
106
107/* I2C Configs */
108#define CONFIG_CMD_I2C
109#define CONFIG_SYS_I2C
110#define CONFIG_SYS_I2C_MXC
York Sunf8cb1012015-03-20 10:20:40 -0700111#define CONFIG_SYS_I2C_MXC_I2C3 /* enable I2C bus 3 */
Tim Harvey9c0fe832014-08-07 22:35:45 -0700112#define CONFIG_SYS_I2C_SPEED 100000
113#define CONFIG_I2C_GSC 0
114#define CONFIG_I2C_PMIC 1
Tim Harveyf6747cd2015-04-08 12:54:41 -0700115#define CONFIG_I2C_EDID
Tim Harvey59189a82014-03-06 07:46:30 -0800116
117/* MMC Configs */
118#define CONFIG_FSL_ESDHC
119#define CONFIG_FSL_USDHC
120#define CONFIG_SYS_FSL_ESDHC_ADDR 0
121#define CONFIG_SYS_FSL_USDHC_NUM 1
122#define CONFIG_MMC
123#define CONFIG_CMD_MMC
124#define CONFIG_GENERIC_MMC
125#define CONFIG_BOUNCE_BUFFER
126
127/* Filesystem support */
128#define CONFIG_CMD_EXT2
Tim Harvey30dc8802015-04-08 12:54:42 -0700129#define CONFIG_CMD_EXT4
130#define CONFIG_CMD_EXT4_WRITE
Tim Harvey59189a82014-03-06 07:46:30 -0800131#define CONFIG_CMD_FAT
132#define CONFIG_CMD_UBIFS
133#define CONFIG_DOS_PARTITION
134
Tim Harvey59189a82014-03-06 07:46:30 -0800135/*
136 * SATA Configs
137 */
138#define CONFIG_CMD_SATA
139#ifdef CONFIG_CMD_SATA
140 #define CONFIG_DWC_AHSATA
141 #define CONFIG_SYS_SATA_MAX_DEVICE 1
142 #define CONFIG_DWC_AHSATA_PORT_ID 0
143 #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
144 #define CONFIG_LBA48
145 #define CONFIG_LIBATA
146#endif
147
148/*
149 * PCI express
150 */
151#define CONFIG_CMD_PCI
152#ifdef CONFIG_CMD_PCI
153#define CONFIG_PCI
154#define CONFIG_PCI_PNP
155#define CONFIG_PCI_SCAN_SHOW
Tim Harveydad08282014-08-07 22:49:57 -0700156#define CONFIG_PCI_FIXUP_DEV
Tim Harvey59189a82014-03-06 07:46:30 -0800157#define CONFIG_PCIE_IMX
158#endif
159
160/*
161 * PMIC
162 */
163#define CONFIG_POWER
164#define CONFIG_POWER_I2C
165#define CONFIG_POWER_PFUZE100
166#define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
Tim Harvey234d89d2014-05-05 08:22:25 -0700167#define CONFIG_POWER_LTC3676
168#define CONFIG_POWER_LTC3676_I2C_ADDR 0x3c
Tim Harvey59189a82014-03-06 07:46:30 -0800169
170/* Various command support */
171#include <config_cmd_default.h>
172#undef CONFIG_CMD_IMLS
173#define CONFIG_CMD_PING
174#define CONFIG_CMD_DHCP
175#define CONFIG_CMD_MII
176#define CONFIG_CMD_NET
177#define CONFIG_CMD_BMODE /* set eFUSE shadow for a boot dev and reset */
178#define CONFIG_CMD_HDMIDETECT /* detect HDMI output device */
179#define CONFIG_CMD_SETEXPR
180#define CONFIG_CMD_BOOTZ
181#define CONFIG_CMD_GSC
Tim Harvey9c0fe832014-08-07 22:35:45 -0700182#define CONFIG_CMD_EECONFIG /* Gateworks EEPROM config cmd */
Tim Harvey59189a82014-03-06 07:46:30 -0800183#define CONFIG_CMD_UBI
184#define CONFIG_RBTREE
185#define CONFIG_LZO
186#define CONFIG_CMD_FUSE /* eFUSE read/write support */
187#ifdef CONFIG_CMD_FUSE
188#define CONFIG_MXC_OCOTP
189#endif
190
191
192/* Ethernet support */
193#define CONFIG_FEC_MXC
Tim Harvey0a6ee032015-04-08 12:54:32 -0700194#define CONFIG_E1000
Tim Harvey59189a82014-03-06 07:46:30 -0800195#define CONFIG_MII
196#define IMX_FEC_BASE ENET_BASE_ADDR
197#define CONFIG_FEC_XCV_TYPE RGMII
Tim Harvey59189a82014-03-06 07:46:30 -0800198#define CONFIG_FEC_MXC_PHYADDR 0
199#define CONFIG_PHYLIB
200#define CONFIG_ARP_TIMEOUT 200UL
201
202/* USB Configs */
203#define CONFIG_CMD_USB
204#define CONFIG_USB_EHCI
205#define CONFIG_USB_EHCI_MX6
206#define CONFIG_USB_STORAGE
207#define CONFIG_USB_HOST_ETHER
208#define CONFIG_USB_ETHER_ASIX
209#define CONFIG_USB_ETHER_SMSC95XX
210#define CONFIG_USB_MAX_CONTROLLER_COUNT 2
211#define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
212#define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
213#define CONFIG_MXC_USB_FLAGS 0
214#define CONFIG_USB_KEYBOARD
215#define CONFIG_CI_UDC
216#define CONFIG_USBD_HS
217#define CONFIG_USB_GADGET_DUALSPEED
218#define CONFIG_USB_ETHER
219#define CONFIG_USB_ETH_CDC
220#define CONFIG_NETCONSOLE
221#define CONFIG_SYS_USB_EVENT_POLL_VIA_CONTROL_EP
Tim Harvey59189a82014-03-06 07:46:30 -0800222
Tim Harvey9543e952015-04-08 12:54:39 -0700223/* USB Mass Storage Gadget */
224#define CONFIG_USB_GADGET
225#define CONFIG_CMD_USB_MASS_STORAGE
226#define CONFIG_USB_GADGET_MASS_STORAGE
227#define CONFIG_USBDOWNLOAD_GADGET
228#define CONFIG_USB_GADGET_VBUS_DRAW 2
229
230/* Netchip IDs */
231#define CONFIG_G_DNL_VENDOR_NUM 0x0525
232#define CONFIG_G_DNL_PRODUCT_NUM 0xa4a5
233#define CONFIG_G_DNL_MANUFACTURER "Gateworks"
234
Tim Harvey7a278f92014-04-25 15:39:07 -0700235/* Framebuffer and LCD */
236#define CONFIG_VIDEO
237#define CONFIG_VIDEO_IPUV3
238#define CONFIG_CFB_CONSOLE
239#define CONFIG_VGA_AS_SINGLE_DEVICE
240#define CONFIG_SYS_CONSOLE_IS_IN_ENV
241#define CONFIG_VIDEO_BMP_RLE8
242#define CONFIG_SPLASH_SCREEN
243#define CONFIG_BMP_16BPP
244#define CONFIG_VIDEO_LOGO
245#define CONFIG_IPUV3_CLK 260000000
246#define CONFIG_CMD_HDMIDETECT
247#define CONFIG_CONSOLE_MUX
248#define CONFIG_IMX_HDMI
249#define CONFIG_IMX_VIDEO_SKIP
250
Tim Harvey59189a82014-03-06 07:46:30 -0800251/* serial console (ttymxc1,115200) */
252#define CONFIG_CONS_INDEX 1
253#define CONFIG_BAUDRATE 115200
254
255/* Miscellaneous configurable options */
256#define CONFIG_SYS_LONGHELP
257#define CONFIG_SYS_HUSH_PARSER
258#define CONFIG_SYS_PROMPT "Ventana > "
259#define CONFIG_SYS_CBSIZE 1024
260#define CONFIG_AUTO_COMPLETE
261#define CONFIG_CMDLINE_EDITING
262#define CONFIG_HWCONFIG
263
264/* Print Buffer Size */
265#define CONFIG_SYS_PBSIZE (CONFIG_SYS_CBSIZE + sizeof(CONFIG_SYS_PROMPT) + 16)
266#define CONFIG_SYS_MAXARGS 16
267#define CONFIG_SYS_BARGSIZE CONFIG_SYS_CBSIZE
268
269/* Memory configuration */
270#define CONFIG_SYS_MEMTEST_START 0x10000000
271#define CONFIG_SYS_MEMTEST_END 0x10010000
272#define CONFIG_SYS_MEMTEST_SCRATCH 0x10800000
273#define CONFIG_SYS_TEXT_BASE 0x17800000
274#define CONFIG_SYS_LOAD_ADDR 0x12000000
275
276/* Physical Memory Map */
277#define CONFIG_NR_DRAM_BANKS 1
278#define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
279#define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
280#define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
281#define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
282
283#define CONFIG_SYS_INIT_SP_OFFSET \
284 (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
285#define CONFIG_SYS_INIT_SP_ADDR \
286 (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
287
288/* FLASH and environment organization */
289#define CONFIG_SYS_NO_FLASH /* no NOR flash */
290
291/*
292 * MTD Command for mtdparts
293 */
294#define CONFIG_CMD_MTDPARTS
295#define CONFIG_MTD_DEVICE
296#define CONFIG_MTD_PARTITIONS
297#ifdef CONFIG_SPI_FLASH
298#define MTDIDS_DEFAULT "nor0=nor"
299#define MTDPARTS_DEFAULT \
300 "mtdparts=nor:512k(uboot),64k(env),2m(kernel),-(rootfs)"
301#else
302#define MTDIDS_DEFAULT "nand0=nand"
303#define MTDPARTS_DEFAULT "mtdparts=nand:16m(uboot),1m(env),-(rootfs)"
304#endif
305
306/* Persistent Environment Config */
307#define CONFIG_ENV_OVERWRITE /* allow to overwrite serial and ethaddr */
308#ifdef CONFIG_SPI_FLASH
309#define CONFIG_ENV_IS_IN_SPI_FLASH
310#else
311#define CONFIG_ENV_IS_IN_NAND
312#endif
313#if defined(CONFIG_ENV_IS_IN_MMC)
Tim Harvey55ff55e2015-05-15 09:17:09 -0700314 #define CONFIG_ENV_OFFSET (384 * SZ_1K)
315 #define CONFIG_ENV_SIZE (8 * SZ_1K)
Tim Harvey59189a82014-03-06 07:46:30 -0800316 #define CONFIG_SYS_MMC_ENV_DEV 0
317#elif defined(CONFIG_ENV_IS_IN_NAND)
Tim Harvey55ff55e2015-05-15 09:17:09 -0700318 #define CONFIG_ENV_OFFSET (16 * SZ_1M)
319 #define CONFIG_ENV_SECT_SIZE (128 * SZ_1K)
Tim Harvey59189a82014-03-06 07:46:30 -0800320 #define CONFIG_ENV_SIZE CONFIG_ENV_SECT_SIZE
Tim Harvey55ff55e2015-05-15 09:17:09 -0700321 #define CONFIG_ENV_OFFSET_REDUND (CONFIG_ENV_OFFSET + (512 * SZ_1K))
Tim Harvey59189a82014-03-06 07:46:30 -0800322 #define CONFIG_ENV_SIZE_REDUND CONFIG_ENV_SIZE
323#elif defined(CONFIG_ENV_IS_IN_SPI_FLASH)
Tim Harvey55ff55e2015-05-15 09:17:09 -0700324 #define CONFIG_ENV_OFFSET (512 * SZ_1K)
325 #define CONFIG_ENV_SECT_SIZE (64 * SZ_1K)
326 #define CONFIG_ENV_SIZE (8 * SZ_1K)
Tim Harvey59189a82014-03-06 07:46:30 -0800327 #define CONFIG_ENV_SPI_BUS CONFIG_SF_DEFAULT_BUS
328 #define CONFIG_ENV_SPI_CS CONFIG_SF_DEFAULT_CS
329 #define CONFIG_ENV_SPI_MODE CONFIG_SF_DEFAULT_MODE
330 #define CONFIG_ENV_SPI_MAX_HZ CONFIG_SF_DEFAULT_SPEED
331#endif
332
333/* Environment */
334#define CONFIG_BOOTDELAY 3
335#define CONFIG_LOADADDR CONFIG_SYS_LOAD_ADDR
336#define CONFIG_IPADDR 192.168.1.1
337#define CONFIG_SERVERIP 192.168.1.146
338#define HWCONFIG_DEFAULT \
339 "hwconfig=rs232;" \
340 "dio0:mode=gpio;dio1:mode=gpio;dio2:mode=gpio;dio3:mode=gpio\0" \
341
342#define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
Tim Harvey04171692015-04-08 12:54:46 -0700343 "usb_pgood_delay=2000\0" \
Tim Harvey59189a82014-03-06 07:46:30 -0800344 "console=ttymxc1\0" \
345 "bootdevs=usb mmc sata flash\0" \
346 HWCONFIG_DEFAULT \
347 "video=\0" \
348 \
349 "mtdparts=" MTDPARTS_DEFAULT "\0" \
350 "mtdids=" MTDIDS_DEFAULT "\0" \
351 \
352 "fdt_high=0xffffffff\0" \
353 "fdt_addr=0x18000000\0" \
Tim Harvey8cc25eb2015-04-08 12:54:40 -0700354 "initrd_high=0xffffffff\0" \
Tim Harveye2801a92015-04-08 12:54:49 -0700355 "bootdir=boot\0" \
Tim Harvey59189a82014-03-06 07:46:30 -0800356 "loadfdt=" \
Tim Harveye2801a92015-04-08 12:54:49 -0700357 "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
358 "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
359 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
360 "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
361 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
362 "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
Tim Harvey59189a82014-03-06 07:46:30 -0800363 "fi\0" \
364 \
Tim Harveye2801a92015-04-08 12:54:49 -0700365 "script=6x_bootscript-ventana\0" \
Tim Harvey59189a82014-03-06 07:46:30 -0800366 "loadscript=" \
Tim Harveye2801a92015-04-08 12:54:49 -0700367 "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
Tim Harvey59189a82014-03-06 07:46:30 -0800368 "source; " \
369 "fi\0" \
370 \
Tim Harveye2801a92015-04-08 12:54:49 -0700371 "uimage=uImage\0" \
Tim Harvey59189a82014-03-06 07:46:30 -0800372 "mmc_root=/dev/mmcblk0p1 rootfstype=ext4 rootwait rw\0" \
373 "mmc_boot=" \
374 "setenv fsload 'ext2load mmc 0:1'; " \
375 "mmc dev 0 && mmc rescan && " \
Tim Harvey560e8b32015-05-08 18:28:24 -0700376 "setenv dtype mmc; run loadscript; " \
Tim Harveye2801a92015-04-08 12:54:49 -0700377 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey59189a82014-03-06 07:46:30 -0800378 "setenv bootargs console=${console},${baudrate} " \
379 "root=/dev/mmcblk0p1 rootfstype=ext4 " \
380 "rootwait rw ${video} ${extra}; " \
381 "if run loadfdt && fdt addr ${fdt_addr}; then " \
382 "bootm ${loadaddr} - ${fdt_addr}; " \
383 "else " \
384 "bootm; " \
385 "fi; " \
386 "fi\0" \
387 \
388 "sata_boot=" \
389 "setenv fsload 'ext2load sata 0:1'; sata init && " \
Tim Harvey560e8b32015-05-08 18:28:24 -0700390 "setenv dtype sata; run loadscript; " \
Tim Harveye2801a92015-04-08 12:54:49 -0700391 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey59189a82014-03-06 07:46:30 -0800392 "setenv bootargs console=${console},${baudrate} " \
393 "root=/dev/sda1 rootfstype=ext4 " \
394 "rootwait rw ${video} ${extra}; " \
395 "if run loadfdt && fdt addr ${fdt_addr}; then " \
396 "bootm ${loadaddr} - ${fdt_addr}; " \
397 "else " \
398 "bootm; " \
399 "fi; " \
400 "fi\0" \
401 "usb_boot=" \
402 "setenv fsload 'ext2load usb 0:1'; usb start && usb dev 0 && " \
Tim Harvey560e8b32015-05-08 18:28:24 -0700403 "setenv dtype usb; run loadscript; " \
Tim Harveye2801a92015-04-08 12:54:49 -0700404 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey59189a82014-03-06 07:46:30 -0800405 "setenv bootargs console=${console},${baudrate} " \
406 "root=/dev/sda1 rootfstype=ext4 " \
407 "rootwait rw ${video} ${extra}; " \
408 "if run loadfdt && fdt addr ${fdt_addr}; then " \
409 "bootm ${loadaddr} - ${fdt_addr}; " \
410 "else " \
411 "bootm; " \
412 "fi; " \
413 "fi\0"
414
415#ifdef CONFIG_SPI_FLASH
416 #define CONFIG_EXTRA_ENV_SETTINGS \
417 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
418 "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
419 "image_uboot=ventana/u-boot_spi.imx\0" \
420 \
421 "spi_koffset=0x90000\0" \
422 "spi_klen=0x200000\0" \
423 \
424 "spi_updateuboot=echo Updating uboot from " \
425 "${serverip}:${image_uboot}...; " \
426 "tftpboot ${loadaddr} ${image_uboot} && " \
427 "sf probe && sf erase 0 80000 && " \
428 "sf write ${loadaddr} 400 ${filesize}\0" \
429 "spi_update=echo Updating OS from ${serverip}:${image_os} " \
430 "to ${spi_koffset} ...; " \
431 "tftp ${loadaddr} ${image_os} && " \
432 "sf probe && " \
433 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
434 \
435 "flash_boot=" \
436 "if sf probe && " \
437 "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
438 "setenv bootargs console=${console},${baudrate} " \
439 "root=/dev/mtdblock3 " \
440 "rootfstype=squashfs,jffs2 " \
441 "${video} ${extra}; " \
442 "bootm; " \
443 "fi\0"
444#else
445 #define CONFIG_EXTRA_ENV_SETTINGS \
446 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
Tim Harvey59189a82014-03-06 07:46:30 -0800447 \
Tim Harveye2801a92015-04-08 12:54:49 -0700448 "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
Tim Harvey59189a82014-03-06 07:46:30 -0800449 "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
450 "tftp ${loadaddr} ${image_rootfs} && " \
451 "nand erase.part rootfs && " \
452 "nand write ${loadaddr} rootfs ${filesize}\0" \
453 \
454 "flash_boot=" \
455 "setenv fsload 'ubifsload'; " \
Tim Harveye2801a92015-04-08 12:54:49 -0700456 "ubi part rootfs; " \
457 "if ubi check boot; then " \
458 "ubifsmount ubi0:boot; " \
459 "setenv root ubi0:rootfs ubi.mtd=2 " \
460 "rootfstype=squashfs,ubifs; " \
461 "setenv bootdir; " \
462 "elif ubi check rootfs; then " \
463 "ubifsmount ubi0:rootfs; " \
464 "setenv root ubi0:rootfs ubi.mtd=2 " \
465 "rootfstype=ubifs; " \
466 "fi; " \
Tim Harvey560e8b32015-05-08 18:28:24 -0700467 "setenv dtype nand; run loadscript; " \
Tim Harveye2801a92015-04-08 12:54:49 -0700468 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
Tim Harvey59189a82014-03-06 07:46:30 -0800469 "setenv bootargs console=${console},${baudrate} " \
Tim Harveye2801a92015-04-08 12:54:49 -0700470 "root=${root} ${video} ${extra}; " \
Tim Harvey59189a82014-03-06 07:46:30 -0800471 "if run loadfdt && fdt addr ${fdt_addr}; then " \
472 "ubifsumount; " \
473 "bootm ${loadaddr} - ${fdt_addr}; " \
474 "else " \
475 "ubifsumount; bootm; " \
476 "fi; " \
477 "fi\0"
478#endif
479
480#define CONFIG_BOOTCOMMAND \
481 "for btype in ${bootdevs}; do " \
482 "echo; echo Attempting ${btype} boot...; " \
483 "if run ${btype}_boot; then; fi; " \
484 "done"
485
486/* Device Tree Support */
487#define CONFIG_OF_BOARD_SETUP
488#define CONFIG_OF_LIBFDT
489#define CONFIG_FDT_FIXUP_PARTITIONS
490
491#ifndef CONFIG_SYS_DCACHE_OFF
492 #define CONFIG_CMD_CACHE
493#endif
494
495#endif /* __CONFIG_H */