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