c07e48629bb2a37dc807ec313b744de411946c0a
[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 #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)
17
18 #include "imx6_spl.h"                  /* common IMX6 SPL configuration */
19 #include "mx6_common.h"
20
21 /* Serial */
22 #define CONFIG_MXC_UART_BASE           UART2_BASE
23
24 /* NAND */
25 #define CONFIG_SYS_MAX_NAND_DEVICE      1
26
27 #undef CONFIG_SYS_BOOTM_LEN
28 #define CONFIG_SYS_BOOTM_LEN            (64 << 20)
29
30 /* MMC Configs */
31 #define CONFIG_SYS_FSL_ESDHC_ADDR      0
32
33 /*
34  * SATA Configs
35  */
36 #ifdef CONFIG_CMD_SATA
37   #define CONFIG_DWC_AHSATA_PORT_ID     0
38   #define CONFIG_DWC_AHSATA_BASE_ADDR   SATA_ARB_BASE_ADDR
39   #define CONFIG_LBA48
40 #endif
41
42 /*
43  * PCI express
44  */
45 #ifdef CONFIG_CMD_PCI
46 #define CONFIG_PCIE_IMX
47 #endif
48
49 /*
50  * PMIC
51  */
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
56
57 /* Various command support */
58
59 /* USB Configs */
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
64
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 */
69
70 /* Miscellaneous configurable options */
71 #define CONFIG_HWCONFIG
72
73 /* Memory configuration */
74
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
80
81 /*
82  * MTD Command for mtdparts
83  */
84
85 /* Persistent Environment Config */
86
87 /* Environment */
88 #define CONFIG_IPADDR             192.168.1.1
89 #define CONFIG_SERVERIP           192.168.1.146
90
91 #define CONFIG_EXTRA_ENV_SETTINGS_COMMON \
92         "splashpos=m,m\0" \
93         "splashimage=" __stringify(CONFIG_SYS_LOAD_ADDR) "\0" \
94         "usb_pgood_delay=2000\0" \
95         "console=ttymxc1\0" \
96         "bootdevs=usb mmc sata flash\0" \
97         "hwconfig=_UNKNOWN_\0" \
98         "video=\0" \
99         \
100         "mtdparts=" CONFIG_MTDPARTS_DEFAULT "\0" \
101         "mtdids=" CONFIG_MTDIDS_DEFAULT "\0" \
102         "disk=0\0" \
103         "part=1\0" \
104         \
105         "fdt_high=0xffffffff\0" \
106         "fdt_addr=0x18000000\0" \
107         "initrd_high=0xffffffff\0" \
108         "fixfdt=" \
109                 "fdt addr ${fdt_addr}\0" \
110         "bootdir=boot\0" \
111         "loadfdt=" \
112                 "if ${fsload} ${fdt_addr} ${bootdir}/${fdt_file}; then " \
113                         "echo Loaded DTB from ${bootdir}/${fdt_file}; " \
114                         "run fixfdt; " \
115                 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file1}; then " \
116                         "echo Loaded DTB from ${bootdir}/${fdt_file1}; " \
117                         "run fixfdt; " \
118                 "elif ${fsload} ${fdt_addr} ${bootdir}/${fdt_file2}; then " \
119                         "echo Loaded DTB from ${bootdir}/${fdt_file2}; " \
120                         "run fixfdt; " \
121                 "fi\0" \
122         \
123         "fs=ext4\0" \
124         "script=6x_bootscript-ventana\0" \
125         "loadscript=" \
126                 "if ${fsload} ${loadaddr} ${bootdir}/${script}; then " \
127                         "source ${loadaddr}; " \
128                 "fi\0" \
129         \
130         "uimage=uImage\0" \
131         "mmc_root=mmcblk0p1\0" \
132         "mmc_boot=" \
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}; " \
142                         "else " \
143                                 "bootm; " \
144                         "fi; " \
145                 "fi\0" \
146         \
147         "sata_boot=" \
148                 "setenv fsload \"${fs}load sata ${disk}:${part}\"; " \
149                 "sata init && " \
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}; " \
157                         "else " \
158                                 "bootm; " \
159                         "fi; " \
160                 "fi\0" \
161         "usb_boot=" \
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}; " \
171                         "else " \
172                                 "bootm; " \
173                         "fi; " \
174                 "fi\0"
175
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" \
181         \
182         "spi_koffset=0x90000\0" \
183         "spi_klen=0x200000\0" \
184         \
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} && " \
193                 "sf probe && " \
194                 "sf update ${loadaddr} ${spi_koffset} ${filesize}\0" \
195         \
196         "flash_boot=" \
197                 "if sf probe && " \
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}; " \
203                         "bootm; " \
204                 "fi\0"
205 #else
206         #define CONFIG_EXTRA_ENV_SETTINGS \
207         CONFIG_EXTRA_ENV_SETTINGS_COMMON \
208         \
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" \
214         \
215         "flash_boot=" \
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; " \
222                         "setenv bootdir; " \
223                 "elif ubi check rootfs; then " \
224                         "ubifsmount ubi0:rootfs; " \
225                         "setenv root ubi0:rootfs ubi.mtd=2 " \
226                                 "rootfstype=ubifs; " \
227                 "fi; " \
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 " \
233                                 "ubifsumount; " \
234                                 "bootm ${loadaddr} - ${fdt_addr}; " \
235                         "else " \
236                                 "ubifsumount; bootm; " \
237                         "fi; " \
238                 "fi\0"
239 #endif
240
241 #endif                         /* __CONFIG_H */