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