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