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