Tom Rini | 10e4779 | 2018-05-06 17:58:06 -0400 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0+ |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 2 | /* |
| 3 | * Copyright (C) 2013 Gateworks Corporation |
| 4 | * |
| 5 | * Author: Tim Harvey <tharvey@gateworks.com> |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 6 | */ |
| 7 | |
Simon Glass | 1e26864 | 2020-05-10 11:39:55 -0600 | [diff] [blame] | 8 | #include <common.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 9 | #include <log.h> |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 10 | #include <asm/arch/clock.h> |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 11 | #include <asm/arch/mx6-pins.h> |
| 12 | #include <asm/arch/sys_proto.h> |
| 13 | #include <asm/gpio.h> |
Stefano Babic | 33731bc | 2017-06-29 10:16:06 +0200 | [diff] [blame] | 14 | #include <asm/mach-imx/mxc_i2c.h> |
Simon Glass | 0af6e2d | 2019-08-01 09:46:52 -0600 | [diff] [blame] | 15 | #include <env.h> |
Yangbo Lu | 7334038 | 2019-06-21 11:42:28 +0800 | [diff] [blame] | 16 | #include <fsl_esdhc_imx.h> |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 17 | #include <hwconfig.h> |
Simon Glass | dbd7954 | 2020-05-10 11:40:11 -0600 | [diff] [blame] | 18 | #include <linux/delay.h> |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 19 | #include <power/pmic.h> |
| 20 | #include <power/ltc3676_pmic.h> |
| 21 | #include <power/pfuze100_pmic.h> |
| 22 | |
| 23 | #include "common.h" |
| 24 | |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 25 | /* UART2: Serial Console */ |
| 26 | static iomux_v3_cfg_t const uart2_pads[] = { |
| 27 | IOMUX_PADS(PAD_SD4_DAT7__UART2_TX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)), |
| 28 | IOMUX_PADS(PAD_SD4_DAT4__UART2_RX_DATA | MUX_PAD_CTRL(UART_PAD_CTRL)), |
| 29 | }; |
| 30 | |
| 31 | void setup_iomux_uart(void) |
| 32 | { |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 33 | SETUP_IOMUX_PADS(uart2_pads); |
| 34 | } |
| 35 | |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 36 | /* MMC */ |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 37 | static iomux_v3_cfg_t const gw5904_emmc_pads[] = { |
| 38 | IOMUX_PADS(PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 39 | IOMUX_PADS(PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 40 | IOMUX_PADS(PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 41 | IOMUX_PADS(PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 42 | IOMUX_PADS(PAD_SD3_DAT4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 43 | IOMUX_PADS(PAD_SD3_DAT5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 44 | IOMUX_PADS(PAD_SD3_DAT6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 45 | IOMUX_PADS(PAD_SD3_DAT7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 46 | IOMUX_PADS(PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 47 | IOMUX_PADS(PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 48 | IOMUX_PADS(PAD_SD3_RST__SD3_RESET | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 49 | }; |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 50 | /* 4-bit microSD on SD2 */ |
| 51 | static iomux_v3_cfg_t const gw5904_mmc_pads[] = { |
| 52 | IOMUX_PADS(PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 53 | IOMUX_PADS(PAD_SD2_CMD__SD2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 54 | IOMUX_PADS(PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 55 | IOMUX_PADS(PAD_SD2_DAT1__SD2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 56 | IOMUX_PADS(PAD_SD2_DAT2__SD2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 57 | IOMUX_PADS(PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 58 | /* CD */ |
| 59 | IOMUX_PADS(PAD_NANDF_CS0__GPIO6_IO11 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 60 | }; |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 61 | /* 8-bit eMMC on SD2/NAND */ |
| 62 | static iomux_v3_cfg_t const gw560x_emmc_sd2_pads[] = { |
| 63 | IOMUX_PADS(PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 64 | IOMUX_PADS(PAD_SD2_CMD__SD2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 65 | IOMUX_PADS(PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 66 | IOMUX_PADS(PAD_SD2_DAT1__SD2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 67 | IOMUX_PADS(PAD_SD2_DAT2__SD2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 68 | IOMUX_PADS(PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 69 | IOMUX_PADS(PAD_NANDF_D4__SD2_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 70 | IOMUX_PADS(PAD_NANDF_D5__SD2_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 71 | IOMUX_PADS(PAD_NANDF_D6__SD2_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 72 | IOMUX_PADS(PAD_NANDF_D7__SD2_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 73 | }; |
| 74 | |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 75 | static iomux_v3_cfg_t const usdhc3_pads[] = { |
| 76 | IOMUX_PADS(PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 77 | IOMUX_PADS(PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 78 | IOMUX_PADS(PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 79 | IOMUX_PADS(PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 80 | IOMUX_PADS(PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 81 | IOMUX_PADS(PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 82 | IOMUX_PADS(PAD_SD3_DAT5__GPIO7_IO00 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 83 | }; |
| 84 | |
Tim Harvey | d04dc81 | 2019-02-04 13:10:49 -0800 | [diff] [blame] | 85 | /* |
| 86 | * I2C pad configs: |
| 87 | * I2C1: GSC |
| 88 | * I2C2: PMIC,PCIe Switch,Clock,Mezz |
| 89 | * I2C3: Multimedia/Expansion |
| 90 | */ |
| 91 | static struct i2c_pads_info mx6q_i2c_pad_info[] = { |
| 92 | { |
| 93 | .scl = { |
| 94 | .i2c_mode = MX6Q_PAD_EIM_D21__I2C1_SCL | PC, |
| 95 | .gpio_mode = MX6Q_PAD_EIM_D21__GPIO3_IO21 | PC, |
| 96 | .gp = IMX_GPIO_NR(3, 21) |
| 97 | }, |
| 98 | .sda = { |
| 99 | .i2c_mode = MX6Q_PAD_EIM_D28__I2C1_SDA | PC, |
| 100 | .gpio_mode = MX6Q_PAD_EIM_D28__GPIO3_IO28 | PC, |
| 101 | .gp = IMX_GPIO_NR(3, 28) |
| 102 | } |
| 103 | }, { |
| 104 | .scl = { |
| 105 | .i2c_mode = MX6Q_PAD_KEY_COL3__I2C2_SCL | PC, |
| 106 | .gpio_mode = MX6Q_PAD_KEY_COL3__GPIO4_IO12 | PC, |
| 107 | .gp = IMX_GPIO_NR(4, 12) |
| 108 | }, |
| 109 | .sda = { |
| 110 | .i2c_mode = MX6Q_PAD_KEY_ROW3__I2C2_SDA | PC, |
| 111 | .gpio_mode = MX6Q_PAD_KEY_ROW3__GPIO4_IO13 | PC, |
| 112 | .gp = IMX_GPIO_NR(4, 13) |
| 113 | } |
| 114 | }, { |
| 115 | .scl = { |
| 116 | .i2c_mode = MX6Q_PAD_GPIO_3__I2C3_SCL | PC, |
| 117 | .gpio_mode = MX6Q_PAD_GPIO_3__GPIO1_IO03 | PC, |
| 118 | .gp = IMX_GPIO_NR(1, 3) |
| 119 | }, |
| 120 | .sda = { |
| 121 | .i2c_mode = MX6Q_PAD_GPIO_6__I2C3_SDA | PC, |
| 122 | .gpio_mode = MX6Q_PAD_GPIO_6__GPIO1_IO06 | PC, |
| 123 | .gp = IMX_GPIO_NR(1, 6) |
| 124 | } |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 125 | } |
| 126 | }; |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 127 | |
Tim Harvey | d04dc81 | 2019-02-04 13:10:49 -0800 | [diff] [blame] | 128 | static struct i2c_pads_info mx6dl_i2c_pad_info[] = { |
| 129 | { |
| 130 | .scl = { |
| 131 | .i2c_mode = MX6DL_PAD_EIM_D21__I2C1_SCL | PC, |
| 132 | .gpio_mode = MX6DL_PAD_EIM_D21__GPIO3_IO21 | PC, |
| 133 | .gp = IMX_GPIO_NR(3, 21) |
| 134 | }, |
| 135 | .sda = { |
| 136 | .i2c_mode = MX6DL_PAD_EIM_D28__I2C1_SDA | PC, |
| 137 | .gpio_mode = MX6DL_PAD_EIM_D28__GPIO3_IO28 | PC, |
| 138 | .gp = IMX_GPIO_NR(3, 28) |
| 139 | } |
| 140 | }, { |
| 141 | .scl = { |
| 142 | .i2c_mode = MX6DL_PAD_KEY_COL3__I2C2_SCL | PC, |
| 143 | .gpio_mode = MX6DL_PAD_KEY_COL3__GPIO4_IO12 | PC, |
| 144 | .gp = IMX_GPIO_NR(4, 12) |
| 145 | }, |
| 146 | .sda = { |
| 147 | .i2c_mode = MX6DL_PAD_KEY_ROW3__I2C2_SDA | PC, |
| 148 | .gpio_mode = MX6DL_PAD_KEY_ROW3__GPIO4_IO13 | PC, |
| 149 | .gp = IMX_GPIO_NR(4, 13) |
| 150 | } |
| 151 | }, { |
| 152 | .scl = { |
| 153 | .i2c_mode = MX6DL_PAD_GPIO_3__I2C3_SCL | PC, |
| 154 | .gpio_mode = MX6DL_PAD_GPIO_3__GPIO1_IO03 | PC, |
| 155 | .gp = IMX_GPIO_NR(1, 3) |
| 156 | }, |
| 157 | .sda = { |
| 158 | .i2c_mode = MX6DL_PAD_GPIO_6__I2C3_SDA | PC, |
| 159 | .gpio_mode = MX6DL_PAD_GPIO_6__GPIO1_IO06 | PC, |
| 160 | .gp = IMX_GPIO_NR(1, 6) |
| 161 | } |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 162 | } |
| 163 | }; |
| 164 | |
Tim Harvey | d04dc81 | 2019-02-04 13:10:49 -0800 | [diff] [blame] | 165 | void setup_ventana_i2c(int i2c) |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 166 | { |
Tim Harvey | d04dc81 | 2019-02-04 13:10:49 -0800 | [diff] [blame] | 167 | struct i2c_pads_info *p; |
| 168 | |
| 169 | if (is_cpu_type(MXC_CPU_MX6Q)) |
| 170 | p = &mx6q_i2c_pad_info[i2c]; |
| 171 | else |
| 172 | p = &mx6dl_i2c_pad_info[i2c]; |
| 173 | |
| 174 | setup_i2c(i2c, CONFIG_SYS_I2C_SPEED, 0x7f, p); |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 175 | } |
| 176 | |
| 177 | /* |
| 178 | * Baseboard specific GPIO |
| 179 | */ |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 180 | static iomux_v3_cfg_t const gw51xx_gpio_pads[] = { |
| 181 | /* PANLEDG# */ |
| 182 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 183 | /* PANLEDR# */ |
| 184 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
| 185 | /* IOEXP_PWREN# */ |
| 186 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 187 | /* IOEXP_IRQ# */ |
| 188 | IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)), |
| 189 | |
| 190 | /* GPS_SHDN */ |
| 191 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
| 192 | /* VID_PWR */ |
| 193 | IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG), |
| 194 | /* PCI_RST# */ |
| 195 | IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG), |
| 196 | /* PCIESKT_WDIS# */ |
| 197 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 198 | }; |
| 199 | |
| 200 | static iomux_v3_cfg_t const gw52xx_gpio_pads[] = { |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 201 | /* SD3_VSELECT */ |
| 202 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 203 | /* RS232_EN# */ |
| 204 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 205 | /* MSATA_EN */ |
| 206 | IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 207 | /* PANLEDG# */ |
| 208 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 209 | /* PANLEDR# */ |
| 210 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
| 211 | /* IOEXP_PWREN# */ |
| 212 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 213 | /* IOEXP_IRQ# */ |
| 214 | IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 215 | /* CAN_STBY */ |
| 216 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 217 | /* MX6_LOCLED# */ |
| 218 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
| 219 | /* GPS_SHDN */ |
| 220 | IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | DIO_PAD_CFG), |
| 221 | /* USBOTG_SEL */ |
| 222 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
| 223 | /* VID_PWR */ |
| 224 | IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG), |
| 225 | /* PCI_RST# */ |
| 226 | IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG), |
| 227 | /* PCI_RST# (GW522x) */ |
| 228 | IOMUX_PADS(PAD_EIM_D23__GPIO3_IO23 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 229 | /* RS485_EN */ |
| 230 | IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 231 | /* PCIESKT_WDIS# */ |
| 232 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 233 | }; |
| 234 | |
| 235 | static iomux_v3_cfg_t const gw53xx_gpio_pads[] = { |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 236 | /* SD3_VSELECT */ |
| 237 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 238 | /* RS232_EN# */ |
| 239 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 240 | /* MSATA_EN */ |
| 241 | IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 242 | /* CAN_STBY */ |
| 243 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
| 244 | /* USB_HUBRST# */ |
| 245 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 246 | /* PANLEDG# */ |
| 247 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 248 | /* PANLEDR# */ |
| 249 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
| 250 | /* MX6_LOCLED# */ |
| 251 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
| 252 | /* IOEXP_PWREN# */ |
| 253 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 254 | /* IOEXP_IRQ# */ |
| 255 | IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)), |
| 256 | /* DIOI2C_DIS# */ |
| 257 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
| 258 | /* GPS_SHDN */ |
| 259 | IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | DIO_PAD_CFG), |
| 260 | /* VID_EN */ |
| 261 | IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG), |
| 262 | /* PCI_RST# */ |
| 263 | IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 264 | /* RS485_EN */ |
| 265 | IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 266 | /* PCIESKT_WDIS# */ |
| 267 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 268 | }; |
| 269 | |
| 270 | static iomux_v3_cfg_t const gw54xx_gpio_pads[] = { |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 271 | /* SD3_VSELECT */ |
| 272 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 273 | /* RS232_EN# */ |
| 274 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 275 | /* MSATA_EN */ |
| 276 | IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 277 | /* CAN_STBY */ |
| 278 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 279 | /* PANLEDG# */ |
| 280 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 281 | /* PANLEDR# */ |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 282 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 283 | /* MX6_LOCLED# */ |
| 284 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 285 | /* USB_HUBRST# */ |
| 286 | IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 287 | /* MIPI_DIO */ |
| 288 | IOMUX_PADS(PAD_SD1_DAT3__GPIO1_IO21 | DIO_PAD_CFG), |
| 289 | /* RS485_EN */ |
| 290 | IOMUX_PADS(PAD_EIM_D24__GPIO3_IO24 | DIO_PAD_CFG), |
| 291 | /* IOEXP_PWREN# */ |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 292 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 293 | /* IOEXP_IRQ# */ |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 294 | IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 295 | /* DIOI2C_DIS# */ |
| 296 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
| 297 | /* PCI_RST# */ |
| 298 | IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG), |
| 299 | /* VID_EN */ |
| 300 | IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 301 | /* RS485_EN */ |
| 302 | IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 303 | /* PCIESKT_WDIS# */ |
| 304 | IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG), |
| 305 | }; |
| 306 | |
| 307 | static iomux_v3_cfg_t const gw551x_gpio_pads[] = { |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 308 | /* CAN_STBY */ |
| 309 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 310 | /* PANLED# */ |
| 311 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
| 312 | /* PCI_RST# */ |
| 313 | IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG), |
| 314 | /* PCIESKT_WDIS# */ |
| 315 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 316 | }; |
| 317 | |
| 318 | static iomux_v3_cfg_t const gw552x_gpio_pads[] = { |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 319 | /* MSATA_EN */ |
| 320 | IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 321 | /* USBOTG_SEL */ |
| 322 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
| 323 | /* USB_HUBRST# */ |
| 324 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 325 | /* PANLEDG# */ |
| 326 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 327 | /* PANLEDR# */ |
| 328 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
| 329 | /* MX6_LOCLED# */ |
| 330 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
| 331 | /* PCI_RST# */ |
| 332 | IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG), |
| 333 | /* MX6_DIO[4:9] */ |
| 334 | IOMUX_PADS(PAD_CSI0_PIXCLK__GPIO5_IO18 | DIO_PAD_CFG), |
| 335 | IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG), |
| 336 | IOMUX_PADS(PAD_CSI0_VSYNC__GPIO5_IO21 | DIO_PAD_CFG), |
| 337 | IOMUX_PADS(PAD_CSI0_DAT4__GPIO5_IO22 | DIO_PAD_CFG), |
| 338 | IOMUX_PADS(PAD_CSI0_DAT5__GPIO5_IO23 | DIO_PAD_CFG), |
| 339 | IOMUX_PADS(PAD_CSI0_DAT7__GPIO5_IO25 | DIO_PAD_CFG), |
| 340 | /* PCIEGBE1_OFF# */ |
| 341 | IOMUX_PADS(PAD_GPIO_1__GPIO1_IO01 | DIO_PAD_CFG), |
| 342 | /* PCIEGBE2_OFF# */ |
| 343 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
| 344 | /* PCIESKT_WDIS# */ |
| 345 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 346 | }; |
| 347 | |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 348 | static iomux_v3_cfg_t const gw553x_gpio_pads[] = { |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 349 | /* SD3_VSELECT */ |
| 350 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 351 | /* PANLEDG# */ |
| 352 | IOMUX_PADS(PAD_KEY_COL2__GPIO4_IO10 | DIO_PAD_CFG), |
| 353 | /* PANLEDR# */ |
| 354 | IOMUX_PADS(PAD_KEY_ROW2__GPIO4_IO11 | DIO_PAD_CFG), |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 355 | /* VID_PWR */ |
| 356 | IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG), |
| 357 | /* PCI_RST# */ |
| 358 | IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG), |
| 359 | /* PCIESKT_WDIS# */ |
| 360 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 361 | }; |
| 362 | |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 363 | static iomux_v3_cfg_t const gw560x_gpio_pads[] = { |
| 364 | /* RS232_EN# */ |
| 365 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
| 366 | /* CAN_STBY */ |
| 367 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
| 368 | /* USB_HUBRST# */ |
| 369 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
| 370 | /* PANLEDG# */ |
| 371 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 372 | /* PANLEDR# */ |
| 373 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
| 374 | /* MX6_LOCLED# */ |
| 375 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
| 376 | /* IOEXP_PWREN# */ |
| 377 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 378 | /* IOEXP_IRQ# */ |
| 379 | IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)), |
| 380 | /* DIOI2C_DIS# */ |
| 381 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
| 382 | /* VID_EN */ |
| 383 | IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG), |
| 384 | /* PCI_RST# */ |
| 385 | IOMUX_PADS(PAD_DISP0_DAT10__GPIO4_IO31 | DIO_PAD_CFG), |
| 386 | /* RS485_EN */ |
| 387 | IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG), |
| 388 | /* PCIESKT_WDIS# */ |
| 389 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 390 | /* USBH2_PEN (OTG) */ |
| 391 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
| 392 | /* 12V0_PWR_EN */ |
| 393 | IOMUX_PADS(PAD_DISP0_DAT5__GPIO4_IO26 | DIO_PAD_CFG), |
| 394 | }; |
| 395 | |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 396 | static iomux_v3_cfg_t const gw5901_gpio_pads[] = { |
| 397 | /* MX6_LOCLED# */ |
| 398 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
| 399 | /* ETH1_EN */ |
| 400 | IOMUX_PADS(PAD_GPIO_1__GPIO1_IO01 | DIO_PAD_CFG), |
| 401 | /* CAN_STBY */ |
| 402 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
| 403 | /* PCI_RST# */ |
| 404 | IOMUX_PADS(PAD_ENET_TXD1__GPIO1_IO29 | DIO_PAD_CFG), |
| 405 | /* PMIC reset */ |
| 406 | IOMUX_PADS(PAD_DISP0_DAT8__WDOG1_B | DIO_PAD_CFG), |
| 407 | /* COM_CFGA/B/C/D */ |
| 408 | IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14 | DIO_PAD_CFG), |
| 409 | IOMUX_PADS(PAD_DISP0_DAT21__GPIO5_IO15 | DIO_PAD_CFG), |
| 410 | IOMUX_PADS(PAD_DISP0_DAT22__GPIO5_IO16 | DIO_PAD_CFG), |
| 411 | IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG), |
| 412 | /* ETI_IRQ# */ |
| 413 | IOMUX_PADS(PAD_GPIO_5__GPIO1_IO05 | DIO_PAD_CFG), |
| 414 | /* DIO_IRQ# */ |
| 415 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
| 416 | /* FIBER_SIGDET */ |
| 417 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
| 418 | }; |
| 419 | |
| 420 | static iomux_v3_cfg_t const gw5902_gpio_pads[] = { |
| 421 | /* MX6_LOCLED# */ |
| 422 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
| 423 | /* CAN1_STBY */ |
| 424 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
| 425 | /* CAN2_STBY */ |
| 426 | IOMUX_PADS(PAD_SD3_CLK__GPIO7_IO03 | DIO_PAD_CFG), |
| 427 | /* UART1_EN# */ |
| 428 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
| 429 | /* PCI_RST# */ |
| 430 | IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG), |
| 431 | /* 5V_UVLO */ |
| 432 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 433 | /* ETI_IRQ# */ |
| 434 | IOMUX_PADS(PAD_GPIO_5__GPIO1_IO05 | DIO_PAD_CFG), |
| 435 | /* DIO_IRQ# */ |
| 436 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
| 437 | /* USBOTG_PEN */ |
| 438 | IOMUX_PADS(PAD_EIM_D23__GPIO3_IO23 | DIO_PAD_CFG), |
| 439 | }; |
| 440 | |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 441 | static iomux_v3_cfg_t const gw5903_gpio_pads[] = { |
| 442 | /* BKLT_12VEN */ |
| 443 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
| 444 | /* EMMY_PDN# */ |
| 445 | IOMUX_PADS(PAD_NANDF_D2__GPIO2_IO02 | DIO_PAD_CFG), |
| 446 | /* EMMY_CFG1# */ |
| 447 | IOMUX_PADS(PAD_NANDF_D3__GPIO2_IO03 | DIO_PAD_CFG), |
| 448 | /* EMMY_CFG1# */ |
| 449 | IOMUX_PADS(PAD_NANDF_D4__GPIO2_IO04 | DIO_PAD_CFG), |
| 450 | /* USBH1_PEN (EHCI) */ |
| 451 | IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG), |
| 452 | /* USBH2_PEN (OTG) */ |
| 453 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
| 454 | /* USBDPC_PEN */ |
| 455 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
| 456 | /* TOUCH_RST */ |
| 457 | IOMUX_PADS(PAD_KEY_COL1__GPIO4_IO08 | DIO_PAD_CFG), |
| 458 | /* AUDIO_RST# */ |
| 459 | IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG), |
| 460 | /* UART1_TEN# */ |
| 461 | IOMUX_PADS(PAD_CSI0_DAT12__GPIO5_IO30 | DIO_PAD_CFG), |
| 462 | /* MX6_LOCLED# */ |
| 463 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
| 464 | /* LVDS_BKLEN # */ |
| 465 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 466 | /* RGMII_PDWN# */ |
| 467 | IOMUX_PADS(PAD_ENET_CRS_DV__GPIO1_IO25 | DIO_PAD_CFG), |
| 468 | /* TOUCH_IRQ# */ |
| 469 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 470 | /* TOUCH_RST# */ |
| 471 | IOMUX_PADS(PAD_KEY_COL1__GPIO4_IO08 | DIO_PAD_CFG), |
| 472 | }; |
| 473 | |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 474 | static iomux_v3_cfg_t const gw5904_gpio_pads[] = { |
| 475 | /* USB_HUBRST# */ |
| 476 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
| 477 | /* PANLEDG# */ |
| 478 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 479 | /* PANLEDR# */ |
| 480 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
| 481 | /* MX6_LOCLED# */ |
| 482 | IOMUX_PADS(PAD_KEY_ROW4__GPIO4_IO15 | DIO_PAD_CFG), |
| 483 | /* IOEXP_PWREN# */ |
| 484 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 485 | /* IOEXP_IRQ# */ |
| 486 | IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)), |
| 487 | /* DIOI2C_DIS# */ |
| 488 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
| 489 | /* UART_RS485 */ |
| 490 | IOMUX_PADS(PAD_DISP0_DAT2__GPIO4_IO23 | DIO_PAD_CFG), |
| 491 | /* UART_HALF */ |
| 492 | IOMUX_PADS(PAD_DISP0_DAT3__GPIO4_IO24 | DIO_PAD_CFG), |
| 493 | /* SKT1_WDIS# */ |
| 494 | IOMUX_PADS(PAD_DISP0_DAT17__GPIO5_IO11 | DIO_PAD_CFG), |
| 495 | /* SKT1_RST# */ |
| 496 | IOMUX_PADS(PAD_DISP0_DAT18__GPIO5_IO12 | DIO_PAD_CFG), |
| 497 | /* SKT2_WDIS# */ |
| 498 | IOMUX_PADS(PAD_DISP0_DAT19__GPIO5_IO13 | DIO_PAD_CFG), |
| 499 | /* SKT2_RST# */ |
| 500 | IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG), |
| 501 | /* M2_OFF# */ |
| 502 | IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | DIO_PAD_CFG), |
| 503 | /* M2_WDIS# */ |
| 504 | IOMUX_PADS(PAD_SD2_DAT1__GPIO1_IO14 | DIO_PAD_CFG), |
| 505 | /* M2_RST# */ |
| 506 | IOMUX_PADS(PAD_SD2_DAT2__GPIO1_IO13 | DIO_PAD_CFG), |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 507 | /* RS232_EN# */ |
| 508 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 509 | }; |
| 510 | |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 511 | static iomux_v3_cfg_t const gw5905_gpio_pads[] = { |
| 512 | /* EMMY_PDN# */ |
| 513 | IOMUX_PADS(PAD_NANDF_D3__GPIO2_IO03 | DIO_PAD_CFG), |
| 514 | /* MX6_LOCLED# */ |
| 515 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
| 516 | /* MIPI_RST */ |
| 517 | IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | DIO_PAD_CFG), |
| 518 | /* MIPI_PWDN */ |
| 519 | IOMUX_PADS(PAD_SD2_DAT1__GPIO1_IO14 | DIO_PAD_CFG), |
| 520 | /* USBEHCI_SEL */ |
| 521 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
| 522 | /* PCI_RST# */ |
| 523 | IOMUX_PADS(PAD_GPIO_16__GPIO7_IO11 | DIO_PAD_CFG), |
| 524 | /* LVDS_BKLEN # */ |
| 525 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 526 | /* PCIESKT_WDIS# */ |
| 527 | IOMUX_PADS(PAD_GPIO_18__GPIO7_IO13 | DIO_PAD_CFG), |
| 528 | /* SPK_SHDN# */ |
| 529 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
| 530 | /* LOCLED# */ |
| 531 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
| 532 | /* FLASH LED1 */ |
| 533 | IOMUX_PADS(PAD_DISP0_DAT11__GPIO5_IO05 | DIO_PAD_CFG), |
| 534 | /* FLASH LED2 */ |
| 535 | IOMUX_PADS(PAD_DISP0_DAT12__GPIO5_IO06 | DIO_PAD_CFG), |
| 536 | /* DECT_RST# */ |
| 537 | IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14 | DIO_PAD_CFG), |
| 538 | /* USBH1_PEN (EHCI) */ |
| 539 | IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG), |
| 540 | /* LVDS_PWM */ |
| 541 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
| 542 | /* CODEC_RST */ |
| 543 | IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG), |
| 544 | /* GYRO_CONTROL/DATA_EN */ |
| 545 | IOMUX_PADS(PAD_CSI0_DAT8__GPIO5_IO26 | DIO_PAD_CFG), |
| 546 | /* TOUCH_RST */ |
| 547 | IOMUX_PADS(PAD_KEY_COL1__GPIO4_IO08 | DIO_PAD_CFG), |
| 548 | /* TOUCH_IRQ */ |
| 549 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 550 | }; |
| 551 | |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 552 | /* Digital I/O */ |
| 553 | struct dio_cfg gw51xx_dio[] = { |
| 554 | { |
| 555 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 556 | IMX_GPIO_NR(1, 16), |
| 557 | { 0, 0 }, |
| 558 | 0 |
| 559 | }, |
| 560 | { |
| 561 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 562 | IMX_GPIO_NR(1, 19), |
| 563 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 564 | 2 |
| 565 | }, |
| 566 | { |
| 567 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 568 | IMX_GPIO_NR(1, 17), |
| 569 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 570 | 3 |
| 571 | }, |
| 572 | { |
| 573 | { IOMUX_PADS(PAD_SD1_CMD__GPIO1_IO18) }, |
| 574 | IMX_GPIO_NR(1, 18), |
| 575 | { IOMUX_PADS(PAD_SD1_CMD__PWM4_OUT) }, |
| 576 | 4 |
| 577 | }, |
| 578 | }; |
| 579 | |
| 580 | struct dio_cfg gw52xx_dio[] = { |
| 581 | { |
| 582 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 583 | IMX_GPIO_NR(1, 16), |
| 584 | { 0, 0 }, |
| 585 | 0 |
| 586 | }, |
| 587 | { |
| 588 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 589 | IMX_GPIO_NR(1, 19), |
| 590 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 591 | 2 |
| 592 | }, |
| 593 | { |
| 594 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 595 | IMX_GPIO_NR(1, 17), |
| 596 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 597 | 3 |
| 598 | }, |
| 599 | { |
| 600 | { IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 601 | IMX_GPIO_NR(1, 20), |
| 602 | { 0, 0 }, |
| 603 | 0 |
| 604 | }, |
| 605 | }; |
| 606 | |
| 607 | struct dio_cfg gw53xx_dio[] = { |
| 608 | { |
| 609 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 610 | IMX_GPIO_NR(1, 16), |
| 611 | { 0, 0 }, |
| 612 | 0 |
| 613 | }, |
| 614 | { |
| 615 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 616 | IMX_GPIO_NR(1, 19), |
| 617 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 618 | 2 |
| 619 | }, |
| 620 | { |
| 621 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 622 | IMX_GPIO_NR(1, 17), |
| 623 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 624 | 3 |
| 625 | }, |
| 626 | { |
| 627 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 628 | IMX_GPIO_NR(1, 20), |
| 629 | { 0, 0 }, |
| 630 | 0 |
| 631 | }, |
| 632 | }; |
| 633 | |
| 634 | struct dio_cfg gw54xx_dio[] = { |
| 635 | { |
| 636 | { IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09) }, |
| 637 | IMX_GPIO_NR(1, 9), |
| 638 | { IOMUX_PADS(PAD_GPIO_9__PWM1_OUT) }, |
| 639 | 1 |
| 640 | }, |
| 641 | { |
| 642 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 643 | IMX_GPIO_NR(1, 19), |
| 644 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 645 | 2 |
| 646 | }, |
| 647 | { |
| 648 | { IOMUX_PADS(PAD_SD4_DAT1__GPIO2_IO09) }, |
| 649 | IMX_GPIO_NR(2, 9), |
| 650 | { IOMUX_PADS(PAD_SD4_DAT1__PWM3_OUT) }, |
| 651 | 3 |
| 652 | }, |
| 653 | { |
| 654 | { IOMUX_PADS(PAD_SD4_DAT2__GPIO2_IO10) }, |
| 655 | IMX_GPIO_NR(2, 10), |
| 656 | { IOMUX_PADS(PAD_SD4_DAT2__PWM4_OUT) }, |
| 657 | 4 |
| 658 | }, |
| 659 | }; |
| 660 | |
| 661 | struct dio_cfg gw551x_dio[] = { |
| 662 | { |
| 663 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 664 | IMX_GPIO_NR(1, 19), |
| 665 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 666 | 2 |
| 667 | }, |
| 668 | { |
| 669 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 670 | IMX_GPIO_NR(1, 17), |
| 671 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 672 | 3 |
| 673 | }, |
| 674 | }; |
| 675 | |
| 676 | struct dio_cfg gw552x_dio[] = { |
| 677 | { |
| 678 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 679 | IMX_GPIO_NR(1, 16), |
| 680 | { 0, 0 }, |
| 681 | 0 |
| 682 | }, |
| 683 | { |
| 684 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 685 | IMX_GPIO_NR(1, 19), |
| 686 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 687 | 2 |
| 688 | }, |
| 689 | { |
| 690 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 691 | IMX_GPIO_NR(1, 17), |
| 692 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 693 | 3 |
| 694 | }, |
| 695 | { |
| 696 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 697 | IMX_GPIO_NR(1, 20), |
| 698 | { 0, 0 }, |
| 699 | 0 |
| 700 | }, |
Tim Harvey | b1243da | 2016-07-15 07:14:24 -0700 | [diff] [blame] | 701 | { |
| 702 | {IOMUX_PADS(PAD_CSI0_PIXCLK__GPIO5_IO18) }, |
| 703 | IMX_GPIO_NR(5, 18), |
| 704 | { 0, 0 }, |
| 705 | 0 |
| 706 | }, |
| 707 | { |
| 708 | {IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20) }, |
| 709 | IMX_GPIO_NR(5, 20), |
| 710 | { 0, 0 }, |
| 711 | 0 |
| 712 | }, |
| 713 | { |
| 714 | {IOMUX_PADS(PAD_CSI0_VSYNC__GPIO5_IO21) }, |
| 715 | IMX_GPIO_NR(5, 21), |
| 716 | { 0, 0 }, |
| 717 | 0 |
| 718 | }, |
| 719 | { |
| 720 | {IOMUX_PADS(PAD_CSI0_DAT4__GPIO5_IO22) }, |
| 721 | IMX_GPIO_NR(5, 22), |
| 722 | { 0, 0 }, |
| 723 | 0 |
| 724 | }, |
| 725 | { |
| 726 | {IOMUX_PADS(PAD_CSI0_DAT5__GPIO5_IO23) }, |
| 727 | IMX_GPIO_NR(5, 23), |
| 728 | { 0, 0 }, |
| 729 | 0 |
| 730 | }, |
| 731 | { |
| 732 | {IOMUX_PADS(PAD_CSI0_DAT7__GPIO5_IO25) }, |
| 733 | IMX_GPIO_NR(5, 25), |
| 734 | { 0, 0 }, |
| 735 | 0 |
| 736 | }, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 737 | }; |
| 738 | |
| 739 | struct dio_cfg gw553x_dio[] = { |
| 740 | { |
| 741 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 742 | IMX_GPIO_NR(1, 16), |
| 743 | { 0, 0 }, |
| 744 | 0 |
| 745 | }, |
| 746 | { |
| 747 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 748 | IMX_GPIO_NR(1, 19), |
| 749 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 750 | 2 |
| 751 | }, |
| 752 | { |
| 753 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 754 | IMX_GPIO_NR(1, 17), |
| 755 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 756 | 3 |
| 757 | }, |
| 758 | { |
| 759 | { IOMUX_PADS(PAD_SD1_CMD__GPIO1_IO18) }, |
| 760 | IMX_GPIO_NR(1, 18), |
| 761 | { IOMUX_PADS(PAD_SD1_CMD__PWM4_OUT) }, |
| 762 | 4 |
| 763 | }, |
| 764 | }; |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 765 | |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 766 | struct dio_cfg gw560x_dio[] = { |
| 767 | { |
| 768 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 769 | IMX_GPIO_NR(1, 16), |
| 770 | { 0, 0 }, |
| 771 | 0 |
| 772 | }, |
| 773 | { |
| 774 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 775 | IMX_GPIO_NR(1, 19), |
| 776 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 777 | 2 |
| 778 | }, |
| 779 | { |
| 780 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 781 | IMX_GPIO_NR(1, 17), |
| 782 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 783 | 3 |
| 784 | }, |
| 785 | { |
| 786 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 787 | IMX_GPIO_NR(1, 20), |
| 788 | { 0, 0 }, |
| 789 | 0 |
| 790 | }, |
| 791 | }; |
| 792 | |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 793 | struct dio_cfg gw5901_dio[] = { |
| 794 | { |
| 795 | { IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14) }, |
| 796 | IMX_GPIO_NR(5, 14), |
| 797 | { 0, 0 }, |
| 798 | 0 |
| 799 | }, |
| 800 | { |
| 801 | { IOMUX_PADS(PAD_DISP0_DAT21__GPIO5_IO15) }, |
| 802 | IMX_GPIO_NR(5, 15), |
| 803 | { 0, 0 }, |
| 804 | 0 |
| 805 | }, |
| 806 | { |
| 807 | { IOMUX_PADS(PAD_DISP0_DAT22__GPIO5_IO16) }, |
| 808 | IMX_GPIO_NR(5, 16), |
| 809 | { 0, 0 }, |
| 810 | 0 |
| 811 | }, |
| 812 | { |
| 813 | { IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17) }, |
| 814 | IMX_GPIO_NR(5, 17), |
| 815 | { 0, 0 }, |
| 816 | 0 |
| 817 | }, |
| 818 | }; |
| 819 | |
| 820 | struct dio_cfg gw5902_dio[] = { |
| 821 | { |
| 822 | { IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14) }, |
| 823 | IMX_GPIO_NR(5, 14), |
| 824 | { 0, 0 }, |
| 825 | 0 |
| 826 | }, |
| 827 | { |
| 828 | { IOMUX_PADS(PAD_DISP0_DAT21__GPIO5_IO15) }, |
| 829 | IMX_GPIO_NR(5, 15), |
| 830 | { 0, 0 }, |
| 831 | 0 |
| 832 | }, |
| 833 | { |
| 834 | { IOMUX_PADS(PAD_DISP0_DAT22__GPIO5_IO16) }, |
| 835 | IMX_GPIO_NR(5, 16), |
| 836 | { 0, 0 }, |
| 837 | 0 |
| 838 | }, |
| 839 | { |
| 840 | { IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17) }, |
| 841 | IMX_GPIO_NR(5, 17), |
| 842 | { 0, 0 }, |
| 843 | 0 |
| 844 | }, |
| 845 | }; |
| 846 | |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 847 | struct dio_cfg gw5903_dio[] = { |
| 848 | }; |
| 849 | |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 850 | struct dio_cfg gw5904_dio[] = { |
| 851 | { |
| 852 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 853 | IMX_GPIO_NR(1, 16), |
| 854 | { 0, 0 }, |
| 855 | 0 |
| 856 | }, |
| 857 | { |
| 858 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 859 | IMX_GPIO_NR(1, 19), |
| 860 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 861 | 2 |
| 862 | }, |
| 863 | { |
| 864 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 865 | IMX_GPIO_NR(1, 17), |
| 866 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 867 | 3 |
| 868 | }, |
| 869 | { |
| 870 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 871 | IMX_GPIO_NR(1, 20), |
| 872 | { 0, 0 }, |
| 873 | 0 |
| 874 | }, |
| 875 | { |
| 876 | {IOMUX_PADS(PAD_NANDF_D0__GPIO2_IO00) }, |
| 877 | IMX_GPIO_NR(2, 0), |
| 878 | { 0, 0 }, |
| 879 | 0 |
| 880 | }, |
| 881 | { |
| 882 | {IOMUX_PADS(PAD_NANDF_D1__GPIO2_IO01) }, |
| 883 | IMX_GPIO_NR(2, 1), |
| 884 | { 0, 0 }, |
| 885 | 0 |
| 886 | }, |
| 887 | { |
| 888 | {IOMUX_PADS(PAD_NANDF_D2__GPIO2_IO02) }, |
| 889 | IMX_GPIO_NR(2, 2), |
| 890 | { 0, 0 }, |
| 891 | 0 |
| 892 | }, |
| 893 | { |
| 894 | {IOMUX_PADS(PAD_NANDF_D3__GPIO2_IO03) }, |
| 895 | IMX_GPIO_NR(2, 3), |
| 896 | { 0, 0 }, |
| 897 | 0 |
| 898 | }, |
| 899 | { |
| 900 | {IOMUX_PADS(PAD_NANDF_D4__GPIO2_IO04) }, |
| 901 | IMX_GPIO_NR(2, 4), |
| 902 | { 0, 0 }, |
| 903 | 0 |
| 904 | }, |
| 905 | { |
| 906 | {IOMUX_PADS(PAD_NANDF_D5__GPIO2_IO05) }, |
| 907 | IMX_GPIO_NR(2, 5), |
| 908 | { 0, 0 }, |
| 909 | 0 |
| 910 | }, |
| 911 | { |
| 912 | {IOMUX_PADS(PAD_NANDF_D6__GPIO2_IO06) }, |
| 913 | IMX_GPIO_NR(2, 6), |
| 914 | { 0, 0 }, |
| 915 | 0 |
| 916 | }, |
| 917 | { |
| 918 | {IOMUX_PADS(PAD_NANDF_D7__GPIO2_IO07) }, |
| 919 | IMX_GPIO_NR(2, 7), |
| 920 | { 0, 0 }, |
| 921 | 0 |
| 922 | }, |
| 923 | }; |
| 924 | |
Tim Harvey | b7c48a9 | 2019-02-04 13:10:54 -0800 | [diff] [blame] | 925 | struct dio_cfg gw5906_dio[] = { |
| 926 | { |
| 927 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 928 | IMX_GPIO_NR(1, 16), |
| 929 | { 0, 0 }, |
| 930 | 0 |
| 931 | }, |
| 932 | { |
| 933 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 934 | IMX_GPIO_NR(1, 19), |
| 935 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 936 | 2 |
| 937 | }, |
| 938 | { |
| 939 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 940 | IMX_GPIO_NR(1, 17), |
| 941 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 942 | 3 |
| 943 | }, |
| 944 | { |
| 945 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 946 | IMX_GPIO_NR(1, 20), |
| 947 | { 0, 0 }, |
| 948 | 0 |
| 949 | }, |
| 950 | }; |
| 951 | |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 952 | /* |
| 953 | * Board Specific GPIO |
| 954 | */ |
| 955 | struct ventana gpio_cfg[GW_UNKNOWN] = { |
| 956 | /* GW5400proto */ |
| 957 | { |
| 958 | .gpio_pads = gw54xx_gpio_pads, |
| 959 | .num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 960 | .dio_cfg = gw54xx_dio, |
| 961 | .dio_num = ARRAY_SIZE(gw54xx_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 962 | .leds = { |
| 963 | IMX_GPIO_NR(4, 6), |
| 964 | IMX_GPIO_NR(4, 10), |
| 965 | IMX_GPIO_NR(4, 15), |
| 966 | }, |
| 967 | .pcie_rst = IMX_GPIO_NR(1, 29), |
| 968 | .mezz_pwren = IMX_GPIO_NR(4, 7), |
| 969 | .mezz_irq = IMX_GPIO_NR(4, 9), |
| 970 | .rs485en = IMX_GPIO_NR(3, 24), |
| 971 | .dioi2c_en = IMX_GPIO_NR(4, 5), |
| 972 | .pcie_sson = IMX_GPIO_NR(1, 20), |
Tim Harvey | 9b9e75f | 2017-03-13 08:51:07 -0700 | [diff] [blame] | 973 | .otgpwr_en = IMX_GPIO_NR(3, 22), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 974 | .mmc_cd = IMX_GPIO_NR(7, 0), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 975 | }, |
| 976 | |
| 977 | /* GW51xx */ |
| 978 | { |
| 979 | .gpio_pads = gw51xx_gpio_pads, |
| 980 | .num_pads = ARRAY_SIZE(gw51xx_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 981 | .dio_cfg = gw51xx_dio, |
| 982 | .dio_num = ARRAY_SIZE(gw51xx_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 983 | .leds = { |
| 984 | IMX_GPIO_NR(4, 6), |
| 985 | IMX_GPIO_NR(4, 10), |
| 986 | }, |
| 987 | .pcie_rst = IMX_GPIO_NR(1, 0), |
| 988 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 989 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 990 | .gps_shdn = IMX_GPIO_NR(1, 2), |
| 991 | .vidin_en = IMX_GPIO_NR(5, 20), |
| 992 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 9b9e75f | 2017-03-13 08:51:07 -0700 | [diff] [blame] | 993 | .otgpwr_en = IMX_GPIO_NR(3, 22), |
Tim Harvey | ba9f234 | 2019-02-04 13:10:52 -0800 | [diff] [blame] | 994 | .nand = true, |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 995 | }, |
| 996 | |
| 997 | /* GW52xx */ |
| 998 | { |
| 999 | .gpio_pads = gw52xx_gpio_pads, |
| 1000 | .num_pads = ARRAY_SIZE(gw52xx_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 1001 | .dio_cfg = gw52xx_dio, |
| 1002 | .dio_num = ARRAY_SIZE(gw52xx_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1003 | .leds = { |
| 1004 | IMX_GPIO_NR(4, 6), |
| 1005 | IMX_GPIO_NR(4, 7), |
| 1006 | IMX_GPIO_NR(4, 15), |
| 1007 | }, |
| 1008 | .pcie_rst = IMX_GPIO_NR(1, 29), |
| 1009 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 1010 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 1011 | .gps_shdn = IMX_GPIO_NR(1, 27), |
| 1012 | .vidin_en = IMX_GPIO_NR(3, 31), |
| 1013 | .usb_sel = IMX_GPIO_NR(1, 2), |
| 1014 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 1015 | .msata_en = GP_MSATA_SEL, |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 1016 | .rs232_en = GP_RS232_EN, |
Tim Harvey | 9b9e75f | 2017-03-13 08:51:07 -0700 | [diff] [blame] | 1017 | .otgpwr_en = IMX_GPIO_NR(3, 22), |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 1018 | .vsel_pin = IMX_GPIO_NR(6, 14), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1019 | .mmc_cd = IMX_GPIO_NR(7, 0), |
Tim Harvey | ba9f234 | 2019-02-04 13:10:52 -0800 | [diff] [blame] | 1020 | .nand = true, |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1021 | }, |
| 1022 | |
| 1023 | /* GW53xx */ |
| 1024 | { |
| 1025 | .gpio_pads = gw53xx_gpio_pads, |
| 1026 | .num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 1027 | .dio_cfg = gw53xx_dio, |
| 1028 | .dio_num = ARRAY_SIZE(gw53xx_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1029 | .leds = { |
| 1030 | IMX_GPIO_NR(4, 6), |
| 1031 | IMX_GPIO_NR(4, 7), |
| 1032 | IMX_GPIO_NR(4, 15), |
| 1033 | }, |
| 1034 | .pcie_rst = IMX_GPIO_NR(1, 29), |
| 1035 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 1036 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 1037 | .gps_shdn = IMX_GPIO_NR(1, 27), |
| 1038 | .vidin_en = IMX_GPIO_NR(3, 31), |
| 1039 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 1040 | .msata_en = GP_MSATA_SEL, |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 1041 | .rs232_en = GP_RS232_EN, |
Tim Harvey | 9b9e75f | 2017-03-13 08:51:07 -0700 | [diff] [blame] | 1042 | .otgpwr_en = IMX_GPIO_NR(3, 22), |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 1043 | .vsel_pin = IMX_GPIO_NR(6, 14), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1044 | .mmc_cd = IMX_GPIO_NR(7, 0), |
Tim Harvey | ba9f234 | 2019-02-04 13:10:52 -0800 | [diff] [blame] | 1045 | .nand = true, |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1046 | }, |
| 1047 | |
| 1048 | /* GW54xx */ |
| 1049 | { |
| 1050 | .gpio_pads = gw54xx_gpio_pads, |
| 1051 | .num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 1052 | .dio_cfg = gw54xx_dio, |
| 1053 | .dio_num = ARRAY_SIZE(gw54xx_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1054 | .leds = { |
| 1055 | IMX_GPIO_NR(4, 6), |
| 1056 | IMX_GPIO_NR(4, 7), |
| 1057 | IMX_GPIO_NR(4, 15), |
| 1058 | }, |
| 1059 | .pcie_rst = IMX_GPIO_NR(1, 29), |
| 1060 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 1061 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 1062 | .rs485en = IMX_GPIO_NR(7, 1), |
| 1063 | .vidin_en = IMX_GPIO_NR(3, 31), |
| 1064 | .dioi2c_en = IMX_GPIO_NR(4, 5), |
| 1065 | .pcie_sson = IMX_GPIO_NR(1, 20), |
| 1066 | .wdis = IMX_GPIO_NR(5, 17), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 1067 | .msata_en = GP_MSATA_SEL, |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 1068 | .rs232_en = GP_RS232_EN, |
Tim Harvey | 9b9e75f | 2017-03-13 08:51:07 -0700 | [diff] [blame] | 1069 | .otgpwr_en = IMX_GPIO_NR(3, 22), |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 1070 | .vsel_pin = IMX_GPIO_NR(6, 14), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1071 | .mmc_cd = IMX_GPIO_NR(7, 0), |
Tim Harvey | ba9f234 | 2019-02-04 13:10:52 -0800 | [diff] [blame] | 1072 | .nand = true, |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1073 | }, |
| 1074 | |
| 1075 | /* GW551x */ |
| 1076 | { |
| 1077 | .gpio_pads = gw551x_gpio_pads, |
| 1078 | .num_pads = ARRAY_SIZE(gw551x_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 1079 | .dio_cfg = gw551x_dio, |
| 1080 | .dio_num = ARRAY_SIZE(gw551x_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1081 | .leds = { |
| 1082 | IMX_GPIO_NR(4, 7), |
| 1083 | }, |
| 1084 | .pcie_rst = IMX_GPIO_NR(1, 0), |
| 1085 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | ba9f234 | 2019-02-04 13:10:52 -0800 | [diff] [blame] | 1086 | .nand = true, |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1087 | }, |
| 1088 | |
| 1089 | /* GW552x */ |
| 1090 | { |
| 1091 | .gpio_pads = gw552x_gpio_pads, |
| 1092 | .num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 1093 | .dio_cfg = gw552x_dio, |
| 1094 | .dio_num = ARRAY_SIZE(gw552x_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1095 | .leds = { |
| 1096 | IMX_GPIO_NR(4, 6), |
| 1097 | IMX_GPIO_NR(4, 7), |
| 1098 | IMX_GPIO_NR(4, 15), |
| 1099 | }, |
| 1100 | .pcie_rst = IMX_GPIO_NR(1, 29), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 1101 | .usb_sel = IMX_GPIO_NR(1, 7), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1102 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 1103 | .msata_en = GP_MSATA_SEL, |
Tim Harvey | ba9f234 | 2019-02-04 13:10:52 -0800 | [diff] [blame] | 1104 | .nand = true, |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1105 | }, |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 1106 | |
| 1107 | /* GW553x */ |
| 1108 | { |
| 1109 | .gpio_pads = gw553x_gpio_pads, |
| 1110 | .num_pads = ARRAY_SIZE(gw553x_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 1111 | .dio_cfg = gw553x_dio, |
| 1112 | .dio_num = ARRAY_SIZE(gw553x_dio), |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 1113 | .leds = { |
| 1114 | IMX_GPIO_NR(4, 10), |
| 1115 | IMX_GPIO_NR(4, 11), |
| 1116 | }, |
| 1117 | .pcie_rst = IMX_GPIO_NR(1, 0), |
| 1118 | .vidin_en = IMX_GPIO_NR(5, 20), |
| 1119 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 9b9e75f | 2017-03-13 08:51:07 -0700 | [diff] [blame] | 1120 | .otgpwr_en = IMX_GPIO_NR(3, 22), |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 1121 | .vsel_pin = IMX_GPIO_NR(6, 14), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1122 | .mmc_cd = IMX_GPIO_NR(7, 0), |
Tim Harvey | ba9f234 | 2019-02-04 13:10:52 -0800 | [diff] [blame] | 1123 | .nand = true, |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1124 | }, |
| 1125 | |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1126 | /* GW560x */ |
| 1127 | { |
| 1128 | .gpio_pads = gw560x_gpio_pads, |
| 1129 | .num_pads = ARRAY_SIZE(gw560x_gpio_pads)/2, |
| 1130 | .dio_cfg = gw560x_dio, |
| 1131 | .dio_num = ARRAY_SIZE(gw560x_dio), |
| 1132 | .leds = { |
| 1133 | IMX_GPIO_NR(4, 6), |
| 1134 | IMX_GPIO_NR(4, 7), |
| 1135 | IMX_GPIO_NR(4, 15), |
| 1136 | }, |
| 1137 | .pcie_rst = IMX_GPIO_NR(4, 31), |
| 1138 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 1139 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 1140 | .rs232_en = GP_RS232_EN, |
| 1141 | .vidin_en = IMX_GPIO_NR(3, 31), |
| 1142 | .wdis = IMX_GPIO_NR(7, 12), |
| 1143 | .otgpwr_en = IMX_GPIO_NR(4, 15), |
| 1144 | .mmc_cd = IMX_GPIO_NR(7, 0), |
| 1145 | }, |
| 1146 | |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 1147 | /* GW5901 */ |
| 1148 | { |
| 1149 | .gpio_pads = gw5901_gpio_pads, |
| 1150 | .num_pads = ARRAY_SIZE(gw5901_gpio_pads)/2, |
| 1151 | .dio_cfg = gw5901_dio, |
| 1152 | .leds = { |
| 1153 | IMX_GPIO_NR(4, 15), |
| 1154 | }, |
| 1155 | .pcie_rst = IMX_GPIO_NR(1, 29), |
| 1156 | .nand = true, |
| 1157 | }, |
| 1158 | |
| 1159 | /* GW5902 */ |
| 1160 | { |
| 1161 | .gpio_pads = gw5902_gpio_pads, |
| 1162 | .num_pads = ARRAY_SIZE(gw5902_gpio_pads)/2, |
| 1163 | .dio_cfg = gw5902_dio, |
| 1164 | .leds = { |
| 1165 | IMX_GPIO_NR(4, 15), |
| 1166 | }, |
| 1167 | .pcie_rst = IMX_GPIO_NR(1, 0), |
| 1168 | .rs232_en = GP_RS232_EN, |
| 1169 | .otgpwr_en = IMX_GPIO_NR(3, 23), |
| 1170 | .nand = true, |
| 1171 | }, |
| 1172 | |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 1173 | /* GW5903 */ |
| 1174 | { |
| 1175 | .gpio_pads = gw5903_gpio_pads, |
| 1176 | .num_pads = ARRAY_SIZE(gw5903_gpio_pads)/2, |
| 1177 | .dio_cfg = gw5903_dio, |
| 1178 | .dio_num = ARRAY_SIZE(gw5903_dio), |
| 1179 | .leds = { |
| 1180 | IMX_GPIO_NR(6, 14), |
| 1181 | }, |
| 1182 | .otgpwr_en = IMX_GPIO_NR(4, 15), |
| 1183 | .mmc_cd = IMX_GPIO_NR(6, 11), |
| 1184 | }, |
| 1185 | |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1186 | /* GW5904 */ |
| 1187 | { |
| 1188 | .gpio_pads = gw5904_gpio_pads, |
| 1189 | .num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2, |
| 1190 | .dio_cfg = gw5904_dio, |
| 1191 | .dio_num = ARRAY_SIZE(gw5904_dio), |
| 1192 | .leds = { |
| 1193 | IMX_GPIO_NR(4, 6), |
| 1194 | IMX_GPIO_NR(4, 7), |
| 1195 | IMX_GPIO_NR(4, 15), |
| 1196 | }, |
| 1197 | .pcie_rst = IMX_GPIO_NR(1, 0), |
| 1198 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 1199 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 1200 | .otgpwr_en = IMX_GPIO_NR(3, 22), |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 1201 | }, |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1202 | |
| 1203 | /* GW5905 */ |
| 1204 | { |
| 1205 | .gpio_pads = gw5905_gpio_pads, |
| 1206 | .num_pads = ARRAY_SIZE(gw5905_gpio_pads)/2, |
| 1207 | .leds = { |
| 1208 | IMX_GPIO_NR(6, 14), |
| 1209 | }, |
| 1210 | .pcie_rst = IMX_GPIO_NR(7, 11), |
| 1211 | .wdis = IMX_GPIO_NR(7, 13), |
| 1212 | }, |
Tim Harvey | b7c48a9 | 2019-02-04 13:10:54 -0800 | [diff] [blame] | 1213 | |
| 1214 | /* GW5906 */ |
| 1215 | { |
| 1216 | .gpio_pads = gw552x_gpio_pads, |
| 1217 | .num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2, |
| 1218 | .dio_cfg = gw5906_dio, |
| 1219 | .dio_num = ARRAY_SIZE(gw5906_dio), |
| 1220 | .leds = { |
| 1221 | IMX_GPIO_NR(4, 6), |
| 1222 | IMX_GPIO_NR(4, 7), |
| 1223 | IMX_GPIO_NR(4, 15), |
| 1224 | }, |
| 1225 | .pcie_rst = IMX_GPIO_NR(1, 29), |
| 1226 | .usb_sel = IMX_GPIO_NR(1, 7), |
| 1227 | .wdis = IMX_GPIO_NR(7, 12), |
| 1228 | .msata_en = GP_MSATA_SEL, |
| 1229 | .nand = true, |
| 1230 | }, |
Tim Harvey | 83cad80 | 2019-02-04 13:10:55 -0800 | [diff] [blame] | 1231 | |
| 1232 | /* GW5907 */ |
| 1233 | { |
| 1234 | .gpio_pads = gw51xx_gpio_pads, |
| 1235 | .num_pads = ARRAY_SIZE(gw51xx_gpio_pads)/2, |
| 1236 | .dio_cfg = gw51xx_dio, |
| 1237 | .dio_num = ARRAY_SIZE(gw51xx_dio), |
| 1238 | .leds = { |
| 1239 | IMX_GPIO_NR(4, 6), |
| 1240 | IMX_GPIO_NR(4, 10), |
| 1241 | }, |
| 1242 | .pcie_rst = IMX_GPIO_NR(1, 0), |
| 1243 | .wdis = IMX_GPIO_NR(7, 12), |
| 1244 | .nand = true, |
| 1245 | }, |
Tim Harvey | c262540 | 2019-02-04 13:10:56 -0800 | [diff] [blame] | 1246 | |
| 1247 | /* GW5908 */ |
| 1248 | { |
| 1249 | .gpio_pads = gw53xx_gpio_pads, |
| 1250 | .num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2, |
| 1251 | .dio_cfg = gw53xx_dio, |
| 1252 | .dio_num = ARRAY_SIZE(gw53xx_dio), |
| 1253 | .leds = { |
| 1254 | IMX_GPIO_NR(4, 6), |
| 1255 | IMX_GPIO_NR(4, 7), |
| 1256 | IMX_GPIO_NR(4, 15), |
| 1257 | }, |
| 1258 | .pcie_rst = IMX_GPIO_NR(1, 29), |
| 1259 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 1260 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 1261 | .gps_shdn = IMX_GPIO_NR(1, 27), |
| 1262 | .vidin_en = IMX_GPIO_NR(3, 31), |
| 1263 | .wdis = IMX_GPIO_NR(7, 12), |
| 1264 | .msata_en = GP_MSATA_SEL, |
| 1265 | .rs232_en = GP_RS232_EN, |
| 1266 | }, |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 1267 | |
| 1268 | /* GW5909 */ |
| 1269 | { |
| 1270 | .gpio_pads = gw5904_gpio_pads, |
| 1271 | .num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2, |
| 1272 | .dio_cfg = gw5904_dio, |
| 1273 | .dio_num = ARRAY_SIZE(gw5904_dio), |
| 1274 | .leds = { |
| 1275 | IMX_GPIO_NR(4, 6), |
| 1276 | IMX_GPIO_NR(4, 7), |
| 1277 | IMX_GPIO_NR(4, 15), |
| 1278 | }, |
| 1279 | .pcie_rst = IMX_GPIO_NR(1, 0), |
| 1280 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 1281 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 1282 | .otgpwr_en = IMX_GPIO_NR(3, 22), |
| 1283 | }, |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1284 | }; |
| 1285 | |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1286 | #define SETUP_GPIO_OUTPUT(gpio, name, level) \ |
| 1287 | gpio_request(gpio, name); \ |
| 1288 | gpio_direction_output(gpio, level); |
| 1289 | #define SETUP_GPIO_INPUT(gpio, name) \ |
| 1290 | gpio_request(gpio, name); \ |
| 1291 | gpio_direction_input(gpio); |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1292 | void setup_iomux_gpio(int board, struct ventana_board_info *info) |
| 1293 | { |
| 1294 | int i; |
| 1295 | |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1296 | if (board >= GW_UNKNOWN) |
| 1297 | return; |
| 1298 | |
| 1299 | /* board specific iomux */ |
| 1300 | imx_iomux_v3_setup_multiple_pads(gpio_cfg[board].gpio_pads, |
| 1301 | gpio_cfg[board].num_pads); |
| 1302 | |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 1303 | /* RS232_EN# */ |
| 1304 | if (gpio_cfg[board].rs232_en) { |
Tim Harvey | 6ea02c9 | 2017-03-13 08:51:05 -0700 | [diff] [blame] | 1305 | gpio_request(gpio_cfg[board].rs232_en, "rs232_en#"); |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 1306 | gpio_direction_output(gpio_cfg[board].rs232_en, 0); |
| 1307 | } |
| 1308 | |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1309 | /* GW522x Uses GPIO3_IO23 for PCIE_RST# */ |
| 1310 | if (board == GW52xx && info->model[4] == '2') |
| 1311 | gpio_cfg[board].pcie_rst = IMX_GPIO_NR(3, 23); |
| 1312 | |
| 1313 | /* assert PCI_RST# */ |
| 1314 | gpio_request(gpio_cfg[board].pcie_rst, "pci_rst#"); |
| 1315 | gpio_direction_output(gpio_cfg[board].pcie_rst, 0); |
| 1316 | |
| 1317 | /* turn off (active-high) user LED's */ |
| 1318 | for (i = 0; i < ARRAY_SIZE(gpio_cfg[board].leds); i++) { |
| 1319 | char name[16]; |
| 1320 | if (gpio_cfg[board].leds[i]) { |
| 1321 | sprintf(name, "led_user%d", i); |
| 1322 | gpio_request(gpio_cfg[board].leds[i], name); |
| 1323 | gpio_direction_output(gpio_cfg[board].leds[i], 1); |
| 1324 | } |
| 1325 | } |
| 1326 | |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 1327 | /* MSATA Enable - default to PCI */ |
| 1328 | if (gpio_cfg[board].msata_en) { |
| 1329 | gpio_request(gpio_cfg[board].msata_en, "msata_en"); |
| 1330 | gpio_direction_output(gpio_cfg[board].msata_en, 0); |
| 1331 | } |
| 1332 | |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1333 | /* Expansion Mezzanine IO */ |
| 1334 | if (gpio_cfg[board].mezz_pwren) { |
| 1335 | gpio_request(gpio_cfg[board].mezz_pwren, "mezz_pwr"); |
| 1336 | gpio_direction_output(gpio_cfg[board].mezz_pwren, 0); |
| 1337 | } |
| 1338 | if (gpio_cfg[board].mezz_irq) { |
| 1339 | gpio_request(gpio_cfg[board].mezz_irq, "mezz_irq#"); |
| 1340 | gpio_direction_input(gpio_cfg[board].mezz_irq); |
| 1341 | } |
| 1342 | |
| 1343 | /* RS485 Transmit Enable */ |
| 1344 | if (gpio_cfg[board].rs485en) { |
| 1345 | gpio_request(gpio_cfg[board].rs485en, "rs485_en"); |
| 1346 | gpio_direction_output(gpio_cfg[board].rs485en, 0); |
| 1347 | } |
| 1348 | |
| 1349 | /* GPS_SHDN */ |
| 1350 | if (gpio_cfg[board].gps_shdn) { |
| 1351 | gpio_request(gpio_cfg[board].gps_shdn, "gps_shdn"); |
| 1352 | gpio_direction_output(gpio_cfg[board].gps_shdn, 1); |
| 1353 | } |
| 1354 | |
| 1355 | /* Analog video codec power enable */ |
| 1356 | if (gpio_cfg[board].vidin_en) { |
| 1357 | gpio_request(gpio_cfg[board].vidin_en, "anavidin_en"); |
| 1358 | gpio_direction_output(gpio_cfg[board].vidin_en, 1); |
| 1359 | } |
| 1360 | |
| 1361 | /* DIOI2C_DIS# */ |
| 1362 | if (gpio_cfg[board].dioi2c_en) { |
| 1363 | gpio_request(gpio_cfg[board].dioi2c_en, "dioi2c_dis#"); |
| 1364 | gpio_direction_output(gpio_cfg[board].dioi2c_en, 0); |
| 1365 | } |
| 1366 | |
| 1367 | /* PCICK_SSON: disable spread-spectrum clock */ |
| 1368 | if (gpio_cfg[board].pcie_sson) { |
| 1369 | gpio_request(gpio_cfg[board].pcie_sson, "pci_sson"); |
| 1370 | gpio_direction_output(gpio_cfg[board].pcie_sson, 0); |
| 1371 | } |
| 1372 | |
| 1373 | /* USBOTG mux routing */ |
| 1374 | if (gpio_cfg[board].usb_sel) { |
| 1375 | gpio_request(gpio_cfg[board].usb_sel, "usb_pcisel"); |
| 1376 | gpio_direction_output(gpio_cfg[board].usb_sel, 0); |
| 1377 | } |
| 1378 | |
| 1379 | /* PCISKT_WDIS# (Wireless disable GPIO to miniPCIe sockets) */ |
| 1380 | if (gpio_cfg[board].wdis) { |
| 1381 | gpio_request(gpio_cfg[board].wdis, "wlan_dis"); |
| 1382 | gpio_direction_output(gpio_cfg[board].wdis, 1); |
| 1383 | } |
Tim Harvey | 147b576 | 2016-05-24 11:03:59 -0700 | [diff] [blame] | 1384 | |
Tim Harvey | 9b9e75f | 2017-03-13 08:51:07 -0700 | [diff] [blame] | 1385 | /* OTG power off */ |
| 1386 | if (gpio_cfg[board].otgpwr_en) { |
| 1387 | gpio_request(gpio_cfg[board].otgpwr_en, "usbotg_pwr"); |
| 1388 | gpio_direction_output(gpio_cfg[board].otgpwr_en, 0); |
| 1389 | } |
| 1390 | |
Tim Harvey | 147b576 | 2016-05-24 11:03:59 -0700 | [diff] [blame] | 1391 | /* sense vselect pin to see if we support uhs-i */ |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 1392 | if (gpio_cfg[board].vsel_pin) { |
| 1393 | gpio_request(gpio_cfg[board].vsel_pin, "sd3_vselect"); |
| 1394 | gpio_direction_input(gpio_cfg[board].vsel_pin); |
| 1395 | gpio_cfg[board].usd_vsel = !gpio_get_value(gpio_cfg[board].vsel_pin); |
| 1396 | } |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1397 | |
| 1398 | /* microSD CD */ |
| 1399 | if (gpio_cfg[board].mmc_cd) { |
| 1400 | gpio_request(gpio_cfg[board].mmc_cd, "sd_cd"); |
| 1401 | gpio_direction_input(gpio_cfg[board].mmc_cd); |
| 1402 | } |
| 1403 | |
| 1404 | /* Anything else board specific */ |
| 1405 | switch(board) { |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1406 | case GW560x: |
| 1407 | gpio_request(IMX_GPIO_NR(4, 26), "12p0_en"); |
| 1408 | gpio_direction_output(IMX_GPIO_NR(4, 26), 1); |
| 1409 | break; |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 1410 | case GW5901: |
| 1411 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 2), "can_stby", 0); |
| 1412 | break; |
| 1413 | case GW5902: |
| 1414 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 2), "can1_stby", 0); |
| 1415 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(7, 3), "can2_stby", 0); |
| 1416 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(7, 12), "5P0V_EN", 1); |
| 1417 | break; |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 1418 | case GW5903: |
| 1419 | gpio_request(IMX_GPIO_NR(3, 31) , "usbh1-ehci_pwr"); |
| 1420 | gpio_direction_output(IMX_GPIO_NR(3, 31), 1); |
| 1421 | gpio_request(IMX_GPIO_NR(4, 15) , "usbh2-otg_pwr"); |
| 1422 | gpio_direction_output(IMX_GPIO_NR(4, 15), 1); |
| 1423 | gpio_request(IMX_GPIO_NR(4, 7) , "usbdpc_pwr"); |
| 1424 | gpio_direction_output(IMX_GPIO_NR(4, 15), 1); |
| 1425 | gpio_request(IMX_GPIO_NR(1, 25) , "rgmii_en"); |
| 1426 | gpio_direction_output(IMX_GPIO_NR(1, 25), 1); |
| 1427 | gpio_request(IMX_GPIO_NR(4, 6) , "touch_irq#"); |
| 1428 | gpio_direction_input(IMX_GPIO_NR(4, 6)); |
| 1429 | gpio_request(IMX_GPIO_NR(4, 8) , "touch_rst"); |
| 1430 | gpio_direction_output(IMX_GPIO_NR(4, 8), 1); |
| 1431 | gpio_request(IMX_GPIO_NR(1, 7) , "bklt_12ven"); |
| 1432 | gpio_direction_output(IMX_GPIO_NR(1, 7), 1); |
| 1433 | break; |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 1434 | case GW5909: |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1435 | case GW5904: |
Tim Harvey | 74107f7 | 2019-02-04 13:10:59 -0800 | [diff] [blame] | 1436 | gpio_request(IMX_GPIO_NR(4, 23), "rs485_en"); |
| 1437 | gpio_direction_output(IMX_GPIO_NR(4, 23), 0); |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1438 | gpio_request(IMX_GPIO_NR(5, 11), "skt1_wdis#"); |
| 1439 | gpio_direction_output(IMX_GPIO_NR(5, 11), 1); |
| 1440 | gpio_request(IMX_GPIO_NR(5, 12), "skt1_rst#"); |
| 1441 | gpio_direction_output(IMX_GPIO_NR(5, 12), 1); |
| 1442 | gpio_request(IMX_GPIO_NR(5, 13), "skt2_wdis#"); |
| 1443 | gpio_direction_output(IMX_GPIO_NR(5, 13), 1); |
| 1444 | gpio_request(IMX_GPIO_NR(1, 15), "m2_off#"); |
| 1445 | gpio_direction_output(IMX_GPIO_NR(1, 15), 1); |
| 1446 | gpio_request(IMX_GPIO_NR(1, 14), "m2_wdis#"); |
| 1447 | gpio_direction_output(IMX_GPIO_NR(1, 14), 1); |
| 1448 | gpio_request(IMX_GPIO_NR(1, 13), "m2_rst#"); |
| 1449 | gpio_direction_output(IMX_GPIO_NR(1, 13), 1); |
| 1450 | break; |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1451 | case GW5905: |
| 1452 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 7), "usb_pcisel", 0); |
| 1453 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 9), "lvds_cabc", 1); |
| 1454 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 14), "mipi_pdwn", 1); |
| 1455 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 15), "mipi_rst#", 0); |
| 1456 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(2, 3), "emmy_pdwn#", 1); |
| 1457 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(4, 5), "spk_shdn#", 0); |
| 1458 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(4, 8), "touch_rst", 0); |
| 1459 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(4, 6), "touch_irq", 0); |
| 1460 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 5), "flash_en1", 0); |
| 1461 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 6), "flash_en2", 0); |
| 1462 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 14), "dect_rst#", 1); |
| 1463 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 17), "codec_rst#", 0); |
| 1464 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 26), "imu_den", 1); |
| 1465 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(7, 12), "lvds_cabc", 0); |
| 1466 | mdelay(100); |
| 1467 | /* |
| 1468 | * gauruntee touch controller comes out of reset with INT |
| 1469 | * low for address |
| 1470 | */ |
| 1471 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(4, 8), "touch_rst", 1); |
| 1472 | break; |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1473 | } |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1474 | } |
| 1475 | |
| 1476 | /* setup GPIO pinmux and default configuration per baseboard and env */ |
| 1477 | void setup_board_gpio(int board, struct ventana_board_info *info) |
| 1478 | { |
| 1479 | const char *s; |
| 1480 | char arg[10]; |
| 1481 | size_t len; |
| 1482 | int i; |
Simon Glass | 64b723f | 2017-08-03 12:22:12 -0600 | [diff] [blame] | 1483 | int quiet = simple_strtol(env_get("quiet"), NULL, 10); |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1484 | |
| 1485 | if (board >= GW_UNKNOWN) |
| 1486 | return; |
| 1487 | |
| 1488 | /* RS232_EN# */ |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 1489 | if (gpio_cfg[board].rs232_en) { |
| 1490 | gpio_direction_output(gpio_cfg[board].rs232_en, |
| 1491 | (hwconfig("rs232")) ? 0 : 1); |
| 1492 | } |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1493 | |
| 1494 | /* MSATA Enable */ |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 1495 | if (gpio_cfg[board].msata_en && is_cpu_type(MXC_CPU_MX6Q)) { |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1496 | gpio_direction_output(GP_MSATA_SEL, |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 1497 | (hwconfig("msata")) ? 1 : 0); |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1498 | } |
| 1499 | |
| 1500 | /* USBOTG Select (PCISKT or FrontPanel) */ |
| 1501 | if (gpio_cfg[board].usb_sel) { |
| 1502 | gpio_direction_output(gpio_cfg[board].usb_sel, |
| 1503 | (hwconfig("usb_pcisel")) ? 1 : 0); |
| 1504 | } |
| 1505 | |
| 1506 | /* |
| 1507 | * Configure DIO pinmux/padctl registers |
| 1508 | * see IMX6DQRM/IMX6SDLRM IOMUXC_SW_PAD_CTL_PAD_* register definitions |
| 1509 | */ |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 1510 | for (i = 0; i < gpio_cfg[board].dio_num; i++) { |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1511 | struct dio_cfg *cfg = &gpio_cfg[board].dio_cfg[i]; |
| 1512 | iomux_v3_cfg_t ctrl = DIO_PAD_CFG; |
| 1513 | unsigned cputype = is_cpu_type(MXC_CPU_MX6Q) ? 0 : 1; |
| 1514 | |
| 1515 | if (!cfg->gpio_padmux[0] && !cfg->gpio_padmux[1]) |
| 1516 | continue; |
| 1517 | sprintf(arg, "dio%d", i); |
| 1518 | if (!hwconfig(arg)) |
| 1519 | continue; |
| 1520 | s = hwconfig_subarg(arg, "padctrl", &len); |
| 1521 | if (s) { |
| 1522 | ctrl = MUX_PAD_CTRL(simple_strtoul(s, NULL, 16) |
| 1523 | & 0x1ffff) | MUX_MODE_SION; |
| 1524 | } |
| 1525 | if (hwconfig_subarg_cmp(arg, "mode", "gpio")) { |
| 1526 | if (!quiet) { |
| 1527 | printf("DIO%d: GPIO%d_IO%02d (gpio-%d)\n", i, |
| 1528 | (cfg->gpio_param/32)+1, |
| 1529 | cfg->gpio_param%32, |
| 1530 | cfg->gpio_param); |
| 1531 | } |
| 1532 | imx_iomux_v3_setup_pad(cfg->gpio_padmux[cputype] | |
| 1533 | ctrl); |
| 1534 | gpio_requestf(cfg->gpio_param, "dio%d", i); |
| 1535 | gpio_direction_input(cfg->gpio_param); |
Tim Harvey | c0e03c3 | 2016-05-24 11:03:54 -0700 | [diff] [blame] | 1536 | } else if (hwconfig_subarg_cmp(arg, "mode", "pwm") && |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1537 | cfg->pwm_padmux) { |
Tim Harvey | 8d2d8df | 2016-05-24 11:03:55 -0700 | [diff] [blame] | 1538 | if (!cfg->pwm_param) { |
| 1539 | printf("DIO%d: Error: pwm config invalid\n", |
| 1540 | i); |
| 1541 | continue; |
| 1542 | } |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1543 | if (!quiet) |
| 1544 | printf("DIO%d: pwm%d\n", i, cfg->pwm_param); |
| 1545 | imx_iomux_v3_setup_pad(cfg->pwm_padmux[cputype] | |
| 1546 | MUX_PAD_CTRL(ctrl)); |
| 1547 | } |
| 1548 | } |
| 1549 | |
| 1550 | if (!quiet) { |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 1551 | if (gpio_cfg[board].msata_en && is_cpu_type(MXC_CPU_MX6Q)) { |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1552 | printf("MSATA: %s\n", (hwconfig("msata") ? |
| 1553 | "enabled" : "disabled")); |
| 1554 | } |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 1555 | if (gpio_cfg[board].rs232_en) { |
| 1556 | printf("RS232: %s\n", (hwconfig("rs232")) ? |
| 1557 | "enabled" : "disabled"); |
| 1558 | } |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1559 | } |
| 1560 | } |
| 1561 | |
| 1562 | /* setup board specific PMIC */ |
Tim Harvey | 195bc97 | 2015-05-08 18:28:37 -0700 | [diff] [blame] | 1563 | void setup_pmic(void) |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1564 | { |
| 1565 | struct pmic *p; |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1566 | struct ventana_board_info ventana_info; |
| 1567 | int board = read_eeprom(CONFIG_I2C_GSC, &ventana_info); |
Simon Glass | 4148d75 | 2017-04-26 22:27:47 -0600 | [diff] [blame] | 1568 | const int i2c_pmic = 1; |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1569 | u32 reg; |
| 1570 | |
Simon Glass | 4148d75 | 2017-04-26 22:27:47 -0600 | [diff] [blame] | 1571 | i2c_set_bus_num(i2c_pmic); |
Tim Harvey | 195bc97 | 2015-05-08 18:28:37 -0700 | [diff] [blame] | 1572 | |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1573 | /* configure PFUZE100 PMIC */ |
Tim Harvey | 195bc97 | 2015-05-08 18:28:37 -0700 | [diff] [blame] | 1574 | if (!i2c_probe(CONFIG_POWER_PFUZE100_I2C_ADDR)) { |
| 1575 | debug("probed PFUZE100@0x%x\n", CONFIG_POWER_PFUZE100_I2C_ADDR); |
Simon Glass | 4148d75 | 2017-04-26 22:27:47 -0600 | [diff] [blame] | 1576 | power_pfuze100_init(i2c_pmic); |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1577 | p = pmic_get("PFUZE100"); |
| 1578 | if (p && !pmic_probe(p)) { |
| 1579 | pmic_reg_read(p, PFUZE100_DEVICEID, ®); |
| 1580 | printf("PMIC: PFUZE100 ID=0x%02x\n", reg); |
| 1581 | |
| 1582 | /* Set VGEN1 to 1.5V and enable */ |
| 1583 | pmic_reg_read(p, PFUZE100_VGEN1VOL, ®); |
| 1584 | reg &= ~(LDO_VOL_MASK); |
| 1585 | reg |= (LDOA_1_50V | LDO_EN); |
| 1586 | pmic_reg_write(p, PFUZE100_VGEN1VOL, reg); |
| 1587 | |
| 1588 | /* Set SWBST to 5.0V and enable */ |
| 1589 | pmic_reg_read(p, PFUZE100_SWBSTCON1, ®); |
| 1590 | reg &= ~(SWBST_MODE_MASK | SWBST_VOL_MASK); |
Marek Vasut | 2aaeb91 | 2015-11-26 14:08:50 +0100 | [diff] [blame] | 1591 | reg |= (SWBST_5_00V | (SWBST_MODE_AUTO << SWBST_MODE_SHIFT)); |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1592 | pmic_reg_write(p, PFUZE100_SWBSTCON1, reg); |
| 1593 | } |
| 1594 | } |
| 1595 | |
| 1596 | /* configure LTC3676 PMIC */ |
Tim Harvey | 195bc97 | 2015-05-08 18:28:37 -0700 | [diff] [blame] | 1597 | else if (!i2c_probe(CONFIG_POWER_LTC3676_I2C_ADDR)) { |
| 1598 | debug("probed LTC3676@0x%x\n", CONFIG_POWER_LTC3676_I2C_ADDR); |
Simon Glass | 4148d75 | 2017-04-26 22:27:47 -0600 | [diff] [blame] | 1599 | power_ltc3676_init(i2c_pmic); |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1600 | p = pmic_get("LTC3676_PMIC"); |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1601 | if (!p || pmic_probe(p)) |
| 1602 | return; |
| 1603 | puts("PMIC: LTC3676\n"); |
| 1604 | /* |
| 1605 | * set board-specific scalar for max CPU frequency |
| 1606 | * per CPU based on the LDO enabled Operating Ranges |
| 1607 | * defined in the respective IMX6DQ and IMX6SDL |
| 1608 | * datasheets. The voltage resulting from the R1/R2 |
| 1609 | * feedback inputs on Ventana is 1308mV. Note that this |
| 1610 | * is a bit shy of the Vmin of 1350mV in the datasheet |
| 1611 | * for LDO enabled mode but is as high as we can go. |
| 1612 | */ |
| 1613 | switch (board) { |
| 1614 | case GW560x: |
| 1615 | /* mask PGOOD during SW3 transition */ |
| 1616 | pmic_reg_write(p, LTC3676_DVB3B, |
| 1617 | 0x1f | LTC3676_PGOOD_MASK); |
| 1618 | /* set SW3 (VDD_ARM) */ |
| 1619 | pmic_reg_write(p, LTC3676_DVB3A, 0x1f); |
| 1620 | break; |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 1621 | case GW5903: |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1622 | /* mask PGOOD during SW3 transition */ |
Tim Harvey | 5f2a189 | 2017-03-21 07:50:13 -0700 | [diff] [blame] | 1623 | pmic_reg_write(p, LTC3676_DVB3B, |
| 1624 | 0x1f | LTC3676_PGOOD_MASK); |
| 1625 | /* set SW3 (VDD_ARM) */ |
| 1626 | pmic_reg_write(p, LTC3676_DVB3A, 0x1f); |
| 1627 | |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 1628 | /* mask PGOOD during SW4 transition */ |
| 1629 | pmic_reg_write(p, LTC3676_DVB4B, |
| 1630 | 0x1f | LTC3676_PGOOD_MASK); |
| 1631 | /* set SW4 (VDD_SOC) */ |
| 1632 | pmic_reg_write(p, LTC3676_DVB4A, 0x1f); |
| 1633 | break; |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1634 | case GW5905: |
| 1635 | /* mask PGOOD during SW1 transition */ |
| 1636 | pmic_reg_write(p, LTC3676_DVB1B, |
| 1637 | 0x1f | LTC3676_PGOOD_MASK); |
| 1638 | /* set SW1 (VDD_ARM) */ |
| 1639 | pmic_reg_write(p, LTC3676_DVB1A, 0x1f); |
| 1640 | |
| 1641 | /* mask PGOOD during SW3 transition */ |
| 1642 | pmic_reg_write(p, LTC3676_DVB3B, |
| 1643 | 0x1f | LTC3676_PGOOD_MASK); |
| 1644 | /* set SW3 (VDD_SOC) */ |
| 1645 | pmic_reg_write(p, LTC3676_DVB3A, 0x1f); |
| 1646 | break; |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1647 | default: |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1648 | /* mask PGOOD during SW1 transition */ |
| 1649 | pmic_reg_write(p, LTC3676_DVB1B, |
| 1650 | 0x1f | LTC3676_PGOOD_MASK); |
| 1651 | /* set SW1 (VDD_SOC) */ |
| 1652 | pmic_reg_write(p, LTC3676_DVB1A, 0x1f); |
| 1653 | |
| 1654 | /* mask PGOOD during SW3 transition */ |
| 1655 | pmic_reg_write(p, LTC3676_DVB3B, |
| 1656 | 0x1f | LTC3676_PGOOD_MASK); |
| 1657 | /* set SW3 (VDD_ARM) */ |
| 1658 | pmic_reg_write(p, LTC3676_DVB3A, 0x1f); |
| 1659 | } |
| 1660 | } |
| 1661 | } |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1662 | |
Yangbo Lu | 7334038 | 2019-06-21 11:42:28 +0800 | [diff] [blame] | 1663 | #ifdef CONFIG_FSL_ESDHC_IMX |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1664 | static struct fsl_esdhc_cfg usdhc_cfg[2]; |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1665 | |
| 1666 | int board_mmc_init(bd_t *bis) |
| 1667 | { |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1668 | struct ventana_board_info ventana_info; |
| 1669 | int board_type = read_eeprom(CONFIG_I2C_GSC, &ventana_info); |
| 1670 | int ret; |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1671 | |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1672 | switch (board_type) { |
| 1673 | case GW52xx: |
| 1674 | case GW53xx: |
| 1675 | case GW54xx: |
| 1676 | case GW553x: |
| 1677 | /* usdhc3: 4bit microSD */ |
| 1678 | SETUP_IOMUX_PADS(usdhc3_pads); |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1679 | usdhc_cfg[0].esdhc_base = USDHC3_BASE_ADDR; |
| 1680 | usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
| 1681 | usdhc_cfg[0].max_bus_width = 4; |
| 1682 | return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); |
| 1683 | case GW560x: |
| 1684 | /* usdhc2: 8-bit eMMC */ |
| 1685 | SETUP_IOMUX_PADS(gw560x_emmc_sd2_pads); |
| 1686 | usdhc_cfg[0].esdhc_base = USDHC2_BASE_ADDR; |
| 1687 | usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); |
| 1688 | usdhc_cfg[0].max_bus_width = 8; |
| 1689 | ret = fsl_esdhc_initialize(bis, &usdhc_cfg[0]); |
| 1690 | if (ret) |
| 1691 | return ret; |
| 1692 | /* usdhc3: 4-bit microSD */ |
| 1693 | SETUP_IOMUX_PADS(usdhc3_pads); |
| 1694 | usdhc_cfg[1].esdhc_base = USDHC3_BASE_ADDR; |
| 1695 | usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
| 1696 | usdhc_cfg[1].max_bus_width = 4; |
| 1697 | return fsl_esdhc_initialize(bis, &usdhc_cfg[1]); |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 1698 | case GW5903: |
| 1699 | /* usdhc3: 8-bit eMMC */ |
| 1700 | SETUP_IOMUX_PADS(gw5904_emmc_pads); |
| 1701 | usdhc_cfg[0].esdhc_base = USDHC3_BASE_ADDR; |
| 1702 | usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
| 1703 | usdhc_cfg[0].max_bus_width = 8; |
| 1704 | ret = fsl_esdhc_initialize(bis, &usdhc_cfg[0]); |
| 1705 | if (ret) |
| 1706 | return ret; |
| 1707 | /* usdhc2: 4-bit microSD */ |
| 1708 | SETUP_IOMUX_PADS(gw5904_mmc_pads); |
| 1709 | usdhc_cfg[1].esdhc_base = USDHC2_BASE_ADDR; |
| 1710 | usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); |
| 1711 | usdhc_cfg[1].max_bus_width = 4; |
| 1712 | return fsl_esdhc_initialize(bis, &usdhc_cfg[1]); |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1713 | case GW5904: |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1714 | case GW5905: |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 1715 | case GW5909: |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1716 | /* usdhc3: 8bit eMMC */ |
| 1717 | SETUP_IOMUX_PADS(gw5904_emmc_pads); |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1718 | usdhc_cfg[0].esdhc_base = USDHC3_BASE_ADDR; |
| 1719 | usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
| 1720 | usdhc_cfg[0].max_bus_width = 8; |
| 1721 | return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1722 | default: |
| 1723 | /* doesn't have MMC */ |
| 1724 | return -1; |
| 1725 | } |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1726 | } |
| 1727 | |
| 1728 | int board_mmc_getcd(struct mmc *mmc) |
| 1729 | { |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1730 | struct ventana_board_info ventana_info; |
| 1731 | struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; |
| 1732 | int board = read_eeprom(CONFIG_I2C_GSC, &ventana_info); |
| 1733 | int gpio = gpio_cfg[board].mmc_cd; |
| 1734 | |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1735 | /* Card Detect */ |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1736 | switch (board) { |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1737 | case GW560x: |
| 1738 | /* emmc is always present */ |
| 1739 | if (cfg->esdhc_base == USDHC2_BASE_ADDR) |
| 1740 | return 1; |
| 1741 | break; |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 1742 | case GW5903: |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1743 | case GW5904: |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1744 | case GW5905: |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 1745 | case GW5909: |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1746 | /* emmc is always present */ |
| 1747 | if (cfg->esdhc_base == USDHC3_BASE_ADDR) |
| 1748 | return 1; |
| 1749 | break; |
| 1750 | } |
| 1751 | |
| 1752 | if (gpio) { |
| 1753 | debug("%s: gpio%d=%d\n", __func__, gpio, gpio_get_value(gpio)); |
| 1754 | return !gpio_get_value(gpio); |
| 1755 | } |
| 1756 | |
| 1757 | return -1; |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1758 | } |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1759 | |
Yangbo Lu | 7334038 | 2019-06-21 11:42:28 +0800 | [diff] [blame] | 1760 | #endif /* CONFIG_FSL_ESDHC_IMX */ |