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