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 */
16 #include "imx6_spl.h" /* common IMX6 SPL configuration */
17 #include "mx6_common.h"
20 #define CONFIG_MXC_UART_BASE UART2_BASE
23 #define CONFIG_SYS_MAX_NAND_DEVICE 1
25 #undef CONFIG_SYS_BOOTM_LEN
26 #define CONFIG_SYS_BOOTM_LEN (64 << 20)
29 #define CONFIG_SYS_FSL_ESDHC_ADDR 0
35 #define CONFIG_PCIE_IMX
41 #define CONFIG_POWER_PFUZE100
42 #define CONFIG_POWER_PFUZE100_I2C_ADDR 0x08
43 #define CONFIG_POWER_LTC3676
44 #define CONFIG_POWER_LTC3676_I2C_ADDR 0x3c
46 /* Various command support */
49 #define CONFIG_MXC_USB_PORTSC (PORT_PTS_UTMI | PORT_PTS_PTW)
50 #define CONFIG_MXC_USB_FLAGS 0
51 #define CONFIG_USBD_HS
53 /* Framebuffer and LCD */
54 #define CONFIG_IMX_HDMI
55 #define CONFIG_IMX_VIDEO_SKIP
56 #define CONFIG_HIDE_LOGO_VERSION /* Custom config to hide U-boot version */
58 /* Miscellaneous configurable options */
59 #define CONFIG_HWCONFIG
61 /* Memory configuration */
63 /* Physical Memory Map */
64 #define PHYS_SDRAM MMDC0_ARB_BASE_ADDR
65 #define CONFIG_SYS_SDRAM_BASE PHYS_SDRAM
66 #define CONFIG_SYS_INIT_RAM_ADDR IRAM_BASE_ADDR
67 #define CONFIG_SYS_INIT_RAM_SIZE IRAM_SIZE
70 * MTD Command for mtdparts
73 /* Persistent Environment Config */
76 #define CONFIG_IPADDR 192.168.1.1
77 #define CONFIG_SERVERIP 192.168.1.146
79 #define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
81 "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
82 "usb_pgood_delay=2000\0" \
84 "bootdevs=usb mmc sata flash\0" \
85 "hwconfig=_UNKNOWN_\0" \
88 "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
89 "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
93 "fdt_high=0xffffffff\0" \
94 "fdt_addr=0x18000000\0" \
95 "initrd_high=0xffffffff\0" \
97 "fdt addr ${fdt_addr}\0" \
100 "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
101 "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
103 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
104 "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
106 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
107 "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
112 "script=6x_bootscript-ventana\0" \
114 "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
115 "source ${loadaddr}; " \
119 "mmc_root=mmcblk0p1\0" \
121 "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
122 "mmc dev ${disk} && mmc rescan && " \
123 "setenv dtype mmc; run loadscript; " \
124 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
125 "setenv bootargs console=${console},${baudrate} " \
126 "root=/dev/${mmc_root} rootfstype=${fs} " \
127 "rootwait rw ${video} ${extra}; " \
128 "if run loadfdt; then " \
129 "bootm ${loadaddr} - ${fdt_addr}; " \
136 "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
138 "setenv dtype sata; run loadscript; " \
139 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
140 "setenv bootargs console=${console},${baudrate} " \
141 "root=/dev/sda1 rootfstype=${fs} " \
142 "rootwait rw ${video} ${extra}; " \
143 "if run loadfdt; then " \
144 "bootm ${loadaddr} - ${fdt_addr}; " \
150 "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
151 "usb start && usb dev ${disk} && " \
152 "setenv dtype usb; run loadscript; " \
153 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
154 "setenv bootargs console=${console},${baudrate} " \
155 "root=/dev/sda1 rootfstype=${fs} " \
156 "rootwait rw ${video} ${extra}; " \
157 "if run loadfdt; then " \
158 "bootm ${loadaddr} - ${fdt_addr}; " \
164 #ifdef CONFIG_SPI_FLASH
165 #define CONFIG_EXTRA_ENV_SETTINGS \
166 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
167 "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
168 "image_uboot=ventana/u-boot_spi.imx\0" \
170 "spi_koffset=0x90000\0" \
171 "spi_klen=0x200000\0" \
173 "spi_updateuboot=echo Updating uboot from " \
174 "${serverip}:${image_uboot}...; " \
175 "tftpboot ${loadaddr} ${image_uboot} && " \
176 "sf probe && sf erase 0 80000 && " \
177 "sf write ${loadaddr} 400 ${filesize}\0" \
178 "spi_update=echo Updating OS from ${serverip}:${image_os} " \
179 "to ${spi_koffset} ...; " \
180 "tftp ${loadaddr} ${image_os} && " \
182 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
186 "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
187 "setenv bootargs console=${console},${baudrate} " \
188 "root=/dev/mtdblock3 " \
189 "rootfstype=squashfs,jffs2 " \
190 "${video} ${extra}; " \
194 #define CONFIG_EXTRA_ENV_SETTINGS \
195 CONFIG_EXTRA_ENV_SETTINGS_COMMON \
197 "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
198 "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
199 "tftp ${loadaddr} ${image_rootfs} && " \
200 "nand erase.part rootfs && " \
201 "nand write ${loadaddr} rootfs ${filesize}\0" \
204 "setenv fsload 'ubifsload'; " \
205 "ubi part rootfs; " \
206 "if ubi check boot; then " \
207 "ubifsmount ubi0:boot; " \
208 "setenv root ubi0:rootfs ubi.mtd=2 " \
209 "rootfstype=squashfs,ubifs; " \
211 "elif ubi check rootfs; then " \
212 "ubifsmount ubi0:rootfs; " \
213 "setenv root ubi0:rootfs ubi.mtd=2 " \
214 "rootfstype=ubifs; " \
216 "setenv dtype nand; run loadscript; " \
217 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
218 "setenv bootargs console=${console},${baudrate} " \
219 "root=${root} ${video} ${extra}; " \
220 "if run loadfdt; then " \
222 "bootm ${loadaddr} - ${fdt_addr}; " \
224 "ubifsumount; bootm; " \
229 #endif /* __CONFIG_H */