Complete migration of MTDPARTS_DEFAULT / MTDIDS_DEFAULT, include in environment
[platform/kernel/u-boot.git] / include / configs / gw_ventana.h
1 /* SPDX-License-Identifier: GPL-2.0+ */
2 /*
3  * Copyright (C) 2013 Gateworks Corporation
4  */
5
6 #ifndef __CONFIG_H
7 #define __CONFIG_H
8
9 /* SPL */
10 /* Location in NAND to read U-Boot from */
11
12 /* Falcon Mode */
13
14 /* Falcon Mode - MMC support: args@1MB kernel@2MB */
15
16 #include "imx6_spl.h"                  /* common IMX6 SPL configuration */
17 #include "mx6_common.h"
18
19 /* Serial */
20 #define CONFIG_MXC_UART_BASE           UART2_BASE
21
22 /* NAND */
23 #define CONFIG_SYS_MAX_NAND_DEVICE      1
24
25 #undef CONFIG_SYS_BOOTM_LEN
26 #define CONFIG_SYS_BOOTM_LEN            (64 << 20)
27
28 /* MMC Configs */
29 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
30
31 /*
32  * PCI express
33  */
34 #ifdef CONFIG_CMD_PCI
35 #define CONFIG_PCIE_IMX
36 #endif
37
38 /*
39  * PMIC
40  */
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
45
46 /* Various command support */
47
48 /* USB Configs */
49 #define CONFIG_MXC_USB_PORTSC     (PORT_PTS_UTMI | PORT_PTS_PTW)
50 #define CONFIG_MXC_USB_FLAGS      0
51 #define CONFIG_USBD_HS
52
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 */
57
58 /* Miscellaneous configurable options */
59 #define CONFIG_HWCONFIG
60
61 /* Memory configuration */
62
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
68
69 /*
70  * MTD Command for mtdparts
71  */
72
73 /* Persistent Environment Config */
74
75 /* Environment */
76 #define CONFIG_IPADDR             192.168.1.1
77 #define CONFIG_SERVERIP           192.168.1.146
78
79 #define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
80         "splashpos=m,m\0" \
81         "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
82         "usb_pgood_delay=2000\0" \
83         "console=ttymxc1\0" \
84         "bootdevs=usb mmc sata flash\0" \
85         "hwconfig=_UNKNOWN_\0" \
86         "video=\0" \
87         \
88         "disk=0\0" \
89         "part=1\0" \
90         \
91         "fdt_high=0xffffffff\0" \
92         "fdt_addr=0x18000000\0" \
93         "initrd_high=0xffffffff\0" \
94         "fixfdt=" \
95                 "fdt addr ${fdt_addr}\0" \
96         "bootdir=boot\0" \
97         "loadfdt=" \
98                 "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
99                         "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
100                         "run fixfdt; " \
101                 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
102                         "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
103                         "run fixfdt; " \
104                 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
105                         "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
106                         "run fixfdt; " \
107                 "fi\0" \
108         \
109         "fs=ext4\0" \
110         "script=6x_bootscript-ventana\0" \
111         "loadscript=" \
112                 "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
113                         "source ${loadaddr}; " \
114                 "fi\0" \
115         \
116         "uimage=uImage\0" \
117         "mmc_root=mmcblk0p1\0" \
118         "mmc_boot=" \
119                 "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
120                 "mmc dev ${disk} && mmc rescan && " \
121                 "setenv dtype mmc; run loadscript; " \
122                 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
123                         "setenv bootargs console=${console},${baudrate} " \
124                                 "root=/dev/${mmc_root} rootfstype=${fs} " \
125                                 "rootwait rw ${video} ${extra}; " \
126                         "if run loadfdt; then " \
127                                 "bootm ${loadaddr} - ${fdt_addr}; " \
128                         "else " \
129                                 "bootm; " \
130                         "fi; " \
131                 "fi\0" \
132         \
133         "sata_boot=" \
134                 "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
135                 "sata init && " \
136                 "setenv dtype sata; run loadscript; " \
137                 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
138                         "setenv bootargs console=${console},${baudrate} " \
139                                 "root=/dev/sda1 rootfstype=${fs} " \
140                                 "rootwait rw ${video} ${extra}; " \
141                         "if run loadfdt; then " \
142                                 "bootm ${loadaddr} - ${fdt_addr}; " \
143                         "else " \
144                                 "bootm; " \
145                         "fi; " \
146                 "fi\0" \
147         "usb_boot=" \
148                 "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
149                 "usb start && usb dev ${disk} && " \
150                 "setenv dtype usb; 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}; " \
157                         "else " \
158                                 "bootm; " \
159                         "fi; " \
160                 "fi\0"
161
162 #ifdef CONFIG_SPI_FLASH
163         #define CONFIG_EXTRA_ENV_SETTINGS \
164         CONFIG_EXTRA_ENV_SETTINGS_COMMON \
165         "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
166         "image_uboot=ventana/u-boot_spi.imx\0" \
167         \
168         "spi_koffset=0x90000\0" \
169         "spi_klen=0x200000\0" \
170         \
171         "spi_updateuboot=echo Updating uboot from " \
172                 "${serverip}:${image_uboot}...; " \
173                 "tftpboot ${loadaddr} ${image_uboot} && " \
174                 "sf probe && sf erase 0 80000 && " \
175                         "sf write ${loadaddr} 400 ${filesize}\0" \
176         "spi_update=echo Updating OS from ${serverip}:${image_os} " \
177                 "to ${spi_koffset} ...; " \
178                 "tftp ${loadaddr} ${image_os} && " \
179                 "sf probe && " \
180                 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
181         \
182         "flash_boot=" \
183                 "if sf probe && " \
184                 "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
185                         "setenv bootargs console=${console},${baudrate} " \
186                                 "root=/dev/mtdblock3 " \
187                                 "rootfstype=squashfs,jffs2 " \
188                                 "${video} ${extra}; " \
189                         "bootm; " \
190                 "fi\0"
191 #else
192         #define CONFIG_EXTRA_ENV_SETTINGS \
193         CONFIG_EXTRA_ENV_SETTINGS_COMMON \
194         \
195         "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
196         "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
197                 "tftp ${loadaddr} ${image_rootfs} && " \
198                 "nand erase.part rootfs && " \
199                 "nand write ${loadaddr} rootfs ${filesize}\0" \
200         \
201         "flash_boot=" \
202                 "setenv fsload 'ubifsload'; " \
203                 "ubi part rootfs; " \
204                 "if ubi check boot; then " \
205                         "ubifsmount ubi0:boot; " \
206                         "setenv root ubi0:rootfs ubi.mtd=2 " \
207                                 "rootfstype=squashfs,ubifs; " \
208                         "setenv bootdir; " \
209                 "elif ubi check rootfs; then " \
210                         "ubifsmount ubi0:rootfs; " \
211                         "setenv root ubi0:rootfs ubi.mtd=2 " \
212                                 "rootfstype=ubifs; " \
213                 "fi; " \
214                 "setenv dtype nand; run loadscript; " \
215                 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
216                         "setenv bootargs console=${console},${baudrate} " \
217                                 "root=${root} ${video} ${extra}; " \
218                         "if run loadfdt; then " \
219                                 "ubifsumount; " \
220                                 "bootm ${loadaddr} - ${fdt_addr}; " \
221                         "else " \
222                                 "ubifsumount; bootm; " \
223                         "fi; " \
224                 "fi\0"
225 #endif
226
227 #endif                         /* __CONFIG_H */