1 /* SPDX-License-Identifier: GPL-2.0+ */
3 * Copyright (C) 2013 Gateworks Corporation
10 /* Location in NAND to read U-Boot from */
14 /* Falcon Mode - MMC support: args@1MB kernel@2MB */
15 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR 0x800 /* 1MB */
16 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS (CONFIG_CMD_SPL_WRITE_SIZE / 512)
18 #include "imx6_spl.h" /* common IMX6 SPL configuration */
19 #include "mx6_common.h"
22 #define CONFIG_MXC_UART_BASE UART2_BASE
25 #define CONFIG_SYS_MAX_NAND_DEVICE 1
27 #undef CONFIG_SYS_BOOTM_LEN
28 #define CONFIG_SYS_BOOTM_LEN (64 << 20)
31 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
36 #ifdef CONFIG_CMD_SATA
37 #define CONFIG_DWC_AHSATA_PORT_ID 0
38 #define CONFIG_DWC_AHSATA_BASE_ADDR SATA_ARB_BASE_ADDR
46 #define CONFIG_PCIE_IMX
52 #define CONFIG_POWER_PFUZE100
53 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
54 #define CONFIG_POWER_LTC3676
55 #define CONFIG_POWER_LTC3676_I2C_ADDR 0x3c
57 /* Various command support */
60 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET /* For OTG port */
61 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
62 #define CONFIG_MXC_USB_FLAGS 0
63 #define CONFIG_USBD_HS
65 /* Framebuffer and LCD */
66 #define CONFIG_IMX_HDMI
67 #define CONFIG_IMX_VIDEO_SKIP
68 #define CONFIG_HIDE_LOGO_VERSION /* Custom config to hide U-boot version */
70 /* Miscellaneous configurable options */
71 #define CONFIG_HWCONFIG
73 /* Memory configuration */
75 /* Physical Memory Map */
76 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
77 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
78 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
79 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
82 * MTD Command for mtdparts
85 /* Persistent Environment Config */
88 #define CONFIG_IPADDR 192.168.1.1
89 #define CONFIG_SERVERIP 192.168.1.146
91 #define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
93 "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
94 "usb_pgood_delay=2000\0" \
96 "bootdevs=usb mmc sata flash\0" \
97 "hwconfig=_UNKNOWN_\0" \
100 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
101 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
105 "fdt_high=0xffffffff\0" \
106 "fdt_addr=0x18000000\0" \
107 "initrd_high=0xffffffff\0" \
109 "fdt addr ${fdt_addr}\0" \
112 "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
113 "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
115 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
116 "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
118 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
119 "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
124 "script=6x_bootscript-ventana\0" \
126 "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
127 "source ${loadaddr}; " \
131 "mmc_root=mmcblk0p1\0" \
133 "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
134 "mmc dev ${disk} && mmc rescan && " \
135 "setenv dtype mmc; run loadscript; " \
136 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
137 "setenv bootargs console=${console},${baudrate} " \
138 "root=/dev/${mmc_root} rootfstype=${fs} " \
139 "rootwait rw ${video} ${extra}; " \
140 "if run loadfdt; then " \
141 "bootm ${loadaddr} - ${fdt_addr}; " \
148 "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
150 "setenv dtype sata; run loadscript; " \
151 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
152 "setenv bootargs console=${console},${baudrate} " \
153 "root=/dev/sda1 rootfstype=${fs} " \
154 "rootwait rw ${video} ${extra}; " \
155 "if run loadfdt; then " \
156 "bootm ${loadaddr} - ${fdt_addr}; " \
162 "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
163 "usb start && usb dev ${disk} && " \
164 "setenv dtype usb; run loadscript; " \
165 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
166 "setenv bootargs console=${console},${baudrate} " \
167 "root=/dev/sda1 rootfstype=${fs} " \
168 "rootwait rw ${video} ${extra}; " \
169 "if run loadfdt; then " \
170 "bootm ${loadaddr} - ${fdt_addr}; " \
176 #ifdef CONFIG_SPI_FLASH
177 #define CONFIG_EXTRA_ENV_SETTINGS \
178 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
179 "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
180 "image_uboot=ventana/u-boot_spi.imx\0" \
182 "spi_koffset=0x90000\0" \
183 "spi_klen=0x200000\0" \
185 "spi_updateuboot=echo Updating uboot from " \
186 "${serverip}:${image_uboot}...; " \
187 "tftpboot ${loadaddr} ${image_uboot} && " \
188 "sf probe && sf erase 0 80000 && " \
189 "sf write ${loadaddr} 400 ${filesize}\0" \
190 "spi_update=echo Updating OS from ${serverip}:${image_os} " \
191 "to ${spi_koffset} ...; " \
192 "tftp ${loadaddr} ${image_os} && " \
194 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
198 "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
199 "setenv bootargs console=${console},${baudrate} " \
200 "root=/dev/mtdblock3 " \
201 "rootfstype=squashfs,jffs2 " \
202 "${video} ${extra}; " \
206 #define CONFIG_EXTRA_ENV_SETTINGS \
207 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
209 "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
210 "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
211 "tftp ${loadaddr} ${image_rootfs} && " \
212 "nand erase.part rootfs && " \
213 "nand write ${loadaddr} rootfs ${filesize}\0" \
216 "setenv fsload 'ubifsload'; " \
217 "ubi part rootfs; " \
218 "if ubi check boot; then " \
219 "ubifsmount ubi0:boot; " \
220 "setenv root ubi0:rootfs ubi.mtd=2 " \
221 "rootfstype=squashfs,ubifs; " \
223 "elif ubi check rootfs; then " \
224 "ubifsmount ubi0:rootfs; " \
225 "setenv root ubi0:rootfs ubi.mtd=2 " \
226 "rootfstype=ubifs; " \
228 "setenv dtype nand; run loadscript; " \
229 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
230 "setenv bootargs console=${console},${baudrate} " \
231 "root=${root} ${video} ${extra}; " \
232 "if run loadfdt; then " \
234 "bootm ${loadaddr} - ${fdt_addr}; " \
236 "ubifsumount; bootm; " \
241 #endif /* __CONFIG_H */