Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 1 | // SPDX-License-Identifier: GPL-2.0 |
| 2 | |
| 3 | #include <clk.h> |
| 4 | #include <dm.h> |
| 5 | #include <dm/device-internal.h> |
| 6 | #include <dm/lists.h> |
| 7 | #include <dm/pinctrl.h> |
| 8 | #include <errno.h> |
| 9 | #include <malloc.h> |
Andre Przywara | f944a61 | 2022-09-06 10:36:38 +0100 | [diff] [blame] | 10 | #include <sunxi_gpio.h> |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 11 | |
| 12 | #include <asm/gpio.h> |
| 13 | |
| 14 | extern U_BOOT_DRIVER(gpio_sunxi); |
| 15 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 16 | /* |
| 17 | * This structure implements a simplified view of the possible pinmux settings: |
| 18 | * Each mux value is assumed to be the same for a given function, across the |
| 19 | * pins in each group (almost universally true, with same rare exceptions not |
| 20 | * relevant to U-Boot), but also across different ports (not true in many |
| 21 | * cases). We ignore the first problem, and work around the latter by just |
| 22 | * supporting one particular port for a each function. This works fine for all |
| 23 | * board configurations so far. If this would need to be revisited, we could |
| 24 | * add a "u8 port;" below and match that, with 0 encoding the "don't care" case. |
| 25 | */ |
| 26 | struct sunxi_pinctrl_function { |
| 27 | const char name[sizeof("gpio_out")]; |
| 28 | u8 mux; |
| 29 | }; |
| 30 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 31 | struct sunxi_pinctrl_desc { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 32 | const struct sunxi_pinctrl_function *functions; |
| 33 | u8 num_functions; |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 34 | u8 first_bank; |
| 35 | u8 num_banks; |
| 36 | }; |
| 37 | |
| 38 | struct sunxi_pinctrl_plat { |
Andre Przywara | 841ebfb3 | 2022-09-05 18:12:39 +0100 | [diff] [blame] | 39 | void __iomem *base; |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 40 | }; |
| 41 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 42 | static int sunxi_pinctrl_get_pins_count(struct udevice *dev) |
| 43 | { |
| 44 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
| 45 | |
| 46 | return desc->num_banks * SUNXI_GPIOS_PER_BANK; |
| 47 | } |
| 48 | |
| 49 | static const char *sunxi_pinctrl_get_pin_name(struct udevice *dev, |
| 50 | uint pin_selector) |
| 51 | { |
| 52 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
Samuel Holland | d478ed8 | 2023-10-30 23:57:40 -0500 | [diff] [blame] | 53 | static char pin_name[sizeof("PN31")] __section(".data"); |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 54 | |
| 55 | snprintf(pin_name, sizeof(pin_name), "P%c%d", |
| 56 | pin_selector / SUNXI_GPIOS_PER_BANK + desc->first_bank + 'A', |
| 57 | pin_selector % SUNXI_GPIOS_PER_BANK); |
| 58 | |
| 59 | return pin_name; |
| 60 | } |
| 61 | |
| 62 | static int sunxi_pinctrl_get_functions_count(struct udevice *dev) |
| 63 | { |
| 64 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
| 65 | |
| 66 | return desc->num_functions; |
| 67 | } |
| 68 | |
| 69 | static const char *sunxi_pinctrl_get_function_name(struct udevice *dev, |
| 70 | uint func_selector) |
| 71 | { |
| 72 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
| 73 | |
| 74 | return desc->functions[func_selector].name; |
| 75 | } |
| 76 | |
| 77 | static int sunxi_pinctrl_pinmux_set(struct udevice *dev, uint pin_selector, |
| 78 | uint func_selector) |
| 79 | { |
| 80 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
| 81 | struct sunxi_pinctrl_plat *plat = dev_get_plat(dev); |
| 82 | int bank = pin_selector / SUNXI_GPIOS_PER_BANK; |
| 83 | int pin = pin_selector % SUNXI_GPIOS_PER_BANK; |
| 84 | |
| 85 | debug("set mux: %-4s => %s (%d)\n", |
| 86 | sunxi_pinctrl_get_pin_name(dev, pin_selector), |
| 87 | sunxi_pinctrl_get_function_name(dev, func_selector), |
| 88 | desc->functions[func_selector].mux); |
| 89 | |
Andre Przywara | 841ebfb3 | 2022-09-05 18:12:39 +0100 | [diff] [blame] | 90 | sunxi_gpio_set_cfgbank(plat->base + bank * SUNXI_PINCTRL_BANK_SIZE, |
| 91 | pin, desc->functions[func_selector].mux); |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 92 | |
| 93 | return 0; |
| 94 | } |
| 95 | |
Samuel Holland | de828b4 | 2021-08-28 21:10:47 -0500 | [diff] [blame] | 96 | static const struct pinconf_param sunxi_pinctrl_pinconf_params[] = { |
| 97 | { "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 }, |
| 98 | { "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 2 }, |
| 99 | { "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 1 }, |
| 100 | { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 10 }, |
| 101 | }; |
| 102 | |
| 103 | static int sunxi_pinctrl_pinconf_set_pull(struct sunxi_pinctrl_plat *plat, |
| 104 | uint bank, uint pin, uint bias) |
| 105 | { |
Andre Przywara | 841ebfb3 | 2022-09-05 18:12:39 +0100 | [diff] [blame] | 106 | void *regs = plat->base + bank * SUNXI_PINCTRL_BANK_SIZE; |
Samuel Holland | de828b4 | 2021-08-28 21:10:47 -0500 | [diff] [blame] | 107 | |
| 108 | sunxi_gpio_set_pull_bank(regs, pin, bias); |
| 109 | |
| 110 | return 0; |
| 111 | } |
| 112 | |
| 113 | static int sunxi_pinctrl_pinconf_set_drive(struct sunxi_pinctrl_plat *plat, |
| 114 | uint bank, uint pin, uint drive) |
| 115 | { |
Andre Przywara | 841ebfb3 | 2022-09-05 18:12:39 +0100 | [diff] [blame] | 116 | void *regs = plat->base + bank * SUNXI_PINCTRL_BANK_SIZE; |
Samuel Holland | de828b4 | 2021-08-28 21:10:47 -0500 | [diff] [blame] | 117 | |
| 118 | if (drive < 10 || drive > 40) |
| 119 | return -EINVAL; |
| 120 | |
| 121 | /* Convert mA to the register value, rounding down. */ |
| 122 | sunxi_gpio_set_drv_bank(regs, pin, drive / 10 - 1); |
| 123 | |
| 124 | return 0; |
| 125 | } |
| 126 | |
| 127 | static int sunxi_pinctrl_pinconf_set(struct udevice *dev, uint pin_selector, |
| 128 | uint param, uint val) |
| 129 | { |
| 130 | struct sunxi_pinctrl_plat *plat = dev_get_plat(dev); |
| 131 | int bank = pin_selector / SUNXI_GPIOS_PER_BANK; |
| 132 | int pin = pin_selector % SUNXI_GPIOS_PER_BANK; |
| 133 | |
| 134 | switch (param) { |
| 135 | case PIN_CONFIG_BIAS_DISABLE: |
| 136 | case PIN_CONFIG_BIAS_PULL_DOWN: |
| 137 | case PIN_CONFIG_BIAS_PULL_UP: |
| 138 | return sunxi_pinctrl_pinconf_set_pull(plat, bank, pin, val); |
| 139 | case PIN_CONFIG_DRIVE_STRENGTH: |
| 140 | return sunxi_pinctrl_pinconf_set_drive(plat, bank, pin, val); |
| 141 | } |
| 142 | |
| 143 | return -EINVAL; |
| 144 | } |
| 145 | |
Samuel Holland | 116d523 | 2021-08-17 00:52:00 -0500 | [diff] [blame] | 146 | static int sunxi_pinctrl_get_pin_muxing(struct udevice *dev, uint pin_selector, |
| 147 | char *buf, int size) |
| 148 | { |
| 149 | struct sunxi_pinctrl_plat *plat = dev_get_plat(dev); |
| 150 | int bank = pin_selector / SUNXI_GPIOS_PER_BANK; |
| 151 | int pin = pin_selector % SUNXI_GPIOS_PER_BANK; |
Andre Przywara | 841ebfb3 | 2022-09-05 18:12:39 +0100 | [diff] [blame] | 152 | int mux = sunxi_gpio_get_cfgbank(plat->base + bank * SUNXI_PINCTRL_BANK_SIZE, pin); |
Samuel Holland | 116d523 | 2021-08-17 00:52:00 -0500 | [diff] [blame] | 153 | |
| 154 | switch (mux) { |
| 155 | case SUNXI_GPIO_INPUT: |
| 156 | strlcpy(buf, "gpio input", size); |
| 157 | break; |
| 158 | case SUNXI_GPIO_OUTPUT: |
| 159 | strlcpy(buf, "gpio output", size); |
| 160 | break; |
| 161 | case SUNXI_GPIO_DISABLE: |
| 162 | strlcpy(buf, "disabled", size); |
| 163 | break; |
| 164 | default: |
| 165 | snprintf(buf, size, "function %d", mux); |
| 166 | break; |
| 167 | } |
| 168 | |
| 169 | return 0; |
| 170 | } |
| 171 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 172 | static const struct pinctrl_ops sunxi_pinctrl_ops = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 173 | .get_pins_count = sunxi_pinctrl_get_pins_count, |
| 174 | .get_pin_name = sunxi_pinctrl_get_pin_name, |
| 175 | .get_functions_count = sunxi_pinctrl_get_functions_count, |
| 176 | .get_function_name = sunxi_pinctrl_get_function_name, |
| 177 | .pinmux_set = sunxi_pinctrl_pinmux_set, |
Samuel Holland | de828b4 | 2021-08-28 21:10:47 -0500 | [diff] [blame] | 178 | .pinconf_num_params = ARRAY_SIZE(sunxi_pinctrl_pinconf_params), |
| 179 | .pinconf_params = sunxi_pinctrl_pinconf_params, |
| 180 | .pinconf_set = sunxi_pinctrl_pinconf_set, |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 181 | .set_state = pinctrl_generic_set_state, |
Samuel Holland | 116d523 | 2021-08-17 00:52:00 -0500 | [diff] [blame] | 182 | .get_pin_muxing = sunxi_pinctrl_get_pin_muxing, |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 183 | }; |
| 184 | |
| 185 | static int sunxi_pinctrl_bind(struct udevice *dev) |
| 186 | { |
| 187 | struct sunxi_pinctrl_plat *plat = dev_get_plat(dev); |
| 188 | struct sunxi_pinctrl_desc *desc; |
| 189 | struct sunxi_gpio_plat *gpio_plat; |
| 190 | struct udevice *gpio_dev; |
| 191 | int i, ret; |
| 192 | |
| 193 | desc = (void *)dev_get_driver_data(dev); |
| 194 | if (!desc) |
| 195 | return -EINVAL; |
| 196 | dev_set_priv(dev, desc); |
| 197 | |
| 198 | plat->base = dev_read_addr_ptr(dev); |
| 199 | |
| 200 | ret = device_bind_driver_to_node(dev, "gpio_sunxi", dev->name, |
| 201 | dev_ofnode(dev), &gpio_dev); |
| 202 | if (ret) |
| 203 | return ret; |
| 204 | |
| 205 | for (i = 0; i < desc->num_banks; ++i) { |
| 206 | gpio_plat = malloc(sizeof(*gpio_plat)); |
| 207 | if (!gpio_plat) |
| 208 | return -ENOMEM; |
| 209 | |
Andre Przywara | 841ebfb3 | 2022-09-05 18:12:39 +0100 | [diff] [blame] | 210 | gpio_plat->regs = plat->base + i * SUNXI_PINCTRL_BANK_SIZE; |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 211 | gpio_plat->bank_name[0] = 'P'; |
| 212 | gpio_plat->bank_name[1] = 'A' + desc->first_bank + i; |
| 213 | gpio_plat->bank_name[2] = '\0'; |
| 214 | |
| 215 | ret = device_bind(gpio_dev, DM_DRIVER_REF(gpio_sunxi), |
| 216 | gpio_plat->bank_name, gpio_plat, |
| 217 | ofnode_null(), NULL); |
| 218 | if (ret) |
| 219 | return ret; |
| 220 | } |
| 221 | |
| 222 | return 0; |
| 223 | } |
| 224 | |
| 225 | static int sunxi_pinctrl_probe(struct udevice *dev) |
| 226 | { |
| 227 | struct clk *apb_clk; |
| 228 | |
| 229 | apb_clk = devm_clk_get(dev, "apb"); |
| 230 | if (!IS_ERR(apb_clk)) |
| 231 | clk_enable(apb_clk); |
| 232 | |
| 233 | return 0; |
| 234 | } |
| 235 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 236 | static const struct sunxi_pinctrl_function suniv_f1c100s_pinctrl_functions[] = { |
| 237 | { "gpio_in", 0 }, |
| 238 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 239 | { "i2c0", 3 }, /* PE11-PE12 */ |
| 240 | { "i2c1", 3 }, /* PD5-PD6 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 241 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 242 | { "mmc1", 3 }, /* PC0-PC2 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 243 | { "spi0", 2 }, /* PC0-PC3 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 244 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 245 | { "uart0", 3 }, /* PF2-PF4 */ |
| 246 | #else |
| 247 | { "uart0", 5 }, /* PE0-PE1 */ |
| 248 | #endif |
Andre Przywara | 72313dc | 2022-10-05 23:19:54 +0100 | [diff] [blame] | 249 | { "uart1", 5 }, /* PA0-PA3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 250 | }; |
| 251 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 252 | static const struct sunxi_pinctrl_desc __maybe_unused suniv_f1c100s_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 253 | .functions = suniv_f1c100s_pinctrl_functions, |
| 254 | .num_functions = ARRAY_SIZE(suniv_f1c100s_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 255 | .first_bank = SUNXI_GPIO_A, |
| 256 | .num_banks = 6, |
| 257 | }; |
| 258 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 259 | static const struct sunxi_pinctrl_function sun4i_a10_pinctrl_functions[] = { |
Samuel Holland | 5d57e05 | 2021-08-28 13:21:36 -0500 | [diff] [blame] | 260 | { "emac", 2 }, /* PA0-PA17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 261 | { "gpio_in", 0 }, |
| 262 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 263 | { "i2c0", 2 }, /* PB0-PB1 */ |
| 264 | { "i2c1", 2 }, /* PB18-PB19 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 265 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 266 | #if IS_ENABLED(CONFIG_MMC1_PINS_PH) |
| 267 | { "mmc1", 5 }, /* PH22-PH27 */ |
| 268 | #else |
| 269 | { "mmc1", 4 }, /* PG0-PG5 */ |
| 270 | #endif |
| 271 | { "mmc2", 3 }, /* PC6-PC15 */ |
| 272 | { "mmc3", 2 }, /* PI4-PI9 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 273 | { "nand0", 2 }, /* PC0-PC24 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 274 | { "spi0", 3 }, /* PC0-PC2, PC23 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 275 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 276 | { "uart0", 4 }, /* PF2-PF4 */ |
| 277 | #else |
| 278 | { "uart0", 2 }, /* PB22-PB23 */ |
| 279 | #endif |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 280 | }; |
| 281 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 282 | static const struct sunxi_pinctrl_desc __maybe_unused sun4i_a10_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 283 | .functions = sun4i_a10_pinctrl_functions, |
| 284 | .num_functions = ARRAY_SIZE(sun4i_a10_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 285 | .first_bank = SUNXI_GPIO_A, |
| 286 | .num_banks = 9, |
| 287 | }; |
| 288 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 289 | static const struct sunxi_pinctrl_function sun5i_a13_pinctrl_functions[] = { |
Samuel Holland | 5d57e05 | 2021-08-28 13:21:36 -0500 | [diff] [blame] | 290 | { "emac", 2 }, /* PA0-PA17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 291 | { "gpio_in", 0 }, |
| 292 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 293 | { "i2c0", 2 }, /* PB0-PB1 */ |
| 294 | { "i2c1", 2 }, /* PB15-PB16 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 295 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 296 | { "mmc1", 2 }, /* PG3-PG8 */ |
| 297 | { "mmc2", 3 }, /* PC6-PC15 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 298 | { "nand0", 2 }, /* PC0-PC19 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 299 | { "spi0", 3 }, /* PC0-PC3 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 300 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 301 | { "uart0", 4 }, /* PF2-PF4 */ |
| 302 | #else |
| 303 | { "uart0", 2 }, /* PB19-PB20 */ |
| 304 | #endif |
| 305 | { "uart1", 4 }, /* PG3-PG4 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 306 | }; |
| 307 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 308 | static const struct sunxi_pinctrl_desc __maybe_unused sun5i_a13_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 309 | .functions = sun5i_a13_pinctrl_functions, |
| 310 | .num_functions = ARRAY_SIZE(sun5i_a13_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 311 | .first_bank = SUNXI_GPIO_A, |
| 312 | .num_banks = 7, |
| 313 | }; |
| 314 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 315 | static const struct sunxi_pinctrl_function sun6i_a31_pinctrl_functions[] = { |
Samuel Holland | 8181f56 | 2021-08-28 13:13:52 -0500 | [diff] [blame] | 316 | { "gmac", 2 }, /* PA0-PA27 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 317 | { "gpio_in", 0 }, |
| 318 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 319 | { "i2c0", 2 }, /* PH14-PH15 */ |
| 320 | { "i2c1", 2 }, /* PH16-PH17 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 321 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 322 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 323 | { "mmc2", 3 }, /* PC6-PC15, PC24 */ |
| 324 | { "mmc3", 4 }, /* PC6-PC15, PC24 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 325 | { "nand0", 2 }, /* PC0-PC26 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 326 | { "spi0", 3 }, /* PC0-PC2, PC27 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 327 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 328 | { "uart0", 3 }, /* PF2-PF4 */ |
| 329 | #else |
| 330 | { "uart0", 2 }, /* PH20-PH21 */ |
| 331 | #endif |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 332 | }; |
| 333 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 334 | static const struct sunxi_pinctrl_desc __maybe_unused sun6i_a31_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 335 | .functions = sun6i_a31_pinctrl_functions, |
| 336 | .num_functions = ARRAY_SIZE(sun6i_a31_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 337 | .first_bank = SUNXI_GPIO_A, |
| 338 | .num_banks = 8, |
| 339 | }; |
| 340 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 341 | static const struct sunxi_pinctrl_function sun6i_a31_r_pinctrl_functions[] = { |
| 342 | { "gpio_in", 0 }, |
| 343 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 344 | { "s_i2c", 2 }, /* PL0-PL1 */ |
Samuel Holland | d98ccb8 | 2022-11-17 22:22:27 -0600 | [diff] [blame] | 345 | { "s_p2wi", 3 }, /* PL0-PL1 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 346 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 347 | }; |
| 348 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 349 | static const struct sunxi_pinctrl_desc __maybe_unused sun6i_a31_r_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 350 | .functions = sun6i_a31_r_pinctrl_functions, |
| 351 | .num_functions = ARRAY_SIZE(sun6i_a31_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 352 | .first_bank = SUNXI_GPIO_L, |
| 353 | .num_banks = 2, |
| 354 | }; |
| 355 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 356 | static const struct sunxi_pinctrl_function sun7i_a20_pinctrl_functions[] = { |
Samuel Holland | 5d57e05 | 2021-08-28 13:21:36 -0500 | [diff] [blame] | 357 | { "emac", 2 }, /* PA0-PA17 */ |
Samuel Holland | 8181f56 | 2021-08-28 13:13:52 -0500 | [diff] [blame] | 358 | { "gmac", 5 }, /* PA0-PA17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 359 | { "gpio_in", 0 }, |
| 360 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 361 | { "i2c0", 2 }, /* PB0-PB1 */ |
| 362 | { "i2c1", 2 }, /* PB18-PB19 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 363 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 364 | #if IS_ENABLED(CONFIG_MMC1_PINS_PH) |
| 365 | { "mmc1", 5 }, /* PH22-PH27 */ |
| 366 | #else |
| 367 | { "mmc1", 4 }, /* PG0-PG5 */ |
| 368 | #endif |
| 369 | { "mmc2", 3 }, /* PC5-PC15, PC24 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 370 | { "nand0", 2 }, /* PC0-PC24 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 371 | { "spi0", 3 }, /* PC0-PC2, PC23 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 372 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 373 | { "uart0", 4 }, /* PF2-PF4 */ |
| 374 | #else |
| 375 | { "uart0", 2 }, /* PB22-PB23 */ |
| 376 | #endif |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 377 | }; |
| 378 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 379 | static const struct sunxi_pinctrl_desc __maybe_unused sun7i_a20_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 380 | .functions = sun7i_a20_pinctrl_functions, |
| 381 | .num_functions = ARRAY_SIZE(sun7i_a20_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 382 | .first_bank = SUNXI_GPIO_A, |
| 383 | .num_banks = 9, |
| 384 | }; |
| 385 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 386 | static const struct sunxi_pinctrl_function sun8i_a23_pinctrl_functions[] = { |
| 387 | { "gpio_in", 0 }, |
| 388 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 389 | { "i2c0", 2 }, /* PH2-PH3 */ |
| 390 | { "i2c1", 2 }, /* PH4-PH5 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 391 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 392 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 393 | { "mmc2", 3 }, /* PC5-PC16 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 394 | { "nand0", 2 }, /* PC0-PC16 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 395 | { "spi0", 3 }, /* PC0-PC3 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 396 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 397 | { "uart0", 3 }, /* PF2-PF4 */ |
| 398 | #endif |
| 399 | { "uart1", 2 }, /* PG6-PG7 */ |
| 400 | { "uart2", 2 }, /* PB0-PB1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 401 | }; |
| 402 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 403 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a23_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 404 | .functions = sun8i_a23_pinctrl_functions, |
| 405 | .num_functions = ARRAY_SIZE(sun8i_a23_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 406 | .first_bank = SUNXI_GPIO_A, |
| 407 | .num_banks = 8, |
| 408 | }; |
| 409 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 410 | static const struct sunxi_pinctrl_function sun8i_a23_r_pinctrl_functions[] = { |
| 411 | { "gpio_in", 0 }, |
| 412 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 413 | { "s_i2c", 3 }, /* PL0-PL1 */ |
Samuel Holland | d98ccb8 | 2022-11-17 22:22:27 -0600 | [diff] [blame] | 414 | { "s_rsb", 2 }, /* PL0-PL1 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 415 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 416 | }; |
| 417 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 418 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a23_r_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 419 | .functions = sun8i_a23_r_pinctrl_functions, |
| 420 | .num_functions = ARRAY_SIZE(sun8i_a23_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 421 | .first_bank = SUNXI_GPIO_L, |
| 422 | .num_banks = 1, |
| 423 | }; |
| 424 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 425 | static const struct sunxi_pinctrl_function sun8i_a33_pinctrl_functions[] = { |
| 426 | { "gpio_in", 0 }, |
| 427 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 428 | { "i2c0", 2 }, /* PH2-PH3 */ |
| 429 | { "i2c1", 2 }, /* PH4-PH5 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 430 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 431 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 432 | { "mmc2", 3 }, /* PC5-PC16 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 433 | { "nand0", 2 }, /* PC0-PC16 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 434 | { "spi0", 3 }, /* PC0-PC3 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 435 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 436 | { "uart0", 3 }, /* PF2-PF4 */ |
| 437 | #else |
| 438 | { "uart0", 3 }, /* PB0-PB1 */ |
| 439 | #endif |
| 440 | { "uart1", 2 }, /* PG6-PG7 */ |
| 441 | { "uart2", 2 }, /* PB0-PB1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 442 | }; |
| 443 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 444 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a33_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 445 | .functions = sun8i_a33_pinctrl_functions, |
| 446 | .num_functions = ARRAY_SIZE(sun8i_a33_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 447 | .first_bank = SUNXI_GPIO_A, |
| 448 | .num_banks = 8, |
| 449 | }; |
| 450 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 451 | static const struct sunxi_pinctrl_function sun8i_a83t_pinctrl_functions[] = { |
Samuel Holland | a8cbf47 | 2021-08-28 13:34:29 -0500 | [diff] [blame] | 452 | { "gmac", 4 }, /* PD2-PD23 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 453 | { "gpio_in", 0 }, |
| 454 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 455 | { "i2c0", 2 }, /* PH0-PH1 */ |
| 456 | { "i2c1", 2 }, /* PH2-PH3 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 457 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 458 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 459 | { "mmc2", 3 }, /* PC5-PC16 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 460 | { "nand0", 2 }, /* PC0-PC18 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 461 | { "spi0", 3 }, /* PC0-PC3 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 462 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 463 | { "uart0", 3 }, /* PF2-PF4 */ |
| 464 | #else |
| 465 | { "uart0", 2 }, /* PB9-PB10 */ |
| 466 | #endif |
| 467 | { "uart1", 2 }, /* PG6-PG7 */ |
| 468 | { "uart2", 2 }, /* PB0-PB1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 469 | }; |
| 470 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 471 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a83t_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 472 | .functions = sun8i_a83t_pinctrl_functions, |
| 473 | .num_functions = ARRAY_SIZE(sun8i_a83t_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 474 | .first_bank = SUNXI_GPIO_A, |
| 475 | .num_banks = 8, |
| 476 | }; |
| 477 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 478 | static const struct sunxi_pinctrl_function sun8i_a83t_r_pinctrl_functions[] = { |
| 479 | { "gpio_in", 0 }, |
| 480 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 481 | { "s_i2c", 2 }, /* PL8-PL9 */ |
Samuel Holland | d98ccb8 | 2022-11-17 22:22:27 -0600 | [diff] [blame] | 482 | { "s_rsb", 2 }, /* PL0-PL1 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 483 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 484 | }; |
| 485 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 486 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a83t_r_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 487 | .functions = sun8i_a83t_r_pinctrl_functions, |
| 488 | .num_functions = ARRAY_SIZE(sun8i_a83t_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 489 | .first_bank = SUNXI_GPIO_L, |
| 490 | .num_banks = 1, |
| 491 | }; |
| 492 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 493 | static const struct sunxi_pinctrl_function sun8i_h3_pinctrl_functions[] = { |
Samuel Holland | a8cbf47 | 2021-08-28 13:34:29 -0500 | [diff] [blame] | 494 | { "emac", 2 }, /* PD0-PD17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 495 | { "gpio_in", 0 }, |
| 496 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 497 | { "i2c0", 2 }, /* PA11-PA12 */ |
| 498 | { "i2c1", 3 }, /* PA18-PA19 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 499 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 500 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 501 | { "mmc2", 3 }, /* PC5-PC16 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 502 | { "nand0", 2 }, /* PC0-PC16 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 503 | { "spi0", 3 }, /* PC0-PC3 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 504 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 505 | { "uart0", 3 }, /* PF2-PF4 */ |
| 506 | #else |
| 507 | { "uart0", 2 }, /* PA4-PA5 */ |
| 508 | #endif |
| 509 | { "uart1", 2 }, /* PG6-PG7 */ |
| 510 | { "uart2", 2 }, /* PA0-PA1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 511 | }; |
| 512 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 513 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_h3_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 514 | .functions = sun8i_h3_pinctrl_functions, |
| 515 | .num_functions = ARRAY_SIZE(sun8i_h3_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 516 | .first_bank = SUNXI_GPIO_A, |
| 517 | .num_banks = 7, |
| 518 | }; |
| 519 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 520 | static const struct sunxi_pinctrl_function sun8i_h3_r_pinctrl_functions[] = { |
| 521 | { "gpio_in", 0 }, |
| 522 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 523 | { "s_i2c", 2 }, /* PL0-PL1 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 524 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 525 | }; |
| 526 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 527 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_h3_r_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 528 | .functions = sun8i_h3_r_pinctrl_functions, |
| 529 | .num_functions = ARRAY_SIZE(sun8i_h3_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 530 | .first_bank = SUNXI_GPIO_L, |
| 531 | .num_banks = 1, |
| 532 | }; |
| 533 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 534 | static const struct sunxi_pinctrl_function sun8i_v3s_pinctrl_functions[] = { |
Samuel Holland | a8cbf47 | 2021-08-28 13:34:29 -0500 | [diff] [blame] | 535 | { "emac", 4 }, /* PD0-PD17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 536 | { "gpio_in", 0 }, |
| 537 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 538 | { "i2c0", 2 }, /* PB6-PB7 */ |
| 539 | { "i2c1", 2 }, /* PB8-PB9 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 540 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 541 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 542 | { "mmc2", 2 }, /* PC0-PC10 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 543 | { "spi0", 3 }, /* PC0-PC3 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 544 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 545 | { "uart0", 3 }, /* PF2-PF4 */ |
| 546 | #else |
| 547 | { "uart0", 3 }, /* PB8-PB9 */ |
| 548 | #endif |
| 549 | { "uart1", 2 }, /* PG6-PG7 */ |
| 550 | { "uart2", 2 }, /* PB0-PB1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 551 | }; |
| 552 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 553 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_v3s_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 554 | .functions = sun8i_v3s_pinctrl_functions, |
| 555 | .num_functions = ARRAY_SIZE(sun8i_v3s_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 556 | .first_bank = SUNXI_GPIO_A, |
| 557 | .num_banks = 7, |
| 558 | }; |
| 559 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 560 | static const struct sunxi_pinctrl_function sun9i_a80_pinctrl_functions[] = { |
Samuel Holland | 8181f56 | 2021-08-28 13:13:52 -0500 | [diff] [blame] | 561 | { "gmac", 2 }, /* PA0-PA17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 562 | { "gpio_in", 0 }, |
| 563 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 564 | { "i2c0", 2 }, /* PH0-PH1 */ |
| 565 | { "i2c1", 2 }, /* PH2-PH3 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 566 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 567 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 568 | { "mmc2", 3 }, /* PC6-PC16 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 569 | { "nand0", 2 }, /* PC0-PC18 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 570 | { "spi0", 3 }, /* PC0-PC2, PC19 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 571 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 572 | { "uart0", 4 }, /* PF2-PF4 */ |
| 573 | #else |
| 574 | { "uart0", 2 }, /* PH12-PH13 */ |
| 575 | #endif |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 576 | }; |
| 577 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 578 | static const struct sunxi_pinctrl_desc __maybe_unused sun9i_a80_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 579 | .functions = sun9i_a80_pinctrl_functions, |
| 580 | .num_functions = ARRAY_SIZE(sun9i_a80_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 581 | .first_bank = SUNXI_GPIO_A, |
| 582 | .num_banks = 8, |
| 583 | }; |
| 584 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 585 | static const struct sunxi_pinctrl_function sun9i_a80_r_pinctrl_functions[] = { |
| 586 | { "gpio_in", 0 }, |
| 587 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 588 | { "s_i2c0", 2 }, /* PN0-PN1 */ |
| 589 | { "s_i2c1", 3 }, /* PM8-PM9 */ |
Samuel Holland | d98ccb8 | 2022-11-17 22:22:27 -0600 | [diff] [blame] | 590 | { "s_rsb", 3 }, /* PN0-PN1 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 591 | { "s_uart", 3 }, /* PL0-PL1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 592 | }; |
| 593 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 594 | static const struct sunxi_pinctrl_desc __maybe_unused sun9i_a80_r_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 595 | .functions = sun9i_a80_r_pinctrl_functions, |
| 596 | .num_functions = ARRAY_SIZE(sun9i_a80_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 597 | .first_bank = SUNXI_GPIO_L, |
| 598 | .num_banks = 3, |
| 599 | }; |
| 600 | |
Andre Przywara | 25841f3 | 2022-09-05 16:25:57 +0100 | [diff] [blame] | 601 | static const struct sunxi_pinctrl_function sun20i_d1_pinctrl_functions[] = { |
| 602 | { "emac", 8 }, /* PE0-PE15 */ |
| 603 | { "gpio_in", 0 }, |
| 604 | { "gpio_out", 1 }, |
| 605 | { "i2c0", 4 }, /* PB10-PB11 */ |
| 606 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 607 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 608 | { "mmc2", 3 }, /* PC2-PC7 */ |
| 609 | { "spi0", 2 }, /* PC2-PC7 */ |
| 610 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 611 | { "uart0", 3 }, /* PF2,PF4 */ |
| 612 | #else |
| 613 | { "uart0", 6 }, /* PB0-PB1, PB8-PB9, PE2-PE3 */ |
| 614 | #endif |
| 615 | { "uart1", 2 }, /* PG6-PG7 */ |
| 616 | { "uart2", 7 }, /* PB0-PB1 */ |
| 617 | { "uart3", 7 }, /* PB6-PB7 */ |
| 618 | }; |
| 619 | |
| 620 | static const struct sunxi_pinctrl_desc __maybe_unused sun20i_d1_pinctrl_desc = { |
| 621 | .functions = sun20i_d1_pinctrl_functions, |
| 622 | .num_functions = ARRAY_SIZE(sun20i_d1_pinctrl_functions), |
| 623 | .first_bank = SUNXI_GPIO_A, |
| 624 | .num_banks = 7, |
| 625 | }; |
| 626 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 627 | static const struct sunxi_pinctrl_function sun50i_a64_pinctrl_functions[] = { |
Samuel Holland | a8cbf47 | 2021-08-28 13:34:29 -0500 | [diff] [blame] | 628 | { "emac", 4 }, /* PD8-PD23 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 629 | { "gpio_in", 0 }, |
| 630 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 631 | { "i2c0", 2 }, /* PH0-PH1 */ |
| 632 | { "i2c1", 2 }, /* PH2-PH3 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 633 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 634 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 635 | { "mmc2", 3 }, /* PC1-PC16 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 636 | { "nand0", 2 }, /* PC0-PC16 */ |
Samuel Holland | 3de641b | 2021-08-28 15:52:52 -0500 | [diff] [blame] | 637 | { "pwm", 2 }, /* PD22 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 638 | { "spi0", 4 }, /* PC0-PC3 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 639 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 640 | { "uart0", 3 }, /* PF2-PF4 */ |
| 641 | #else |
| 642 | { "uart0", 4 }, /* PB8-PB9 */ |
| 643 | #endif |
| 644 | { "uart1", 2 }, /* PG6-PG7 */ |
| 645 | { "uart2", 2 }, /* PB0-PB1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 646 | }; |
| 647 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 648 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_a64_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 649 | .functions = sun50i_a64_pinctrl_functions, |
| 650 | .num_functions = ARRAY_SIZE(sun50i_a64_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 651 | .first_bank = SUNXI_GPIO_A, |
| 652 | .num_banks = 8, |
| 653 | }; |
| 654 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 655 | static const struct sunxi_pinctrl_function sun50i_a64_r_pinctrl_functions[] = { |
| 656 | { "gpio_in", 0 }, |
| 657 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 658 | { "s_i2c", 2 }, /* PL8-PL9 */ |
Samuel Holland | d98ccb8 | 2022-11-17 22:22:27 -0600 | [diff] [blame] | 659 | { "s_rsb", 2 }, /* PL0-PL1 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 660 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 661 | }; |
| 662 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 663 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_a64_r_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 664 | .functions = sun50i_a64_r_pinctrl_functions, |
| 665 | .num_functions = ARRAY_SIZE(sun50i_a64_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 666 | .first_bank = SUNXI_GPIO_L, |
| 667 | .num_banks = 1, |
| 668 | }; |
| 669 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 670 | static const struct sunxi_pinctrl_function sun50i_h5_pinctrl_functions[] = { |
Samuel Holland | a8cbf47 | 2021-08-28 13:34:29 -0500 | [diff] [blame] | 671 | { "emac", 2 }, /* PD0-PD17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 672 | { "gpio_in", 0 }, |
| 673 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 674 | { "i2c0", 2 }, /* PA11-PA12 */ |
| 675 | { "i2c1", 3 }, /* PA18-PA19 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 676 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 677 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 678 | { "mmc2", 3 }, /* PC1-PC16 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 679 | { "nand0", 2 }, /* PC0-PC16 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 680 | { "spi0", 3 }, /* PC0-PC3 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 681 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 682 | { "uart0", 3 }, /* PF2-PF4 */ |
| 683 | #else |
| 684 | { "uart0", 2 }, /* PA4-PA5 */ |
| 685 | #endif |
| 686 | { "uart1", 2 }, /* PG6-PG7 */ |
| 687 | { "uart2", 2 }, /* PA0-PA1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 688 | }; |
| 689 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 690 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h5_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 691 | .functions = sun50i_h5_pinctrl_functions, |
| 692 | .num_functions = ARRAY_SIZE(sun50i_h5_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 693 | .first_bank = SUNXI_GPIO_A, |
| 694 | .num_banks = 7, |
| 695 | }; |
| 696 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 697 | static const struct sunxi_pinctrl_function sun50i_h6_pinctrl_functions[] = { |
Samuel Holland | a8cbf47 | 2021-08-28 13:34:29 -0500 | [diff] [blame] | 698 | { "emac", 5 }, /* PD0-PD20 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 699 | { "gpio_in", 0 }, |
| 700 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 701 | { "i2c0", 2 }, /* PD25-PD26 */ |
| 702 | { "i2c1", 4 }, /* PH5-PH6 */ |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 703 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 704 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 705 | { "mmc2", 3 }, /* PC1-PC14 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 706 | { "nand0", 2 }, /* PC0-PC16 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 707 | { "spi0", 4 }, /* PC0-PC7 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 708 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 709 | { "uart0", 3 }, /* PF2-PF4 */ |
| 710 | #else |
| 711 | { "uart0", 2 }, /* PH0-PH1 */ |
| 712 | #endif |
| 713 | { "uart1", 2 }, /* PG6-PG7 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 714 | }; |
| 715 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 716 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h6_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 717 | .functions = sun50i_h6_pinctrl_functions, |
| 718 | .num_functions = ARRAY_SIZE(sun50i_h6_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 719 | .first_bank = SUNXI_GPIO_A, |
| 720 | .num_banks = 8, |
| 721 | }; |
| 722 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 723 | static const struct sunxi_pinctrl_function sun50i_h6_r_pinctrl_functions[] = { |
| 724 | { "gpio_in", 0 }, |
| 725 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 726 | { "s_i2c", 3 }, /* PL0-PL1 */ |
Samuel Holland | d98ccb8 | 2022-11-17 22:22:27 -0600 | [diff] [blame] | 727 | { "s_rsb", 2 }, /* PL0-PL1 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 728 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 729 | }; |
| 730 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 731 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h6_r_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 732 | .functions = sun50i_h6_r_pinctrl_functions, |
| 733 | .num_functions = ARRAY_SIZE(sun50i_h6_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 734 | .first_bank = SUNXI_GPIO_L, |
| 735 | .num_banks = 2, |
| 736 | }; |
| 737 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 738 | static const struct sunxi_pinctrl_function sun50i_h616_pinctrl_functions[] = { |
Samuel Holland | a8cbf47 | 2021-08-28 13:34:29 -0500 | [diff] [blame] | 739 | { "emac0", 2 }, /* PI0-PI16 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 740 | { "gpio_in", 0 }, |
| 741 | { "gpio_out", 1 }, |
Samuel Holland | 1c17f41 | 2021-08-28 16:51:03 -0500 | [diff] [blame] | 742 | { "mmc0", 2 }, /* PF0-PF5 */ |
| 743 | { "mmc1", 2 }, /* PG0-PG5 */ |
| 744 | { "mmc2", 3 }, /* PC0-PC16 */ |
Samuel Holland | aba2615 | 2023-01-22 16:06:32 -0600 | [diff] [blame] | 745 | { "nand0", 2 }, /* PC0-PC16 */ |
Samuel Holland | 96b75d2 | 2021-08-28 17:05:35 -0500 | [diff] [blame] | 746 | { "spi0", 4 }, /* PC0-PC7, PC15-PC16 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 747 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 748 | { "uart0", 3 }, /* PF2-PF4 */ |
| 749 | #else |
| 750 | { "uart0", 2 }, /* PH0-PH1 */ |
| 751 | #endif |
| 752 | { "uart1", 2 }, /* PG6-PG7 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 753 | }; |
| 754 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 755 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h616_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 756 | .functions = sun50i_h616_pinctrl_functions, |
| 757 | .num_functions = ARRAY_SIZE(sun50i_h616_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 758 | .first_bank = SUNXI_GPIO_A, |
| 759 | .num_banks = 9, |
| 760 | }; |
| 761 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 762 | static const struct sunxi_pinctrl_function sun50i_h616_r_pinctrl_functions[] = { |
| 763 | { "gpio_in", 0 }, |
| 764 | { "gpio_out", 1 }, |
Samuel Holland | 4b10d25 | 2021-08-28 15:17:32 -0500 | [diff] [blame] | 765 | { "s_i2c", 3 }, /* PL0-PL1 */ |
Samuel Holland | d98ccb8 | 2022-11-17 22:22:27 -0600 | [diff] [blame] | 766 | { "s_rsb", 2 }, /* PL0-PL1 */ |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 767 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 768 | }; |
| 769 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 770 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h616_r_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 771 | .functions = sun50i_h616_r_pinctrl_functions, |
| 772 | .num_functions = ARRAY_SIZE(sun50i_h616_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 773 | .first_bank = SUNXI_GPIO_L, |
| 774 | .num_banks = 1, |
| 775 | }; |
| 776 | |
| 777 | static const struct udevice_id sunxi_pinctrl_ids[] = { |
| 778 | #ifdef CONFIG_PINCTRL_SUNIV_F1C100S |
| 779 | { |
| 780 | .compatible = "allwinner,suniv-f1c100s-pinctrl", |
| 781 | .data = (ulong)&suniv_f1c100s_pinctrl_desc, |
| 782 | }, |
| 783 | #endif |
| 784 | #ifdef CONFIG_PINCTRL_SUN4I_A10 |
| 785 | { |
| 786 | .compatible = "allwinner,sun4i-a10-pinctrl", |
| 787 | .data = (ulong)&sun4i_a10_pinctrl_desc, |
| 788 | }, |
| 789 | #endif |
| 790 | #ifdef CONFIG_PINCTRL_SUN5I_A13 |
| 791 | { |
| 792 | .compatible = "allwinner,sun5i-a10s-pinctrl", |
| 793 | .data = (ulong)&sun5i_a13_pinctrl_desc, |
| 794 | }, |
| 795 | { |
| 796 | .compatible = "allwinner,sun5i-a13-pinctrl", |
| 797 | .data = (ulong)&sun5i_a13_pinctrl_desc, |
| 798 | }, |
| 799 | #endif |
| 800 | #ifdef CONFIG_PINCTRL_SUN6I_A31 |
| 801 | { |
| 802 | .compatible = "allwinner,sun6i-a31-pinctrl", |
| 803 | .data = (ulong)&sun6i_a31_pinctrl_desc, |
| 804 | }, |
| 805 | { |
| 806 | .compatible = "allwinner,sun6i-a31s-pinctrl", |
| 807 | .data = (ulong)&sun6i_a31_pinctrl_desc, |
| 808 | }, |
| 809 | #endif |
| 810 | #ifdef CONFIG_PINCTRL_SUN6I_A31_R |
| 811 | { |
| 812 | .compatible = "allwinner,sun6i-a31-r-pinctrl", |
| 813 | .data = (ulong)&sun6i_a31_r_pinctrl_desc, |
| 814 | }, |
| 815 | #endif |
| 816 | #ifdef CONFIG_PINCTRL_SUN7I_A20 |
| 817 | { |
| 818 | .compatible = "allwinner,sun7i-a20-pinctrl", |
| 819 | .data = (ulong)&sun7i_a20_pinctrl_desc, |
| 820 | }, |
| 821 | #endif |
| 822 | #ifdef CONFIG_PINCTRL_SUN8I_A23 |
| 823 | { |
| 824 | .compatible = "allwinner,sun8i-a23-pinctrl", |
| 825 | .data = (ulong)&sun8i_a23_pinctrl_desc, |
| 826 | }, |
| 827 | #endif |
| 828 | #ifdef CONFIG_PINCTRL_SUN8I_A23_R |
| 829 | { |
| 830 | .compatible = "allwinner,sun8i-a23-r-pinctrl", |
| 831 | .data = (ulong)&sun8i_a23_r_pinctrl_desc, |
| 832 | }, |
| 833 | #endif |
| 834 | #ifdef CONFIG_PINCTRL_SUN8I_A33 |
| 835 | { |
| 836 | .compatible = "allwinner,sun8i-a33-pinctrl", |
| 837 | .data = (ulong)&sun8i_a33_pinctrl_desc, |
| 838 | }, |
| 839 | #endif |
| 840 | #ifdef CONFIG_PINCTRL_SUN8I_A83T |
| 841 | { |
| 842 | .compatible = "allwinner,sun8i-a83t-pinctrl", |
| 843 | .data = (ulong)&sun8i_a83t_pinctrl_desc, |
| 844 | }, |
| 845 | #endif |
| 846 | #ifdef CONFIG_PINCTRL_SUN8I_A83T_R |
| 847 | { |
| 848 | .compatible = "allwinner,sun8i-a83t-r-pinctrl", |
| 849 | .data = (ulong)&sun8i_a83t_r_pinctrl_desc, |
| 850 | }, |
| 851 | #endif |
| 852 | #ifdef CONFIG_PINCTRL_SUN8I_H3 |
| 853 | { |
| 854 | .compatible = "allwinner,sun8i-h3-pinctrl", |
| 855 | .data = (ulong)&sun8i_h3_pinctrl_desc, |
| 856 | }, |
| 857 | #endif |
| 858 | #ifdef CONFIG_PINCTRL_SUN8I_H3_R |
| 859 | { |
| 860 | .compatible = "allwinner,sun8i-h3-r-pinctrl", |
| 861 | .data = (ulong)&sun8i_h3_r_pinctrl_desc, |
| 862 | }, |
| 863 | #endif |
| 864 | #ifdef CONFIG_PINCTRL_SUN7I_A20 |
| 865 | { |
| 866 | .compatible = "allwinner,sun8i-r40-pinctrl", |
| 867 | .data = (ulong)&sun7i_a20_pinctrl_desc, |
| 868 | }, |
| 869 | #endif |
| 870 | #ifdef CONFIG_PINCTRL_SUN8I_V3S |
| 871 | { |
| 872 | .compatible = "allwinner,sun8i-v3-pinctrl", |
| 873 | .data = (ulong)&sun8i_v3s_pinctrl_desc, |
| 874 | }, |
| 875 | { |
| 876 | .compatible = "allwinner,sun8i-v3s-pinctrl", |
| 877 | .data = (ulong)&sun8i_v3s_pinctrl_desc, |
| 878 | }, |
| 879 | #endif |
| 880 | #ifdef CONFIG_PINCTRL_SUN9I_A80 |
| 881 | { |
| 882 | .compatible = "allwinner,sun9i-a80-pinctrl", |
| 883 | .data = (ulong)&sun9i_a80_pinctrl_desc, |
| 884 | }, |
| 885 | #endif |
| 886 | #ifdef CONFIG_PINCTRL_SUN9I_A80_R |
| 887 | { |
| 888 | .compatible = "allwinner,sun9i-a80-r-pinctrl", |
| 889 | .data = (ulong)&sun9i_a80_r_pinctrl_desc, |
| 890 | }, |
| 891 | #endif |
Andre Przywara | 25841f3 | 2022-09-05 16:25:57 +0100 | [diff] [blame] | 892 | #ifdef CONFIG_PINCTRL_SUN20I_D1 |
| 893 | { |
| 894 | .compatible = "allwinner,sun20i-d1-pinctrl", |
| 895 | .data = (ulong)&sun20i_d1_pinctrl_desc, |
| 896 | }, |
| 897 | #endif |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 898 | #ifdef CONFIG_PINCTRL_SUN50I_A64 |
| 899 | { |
| 900 | .compatible = "allwinner,sun50i-a64-pinctrl", |
| 901 | .data = (ulong)&sun50i_a64_pinctrl_desc, |
| 902 | }, |
| 903 | #endif |
| 904 | #ifdef CONFIG_PINCTRL_SUN50I_A64_R |
| 905 | { |
| 906 | .compatible = "allwinner,sun50i-a64-r-pinctrl", |
| 907 | .data = (ulong)&sun50i_a64_r_pinctrl_desc, |
| 908 | }, |
| 909 | #endif |
| 910 | #ifdef CONFIG_PINCTRL_SUN50I_H5 |
| 911 | { |
| 912 | .compatible = "allwinner,sun50i-h5-pinctrl", |
| 913 | .data = (ulong)&sun50i_h5_pinctrl_desc, |
| 914 | }, |
| 915 | #endif |
| 916 | #ifdef CONFIG_PINCTRL_SUN50I_H6 |
| 917 | { |
| 918 | .compatible = "allwinner,sun50i-h6-pinctrl", |
| 919 | .data = (ulong)&sun50i_h6_pinctrl_desc, |
| 920 | }, |
| 921 | #endif |
| 922 | #ifdef CONFIG_PINCTRL_SUN50I_H6_R |
| 923 | { |
| 924 | .compatible = "allwinner,sun50i-h6-r-pinctrl", |
| 925 | .data = (ulong)&sun50i_h6_r_pinctrl_desc, |
| 926 | }, |
| 927 | #endif |
| 928 | #ifdef CONFIG_PINCTRL_SUN50I_H616 |
| 929 | { |
| 930 | .compatible = "allwinner,sun50i-h616-pinctrl", |
| 931 | .data = (ulong)&sun50i_h616_pinctrl_desc, |
| 932 | }, |
| 933 | #endif |
| 934 | #ifdef CONFIG_PINCTRL_SUN50I_H616_R |
| 935 | { |
| 936 | .compatible = "allwinner,sun50i-h616-r-pinctrl", |
| 937 | .data = (ulong)&sun50i_h616_r_pinctrl_desc, |
| 938 | }, |
| 939 | #endif |
| 940 | {} |
| 941 | }; |
| 942 | |
| 943 | U_BOOT_DRIVER(sunxi_pinctrl) = { |
| 944 | .name = "sunxi-pinctrl", |
| 945 | .id = UCLASS_PINCTRL, |
| 946 | .of_match = sunxi_pinctrl_ids, |
| 947 | .bind = sunxi_pinctrl_bind, |
| 948 | .probe = sunxi_pinctrl_probe, |
| 949 | .plat_auto = sizeof(struct sunxi_pinctrl_plat), |
| 950 | .ops = &sunxi_pinctrl_ops, |
| 951 | }; |