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 | 4137785 | 2022-04-13 09:29:16 -0700 | [diff] [blame] | 8 | #include <env.h> |
| 9 | #include <fsl_esdhc_imx.h> |
| 10 | #include <hwconfig.h> |
Simon Glass | 0f2af88 | 2020-05-10 11:40:05 -0600 | [diff] [blame] | 11 | #include <log.h> |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 12 | #include <asm/arch/clock.h> |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 13 | #include <asm/arch/mx6-pins.h> |
| 14 | #include <asm/arch/sys_proto.h> |
| 15 | #include <asm/gpio.h> |
Stefano Babic | 33731bc | 2017-06-29 10:16:06 +0200 | [diff] [blame] | 16 | #include <asm/mach-imx/mxc_i2c.h> |
Simon Glass | dbd7954 | 2020-05-10 11:40:11 -0600 | [diff] [blame] | 17 | #include <linux/delay.h> |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 18 | |
| 19 | #include "common.h" |
| 20 | |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 21 | /* MMC */ |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 22 | static iomux_v3_cfg_t const gw5904_emmc_pads[] = { |
| 23 | IOMUX_PADS(PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 24 | IOMUX_PADS(PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 25 | IOMUX_PADS(PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 26 | IOMUX_PADS(PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 27 | IOMUX_PADS(PAD_SD3_DAT4__SD3_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 28 | IOMUX_PADS(PAD_SD3_DAT5__SD3_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 29 | IOMUX_PADS(PAD_SD3_DAT6__SD3_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 30 | IOMUX_PADS(PAD_SD3_DAT7__SD3_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 31 | IOMUX_PADS(PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 32 | IOMUX_PADS(PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 33 | IOMUX_PADS(PAD_SD3_RST__SD3_RESET | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 34 | }; |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 35 | /* 4-bit microSD on SD2 */ |
| 36 | static iomux_v3_cfg_t const gw5904_mmc_pads[] = { |
| 37 | IOMUX_PADS(PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 38 | IOMUX_PADS(PAD_SD2_CMD__SD2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 39 | IOMUX_PADS(PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 40 | IOMUX_PADS(PAD_SD2_DAT1__SD2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 41 | IOMUX_PADS(PAD_SD2_DAT2__SD2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 42 | IOMUX_PADS(PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 43 | /* CD */ |
| 44 | IOMUX_PADS(PAD_NANDF_CS0__GPIO6_IO11 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 45 | }; |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 46 | /* 8-bit eMMC on SD2/NAND */ |
| 47 | static iomux_v3_cfg_t const gw560x_emmc_sd2_pads[] = { |
| 48 | IOMUX_PADS(PAD_SD2_CLK__SD2_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 49 | IOMUX_PADS(PAD_SD2_CMD__SD2_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 50 | IOMUX_PADS(PAD_SD2_DAT0__SD2_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 51 | IOMUX_PADS(PAD_SD2_DAT1__SD2_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 52 | IOMUX_PADS(PAD_SD2_DAT2__SD2_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 53 | IOMUX_PADS(PAD_SD2_DAT3__SD2_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 54 | IOMUX_PADS(PAD_NANDF_D4__SD2_DATA4 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 55 | IOMUX_PADS(PAD_NANDF_D5__SD2_DATA5 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 56 | IOMUX_PADS(PAD_NANDF_D6__SD2_DATA6 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 57 | IOMUX_PADS(PAD_NANDF_D7__SD2_DATA7 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 58 | }; |
| 59 | |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 60 | static iomux_v3_cfg_t const usdhc3_pads[] = { |
| 61 | IOMUX_PADS(PAD_SD3_CLK__SD3_CLK | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 62 | IOMUX_PADS(PAD_SD3_CMD__SD3_CMD | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 63 | IOMUX_PADS(PAD_SD3_DAT0__SD3_DATA0 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 64 | IOMUX_PADS(PAD_SD3_DAT1__SD3_DATA1 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 65 | IOMUX_PADS(PAD_SD3_DAT2__SD3_DATA2 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 66 | IOMUX_PADS(PAD_SD3_DAT3__SD3_DATA3 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 67 | IOMUX_PADS(PAD_SD3_DAT5__GPIO7_IO00 | MUX_PAD_CTRL(USDHC_PAD_CTRL)), |
| 68 | }; |
| 69 | |
Tim Harvey | d04dc81 | 2019-02-04 13:10:49 -0800 | [diff] [blame] | 70 | /* |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 71 | * Baseboard specific GPIO |
| 72 | */ |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 73 | static iomux_v3_cfg_t const gw51xx_gpio_pads[] = { |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 74 | /* IOEXP_PWREN# */ |
| 75 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 76 | /* IOEXP_IRQ# */ |
| 77 | 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] | 78 | /* GPS_SHDN */ |
| 79 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 80 | /* PCIESKT_WDIS# */ |
| 81 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 82 | }; |
| 83 | |
| 84 | static iomux_v3_cfg_t const gw52xx_gpio_pads[] = { |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 85 | /* SD3_VSELECT */ |
| 86 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 87 | /* RS232_EN# */ |
| 88 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 89 | /* MSATA_EN */ |
| 90 | IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 91 | /* IOEXP_PWREN# */ |
| 92 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 93 | /* IOEXP_IRQ# */ |
| 94 | 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] | 95 | /* GPS_SHDN */ |
| 96 | IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | DIO_PAD_CFG), |
| 97 | /* USBOTG_SEL */ |
| 98 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 99 | /* RS485_EN */ |
| 100 | IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 101 | /* PCIESKT_WDIS# */ |
| 102 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 103 | }; |
| 104 | |
| 105 | static iomux_v3_cfg_t const gw53xx_gpio_pads[] = { |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 106 | /* SD3_VSELECT */ |
| 107 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 108 | /* RS232_EN# */ |
| 109 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 110 | /* MSATA_EN */ |
| 111 | IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 112 | /* IOEXP_PWREN# */ |
| 113 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 114 | /* IOEXP_IRQ# */ |
| 115 | IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)), |
| 116 | /* DIOI2C_DIS# */ |
| 117 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
| 118 | /* GPS_SHDN */ |
| 119 | IOMUX_PADS(PAD_ENET_RXD0__GPIO1_IO27 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 120 | /* RS485_EN */ |
| 121 | IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 122 | /* PCIESKT_WDIS# */ |
| 123 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
Tim Harvey | 409fe9a | 2021-07-24 10:40:45 -0700 | [diff] [blame] | 124 | /* J6_PWREN */ |
| 125 | IOMUX_PADS(PAD_EIM_DA15__GPIO3_IO15 | DIO_PAD_CFG), |
| 126 | /* PCIEGBE_EN */ |
| 127 | IOMUX_PADS(PAD_EIM_DA14__GPIO3_IO14 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 128 | }; |
| 129 | |
| 130 | static iomux_v3_cfg_t const gw54xx_gpio_pads[] = { |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 131 | /* SD3_VSELECT */ |
| 132 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 133 | /* RS232_EN# */ |
| 134 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 135 | /* MSATA_EN */ |
| 136 | IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 137 | /* MIPI_DIO */ |
| 138 | IOMUX_PADS(PAD_SD1_DAT3__GPIO1_IO21 | DIO_PAD_CFG), |
| 139 | /* RS485_EN */ |
| 140 | IOMUX_PADS(PAD_EIM_D24__GPIO3_IO24 | DIO_PAD_CFG), |
| 141 | /* IOEXP_PWREN# */ |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 142 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 143 | /* IOEXP_IRQ# */ |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 144 | 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] | 145 | /* DIOI2C_DIS# */ |
| 146 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 147 | /* RS485_EN */ |
| 148 | IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 149 | /* PCIESKT_WDIS# */ |
| 150 | IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG), |
Tim Harvey | db06398 | 2021-07-24 10:40:46 -0700 | [diff] [blame] | 151 | /* J7_PWREN */ |
| 152 | IOMUX_PADS(PAD_EIM_DA15__GPIO3_IO15 | DIO_PAD_CFG), |
| 153 | /* PCIEGBE_EN */ |
| 154 | IOMUX_PADS(PAD_EIM_DA14__GPIO3_IO14 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 155 | }; |
| 156 | |
| 157 | static iomux_v3_cfg_t const gw551x_gpio_pads[] = { |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 158 | /* PCIESKT_WDIS# */ |
| 159 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 160 | }; |
| 161 | |
| 162 | static iomux_v3_cfg_t const gw552x_gpio_pads[] = { |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 163 | /* MSATA_EN */ |
| 164 | IOMUX_PADS(PAD_SD4_DAT0__GPIO2_IO08 | DIO_PAD_CFG), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 165 | /* USBOTG_SEL */ |
| 166 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 167 | /* MX6_DIO[4:9] */ |
| 168 | IOMUX_PADS(PAD_CSI0_PIXCLK__GPIO5_IO18 | DIO_PAD_CFG), |
| 169 | IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20 | DIO_PAD_CFG), |
| 170 | IOMUX_PADS(PAD_CSI0_VSYNC__GPIO5_IO21 | DIO_PAD_CFG), |
| 171 | IOMUX_PADS(PAD_CSI0_DAT4__GPIO5_IO22 | DIO_PAD_CFG), |
| 172 | IOMUX_PADS(PAD_CSI0_DAT5__GPIO5_IO23 | DIO_PAD_CFG), |
| 173 | IOMUX_PADS(PAD_CSI0_DAT7__GPIO5_IO25 | DIO_PAD_CFG), |
| 174 | /* PCIEGBE1_OFF# */ |
| 175 | IOMUX_PADS(PAD_GPIO_1__GPIO1_IO01 | DIO_PAD_CFG), |
| 176 | /* PCIEGBE2_OFF# */ |
| 177 | IOMUX_PADS(PAD_GPIO_2__GPIO1_IO02 | DIO_PAD_CFG), |
| 178 | /* PCIESKT_WDIS# */ |
| 179 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 180 | }; |
| 181 | |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 182 | static iomux_v3_cfg_t const gw553x_gpio_pads[] = { |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 183 | /* SD3_VSELECT */ |
| 184 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 185 | /* PCIESKT_WDIS# */ |
| 186 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 187 | }; |
| 188 | |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 189 | static iomux_v3_cfg_t const gw560x_gpio_pads[] = { |
| 190 | /* RS232_EN# */ |
| 191 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 192 | /* IOEXP_PWREN# */ |
| 193 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 194 | /* IOEXP_IRQ# */ |
| 195 | IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)), |
| 196 | /* DIOI2C_DIS# */ |
| 197 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 198 | /* RS485_EN */ |
| 199 | IOMUX_PADS(PAD_SD3_DAT4__GPIO7_IO01 | DIO_PAD_CFG), |
| 200 | /* PCIESKT_WDIS# */ |
| 201 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 202 | /* 12V0_PWR_EN */ |
| 203 | IOMUX_PADS(PAD_DISP0_DAT5__GPIO4_IO26 | DIO_PAD_CFG), |
| 204 | }; |
| 205 | |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 206 | static iomux_v3_cfg_t const gw5901_gpio_pads[] = { |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 207 | /* ETH1_EN */ |
| 208 | IOMUX_PADS(PAD_GPIO_1__GPIO1_IO01 | DIO_PAD_CFG), |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 209 | /* PMIC reset */ |
| 210 | IOMUX_PADS(PAD_DISP0_DAT8__WDOG1_B | DIO_PAD_CFG), |
| 211 | /* COM_CFGA/B/C/D */ |
| 212 | IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14 | DIO_PAD_CFG), |
| 213 | IOMUX_PADS(PAD_DISP0_DAT21__GPIO5_IO15 | DIO_PAD_CFG), |
| 214 | IOMUX_PADS(PAD_DISP0_DAT22__GPIO5_IO16 | DIO_PAD_CFG), |
| 215 | IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG), |
| 216 | /* ETI_IRQ# */ |
| 217 | IOMUX_PADS(PAD_GPIO_5__GPIO1_IO05 | DIO_PAD_CFG), |
| 218 | /* DIO_IRQ# */ |
| 219 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
| 220 | /* FIBER_SIGDET */ |
| 221 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
| 222 | }; |
| 223 | |
| 224 | static iomux_v3_cfg_t const gw5902_gpio_pads[] = { |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 225 | /* UART1_EN# */ |
| 226 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 227 | /* 5V_UVLO */ |
| 228 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 229 | /* ETI_IRQ# */ |
| 230 | IOMUX_PADS(PAD_GPIO_5__GPIO1_IO05 | DIO_PAD_CFG), |
| 231 | /* DIO_IRQ# */ |
| 232 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 233 | }; |
| 234 | |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 235 | static iomux_v3_cfg_t const gw5903_gpio_pads[] = { |
| 236 | /* BKLT_12VEN */ |
| 237 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
| 238 | /* EMMY_PDN# */ |
| 239 | IOMUX_PADS(PAD_NANDF_D2__GPIO2_IO02 | DIO_PAD_CFG), |
| 240 | /* EMMY_CFG1# */ |
| 241 | IOMUX_PADS(PAD_NANDF_D3__GPIO2_IO03 | DIO_PAD_CFG), |
| 242 | /* EMMY_CFG1# */ |
| 243 | IOMUX_PADS(PAD_NANDF_D4__GPIO2_IO04 | DIO_PAD_CFG), |
| 244 | /* USBH1_PEN (EHCI) */ |
| 245 | IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG), |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 246 | /* USBDPC_PEN */ |
| 247 | IOMUX_PADS(PAD_KEY_ROW0__GPIO4_IO07 | DIO_PAD_CFG), |
| 248 | /* TOUCH_RST */ |
| 249 | IOMUX_PADS(PAD_KEY_COL1__GPIO4_IO08 | DIO_PAD_CFG), |
| 250 | /* AUDIO_RST# */ |
| 251 | IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG), |
| 252 | /* UART1_TEN# */ |
| 253 | IOMUX_PADS(PAD_CSI0_DAT12__GPIO5_IO30 | DIO_PAD_CFG), |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 254 | /* LVDS_BKLEN # */ |
| 255 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 256 | /* RGMII_PDWN# */ |
| 257 | IOMUX_PADS(PAD_ENET_CRS_DV__GPIO1_IO25 | DIO_PAD_CFG), |
| 258 | /* TOUCH_IRQ# */ |
| 259 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 260 | /* TOUCH_RST# */ |
| 261 | IOMUX_PADS(PAD_KEY_COL1__GPIO4_IO08 | DIO_PAD_CFG), |
| 262 | }; |
| 263 | |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 264 | static iomux_v3_cfg_t const gw5904_gpio_pads[] = { |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 265 | /* IOEXP_PWREN# */ |
| 266 | IOMUX_PADS(PAD_EIM_A19__GPIO2_IO19 | DIO_PAD_CFG), |
| 267 | /* IOEXP_IRQ# */ |
| 268 | IOMUX_PADS(PAD_EIM_A20__GPIO2_IO18 | MUX_PAD_CTRL(IRQ_PAD_CTRL)), |
| 269 | /* DIOI2C_DIS# */ |
| 270 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
| 271 | /* UART_RS485 */ |
| 272 | IOMUX_PADS(PAD_DISP0_DAT2__GPIO4_IO23 | DIO_PAD_CFG), |
| 273 | /* UART_HALF */ |
| 274 | IOMUX_PADS(PAD_DISP0_DAT3__GPIO4_IO24 | DIO_PAD_CFG), |
| 275 | /* SKT1_WDIS# */ |
| 276 | IOMUX_PADS(PAD_DISP0_DAT17__GPIO5_IO11 | DIO_PAD_CFG), |
| 277 | /* SKT1_RST# */ |
| 278 | IOMUX_PADS(PAD_DISP0_DAT18__GPIO5_IO12 | DIO_PAD_CFG), |
| 279 | /* SKT2_WDIS# */ |
| 280 | IOMUX_PADS(PAD_DISP0_DAT19__GPIO5_IO13 | DIO_PAD_CFG), |
| 281 | /* SKT2_RST# */ |
| 282 | IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG), |
| 283 | /* M2_OFF# */ |
| 284 | IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | DIO_PAD_CFG), |
| 285 | /* M2_WDIS# */ |
| 286 | IOMUX_PADS(PAD_SD2_DAT1__GPIO1_IO14 | DIO_PAD_CFG), |
| 287 | /* M2_RST# */ |
| 288 | IOMUX_PADS(PAD_SD2_DAT2__GPIO1_IO13 | DIO_PAD_CFG), |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 289 | /* RS232_EN# */ |
| 290 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 291 | }; |
| 292 | |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 293 | static iomux_v3_cfg_t const gw5905_gpio_pads[] = { |
| 294 | /* EMMY_PDN# */ |
| 295 | IOMUX_PADS(PAD_NANDF_D3__GPIO2_IO03 | DIO_PAD_CFG), |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 296 | /* MIPI_RST */ |
| 297 | IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15 | DIO_PAD_CFG), |
| 298 | /* MIPI_PWDN */ |
| 299 | IOMUX_PADS(PAD_SD2_DAT1__GPIO1_IO14 | DIO_PAD_CFG), |
| 300 | /* USBEHCI_SEL */ |
| 301 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 302 | /* LVDS_BKLEN # */ |
| 303 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 304 | /* PCIESKT_WDIS# */ |
| 305 | IOMUX_PADS(PAD_GPIO_18__GPIO7_IO13 | DIO_PAD_CFG), |
| 306 | /* SPK_SHDN# */ |
| 307 | IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05 | DIO_PAD_CFG), |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 308 | /* DECT_RST# */ |
| 309 | IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14 | DIO_PAD_CFG), |
| 310 | /* USBH1_PEN (EHCI) */ |
| 311 | IOMUX_PADS(PAD_EIM_D31__GPIO3_IO31 | DIO_PAD_CFG), |
| 312 | /* LVDS_PWM */ |
| 313 | IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09 | DIO_PAD_CFG), |
| 314 | /* CODEC_RST */ |
| 315 | IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17 | DIO_PAD_CFG), |
| 316 | /* GYRO_CONTROL/DATA_EN */ |
| 317 | IOMUX_PADS(PAD_CSI0_DAT8__GPIO5_IO26 | DIO_PAD_CFG), |
| 318 | /* TOUCH_RST */ |
| 319 | IOMUX_PADS(PAD_KEY_COL1__GPIO4_IO08 | DIO_PAD_CFG), |
| 320 | /* TOUCH_IRQ */ |
| 321 | IOMUX_PADS(PAD_KEY_COL0__GPIO4_IO06 | DIO_PAD_CFG), |
| 322 | }; |
| 323 | |
Tim Harvey | 08aec66 | 2021-07-24 10:40:42 -0700 | [diff] [blame] | 324 | static iomux_v3_cfg_t const gw5910_gpio_pads[] = { |
| 325 | /* SD3_VSELECT */ |
| 326 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
| 327 | /* RS232_EN# */ |
| 328 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
| 329 | /* RF_RESET# */ |
| 330 | IOMUX_PADS(PAD_GPIO_7__GPIO1_IO07 | DIO_PAD_CFG), |
| 331 | /* RF_BOOT */ |
| 332 | IOMUX_PADS(PAD_GPIO_8__GPIO1_IO08 | DIO_PAD_CFG), |
| 333 | /* PCIESKT_WDIS# */ |
| 334 | IOMUX_PADS(PAD_GPIO_17__GPIO7_IO12 | DIO_PAD_CFG), |
| 335 | }; |
| 336 | |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 337 | static iomux_v3_cfg_t const gw5912_gpio_pads[] = { |
| 338 | /* SD3_VSELECT */ |
| 339 | IOMUX_PADS(PAD_NANDF_CS1__GPIO6_IO14 | DIO_PAD_CFG), |
| 340 | /* RS232_EN# */ |
| 341 | IOMUX_PADS(PAD_SD4_DAT3__GPIO2_IO11 | DIO_PAD_CFG), |
| 342 | /* PCIESKT_WDIS# */ |
| 343 | IOMUX_PADS(PAD_GPIO_0__GPIO1_IO00 | DIO_PAD_CFG), |
| 344 | }; |
| 345 | |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 346 | /* Digital I/O */ |
| 347 | struct dio_cfg gw51xx_dio[] = { |
| 348 | { |
| 349 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 350 | IMX_GPIO_NR(1, 16), |
| 351 | { 0, 0 }, |
| 352 | 0 |
| 353 | }, |
| 354 | { |
| 355 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 356 | IMX_GPIO_NR(1, 19), |
| 357 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 358 | 2 |
| 359 | }, |
| 360 | { |
| 361 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 362 | IMX_GPIO_NR(1, 17), |
| 363 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 364 | 3 |
| 365 | }, |
| 366 | { |
| 367 | { IOMUX_PADS(PAD_SD1_CMD__GPIO1_IO18) }, |
| 368 | IMX_GPIO_NR(1, 18), |
| 369 | { IOMUX_PADS(PAD_SD1_CMD__PWM4_OUT) }, |
| 370 | 4 |
| 371 | }, |
| 372 | }; |
| 373 | |
| 374 | struct dio_cfg gw52xx_dio[] = { |
| 375 | { |
| 376 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 377 | IMX_GPIO_NR(1, 16), |
| 378 | { 0, 0 }, |
| 379 | 0 |
| 380 | }, |
| 381 | { |
| 382 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 383 | IMX_GPIO_NR(1, 19), |
| 384 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 385 | 2 |
| 386 | }, |
| 387 | { |
| 388 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 389 | IMX_GPIO_NR(1, 17), |
| 390 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 391 | 3 |
| 392 | }, |
| 393 | { |
| 394 | { IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 395 | IMX_GPIO_NR(1, 20), |
| 396 | { 0, 0 }, |
| 397 | 0 |
| 398 | }, |
| 399 | }; |
| 400 | |
| 401 | struct dio_cfg gw53xx_dio[] = { |
| 402 | { |
| 403 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 404 | IMX_GPIO_NR(1, 16), |
| 405 | { 0, 0 }, |
| 406 | 0 |
| 407 | }, |
| 408 | { |
| 409 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 410 | IMX_GPIO_NR(1, 19), |
| 411 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 412 | 2 |
| 413 | }, |
| 414 | { |
| 415 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 416 | IMX_GPIO_NR(1, 17), |
| 417 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 418 | 3 |
| 419 | }, |
| 420 | { |
| 421 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 422 | IMX_GPIO_NR(1, 20), |
| 423 | { 0, 0 }, |
| 424 | 0 |
| 425 | }, |
| 426 | }; |
| 427 | |
| 428 | struct dio_cfg gw54xx_dio[] = { |
| 429 | { |
| 430 | { IOMUX_PADS(PAD_GPIO_9__GPIO1_IO09) }, |
| 431 | IMX_GPIO_NR(1, 9), |
| 432 | { IOMUX_PADS(PAD_GPIO_9__PWM1_OUT) }, |
| 433 | 1 |
| 434 | }, |
| 435 | { |
| 436 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 437 | IMX_GPIO_NR(1, 19), |
| 438 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 439 | 2 |
| 440 | }, |
| 441 | { |
| 442 | { IOMUX_PADS(PAD_SD4_DAT1__GPIO2_IO09) }, |
| 443 | IMX_GPIO_NR(2, 9), |
| 444 | { IOMUX_PADS(PAD_SD4_DAT1__PWM3_OUT) }, |
| 445 | 3 |
| 446 | }, |
| 447 | { |
| 448 | { IOMUX_PADS(PAD_SD4_DAT2__GPIO2_IO10) }, |
| 449 | IMX_GPIO_NR(2, 10), |
| 450 | { IOMUX_PADS(PAD_SD4_DAT2__PWM4_OUT) }, |
| 451 | 4 |
| 452 | }, |
| 453 | }; |
| 454 | |
| 455 | struct dio_cfg gw551x_dio[] = { |
| 456 | { |
| 457 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 458 | IMX_GPIO_NR(1, 19), |
| 459 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 460 | 2 |
| 461 | }, |
| 462 | { |
| 463 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 464 | IMX_GPIO_NR(1, 17), |
| 465 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 466 | 3 |
| 467 | }, |
| 468 | }; |
| 469 | |
| 470 | struct dio_cfg gw552x_dio[] = { |
| 471 | { |
| 472 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 473 | IMX_GPIO_NR(1, 16), |
| 474 | { 0, 0 }, |
| 475 | 0 |
| 476 | }, |
| 477 | { |
| 478 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 479 | IMX_GPIO_NR(1, 19), |
| 480 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 481 | 2 |
| 482 | }, |
| 483 | { |
| 484 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 485 | IMX_GPIO_NR(1, 17), |
| 486 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 487 | 3 |
| 488 | }, |
| 489 | { |
| 490 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 491 | IMX_GPIO_NR(1, 20), |
| 492 | { 0, 0 }, |
| 493 | 0 |
| 494 | }, |
Tim Harvey | b1243da | 2016-07-15 07:14:24 -0700 | [diff] [blame] | 495 | { |
| 496 | {IOMUX_PADS(PAD_CSI0_PIXCLK__GPIO5_IO18) }, |
| 497 | IMX_GPIO_NR(5, 18), |
| 498 | { 0, 0 }, |
| 499 | 0 |
| 500 | }, |
| 501 | { |
| 502 | {IOMUX_PADS(PAD_CSI0_DATA_EN__GPIO5_IO20) }, |
| 503 | IMX_GPIO_NR(5, 20), |
| 504 | { 0, 0 }, |
| 505 | 0 |
| 506 | }, |
| 507 | { |
| 508 | {IOMUX_PADS(PAD_CSI0_VSYNC__GPIO5_IO21) }, |
| 509 | IMX_GPIO_NR(5, 21), |
| 510 | { 0, 0 }, |
| 511 | 0 |
| 512 | }, |
| 513 | { |
| 514 | {IOMUX_PADS(PAD_CSI0_DAT4__GPIO5_IO22) }, |
| 515 | IMX_GPIO_NR(5, 22), |
| 516 | { 0, 0 }, |
| 517 | 0 |
| 518 | }, |
| 519 | { |
| 520 | {IOMUX_PADS(PAD_CSI0_DAT5__GPIO5_IO23) }, |
| 521 | IMX_GPIO_NR(5, 23), |
| 522 | { 0, 0 }, |
| 523 | 0 |
| 524 | }, |
| 525 | { |
| 526 | {IOMUX_PADS(PAD_CSI0_DAT7__GPIO5_IO25) }, |
| 527 | IMX_GPIO_NR(5, 25), |
| 528 | { 0, 0 }, |
| 529 | 0 |
| 530 | }, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 531 | }; |
| 532 | |
| 533 | struct dio_cfg gw553x_dio[] = { |
| 534 | { |
| 535 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 536 | IMX_GPIO_NR(1, 16), |
| 537 | { 0, 0 }, |
| 538 | 0 |
| 539 | }, |
| 540 | { |
| 541 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 542 | IMX_GPIO_NR(1, 19), |
| 543 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 544 | 2 |
| 545 | }, |
| 546 | { |
| 547 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 548 | IMX_GPIO_NR(1, 17), |
| 549 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 550 | 3 |
| 551 | }, |
| 552 | { |
| 553 | { IOMUX_PADS(PAD_SD1_CMD__GPIO1_IO18) }, |
| 554 | IMX_GPIO_NR(1, 18), |
| 555 | { IOMUX_PADS(PAD_SD1_CMD__PWM4_OUT) }, |
| 556 | 4 |
| 557 | }, |
| 558 | }; |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 559 | |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 560 | struct dio_cfg gw560x_dio[] = { |
| 561 | { |
| 562 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 563 | IMX_GPIO_NR(1, 16), |
| 564 | { 0, 0 }, |
| 565 | 0 |
| 566 | }, |
| 567 | { |
| 568 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 569 | IMX_GPIO_NR(1, 19), |
| 570 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 571 | 2 |
| 572 | }, |
| 573 | { |
| 574 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 575 | IMX_GPIO_NR(1, 17), |
| 576 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 577 | 3 |
| 578 | }, |
| 579 | { |
| 580 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 581 | IMX_GPIO_NR(1, 20), |
| 582 | { 0, 0 }, |
| 583 | 0 |
| 584 | }, |
| 585 | }; |
| 586 | |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 587 | struct dio_cfg gw5901_dio[] = { |
| 588 | { |
| 589 | { IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14) }, |
| 590 | IMX_GPIO_NR(5, 14), |
| 591 | { 0, 0 }, |
| 592 | 0 |
| 593 | }, |
| 594 | { |
| 595 | { IOMUX_PADS(PAD_DISP0_DAT21__GPIO5_IO15) }, |
| 596 | IMX_GPIO_NR(5, 15), |
| 597 | { 0, 0 }, |
| 598 | 0 |
| 599 | }, |
| 600 | { |
| 601 | { IOMUX_PADS(PAD_DISP0_DAT22__GPIO5_IO16) }, |
| 602 | IMX_GPIO_NR(5, 16), |
| 603 | { 0, 0 }, |
| 604 | 0 |
| 605 | }, |
| 606 | { |
| 607 | { IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17) }, |
| 608 | IMX_GPIO_NR(5, 17), |
| 609 | { 0, 0 }, |
| 610 | 0 |
| 611 | }, |
| 612 | }; |
| 613 | |
| 614 | struct dio_cfg gw5902_dio[] = { |
| 615 | { |
| 616 | { IOMUX_PADS(PAD_DISP0_DAT20__GPIO5_IO14) }, |
| 617 | IMX_GPIO_NR(5, 14), |
| 618 | { 0, 0 }, |
| 619 | 0 |
| 620 | }, |
| 621 | { |
| 622 | { IOMUX_PADS(PAD_DISP0_DAT21__GPIO5_IO15) }, |
| 623 | IMX_GPIO_NR(5, 15), |
| 624 | { 0, 0 }, |
| 625 | 0 |
| 626 | }, |
| 627 | { |
| 628 | { IOMUX_PADS(PAD_DISP0_DAT22__GPIO5_IO16) }, |
| 629 | IMX_GPIO_NR(5, 16), |
| 630 | { 0, 0 }, |
| 631 | 0 |
| 632 | }, |
| 633 | { |
| 634 | { IOMUX_PADS(PAD_DISP0_DAT23__GPIO5_IO17) }, |
| 635 | IMX_GPIO_NR(5, 17), |
| 636 | { 0, 0 }, |
| 637 | 0 |
| 638 | }, |
| 639 | }; |
| 640 | |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 641 | struct dio_cfg gw5903_dio[] = { |
| 642 | }; |
| 643 | |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 644 | struct dio_cfg gw5904_dio[] = { |
| 645 | { |
| 646 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 647 | IMX_GPIO_NR(1, 16), |
| 648 | { 0, 0 }, |
| 649 | 0 |
| 650 | }, |
| 651 | { |
| 652 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 653 | IMX_GPIO_NR(1, 19), |
| 654 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 655 | 2 |
| 656 | }, |
| 657 | { |
| 658 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 659 | IMX_GPIO_NR(1, 17), |
| 660 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 661 | 3 |
| 662 | }, |
| 663 | { |
| 664 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 665 | IMX_GPIO_NR(1, 20), |
| 666 | { 0, 0 }, |
| 667 | 0 |
| 668 | }, |
| 669 | { |
| 670 | {IOMUX_PADS(PAD_NANDF_D0__GPIO2_IO00) }, |
| 671 | IMX_GPIO_NR(2, 0), |
| 672 | { 0, 0 }, |
| 673 | 0 |
| 674 | }, |
| 675 | { |
| 676 | {IOMUX_PADS(PAD_NANDF_D1__GPIO2_IO01) }, |
| 677 | IMX_GPIO_NR(2, 1), |
| 678 | { 0, 0 }, |
| 679 | 0 |
| 680 | }, |
| 681 | { |
| 682 | {IOMUX_PADS(PAD_NANDF_D2__GPIO2_IO02) }, |
| 683 | IMX_GPIO_NR(2, 2), |
| 684 | { 0, 0 }, |
| 685 | 0 |
| 686 | }, |
| 687 | { |
| 688 | {IOMUX_PADS(PAD_NANDF_D3__GPIO2_IO03) }, |
| 689 | IMX_GPIO_NR(2, 3), |
| 690 | { 0, 0 }, |
| 691 | 0 |
| 692 | }, |
| 693 | { |
| 694 | {IOMUX_PADS(PAD_NANDF_D4__GPIO2_IO04) }, |
| 695 | IMX_GPIO_NR(2, 4), |
| 696 | { 0, 0 }, |
| 697 | 0 |
| 698 | }, |
| 699 | { |
| 700 | {IOMUX_PADS(PAD_NANDF_D5__GPIO2_IO05) }, |
| 701 | IMX_GPIO_NR(2, 5), |
| 702 | { 0, 0 }, |
| 703 | 0 |
| 704 | }, |
| 705 | { |
| 706 | {IOMUX_PADS(PAD_NANDF_D6__GPIO2_IO06) }, |
| 707 | IMX_GPIO_NR(2, 6), |
| 708 | { 0, 0 }, |
| 709 | 0 |
| 710 | }, |
| 711 | { |
| 712 | {IOMUX_PADS(PAD_NANDF_D7__GPIO2_IO07) }, |
| 713 | IMX_GPIO_NR(2, 7), |
| 714 | { 0, 0 }, |
| 715 | 0 |
| 716 | }, |
| 717 | }; |
| 718 | |
Tim Harvey | b7c48a9 | 2019-02-04 13:10:54 -0800 | [diff] [blame] | 719 | struct dio_cfg gw5906_dio[] = { |
| 720 | { |
| 721 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 722 | IMX_GPIO_NR(1, 16), |
| 723 | { 0, 0 }, |
| 724 | 0 |
| 725 | }, |
| 726 | { |
| 727 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 728 | IMX_GPIO_NR(1, 19), |
| 729 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 730 | 2 |
| 731 | }, |
| 732 | { |
| 733 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 734 | IMX_GPIO_NR(1, 17), |
| 735 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 736 | 3 |
| 737 | }, |
| 738 | { |
| 739 | {IOMUX_PADS(PAD_SD1_CLK__GPIO1_IO20) }, |
| 740 | IMX_GPIO_NR(1, 20), |
| 741 | { 0, 0 }, |
| 742 | 0 |
| 743 | }, |
| 744 | }; |
| 745 | |
Tim Harvey | b7c9f36 | 2021-07-24 10:40:44 -0700 | [diff] [blame] | 746 | struct dio_cfg gw5913_dio[] = { |
| 747 | { |
| 748 | { IOMUX_PADS(PAD_SD1_DAT0__GPIO1_IO16) }, |
| 749 | IMX_GPIO_NR(1, 16), |
| 750 | { 0, 0 }, |
| 751 | 0 |
| 752 | }, |
| 753 | { |
| 754 | { IOMUX_PADS(PAD_SD1_DAT2__GPIO1_IO19) }, |
| 755 | IMX_GPIO_NR(1, 19), |
| 756 | { IOMUX_PADS(PAD_SD1_DAT2__PWM2_OUT) }, |
| 757 | 2 |
| 758 | }, |
| 759 | { |
| 760 | { IOMUX_PADS(PAD_SD1_DAT1__GPIO1_IO17) }, |
| 761 | IMX_GPIO_NR(1, 17), |
| 762 | { IOMUX_PADS(PAD_SD1_DAT1__PWM3_OUT) }, |
| 763 | 3 |
| 764 | }, |
| 765 | { |
| 766 | { IOMUX_PADS(PAD_SD1_CMD__GPIO1_IO18) }, |
| 767 | IMX_GPIO_NR(1, 18), |
| 768 | { IOMUX_PADS(PAD_SD1_CMD__PWM4_OUT) }, |
| 769 | 4 |
| 770 | }, |
| 771 | { |
| 772 | { IOMUX_PADS(PAD_SD2_DAT0__GPIO1_IO15) }, |
| 773 | IMX_GPIO_NR(1, 15), |
| 774 | { 0, 0 }, |
| 775 | 0 |
| 776 | }, |
| 777 | { |
| 778 | { IOMUX_PADS(PAD_SD2_DAT1__GPIO1_IO14) }, |
| 779 | IMX_GPIO_NR(1, 14), |
| 780 | { 0, 0 }, |
| 781 | 0 |
| 782 | }, |
| 783 | { |
| 784 | { IOMUX_PADS(PAD_GPIO_19__GPIO4_IO05) }, |
| 785 | IMX_GPIO_NR(4, 5), |
| 786 | { 0, 0 }, |
| 787 | 0 |
| 788 | }, |
| 789 | }; |
| 790 | |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 791 | /* |
| 792 | * Board Specific GPIO |
| 793 | */ |
| 794 | struct ventana gpio_cfg[GW_UNKNOWN] = { |
| 795 | /* GW5400proto */ |
| 796 | { |
| 797 | .gpio_pads = gw54xx_gpio_pads, |
| 798 | .num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 799 | .dio_cfg = gw54xx_dio, |
| 800 | .dio_num = ARRAY_SIZE(gw54xx_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 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 | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 806 | .mmc_cd = IMX_GPIO_NR(7, 0), |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 807 | .wdis = -1, |
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 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 817 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 818 | .gps_shdn = IMX_GPIO_NR(1, 2), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 819 | .wdis = IMX_GPIO_NR(7, 12), |
| 820 | }, |
| 821 | |
| 822 | /* GW52xx */ |
| 823 | { |
| 824 | .gpio_pads = gw52xx_gpio_pads, |
| 825 | .num_pads = ARRAY_SIZE(gw52xx_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 826 | .dio_cfg = gw52xx_dio, |
| 827 | .dio_num = ARRAY_SIZE(gw52xx_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 828 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 829 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 830 | .gps_shdn = IMX_GPIO_NR(1, 27), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 831 | .usb_sel = IMX_GPIO_NR(1, 2), |
| 832 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 833 | .msata_en = GP_MSATA_SEL, |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 834 | .rs232_en = GP_RS232_EN, |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 835 | .vsel_pin = IMX_GPIO_NR(6, 14), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 836 | .mmc_cd = IMX_GPIO_NR(7, 0), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 837 | }, |
| 838 | |
| 839 | /* GW53xx */ |
| 840 | { |
| 841 | .gpio_pads = gw53xx_gpio_pads, |
| 842 | .num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 843 | .dio_cfg = gw53xx_dio, |
| 844 | .dio_num = ARRAY_SIZE(gw53xx_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 845 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 846 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 847 | .gps_shdn = IMX_GPIO_NR(1, 27), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 848 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 849 | .msata_en = GP_MSATA_SEL, |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 850 | .rs232_en = GP_RS232_EN, |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 851 | .vsel_pin = IMX_GPIO_NR(6, 14), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 852 | .mmc_cd = IMX_GPIO_NR(7, 0), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 853 | }, |
| 854 | |
| 855 | /* GW54xx */ |
| 856 | { |
| 857 | .gpio_pads = gw54xx_gpio_pads, |
| 858 | .num_pads = ARRAY_SIZE(gw54xx_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 859 | .dio_cfg = gw54xx_dio, |
| 860 | .dio_num = ARRAY_SIZE(gw54xx_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 861 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 862 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 863 | .rs485en = IMX_GPIO_NR(7, 1), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 864 | .dioi2c_en = IMX_GPIO_NR(4, 5), |
| 865 | .pcie_sson = IMX_GPIO_NR(1, 20), |
| 866 | .wdis = IMX_GPIO_NR(5, 17), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 867 | .msata_en = GP_MSATA_SEL, |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 868 | .rs232_en = GP_RS232_EN, |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 869 | .vsel_pin = IMX_GPIO_NR(6, 14), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 870 | .mmc_cd = IMX_GPIO_NR(7, 0), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 871 | }, |
| 872 | |
| 873 | /* GW551x */ |
| 874 | { |
| 875 | .gpio_pads = gw551x_gpio_pads, |
| 876 | .num_pads = ARRAY_SIZE(gw551x_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 877 | .dio_cfg = gw551x_dio, |
| 878 | .dio_num = ARRAY_SIZE(gw551x_dio), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 879 | .wdis = IMX_GPIO_NR(7, 12), |
| 880 | }, |
| 881 | |
| 882 | /* GW552x */ |
| 883 | { |
| 884 | .gpio_pads = gw552x_gpio_pads, |
| 885 | .num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 886 | .dio_cfg = gw552x_dio, |
| 887 | .dio_num = ARRAY_SIZE(gw552x_dio), |
Tim Harvey | db7edfa | 2015-05-26 11:04:54 -0700 | [diff] [blame] | 888 | .usb_sel = IMX_GPIO_NR(1, 7), |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 889 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 890 | .msata_en = GP_MSATA_SEL, |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 891 | }, |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 892 | |
| 893 | /* GW553x */ |
| 894 | { |
| 895 | .gpio_pads = gw553x_gpio_pads, |
| 896 | .num_pads = ARRAY_SIZE(gw553x_gpio_pads)/2, |
Tim Harvey | 41595b5 | 2016-07-15 07:14:23 -0700 | [diff] [blame] | 897 | .dio_cfg = gw553x_dio, |
| 898 | .dio_num = ARRAY_SIZE(gw553x_dio), |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 899 | .wdis = IMX_GPIO_NR(7, 12), |
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), |
| 902 | }, |
| 903 | |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 904 | /* GW560x */ |
| 905 | { |
| 906 | .gpio_pads = gw560x_gpio_pads, |
| 907 | .num_pads = ARRAY_SIZE(gw560x_gpio_pads)/2, |
| 908 | .dio_cfg = gw560x_dio, |
| 909 | .dio_num = ARRAY_SIZE(gw560x_dio), |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 910 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 911 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 912 | .rs232_en = GP_RS232_EN, |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 913 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 914 | .mmc_cd = IMX_GPIO_NR(7, 0), |
| 915 | }, |
| 916 | |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 917 | /* GW5901 */ |
| 918 | { |
| 919 | .gpio_pads = gw5901_gpio_pads, |
| 920 | .num_pads = ARRAY_SIZE(gw5901_gpio_pads)/2, |
| 921 | .dio_cfg = gw5901_dio, |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 922 | .wdis = -1, |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 923 | }, |
| 924 | |
| 925 | /* GW5902 */ |
| 926 | { |
| 927 | .gpio_pads = gw5902_gpio_pads, |
| 928 | .num_pads = ARRAY_SIZE(gw5902_gpio_pads)/2, |
| 929 | .dio_cfg = gw5902_dio, |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 930 | .rs232_en = GP_RS232_EN, |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 931 | .wdis = -1, |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 932 | }, |
| 933 | |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 934 | /* GW5903 */ |
| 935 | { |
| 936 | .gpio_pads = gw5903_gpio_pads, |
| 937 | .num_pads = ARRAY_SIZE(gw5903_gpio_pads)/2, |
| 938 | .dio_cfg = gw5903_dio, |
| 939 | .dio_num = ARRAY_SIZE(gw5903_dio), |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 940 | .mmc_cd = IMX_GPIO_NR(6, 11), |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 941 | .wdis = -1, |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 942 | }, |
| 943 | |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 944 | /* GW5904 */ |
| 945 | { |
| 946 | .gpio_pads = gw5904_gpio_pads, |
| 947 | .num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2, |
| 948 | .dio_cfg = gw5904_dio, |
| 949 | .dio_num = ARRAY_SIZE(gw5904_dio), |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 950 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 951 | .mezz_irq = IMX_GPIO_NR(2, 18), |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 952 | .wdis = -1, |
Tim Harvey | 892068c | 2016-05-24 11:03:58 -0700 | [diff] [blame] | 953 | }, |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 954 | |
| 955 | /* GW5905 */ |
| 956 | { |
| 957 | .gpio_pads = gw5905_gpio_pads, |
| 958 | .num_pads = ARRAY_SIZE(gw5905_gpio_pads)/2, |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 959 | .wdis = IMX_GPIO_NR(7, 13), |
| 960 | }, |
Tim Harvey | b7c48a9 | 2019-02-04 13:10:54 -0800 | [diff] [blame] | 961 | |
| 962 | /* GW5906 */ |
| 963 | { |
| 964 | .gpio_pads = gw552x_gpio_pads, |
| 965 | .num_pads = ARRAY_SIZE(gw552x_gpio_pads)/2, |
| 966 | .dio_cfg = gw5906_dio, |
| 967 | .dio_num = ARRAY_SIZE(gw5906_dio), |
Tim Harvey | b7c48a9 | 2019-02-04 13:10:54 -0800 | [diff] [blame] | 968 | .usb_sel = IMX_GPIO_NR(1, 7), |
| 969 | .wdis = IMX_GPIO_NR(7, 12), |
| 970 | .msata_en = GP_MSATA_SEL, |
Tim Harvey | b7c48a9 | 2019-02-04 13:10:54 -0800 | [diff] [blame] | 971 | }, |
Tim Harvey | 83cad80 | 2019-02-04 13:10:55 -0800 | [diff] [blame] | 972 | |
| 973 | /* GW5907 */ |
| 974 | { |
| 975 | .gpio_pads = gw51xx_gpio_pads, |
| 976 | .num_pads = ARRAY_SIZE(gw51xx_gpio_pads)/2, |
| 977 | .dio_cfg = gw51xx_dio, |
| 978 | .dio_num = ARRAY_SIZE(gw51xx_dio), |
Tim Harvey | 83cad80 | 2019-02-04 13:10:55 -0800 | [diff] [blame] | 979 | .wdis = IMX_GPIO_NR(7, 12), |
Tim Harvey | 83cad80 | 2019-02-04 13:10:55 -0800 | [diff] [blame] | 980 | }, |
Tim Harvey | c262540 | 2019-02-04 13:10:56 -0800 | [diff] [blame] | 981 | |
| 982 | /* GW5908 */ |
| 983 | { |
| 984 | .gpio_pads = gw53xx_gpio_pads, |
| 985 | .num_pads = ARRAY_SIZE(gw53xx_gpio_pads)/2, |
| 986 | .dio_cfg = gw53xx_dio, |
| 987 | .dio_num = ARRAY_SIZE(gw53xx_dio), |
Tim Harvey | c262540 | 2019-02-04 13:10:56 -0800 | [diff] [blame] | 988 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 989 | .mezz_irq = IMX_GPIO_NR(2, 18), |
| 990 | .gps_shdn = IMX_GPIO_NR(1, 27), |
Tim Harvey | c262540 | 2019-02-04 13:10:56 -0800 | [diff] [blame] | 991 | .wdis = IMX_GPIO_NR(7, 12), |
| 992 | .msata_en = GP_MSATA_SEL, |
| 993 | .rs232_en = GP_RS232_EN, |
| 994 | }, |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 995 | |
| 996 | /* GW5909 */ |
| 997 | { |
| 998 | .gpio_pads = gw5904_gpio_pads, |
| 999 | .num_pads = ARRAY_SIZE(gw5904_gpio_pads)/2, |
| 1000 | .dio_cfg = gw5904_dio, |
| 1001 | .dio_num = ARRAY_SIZE(gw5904_dio), |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 1002 | .mezz_pwren = IMX_GPIO_NR(2, 19), |
| 1003 | .mezz_irq = IMX_GPIO_NR(2, 18), |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 1004 | .wdis = -1, |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 1005 | }, |
Tim Harvey | 08aec66 | 2021-07-24 10:40:42 -0700 | [diff] [blame] | 1006 | |
| 1007 | /* GW5910 */ |
| 1008 | { |
| 1009 | .gpio_pads = gw5910_gpio_pads, |
| 1010 | .num_pads = ARRAY_SIZE(gw5910_gpio_pads) / 2, |
| 1011 | .dio_cfg = gw52xx_dio, |
| 1012 | .dio_num = ARRAY_SIZE(gw52xx_dio), |
| 1013 | .wdis = IMX_GPIO_NR(7, 12), |
| 1014 | .rs232_en = GP_RS232_EN, |
| 1015 | .vsel_pin = IMX_GPIO_NR(6, 14), |
| 1016 | .mmc_cd = IMX_GPIO_NR(7, 0), |
| 1017 | }, |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 1018 | |
| 1019 | /* GW5912 */ |
| 1020 | { |
| 1021 | .gpio_pads = gw5912_gpio_pads, |
| 1022 | .num_pads = ARRAY_SIZE(gw5912_gpio_pads) / 2, |
| 1023 | .dio_cfg = gw54xx_dio, |
| 1024 | .dio_num = ARRAY_SIZE(gw54xx_dio), |
| 1025 | .wdis = IMX_GPIO_NR(1, 0), |
| 1026 | .rs232_en = GP_RS232_EN, |
| 1027 | .vsel_pin = IMX_GPIO_NR(6, 14), |
| 1028 | .mmc_cd = IMX_GPIO_NR(7, 0), |
| 1029 | }, |
Tim Harvey | b7c9f36 | 2021-07-24 10:40:44 -0700 | [diff] [blame] | 1030 | |
| 1031 | /* GW5913 */ |
| 1032 | { |
| 1033 | .gpio_pads = gw5912_gpio_pads, |
| 1034 | .num_pads = ARRAY_SIZE(gw5912_gpio_pads) / 2, |
| 1035 | .dio_cfg = gw5913_dio, |
| 1036 | .dio_num = ARRAY_SIZE(gw5913_dio), |
| 1037 | .wdis = IMX_GPIO_NR(1, 0), |
| 1038 | }, |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1039 | }; |
| 1040 | |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1041 | #define SETUP_GPIO_OUTPUT(gpio, name, level) \ |
| 1042 | gpio_request(gpio, name); \ |
| 1043 | gpio_direction_output(gpio, level); |
| 1044 | #define SETUP_GPIO_INPUT(gpio, name) \ |
| 1045 | gpio_request(gpio, name); \ |
| 1046 | gpio_direction_input(gpio); |
Tim Harvey | 4137785 | 2022-04-13 09:29:16 -0700 | [diff] [blame] | 1047 | void setup_iomux_gpio(int board) |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1048 | { |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1049 | if (board >= GW_UNKNOWN) |
| 1050 | return; |
| 1051 | |
| 1052 | /* board specific iomux */ |
| 1053 | imx_iomux_v3_setup_multiple_pads(gpio_cfg[board].gpio_pads, |
| 1054 | gpio_cfg[board].num_pads); |
| 1055 | |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 1056 | /* RS232_EN# */ |
| 1057 | if (gpio_cfg[board].rs232_en) { |
Tim Harvey | 6ea02c9 | 2017-03-13 08:51:05 -0700 | [diff] [blame] | 1058 | gpio_request(gpio_cfg[board].rs232_en, "rs232_en#"); |
Tim Harvey | 2cb61c1 | 2016-07-15 07:14:22 -0700 | [diff] [blame] | 1059 | gpio_direction_output(gpio_cfg[board].rs232_en, 0); |
| 1060 | } |
| 1061 | |
Tim Harvey | 86b7532 | 2016-05-24 11:03:56 -0700 | [diff] [blame] | 1062 | /* MSATA Enable - default to PCI */ |
| 1063 | if (gpio_cfg[board].msata_en) { |
| 1064 | gpio_request(gpio_cfg[board].msata_en, "msata_en"); |
| 1065 | gpio_direction_output(gpio_cfg[board].msata_en, 0); |
| 1066 | } |
| 1067 | |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1068 | /* Expansion Mezzanine IO */ |
| 1069 | if (gpio_cfg[board].mezz_pwren) { |
| 1070 | gpio_request(gpio_cfg[board].mezz_pwren, "mezz_pwr"); |
| 1071 | gpio_direction_output(gpio_cfg[board].mezz_pwren, 0); |
| 1072 | } |
| 1073 | if (gpio_cfg[board].mezz_irq) { |
| 1074 | gpio_request(gpio_cfg[board].mezz_irq, "mezz_irq#"); |
| 1075 | gpio_direction_input(gpio_cfg[board].mezz_irq); |
| 1076 | } |
| 1077 | |
| 1078 | /* RS485 Transmit Enable */ |
| 1079 | if (gpio_cfg[board].rs485en) { |
| 1080 | gpio_request(gpio_cfg[board].rs485en, "rs485_en"); |
| 1081 | gpio_direction_output(gpio_cfg[board].rs485en, 0); |
| 1082 | } |
| 1083 | |
| 1084 | /* GPS_SHDN */ |
| 1085 | if (gpio_cfg[board].gps_shdn) { |
| 1086 | gpio_request(gpio_cfg[board].gps_shdn, "gps_shdn"); |
| 1087 | gpio_direction_output(gpio_cfg[board].gps_shdn, 1); |
| 1088 | } |
| 1089 | |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1090 | /* DIOI2C_DIS# */ |
| 1091 | if (gpio_cfg[board].dioi2c_en) { |
| 1092 | gpio_request(gpio_cfg[board].dioi2c_en, "dioi2c_dis#"); |
| 1093 | gpio_direction_output(gpio_cfg[board].dioi2c_en, 0); |
| 1094 | } |
| 1095 | |
| 1096 | /* PCICK_SSON: disable spread-spectrum clock */ |
| 1097 | if (gpio_cfg[board].pcie_sson) { |
| 1098 | gpio_request(gpio_cfg[board].pcie_sson, "pci_sson"); |
| 1099 | gpio_direction_output(gpio_cfg[board].pcie_sson, 0); |
| 1100 | } |
| 1101 | |
| 1102 | /* USBOTG mux routing */ |
| 1103 | if (gpio_cfg[board].usb_sel) { |
| 1104 | gpio_request(gpio_cfg[board].usb_sel, "usb_pcisel"); |
| 1105 | gpio_direction_output(gpio_cfg[board].usb_sel, 0); |
| 1106 | } |
| 1107 | |
| 1108 | /* PCISKT_WDIS# (Wireless disable GPIO to miniPCIe sockets) */ |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 1109 | if (gpio_cfg[board].wdis != -1) { |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1110 | gpio_request(gpio_cfg[board].wdis, "wlan_dis"); |
| 1111 | gpio_direction_output(gpio_cfg[board].wdis, 1); |
| 1112 | } |
Tim Harvey | 147b576 | 2016-05-24 11:03:59 -0700 | [diff] [blame] | 1113 | |
| 1114 | /* sense vselect pin to see if we support uhs-i */ |
Tim Harvey | d7babd4 | 2017-03-13 08:51:08 -0700 | [diff] [blame] | 1115 | if (gpio_cfg[board].vsel_pin) { |
| 1116 | gpio_request(gpio_cfg[board].vsel_pin, "sd3_vselect"); |
| 1117 | gpio_direction_input(gpio_cfg[board].vsel_pin); |
| 1118 | gpio_cfg[board].usd_vsel = !gpio_get_value(gpio_cfg[board].vsel_pin); |
| 1119 | } |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1120 | |
| 1121 | /* microSD CD */ |
| 1122 | if (gpio_cfg[board].mmc_cd) { |
| 1123 | gpio_request(gpio_cfg[board].mmc_cd, "sd_cd"); |
| 1124 | gpio_direction_input(gpio_cfg[board].mmc_cd); |
| 1125 | } |
| 1126 | |
| 1127 | /* Anything else board specific */ |
| 1128 | switch(board) { |
Tim Harvey | 409fe9a | 2021-07-24 10:40:45 -0700 | [diff] [blame] | 1129 | case GW53xx: |
| 1130 | gpio_request(IMX_GPIO_NR(3, 15), "j6_pwren"); |
| 1131 | gpio_direction_output(IMX_GPIO_NR(3, 15), 1); |
| 1132 | gpio_request(IMX_GPIO_NR(3, 14), "gbe_en"); |
| 1133 | gpio_direction_output(IMX_GPIO_NR(3, 14), 1); |
| 1134 | break; |
Tim Harvey | db06398 | 2021-07-24 10:40:46 -0700 | [diff] [blame] | 1135 | case GW54xx: |
| 1136 | gpio_request(IMX_GPIO_NR(3, 15), "j7_pwren"); |
| 1137 | gpio_direction_output(IMX_GPIO_NR(3, 15), 1); |
| 1138 | gpio_request(IMX_GPIO_NR(3, 14), "gbe_en"); |
| 1139 | gpio_direction_output(IMX_GPIO_NR(3, 14), 1); |
| 1140 | break; |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1141 | case GW560x: |
| 1142 | gpio_request(IMX_GPIO_NR(4, 26), "12p0_en"); |
| 1143 | gpio_direction_output(IMX_GPIO_NR(4, 26), 1); |
| 1144 | break; |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 1145 | case GW5902: |
Tim Harvey | 5852a33 | 2019-02-04 13:10:58 -0800 | [diff] [blame] | 1146 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(7, 12), "5P0V_EN", 1); |
| 1147 | break; |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 1148 | case GW5903: |
| 1149 | gpio_request(IMX_GPIO_NR(3, 31) , "usbh1-ehci_pwr"); |
| 1150 | gpio_direction_output(IMX_GPIO_NR(3, 31), 1); |
| 1151 | gpio_request(IMX_GPIO_NR(4, 15) , "usbh2-otg_pwr"); |
| 1152 | gpio_direction_output(IMX_GPIO_NR(4, 15), 1); |
| 1153 | gpio_request(IMX_GPIO_NR(4, 7) , "usbdpc_pwr"); |
| 1154 | gpio_direction_output(IMX_GPIO_NR(4, 15), 1); |
| 1155 | gpio_request(IMX_GPIO_NR(1, 25) , "rgmii_en"); |
| 1156 | gpio_direction_output(IMX_GPIO_NR(1, 25), 1); |
| 1157 | gpio_request(IMX_GPIO_NR(4, 6) , "touch_irq#"); |
| 1158 | gpio_direction_input(IMX_GPIO_NR(4, 6)); |
| 1159 | gpio_request(IMX_GPIO_NR(4, 8) , "touch_rst"); |
| 1160 | gpio_direction_output(IMX_GPIO_NR(4, 8), 1); |
| 1161 | gpio_request(IMX_GPIO_NR(1, 7) , "bklt_12ven"); |
| 1162 | gpio_direction_output(IMX_GPIO_NR(1, 7), 1); |
| 1163 | break; |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 1164 | case GW5909: |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1165 | case GW5904: |
Tim Harvey | 74107f7 | 2019-02-04 13:10:59 -0800 | [diff] [blame] | 1166 | gpio_request(IMX_GPIO_NR(4, 23), "rs485_en"); |
| 1167 | gpio_direction_output(IMX_GPIO_NR(4, 23), 0); |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1168 | gpio_request(IMX_GPIO_NR(5, 11), "skt1_wdis#"); |
| 1169 | gpio_direction_output(IMX_GPIO_NR(5, 11), 1); |
| 1170 | gpio_request(IMX_GPIO_NR(5, 12), "skt1_rst#"); |
| 1171 | gpio_direction_output(IMX_GPIO_NR(5, 12), 1); |
| 1172 | gpio_request(IMX_GPIO_NR(5, 13), "skt2_wdis#"); |
| 1173 | gpio_direction_output(IMX_GPIO_NR(5, 13), 1); |
| 1174 | gpio_request(IMX_GPIO_NR(1, 15), "m2_off#"); |
| 1175 | gpio_direction_output(IMX_GPIO_NR(1, 15), 1); |
| 1176 | gpio_request(IMX_GPIO_NR(1, 14), "m2_wdis#"); |
| 1177 | gpio_direction_output(IMX_GPIO_NR(1, 14), 1); |
| 1178 | gpio_request(IMX_GPIO_NR(1, 13), "m2_rst#"); |
| 1179 | gpio_direction_output(IMX_GPIO_NR(1, 13), 1); |
| 1180 | break; |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1181 | case GW5905: |
| 1182 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 7), "usb_pcisel", 0); |
| 1183 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 9), "lvds_cabc", 1); |
| 1184 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 14), "mipi_pdwn", 1); |
| 1185 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 15), "mipi_rst#", 0); |
| 1186 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(2, 3), "emmy_pdwn#", 1); |
| 1187 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(4, 5), "spk_shdn#", 0); |
| 1188 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(4, 8), "touch_rst", 0); |
| 1189 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(4, 6), "touch_irq", 0); |
| 1190 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 5), "flash_en1", 0); |
| 1191 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 6), "flash_en2", 0); |
| 1192 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 14), "dect_rst#", 1); |
| 1193 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 17), "codec_rst#", 0); |
| 1194 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(5, 26), "imu_den", 1); |
| 1195 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(7, 12), "lvds_cabc", 0); |
| 1196 | mdelay(100); |
| 1197 | /* |
| 1198 | * gauruntee touch controller comes out of reset with INT |
| 1199 | * low for address |
| 1200 | */ |
| 1201 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(4, 8), "touch_rst", 1); |
| 1202 | break; |
Tim Harvey | 08aec66 | 2021-07-24 10:40:42 -0700 | [diff] [blame] | 1203 | case GW5910: |
| 1204 | /* CC1352 */ |
| 1205 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 7), "rf_reset#", 1); |
| 1206 | SETUP_GPIO_OUTPUT(IMX_GPIO_NR(1, 8), "rf_boot", 1); |
| 1207 | break; |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1208 | } |
Tim Harvey | 0cee224 | 2015-05-08 18:28:35 -0700 | [diff] [blame] | 1209 | } |
| 1210 | |
Yangbo Lu | 7334038 | 2019-06-21 11:42:28 +0800 | [diff] [blame] | 1211 | #ifdef CONFIG_FSL_ESDHC_IMX |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1212 | static struct fsl_esdhc_cfg usdhc_cfg[2]; |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1213 | |
Masahiro Yamada | f7ed78b | 2020-06-26 15:13:33 +0900 | [diff] [blame] | 1214 | int board_mmc_init(struct bd_info *bis) |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1215 | { |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1216 | int ret; |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1217 | |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1218 | switch (board_type) { |
| 1219 | case GW52xx: |
| 1220 | case GW53xx: |
| 1221 | case GW54xx: |
| 1222 | case GW553x: |
Tim Harvey | 08aec66 | 2021-07-24 10:40:42 -0700 | [diff] [blame] | 1223 | case GW5910: |
Tim Harvey | d67ad6e | 2021-07-24 10:40:43 -0700 | [diff] [blame] | 1224 | case GW5912: |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1225 | /* usdhc3: 4bit microSD */ |
| 1226 | SETUP_IOMUX_PADS(usdhc3_pads); |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1227 | usdhc_cfg[0].esdhc_base = USDHC3_BASE_ADDR; |
| 1228 | usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
| 1229 | usdhc_cfg[0].max_bus_width = 4; |
| 1230 | return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); |
| 1231 | case GW560x: |
| 1232 | /* usdhc2: 8-bit eMMC */ |
| 1233 | SETUP_IOMUX_PADS(gw560x_emmc_sd2_pads); |
| 1234 | usdhc_cfg[0].esdhc_base = USDHC2_BASE_ADDR; |
| 1235 | usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); |
| 1236 | usdhc_cfg[0].max_bus_width = 8; |
| 1237 | ret = fsl_esdhc_initialize(bis, &usdhc_cfg[0]); |
| 1238 | if (ret) |
| 1239 | return ret; |
| 1240 | /* usdhc3: 4-bit microSD */ |
| 1241 | SETUP_IOMUX_PADS(usdhc3_pads); |
| 1242 | usdhc_cfg[1].esdhc_base = USDHC3_BASE_ADDR; |
| 1243 | usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
| 1244 | usdhc_cfg[1].max_bus_width = 4; |
| 1245 | return fsl_esdhc_initialize(bis, &usdhc_cfg[1]); |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 1246 | case GW5903: |
| 1247 | /* usdhc3: 8-bit eMMC */ |
| 1248 | SETUP_IOMUX_PADS(gw5904_emmc_pads); |
| 1249 | usdhc_cfg[0].esdhc_base = USDHC3_BASE_ADDR; |
| 1250 | usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
| 1251 | usdhc_cfg[0].max_bus_width = 8; |
| 1252 | ret = fsl_esdhc_initialize(bis, &usdhc_cfg[0]); |
| 1253 | if (ret) |
| 1254 | return ret; |
| 1255 | /* usdhc2: 4-bit microSD */ |
| 1256 | SETUP_IOMUX_PADS(gw5904_mmc_pads); |
| 1257 | usdhc_cfg[1].esdhc_base = USDHC2_BASE_ADDR; |
| 1258 | usdhc_cfg[1].sdhc_clk = mxc_get_clock(MXC_ESDHC2_CLK); |
| 1259 | usdhc_cfg[1].max_bus_width = 4; |
| 1260 | return fsl_esdhc_initialize(bis, &usdhc_cfg[1]); |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1261 | case GW5904: |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1262 | case GW5905: |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 1263 | case GW5909: |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1264 | /* usdhc3: 8bit eMMC */ |
| 1265 | SETUP_IOMUX_PADS(gw5904_emmc_pads); |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1266 | usdhc_cfg[0].esdhc_base = USDHC3_BASE_ADDR; |
| 1267 | usdhc_cfg[0].sdhc_clk = mxc_get_clock(MXC_ESDHC3_CLK); |
| 1268 | usdhc_cfg[0].max_bus_width = 8; |
| 1269 | return fsl_esdhc_initialize(bis, &usdhc_cfg[0]); |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1270 | default: |
| 1271 | /* doesn't have MMC */ |
Tim Harvey | d0744d1 | 2021-06-11 12:46:28 -0700 | [diff] [blame] | 1272 | printf("None"); |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1273 | return -1; |
| 1274 | } |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1275 | } |
| 1276 | |
| 1277 | int board_mmc_getcd(struct mmc *mmc) |
| 1278 | { |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1279 | struct fsl_esdhc_cfg *cfg = (struct fsl_esdhc_cfg *)mmc->priv; |
Tim Harvey | 4137785 | 2022-04-13 09:29:16 -0700 | [diff] [blame] | 1280 | int gpio = gpio_cfg[board_type].mmc_cd; |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1281 | |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1282 | /* Card Detect */ |
Tim Harvey | 4137785 | 2022-04-13 09:29:16 -0700 | [diff] [blame] | 1283 | switch (board_type) { |
Tim Harvey | 659441b | 2017-03-17 07:31:02 -0700 | [diff] [blame] | 1284 | case GW560x: |
| 1285 | /* emmc is always present */ |
| 1286 | if (cfg->esdhc_base == USDHC2_BASE_ADDR) |
| 1287 | return 1; |
| 1288 | break; |
Tim Harvey | 4533c90 | 2017-03-17 07:32:21 -0700 | [diff] [blame] | 1289 | case GW5903: |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1290 | case GW5904: |
Tim Harvey | a2d24c9 | 2019-02-04 13:10:50 -0800 | [diff] [blame] | 1291 | case GW5905: |
Tim Harvey | 2df5046 | 2019-02-04 13:10:57 -0800 | [diff] [blame] | 1292 | case GW5909: |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1293 | /* emmc is always present */ |
| 1294 | if (cfg->esdhc_base == USDHC3_BASE_ADDR) |
| 1295 | return 1; |
| 1296 | break; |
| 1297 | } |
| 1298 | |
| 1299 | if (gpio) { |
| 1300 | debug("%s: gpio%d=%d\n", __func__, gpio, gpio_get_value(gpio)); |
| 1301 | return !gpio_get_value(gpio); |
| 1302 | } |
| 1303 | |
| 1304 | return -1; |
Tim Harvey | 84ae191 | 2017-03-13 08:51:03 -0700 | [diff] [blame] | 1305 | } |
Tim Harvey | 6353779 | 2017-03-17 07:30:38 -0700 | [diff] [blame] | 1306 | |
Yangbo Lu | 7334038 | 2019-06-21 11:42:28 +0800 | [diff] [blame] | 1307 | #endif /* CONFIG_FSL_ESDHC_IMX */ |