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