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