Convert CONFIG_LBA48 et al to Kconfig
[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         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
89         "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
90         "disk=0\0" \
91         "part=1\0" \
92         \
93         "fdt_high=0xffffffff\0" \
94         "fdt_addr=0x18000000\0" \
95         "initrd_high=0xffffffff\0" \
96         "fixfdt=" \
97                 "fdt addr ${fdt_addr}\0" \
98         "bootdir=boot\0" \
99         "loadfdt=" \
100                 "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
101                         "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
102                         "run fixfdt; " \
103                 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
104                         "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
105                         "run fixfdt; " \
106                 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
107                         "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
108                         "run fixfdt; " \
109                 "fi\0" \
110         \
111         "fs=ext4\0" \
112         "script=6x_bootscript-ventana\0" \
113         "loadscript=" \
114                 "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
115                         "source ${loadaddr}; " \
116                 "fi\0" \
117         \
118         "uimage=uImage\0" \
119         "mmc_root=mmcblk0p1\0" \
120         "mmc_boot=" \
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}; " \
130                         "else " \
131                                 "bootm; " \
132                         "fi; " \
133                 "fi\0" \
134         \
135         "sata_boot=" \
136                 "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
137                 "sata init && " \
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}; " \
145                         "else " \
146                                 "bootm; " \
147                         "fi; " \
148                 "fi\0" \
149         "usb_boot=" \
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}; " \
159                         "else " \
160                                 "bootm; " \
161                         "fi; " \
162                 "fi\0"
163
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" \
169         \
170         "spi_koffset=0x90000\0" \
171         "spi_klen=0x200000\0" \
172         \
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} && " \
181                 "sf probe && " \
182                 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
183         \
184         "flash_boot=" \
185                 "if sf probe && " \
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}; " \
191                         "bootm; " \
192                 "fi\0"
193 #else
194         #define CONFIG_EXTRA_ENV_SETTINGS \
195         CONFIG_EXTRA_ENV_SETTINGS_COMMON \
196         \
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" \
202         \
203         "flash_boot=" \
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; " \
210                         "setenv bootdir; " \
211                 "elif ubi check rootfs; then " \
212                         "ubifsmount ubi0:rootfs; " \
213                         "setenv root ubi0:rootfs ubi.mtd=2 " \
214                                 "rootfstype=ubifs; " \
215                 "fi; " \
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 " \
221                                 "ubifsumount; " \
222                                 "bootm ${loadaddr} - ${fdt_addr}; " \
223                         "else " \
224                                 "ubifsumount; bootm; " \
225                         "fi; " \
226                 "fi\0"
227 #endif
228
229 #endif                         /* __CONFIG_H */