668d00cbc0ed203d59380c1d536d95831773efff
[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 #define CONFIG_SYS_SPL_ARGS_ADDR        0x18000000
14
15 /* Falcon Mode - NAND support: args@17MB kernel@18MB */
16 #define CONFIG_SYS_NAND_SPL_KERNEL_OFFS (18 * SZ_1M)
17
18 /* Falcon Mode - MMC support: args@1MB kernel@2MB */
19 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTOR   0x800   /* 1MB */
20 #define CONFIG_SYS_MMCSD_RAW_MODE_ARGS_SECTORS  (CONFIG_CMD_SPL_WRITE_SIZE / 512)
21
22 #include "imx6_spl.h"                  /* common IMX6 SPL configuration */
23 #include "mx6_common.h"
24
25 /* Serial */
26 #define CONFIG_MXC_UART_BASE           UART2_BASE
27
28 /* NAND */
29 #define CONFIG_SYS_MAX_NAND_DEVICE      1
30
31 #undef CONFIG_SYS_BOOTM_LEN
32 #define CONFIG_SYS_BOOTM_LEN            (64 << 20)
33
34 /* I2C Configs */
35 #define CONFIG_I2C_GSC                  0
36
37 /* MMC Configs */
38 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
39
40 /*
41  * SATA Configs
42  */
43 #ifdef CONFIG_CMD_SATA
44   #define CONFIG_DWC_AHSATA_PORT_ID     0
45   #define CONFIG_DWC_AHSATA_BASE_ADDR   SATA_ARB_BASE_ADDR
46   #define CONFIG_LBA48
47 #endif
48
49 /*
50  * PCI express
51  */
52 #ifdef CONFIG_CMD_PCI
53 #define CONFIG_PCIE_IMX
54 #endif
55
56 /*
57  * PMIC
58  */
59 #define CONFIG_POWER_PFUZE100
60 #define CONFIG_POWER_PFUZE100_I2C_ADDR  0x08
61 #define CONFIG_POWER_LTC3676
62 #define CONFIG_POWER_LTC3676_I2C_ADDR  0x3c
63
64 /* Various command support */
65
66 /* USB Configs */
67 #define CONFIG_EHCI_HCD_INIT_AFTER_RESET  /* For OTG port */
68 #define CONFIG_MXC_USB_PORTSC     (PORT_PTS_UTMI | PORT_PTS_PTW)
69 #define CONFIG_MXC_USB_FLAGS      0
70 #define CONFIG_USBD_HS
71
72 /* Framebuffer and LCD */
73 #define CONFIG_IMX_HDMI
74 #define CONFIG_IMX_VIDEO_SKIP
75 #define CONFIG_VIDEO_BMP_LOGO
76 #define CONFIG_HIDE_LOGO_VERSION  /* Custom config to hide U-boot version */
77
78 /* Miscellaneous configurable options */
79 #define CONFIG_HWCONFIG
80
81 /* Memory configuration */
82
83 /* Physical Memory Map */
84 #define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
85 #define CONFIG_SYS_SDRAM_BASE          PHYS_SDRAM
86 #define CONFIG_SYS_INIT_RAM_ADDR       IRAM_BASE_ADDR
87 #define CONFIG_SYS_INIT_RAM_SIZE       IRAM_SIZE
88
89 #define CONFIG_SYS_INIT_SP_OFFSET \
90         (CONFIG_SYS_INIT_RAM_SIZE - GENERATED_GBL_DATA_SIZE)
91 #define CONFIG_SYS_INIT_SP_ADDR \
92         (CONFIG_SYS_INIT_RAM_ADDR + CONFIG_SYS_INIT_SP_OFFSET)
93
94 /*
95  * MTD Command for mtdparts
96  */
97
98 /* Persistent Environment Config */
99
100 /* Environment */
101 #define CONFIG_IPADDR             192.168.1.1
102 #define CONFIG_SERVERIP           192.168.1.146
103
104 #define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
105         "splashpos=m,m\0" \
106         "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
107         "usb_pgood_delay=2000\0" \
108         "console=ttymxc1\0" \
109         "bootdevs=usb mmc sata flash\0" \
110         "hwconfig=_UNKNOWN_\0" \
111         "video=\0" \
112         \
113         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
114         "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
115         "disk=0\0" \
116         "part=1\0" \
117         \
118         "fdt_high=0xffffffff\0" \
119         "fdt_addr=0x18000000\0" \
120         "initrd_high=0xffffffff\0" \
121         "fixfdt=" \
122                 "fdt addr ${fdt_addr}\0" \
123         "bootdir=boot\0" \
124         "loadfdt=" \
125                 "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
126                         "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
127                         "run fixfdt; " \
128                 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
129                         "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
130                         "run fixfdt; " \
131                 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
132                         "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
133                         "run fixfdt; " \
134                 "fi\0" \
135         \
136         "fs=ext4\0" \
137         "script=6x_bootscript-ventana\0" \
138         "loadscript=" \
139                 "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
140                         "source ${loadaddr}; " \
141                 "fi\0" \
142         \
143         "uimage=uImage\0" \
144         "mmc_root=mmcblk0p1\0" \
145         "mmc_boot=" \
146                 "setenv fsload \"${fs}load mmc ${disk}:${part}\"; " \
147                 "mmc dev ${disk} && mmc rescan && " \
148                 "setenv dtype mmc; run loadscript; " \
149                 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
150                         "setenv bootargs console=${console},${baudrate} " \
151                                 "root=/dev/${mmc_root} rootfstype=${fs} " \
152                                 "rootwait rw ${video} ${extra}; " \
153                         "if run loadfdt; then " \
154                                 "bootm ${loadaddr} - ${fdt_addr}; " \
155                         "else " \
156                                 "bootm; " \
157                         "fi; " \
158                 "fi\0" \
159         \
160         "sata_boot=" \
161                 "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
162                 "sata init && " \
163                 "setenv dtype sata; run loadscript; " \
164                 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
165                         "setenv bootargs console=${console},${baudrate} " \
166                                 "root=/dev/sda1 rootfstype=${fs} " \
167                                 "rootwait rw ${video} ${extra}; " \
168                         "if run loadfdt; then " \
169                                 "bootm ${loadaddr} - ${fdt_addr}; " \
170                         "else " \
171                                 "bootm; " \
172                         "fi; " \
173                 "fi\0" \
174         "usb_boot=" \
175                 "setenv fsload \"${fs}load usb ${disk}:${part}\"; " \
176                 "usb start && usb dev ${disk} && " \
177                 "setenv dtype usb; run loadscript; " \
178                 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
179                         "setenv bootargs console=${console},${baudrate} " \
180                                 "root=/dev/sda1 rootfstype=${fs} " \
181                                 "rootwait rw ${video} ${extra}; " \
182                         "if run loadfdt; then " \
183                                 "bootm ${loadaddr} - ${fdt_addr}; " \
184                         "else " \
185                                 "bootm; " \
186                         "fi; " \
187                 "fi\0"
188
189 #ifdef CONFIG_SPI_FLASH
190         #define CONFIG_EXTRA_ENV_SETTINGS \
191         CONFIG_EXTRA_ENV_SETTINGS_COMMON \
192         "image_os=ventana/openwrt-imx6-imx6q-gw5400-a-squashfs.bin\0" \
193         "image_uboot=ventana/u-boot_spi.imx\0" \
194         \
195         "spi_koffset=0x90000\0" \
196         "spi_klen=0x200000\0" \
197         \
198         "spi_updateuboot=echo Updating uboot from " \
199                 "${serverip}:${image_uboot}...; " \
200                 "tftpboot ${loadaddr} ${image_uboot} && " \
201                 "sf probe && sf erase 0 80000 && " \
202                         "sf write ${loadaddr} 400 ${filesize}\0" \
203         "spi_update=echo Updating OS from ${serverip}:${image_os} " \
204                 "to ${spi_koffset} ...; " \
205                 "tftp ${loadaddr} ${image_os} && " \
206                 "sf probe && " \
207                 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
208         \
209         "flash_boot=" \
210                 "if sf probe && " \
211                 "sf read ${loadaddr} ${spi_koffset} ${spi_klen}; then " \
212                         "setenv bootargs console=${console},${baudrate} " \
213                                 "root=/dev/mtdblock3 " \
214                                 "rootfstype=squashfs,jffs2 " \
215                                 "${video} ${extra}; " \
216                         "bootm; " \
217                 "fi\0"
218 #else
219         #define CONFIG_EXTRA_ENV_SETTINGS \
220         CONFIG_EXTRA_ENV_SETTINGS_COMMON \
221         \
222         "image_rootfs=openwrt-imx6-ventana-rootfs.ubi\0" \
223         "nand_update=echo Updating NAND from ${serverip}:${image_rootfs}...; " \
224                 "tftp ${loadaddr} ${image_rootfs} && " \
225                 "nand erase.part rootfs && " \
226                 "nand write ${loadaddr} rootfs ${filesize}\0" \
227         \
228         "flash_boot=" \
229                 "setenv fsload 'ubifsload'; " \
230                 "ubi part rootfs; " \
231                 "if ubi check boot; then " \
232                         "ubifsmount ubi0:boot; " \
233                         "setenv root ubi0:rootfs ubi.mtd=2 " \
234                                 "rootfstype=squashfs,ubifs; " \
235                         "setenv bootdir; " \
236                 "elif ubi check rootfs; then " \
237                         "ubifsmount ubi0:rootfs; " \
238                         "setenv root ubi0:rootfs ubi.mtd=2 " \
239                                 "rootfstype=ubifs; " \
240                 "fi; " \
241                 "setenv dtype nand; run loadscript; " \
242                 "if ${fsload} ${loadaddr} ${bootdir}/${uimage}; then " \
243                         "setenv bootargs console=${console},${baudrate} " \
244                                 "root=${root} ${video} ${extra}; " \
245                         "if run loadfdt; then " \
246                                 "ubifsumount; " \
247                                 "bootm ${loadaddr} - ${fdt_addr}; " \
248                         "else " \
249                                 "ubifsumount; bootm; " \
250                         "fi; " \
251                 "fi\0"
252 #endif
253
254 #endif                         /* __CONFIG_H */