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> |
| 10 | |
| 11 | #include <asm/gpio.h> |
| 12 | |
| 13 | extern U_BOOT_DRIVER(gpio_sunxi); |
| 14 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 15 | /* |
| 16 | * This structure implements a simplified view of the possible pinmux settings: |
| 17 | * Each mux value is assumed to be the same for a given function, across the |
| 18 | * pins in each group (almost universally true, with same rare exceptions not |
| 19 | * relevant to U-Boot), but also across different ports (not true in many |
| 20 | * cases). We ignore the first problem, and work around the latter by just |
| 21 | * supporting one particular port for a each function. This works fine for all |
| 22 | * board configurations so far. If this would need to be revisited, we could |
| 23 | * add a "u8 port;" below and match that, with 0 encoding the "don't care" case. |
| 24 | */ |
| 25 | struct sunxi_pinctrl_function { |
| 26 | const char name[sizeof("gpio_out")]; |
| 27 | u8 mux; |
| 28 | }; |
| 29 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 30 | struct sunxi_pinctrl_desc { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 31 | const struct sunxi_pinctrl_function *functions; |
| 32 | u8 num_functions; |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 33 | u8 first_bank; |
| 34 | u8 num_banks; |
| 35 | }; |
| 36 | |
| 37 | struct sunxi_pinctrl_plat { |
| 38 | struct sunxi_gpio __iomem *base; |
| 39 | }; |
| 40 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 41 | static int sunxi_pinctrl_get_pins_count(struct udevice *dev) |
| 42 | { |
| 43 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
| 44 | |
| 45 | return desc->num_banks * SUNXI_GPIOS_PER_BANK; |
| 46 | } |
| 47 | |
| 48 | static const char *sunxi_pinctrl_get_pin_name(struct udevice *dev, |
| 49 | uint pin_selector) |
| 50 | { |
| 51 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
| 52 | static char pin_name[sizeof("PN31")]; |
| 53 | |
| 54 | snprintf(pin_name, sizeof(pin_name), "P%c%d", |
| 55 | pin_selector / SUNXI_GPIOS_PER_BANK + desc->first_bank + 'A', |
| 56 | pin_selector % SUNXI_GPIOS_PER_BANK); |
| 57 | |
| 58 | return pin_name; |
| 59 | } |
| 60 | |
| 61 | static int sunxi_pinctrl_get_functions_count(struct udevice *dev) |
| 62 | { |
| 63 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
| 64 | |
| 65 | return desc->num_functions; |
| 66 | } |
| 67 | |
| 68 | static const char *sunxi_pinctrl_get_function_name(struct udevice *dev, |
| 69 | uint func_selector) |
| 70 | { |
| 71 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
| 72 | |
| 73 | return desc->functions[func_selector].name; |
| 74 | } |
| 75 | |
| 76 | static int sunxi_pinctrl_pinmux_set(struct udevice *dev, uint pin_selector, |
| 77 | uint func_selector) |
| 78 | { |
| 79 | const struct sunxi_pinctrl_desc *desc = dev_get_priv(dev); |
| 80 | struct sunxi_pinctrl_plat *plat = dev_get_plat(dev); |
| 81 | int bank = pin_selector / SUNXI_GPIOS_PER_BANK; |
| 82 | int pin = pin_selector % SUNXI_GPIOS_PER_BANK; |
| 83 | |
| 84 | debug("set mux: %-4s => %s (%d)\n", |
| 85 | sunxi_pinctrl_get_pin_name(dev, pin_selector), |
| 86 | sunxi_pinctrl_get_function_name(dev, func_selector), |
| 87 | desc->functions[func_selector].mux); |
| 88 | |
| 89 | sunxi_gpio_set_cfgbank(plat->base + bank, pin, |
| 90 | desc->functions[func_selector].mux); |
| 91 | |
| 92 | return 0; |
| 93 | } |
| 94 | |
Samuel Holland | de828b4 | 2021-08-28 21:10:47 -0500 | [diff] [blame] | 95 | static const struct pinconf_param sunxi_pinctrl_pinconf_params[] = { |
| 96 | { "bias-disable", PIN_CONFIG_BIAS_DISABLE, 0 }, |
| 97 | { "bias-pull-down", PIN_CONFIG_BIAS_PULL_DOWN, 2 }, |
| 98 | { "bias-pull-up", PIN_CONFIG_BIAS_PULL_UP, 1 }, |
| 99 | { "drive-strength", PIN_CONFIG_DRIVE_STRENGTH, 10 }, |
| 100 | }; |
| 101 | |
| 102 | static int sunxi_pinctrl_pinconf_set_pull(struct sunxi_pinctrl_plat *plat, |
| 103 | uint bank, uint pin, uint bias) |
| 104 | { |
| 105 | struct sunxi_gpio *regs = &plat->base[bank]; |
| 106 | |
| 107 | sunxi_gpio_set_pull_bank(regs, pin, bias); |
| 108 | |
| 109 | return 0; |
| 110 | } |
| 111 | |
| 112 | static int sunxi_pinctrl_pinconf_set_drive(struct sunxi_pinctrl_plat *plat, |
| 113 | uint bank, uint pin, uint drive) |
| 114 | { |
| 115 | struct sunxi_gpio *regs = &plat->base[bank]; |
| 116 | |
| 117 | if (drive < 10 || drive > 40) |
| 118 | return -EINVAL; |
| 119 | |
| 120 | /* Convert mA to the register value, rounding down. */ |
| 121 | sunxi_gpio_set_drv_bank(regs, pin, drive / 10 - 1); |
| 122 | |
| 123 | return 0; |
| 124 | } |
| 125 | |
| 126 | static int sunxi_pinctrl_pinconf_set(struct udevice *dev, uint pin_selector, |
| 127 | uint param, uint val) |
| 128 | { |
| 129 | struct sunxi_pinctrl_plat *plat = dev_get_plat(dev); |
| 130 | int bank = pin_selector / SUNXI_GPIOS_PER_BANK; |
| 131 | int pin = pin_selector % SUNXI_GPIOS_PER_BANK; |
| 132 | |
| 133 | switch (param) { |
| 134 | case PIN_CONFIG_BIAS_DISABLE: |
| 135 | case PIN_CONFIG_BIAS_PULL_DOWN: |
| 136 | case PIN_CONFIG_BIAS_PULL_UP: |
| 137 | return sunxi_pinctrl_pinconf_set_pull(plat, bank, pin, val); |
| 138 | case PIN_CONFIG_DRIVE_STRENGTH: |
| 139 | return sunxi_pinctrl_pinconf_set_drive(plat, bank, pin, val); |
| 140 | } |
| 141 | |
| 142 | return -EINVAL; |
| 143 | } |
| 144 | |
Samuel Holland | 116d523 | 2021-08-17 00:52:00 -0500 | [diff] [blame] | 145 | static int sunxi_pinctrl_get_pin_muxing(struct udevice *dev, uint pin_selector, |
| 146 | char *buf, int size) |
| 147 | { |
| 148 | struct sunxi_pinctrl_plat *plat = dev_get_plat(dev); |
| 149 | int bank = pin_selector / SUNXI_GPIOS_PER_BANK; |
| 150 | int pin = pin_selector % SUNXI_GPIOS_PER_BANK; |
| 151 | int mux = sunxi_gpio_get_cfgbank(plat->base + bank, pin); |
| 152 | |
| 153 | switch (mux) { |
| 154 | case SUNXI_GPIO_INPUT: |
| 155 | strlcpy(buf, "gpio input", size); |
| 156 | break; |
| 157 | case SUNXI_GPIO_OUTPUT: |
| 158 | strlcpy(buf, "gpio output", size); |
| 159 | break; |
| 160 | case SUNXI_GPIO_DISABLE: |
| 161 | strlcpy(buf, "disabled", size); |
| 162 | break; |
| 163 | default: |
| 164 | snprintf(buf, size, "function %d", mux); |
| 165 | break; |
| 166 | } |
| 167 | |
| 168 | return 0; |
| 169 | } |
| 170 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 171 | static const struct pinctrl_ops sunxi_pinctrl_ops = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 172 | .get_pins_count = sunxi_pinctrl_get_pins_count, |
| 173 | .get_pin_name = sunxi_pinctrl_get_pin_name, |
| 174 | .get_functions_count = sunxi_pinctrl_get_functions_count, |
| 175 | .get_function_name = sunxi_pinctrl_get_function_name, |
| 176 | .pinmux_set = sunxi_pinctrl_pinmux_set, |
Samuel Holland | de828b4 | 2021-08-28 21:10:47 -0500 | [diff] [blame] | 177 | .pinconf_num_params = ARRAY_SIZE(sunxi_pinctrl_pinconf_params), |
| 178 | .pinconf_params = sunxi_pinctrl_pinconf_params, |
| 179 | .pinconf_set = sunxi_pinctrl_pinconf_set, |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 180 | .set_state = pinctrl_generic_set_state, |
Samuel Holland | 116d523 | 2021-08-17 00:52:00 -0500 | [diff] [blame] | 181 | .get_pin_muxing = sunxi_pinctrl_get_pin_muxing, |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 182 | }; |
| 183 | |
| 184 | static int sunxi_pinctrl_bind(struct udevice *dev) |
| 185 | { |
| 186 | struct sunxi_pinctrl_plat *plat = dev_get_plat(dev); |
| 187 | struct sunxi_pinctrl_desc *desc; |
| 188 | struct sunxi_gpio_plat *gpio_plat; |
| 189 | struct udevice *gpio_dev; |
| 190 | int i, ret; |
| 191 | |
| 192 | desc = (void *)dev_get_driver_data(dev); |
| 193 | if (!desc) |
| 194 | return -EINVAL; |
| 195 | dev_set_priv(dev, desc); |
| 196 | |
| 197 | plat->base = dev_read_addr_ptr(dev); |
| 198 | |
| 199 | ret = device_bind_driver_to_node(dev, "gpio_sunxi", dev->name, |
| 200 | dev_ofnode(dev), &gpio_dev); |
| 201 | if (ret) |
| 202 | return ret; |
| 203 | |
| 204 | for (i = 0; i < desc->num_banks; ++i) { |
| 205 | gpio_plat = malloc(sizeof(*gpio_plat)); |
| 206 | if (!gpio_plat) |
| 207 | return -ENOMEM; |
| 208 | |
| 209 | gpio_plat->regs = plat->base + i; |
| 210 | gpio_plat->bank_name[0] = 'P'; |
| 211 | gpio_plat->bank_name[1] = 'A' + desc->first_bank + i; |
| 212 | gpio_plat->bank_name[2] = '\0'; |
| 213 | |
| 214 | ret = device_bind(gpio_dev, DM_DRIVER_REF(gpio_sunxi), |
| 215 | gpio_plat->bank_name, gpio_plat, |
| 216 | ofnode_null(), NULL); |
| 217 | if (ret) |
| 218 | return ret; |
| 219 | } |
| 220 | |
| 221 | return 0; |
| 222 | } |
| 223 | |
| 224 | static int sunxi_pinctrl_probe(struct udevice *dev) |
| 225 | { |
| 226 | struct clk *apb_clk; |
| 227 | |
| 228 | apb_clk = devm_clk_get(dev, "apb"); |
| 229 | if (!IS_ERR(apb_clk)) |
| 230 | clk_enable(apb_clk); |
| 231 | |
| 232 | return 0; |
| 233 | } |
| 234 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 235 | static const struct sunxi_pinctrl_function suniv_f1c100s_pinctrl_functions[] = { |
| 236 | { "gpio_in", 0 }, |
| 237 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 238 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 239 | { "uart0", 3 }, /* PF2-PF4 */ |
| 240 | #else |
| 241 | { "uart0", 5 }, /* PE0-PE1 */ |
| 242 | #endif |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 243 | }; |
| 244 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 245 | static const struct sunxi_pinctrl_desc __maybe_unused suniv_f1c100s_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 246 | .functions = suniv_f1c100s_pinctrl_functions, |
| 247 | .num_functions = ARRAY_SIZE(suniv_f1c100s_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 248 | .first_bank = SUNXI_GPIO_A, |
| 249 | .num_banks = 6, |
| 250 | }; |
| 251 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 252 | static const struct sunxi_pinctrl_function sun4i_a10_pinctrl_functions[] = { |
Samuel Holland | 5d57e05 | 2021-08-28 13:21:36 -0500 | [diff] [blame^] | 253 | { "emac", 2 }, /* PA0-PA17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 254 | { "gpio_in", 0 }, |
| 255 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 256 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 257 | { "uart0", 4 }, /* PF2-PF4 */ |
| 258 | #else |
| 259 | { "uart0", 2 }, /* PB22-PB23 */ |
| 260 | #endif |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 261 | }; |
| 262 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 263 | static const struct sunxi_pinctrl_desc __maybe_unused sun4i_a10_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 264 | .functions = sun4i_a10_pinctrl_functions, |
| 265 | .num_functions = ARRAY_SIZE(sun4i_a10_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 266 | .first_bank = SUNXI_GPIO_A, |
| 267 | .num_banks = 9, |
| 268 | }; |
| 269 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 270 | static const struct sunxi_pinctrl_function sun5i_a13_pinctrl_functions[] = { |
Samuel Holland | 5d57e05 | 2021-08-28 13:21:36 -0500 | [diff] [blame^] | 271 | { "emac", 2 }, /* PA0-PA17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 272 | { "gpio_in", 0 }, |
| 273 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 274 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 275 | { "uart0", 4 }, /* PF2-PF4 */ |
| 276 | #else |
| 277 | { "uart0", 2 }, /* PB19-PB20 */ |
| 278 | #endif |
| 279 | { "uart1", 4 }, /* PG3-PG4 */ |
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 sun5i_a13_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 283 | .functions = sun5i_a13_pinctrl_functions, |
| 284 | .num_functions = ARRAY_SIZE(sun5i_a13_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 285 | .first_bank = SUNXI_GPIO_A, |
| 286 | .num_banks = 7, |
| 287 | }; |
| 288 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 289 | static const struct sunxi_pinctrl_function sun6i_a31_pinctrl_functions[] = { |
| 290 | { "gpio_in", 0 }, |
| 291 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 292 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 293 | { "uart0", 3 }, /* PF2-PF4 */ |
| 294 | #else |
| 295 | { "uart0", 2 }, /* PH20-PH21 */ |
| 296 | #endif |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 297 | }; |
| 298 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 299 | static const struct sunxi_pinctrl_desc __maybe_unused sun6i_a31_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 300 | .functions = sun6i_a31_pinctrl_functions, |
| 301 | .num_functions = ARRAY_SIZE(sun6i_a31_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 302 | .first_bank = SUNXI_GPIO_A, |
| 303 | .num_banks = 8, |
| 304 | }; |
| 305 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 306 | static const struct sunxi_pinctrl_function sun6i_a31_r_pinctrl_functions[] = { |
| 307 | { "gpio_in", 0 }, |
| 308 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 309 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 310 | }; |
| 311 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 312 | 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] | 313 | .functions = sun6i_a31_r_pinctrl_functions, |
| 314 | .num_functions = ARRAY_SIZE(sun6i_a31_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 315 | .first_bank = SUNXI_GPIO_L, |
| 316 | .num_banks = 2, |
| 317 | }; |
| 318 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 319 | static const struct sunxi_pinctrl_function sun7i_a20_pinctrl_functions[] = { |
Samuel Holland | 5d57e05 | 2021-08-28 13:21:36 -0500 | [diff] [blame^] | 320 | { "emac", 2 }, /* PA0-PA17 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 321 | { "gpio_in", 0 }, |
| 322 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 323 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 324 | { "uart0", 4 }, /* PF2-PF4 */ |
| 325 | #else |
| 326 | { "uart0", 2 }, /* PB22-PB23 */ |
| 327 | #endif |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 328 | }; |
| 329 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 330 | static const struct sunxi_pinctrl_desc __maybe_unused sun7i_a20_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 331 | .functions = sun7i_a20_pinctrl_functions, |
| 332 | .num_functions = ARRAY_SIZE(sun7i_a20_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 333 | .first_bank = SUNXI_GPIO_A, |
| 334 | .num_banks = 9, |
| 335 | }; |
| 336 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 337 | static const struct sunxi_pinctrl_function sun8i_a23_pinctrl_functions[] = { |
| 338 | { "gpio_in", 0 }, |
| 339 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 340 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 341 | { "uart0", 3 }, /* PF2-PF4 */ |
| 342 | #endif |
| 343 | { "uart1", 2 }, /* PG6-PG7 */ |
| 344 | { "uart2", 2 }, /* PB0-PB1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 345 | }; |
| 346 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 347 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a23_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 348 | .functions = sun8i_a23_pinctrl_functions, |
| 349 | .num_functions = ARRAY_SIZE(sun8i_a23_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 350 | .first_bank = SUNXI_GPIO_A, |
| 351 | .num_banks = 8, |
| 352 | }; |
| 353 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 354 | static const struct sunxi_pinctrl_function sun8i_a23_r_pinctrl_functions[] = { |
| 355 | { "gpio_in", 0 }, |
| 356 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 357 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 358 | }; |
| 359 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 360 | 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] | 361 | .functions = sun8i_a23_r_pinctrl_functions, |
| 362 | .num_functions = ARRAY_SIZE(sun8i_a23_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 363 | .first_bank = SUNXI_GPIO_L, |
| 364 | .num_banks = 1, |
| 365 | }; |
| 366 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 367 | static const struct sunxi_pinctrl_function sun8i_a33_pinctrl_functions[] = { |
| 368 | { "gpio_in", 0 }, |
| 369 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 370 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 371 | { "uart0", 3 }, /* PF2-PF4 */ |
| 372 | #else |
| 373 | { "uart0", 3 }, /* PB0-PB1 */ |
| 374 | #endif |
| 375 | { "uart1", 2 }, /* PG6-PG7 */ |
| 376 | { "uart2", 2 }, /* PB0-PB1 */ |
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 sun8i_a33_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 380 | .functions = sun8i_a33_pinctrl_functions, |
| 381 | .num_functions = ARRAY_SIZE(sun8i_a33_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 382 | .first_bank = SUNXI_GPIO_A, |
| 383 | .num_banks = 8, |
| 384 | }; |
| 385 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 386 | static const struct sunxi_pinctrl_function sun8i_a83t_pinctrl_functions[] = { |
| 387 | { "gpio_in", 0 }, |
| 388 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 389 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 390 | { "uart0", 3 }, /* PF2-PF4 */ |
| 391 | #else |
| 392 | { "uart0", 2 }, /* PB9-PB10 */ |
| 393 | #endif |
| 394 | { "uart1", 2 }, /* PG6-PG7 */ |
| 395 | { "uart2", 2 }, /* PB0-PB1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 396 | }; |
| 397 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 398 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_a83t_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 399 | .functions = sun8i_a83t_pinctrl_functions, |
| 400 | .num_functions = ARRAY_SIZE(sun8i_a83t_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 401 | .first_bank = SUNXI_GPIO_A, |
| 402 | .num_banks = 8, |
| 403 | }; |
| 404 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 405 | static const struct sunxi_pinctrl_function sun8i_a83t_r_pinctrl_functions[] = { |
| 406 | { "gpio_in", 0 }, |
| 407 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 408 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 409 | }; |
| 410 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 411 | 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] | 412 | .functions = sun8i_a83t_r_pinctrl_functions, |
| 413 | .num_functions = ARRAY_SIZE(sun8i_a83t_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 414 | .first_bank = SUNXI_GPIO_L, |
| 415 | .num_banks = 1, |
| 416 | }; |
| 417 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 418 | static const struct sunxi_pinctrl_function sun8i_h3_pinctrl_functions[] = { |
| 419 | { "gpio_in", 0 }, |
| 420 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 421 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 422 | { "uart0", 3 }, /* PF2-PF4 */ |
| 423 | #else |
| 424 | { "uart0", 2 }, /* PA4-PA5 */ |
| 425 | #endif |
| 426 | { "uart1", 2 }, /* PG6-PG7 */ |
| 427 | { "uart2", 2 }, /* PA0-PA1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 428 | }; |
| 429 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 430 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_h3_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 431 | .functions = sun8i_h3_pinctrl_functions, |
| 432 | .num_functions = ARRAY_SIZE(sun8i_h3_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 433 | .first_bank = SUNXI_GPIO_A, |
| 434 | .num_banks = 7, |
| 435 | }; |
| 436 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 437 | static const struct sunxi_pinctrl_function sun8i_h3_r_pinctrl_functions[] = { |
| 438 | { "gpio_in", 0 }, |
| 439 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 440 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 441 | }; |
| 442 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 443 | 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] | 444 | .functions = sun8i_h3_r_pinctrl_functions, |
| 445 | .num_functions = ARRAY_SIZE(sun8i_h3_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 446 | .first_bank = SUNXI_GPIO_L, |
| 447 | .num_banks = 1, |
| 448 | }; |
| 449 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 450 | static const struct sunxi_pinctrl_function sun8i_v3s_pinctrl_functions[] = { |
| 451 | { "gpio_in", 0 }, |
| 452 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 453 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 454 | { "uart0", 3 }, /* PF2-PF4 */ |
| 455 | #else |
| 456 | { "uart0", 3 }, /* PB8-PB9 */ |
| 457 | #endif |
| 458 | { "uart1", 2 }, /* PG6-PG7 */ |
| 459 | { "uart2", 2 }, /* PB0-PB1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 460 | }; |
| 461 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 462 | static const struct sunxi_pinctrl_desc __maybe_unused sun8i_v3s_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 463 | .functions = sun8i_v3s_pinctrl_functions, |
| 464 | .num_functions = ARRAY_SIZE(sun8i_v3s_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 465 | .first_bank = SUNXI_GPIO_A, |
| 466 | .num_banks = 7, |
| 467 | }; |
| 468 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 469 | static const struct sunxi_pinctrl_function sun9i_a80_pinctrl_functions[] = { |
| 470 | { "gpio_in", 0 }, |
| 471 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 472 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 473 | { "uart0", 4 }, /* PF2-PF4 */ |
| 474 | #else |
| 475 | { "uart0", 2 }, /* PH12-PH13 */ |
| 476 | #endif |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 477 | }; |
| 478 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 479 | static const struct sunxi_pinctrl_desc __maybe_unused sun9i_a80_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 480 | .functions = sun9i_a80_pinctrl_functions, |
| 481 | .num_functions = ARRAY_SIZE(sun9i_a80_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 482 | .first_bank = SUNXI_GPIO_A, |
| 483 | .num_banks = 8, |
| 484 | }; |
| 485 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 486 | static const struct sunxi_pinctrl_function sun9i_a80_r_pinctrl_functions[] = { |
| 487 | { "gpio_in", 0 }, |
| 488 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 489 | { "s_uart", 3 }, /* PL0-PL1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 490 | }; |
| 491 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 492 | 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] | 493 | .functions = sun9i_a80_r_pinctrl_functions, |
| 494 | .num_functions = ARRAY_SIZE(sun9i_a80_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 495 | .first_bank = SUNXI_GPIO_L, |
| 496 | .num_banks = 3, |
| 497 | }; |
| 498 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 499 | static const struct sunxi_pinctrl_function sun50i_a64_pinctrl_functions[] = { |
| 500 | { "gpio_in", 0 }, |
| 501 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 502 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 503 | { "uart0", 3 }, /* PF2-PF4 */ |
| 504 | #else |
| 505 | { "uart0", 4 }, /* PB8-PB9 */ |
| 506 | #endif |
| 507 | { "uart1", 2 }, /* PG6-PG7 */ |
| 508 | { "uart2", 2 }, /* PB0-PB1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 509 | }; |
| 510 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 511 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_a64_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 512 | .functions = sun50i_a64_pinctrl_functions, |
| 513 | .num_functions = ARRAY_SIZE(sun50i_a64_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 514 | .first_bank = SUNXI_GPIO_A, |
| 515 | .num_banks = 8, |
| 516 | }; |
| 517 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 518 | static const struct sunxi_pinctrl_function sun50i_a64_r_pinctrl_functions[] = { |
| 519 | { "gpio_in", 0 }, |
| 520 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 521 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 522 | }; |
| 523 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 524 | 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] | 525 | .functions = sun50i_a64_r_pinctrl_functions, |
| 526 | .num_functions = ARRAY_SIZE(sun50i_a64_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 527 | .first_bank = SUNXI_GPIO_L, |
| 528 | .num_banks = 1, |
| 529 | }; |
| 530 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 531 | static const struct sunxi_pinctrl_function sun50i_h5_pinctrl_functions[] = { |
| 532 | { "gpio_in", 0 }, |
| 533 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 534 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 535 | { "uart0", 3 }, /* PF2-PF4 */ |
| 536 | #else |
| 537 | { "uart0", 2 }, /* PA4-PA5 */ |
| 538 | #endif |
| 539 | { "uart1", 2 }, /* PG6-PG7 */ |
| 540 | { "uart2", 2 }, /* PA0-PA1 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 541 | }; |
| 542 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 543 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h5_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 544 | .functions = sun50i_h5_pinctrl_functions, |
| 545 | .num_functions = ARRAY_SIZE(sun50i_h5_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 546 | .first_bank = SUNXI_GPIO_A, |
| 547 | .num_banks = 7, |
| 548 | }; |
| 549 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 550 | static const struct sunxi_pinctrl_function sun50i_h6_pinctrl_functions[] = { |
| 551 | { "gpio_in", 0 }, |
| 552 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 553 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 554 | { "uart0", 3 }, /* PF2-PF4 */ |
| 555 | #else |
| 556 | { "uart0", 2 }, /* PH0-PH1 */ |
| 557 | #endif |
| 558 | { "uart1", 2 }, /* PG6-PG7 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 559 | }; |
| 560 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 561 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h6_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 562 | .functions = sun50i_h6_pinctrl_functions, |
| 563 | .num_functions = ARRAY_SIZE(sun50i_h6_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 564 | .first_bank = SUNXI_GPIO_A, |
| 565 | .num_banks = 8, |
| 566 | }; |
| 567 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 568 | static const struct sunxi_pinctrl_function sun50i_h6_r_pinctrl_functions[] = { |
| 569 | { "gpio_in", 0 }, |
| 570 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 571 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 572 | }; |
| 573 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 574 | 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] | 575 | .functions = sun50i_h6_r_pinctrl_functions, |
| 576 | .num_functions = ARRAY_SIZE(sun50i_h6_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 577 | .first_bank = SUNXI_GPIO_L, |
| 578 | .num_banks = 2, |
| 579 | }; |
| 580 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 581 | static const struct sunxi_pinctrl_function sun50i_h616_pinctrl_functions[] = { |
| 582 | { "gpio_in", 0 }, |
| 583 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 584 | #if IS_ENABLED(CONFIG_UART0_PORT_F) |
| 585 | { "uart0", 3 }, /* PF2-PF4 */ |
| 586 | #else |
| 587 | { "uart0", 2 }, /* PH0-PH1 */ |
| 588 | #endif |
| 589 | { "uart1", 2 }, /* PG6-PG7 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 590 | }; |
| 591 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 592 | static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h616_pinctrl_desc = { |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 593 | .functions = sun50i_h616_pinctrl_functions, |
| 594 | .num_functions = ARRAY_SIZE(sun50i_h616_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 595 | .first_bank = SUNXI_GPIO_A, |
| 596 | .num_banks = 9, |
| 597 | }; |
| 598 | |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 599 | static const struct sunxi_pinctrl_function sun50i_h616_r_pinctrl_functions[] = { |
| 600 | { "gpio_in", 0 }, |
| 601 | { "gpio_out", 1 }, |
Samuel Holland | 5a08d41 | 2021-08-28 13:00:45 -0500 | [diff] [blame] | 602 | { "s_uart", 2 }, /* PL2-PL3 */ |
Samuel Holland | ecbbedb | 2021-08-16 23:56:47 -0500 | [diff] [blame] | 603 | }; |
| 604 | |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 605 | 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] | 606 | .functions = sun50i_h616_r_pinctrl_functions, |
| 607 | .num_functions = ARRAY_SIZE(sun50i_h616_r_pinctrl_functions), |
Samuel Holland | e309502 | 2021-08-12 20:09:43 -0500 | [diff] [blame] | 608 | .first_bank = SUNXI_GPIO_L, |
| 609 | .num_banks = 1, |
| 610 | }; |
| 611 | |
| 612 | static const struct udevice_id sunxi_pinctrl_ids[] = { |
| 613 | #ifdef CONFIG_PINCTRL_SUNIV_F1C100S |
| 614 | { |
| 615 | .compatible = "allwinner,suniv-f1c100s-pinctrl", |
| 616 | .data = (ulong)&suniv_f1c100s_pinctrl_desc, |
| 617 | }, |
| 618 | #endif |
| 619 | #ifdef CONFIG_PINCTRL_SUN4I_A10 |
| 620 | { |
| 621 | .compatible = "allwinner,sun4i-a10-pinctrl", |
| 622 | .data = (ulong)&sun4i_a10_pinctrl_desc, |
| 623 | }, |
| 624 | #endif |
| 625 | #ifdef CONFIG_PINCTRL_SUN5I_A13 |
| 626 | { |
| 627 | .compatible = "allwinner,sun5i-a10s-pinctrl", |
| 628 | .data = (ulong)&sun5i_a13_pinctrl_desc, |
| 629 | }, |
| 630 | { |
| 631 | .compatible = "allwinner,sun5i-a13-pinctrl", |
| 632 | .data = (ulong)&sun5i_a13_pinctrl_desc, |
| 633 | }, |
| 634 | #endif |
| 635 | #ifdef CONFIG_PINCTRL_SUN6I_A31 |
| 636 | { |
| 637 | .compatible = "allwinner,sun6i-a31-pinctrl", |
| 638 | .data = (ulong)&sun6i_a31_pinctrl_desc, |
| 639 | }, |
| 640 | { |
| 641 | .compatible = "allwinner,sun6i-a31s-pinctrl", |
| 642 | .data = (ulong)&sun6i_a31_pinctrl_desc, |
| 643 | }, |
| 644 | #endif |
| 645 | #ifdef CONFIG_PINCTRL_SUN6I_A31_R |
| 646 | { |
| 647 | .compatible = "allwinner,sun6i-a31-r-pinctrl", |
| 648 | .data = (ulong)&sun6i_a31_r_pinctrl_desc, |
| 649 | }, |
| 650 | #endif |
| 651 | #ifdef CONFIG_PINCTRL_SUN7I_A20 |
| 652 | { |
| 653 | .compatible = "allwinner,sun7i-a20-pinctrl", |
| 654 | .data = (ulong)&sun7i_a20_pinctrl_desc, |
| 655 | }, |
| 656 | #endif |
| 657 | #ifdef CONFIG_PINCTRL_SUN8I_A23 |
| 658 | { |
| 659 | .compatible = "allwinner,sun8i-a23-pinctrl", |
| 660 | .data = (ulong)&sun8i_a23_pinctrl_desc, |
| 661 | }, |
| 662 | #endif |
| 663 | #ifdef CONFIG_PINCTRL_SUN8I_A23_R |
| 664 | { |
| 665 | .compatible = "allwinner,sun8i-a23-r-pinctrl", |
| 666 | .data = (ulong)&sun8i_a23_r_pinctrl_desc, |
| 667 | }, |
| 668 | #endif |
| 669 | #ifdef CONFIG_PINCTRL_SUN8I_A33 |
| 670 | { |
| 671 | .compatible = "allwinner,sun8i-a33-pinctrl", |
| 672 | .data = (ulong)&sun8i_a33_pinctrl_desc, |
| 673 | }, |
| 674 | #endif |
| 675 | #ifdef CONFIG_PINCTRL_SUN8I_A83T |
| 676 | { |
| 677 | .compatible = "allwinner,sun8i-a83t-pinctrl", |
| 678 | .data = (ulong)&sun8i_a83t_pinctrl_desc, |
| 679 | }, |
| 680 | #endif |
| 681 | #ifdef CONFIG_PINCTRL_SUN8I_A83T_R |
| 682 | { |
| 683 | .compatible = "allwinner,sun8i-a83t-r-pinctrl", |
| 684 | .data = (ulong)&sun8i_a83t_r_pinctrl_desc, |
| 685 | }, |
| 686 | #endif |
| 687 | #ifdef CONFIG_PINCTRL_SUN8I_H3 |
| 688 | { |
| 689 | .compatible = "allwinner,sun8i-h3-pinctrl", |
| 690 | .data = (ulong)&sun8i_h3_pinctrl_desc, |
| 691 | }, |
| 692 | #endif |
| 693 | #ifdef CONFIG_PINCTRL_SUN8I_H3_R |
| 694 | { |
| 695 | .compatible = "allwinner,sun8i-h3-r-pinctrl", |
| 696 | .data = (ulong)&sun8i_h3_r_pinctrl_desc, |
| 697 | }, |
| 698 | #endif |
| 699 | #ifdef CONFIG_PINCTRL_SUN7I_A20 |
| 700 | { |
| 701 | .compatible = "allwinner,sun8i-r40-pinctrl", |
| 702 | .data = (ulong)&sun7i_a20_pinctrl_desc, |
| 703 | }, |
| 704 | #endif |
| 705 | #ifdef CONFIG_PINCTRL_SUN8I_V3S |
| 706 | { |
| 707 | .compatible = "allwinner,sun8i-v3-pinctrl", |
| 708 | .data = (ulong)&sun8i_v3s_pinctrl_desc, |
| 709 | }, |
| 710 | { |
| 711 | .compatible = "allwinner,sun8i-v3s-pinctrl", |
| 712 | .data = (ulong)&sun8i_v3s_pinctrl_desc, |
| 713 | }, |
| 714 | #endif |
| 715 | #ifdef CONFIG_PINCTRL_SUN9I_A80 |
| 716 | { |
| 717 | .compatible = "allwinner,sun9i-a80-pinctrl", |
| 718 | .data = (ulong)&sun9i_a80_pinctrl_desc, |
| 719 | }, |
| 720 | #endif |
| 721 | #ifdef CONFIG_PINCTRL_SUN9I_A80_R |
| 722 | { |
| 723 | .compatible = "allwinner,sun9i-a80-r-pinctrl", |
| 724 | .data = (ulong)&sun9i_a80_r_pinctrl_desc, |
| 725 | }, |
| 726 | #endif |
| 727 | #ifdef CONFIG_PINCTRL_SUN50I_A64 |
| 728 | { |
| 729 | .compatible = "allwinner,sun50i-a64-pinctrl", |
| 730 | .data = (ulong)&sun50i_a64_pinctrl_desc, |
| 731 | }, |
| 732 | #endif |
| 733 | #ifdef CONFIG_PINCTRL_SUN50I_A64_R |
| 734 | { |
| 735 | .compatible = "allwinner,sun50i-a64-r-pinctrl", |
| 736 | .data = (ulong)&sun50i_a64_r_pinctrl_desc, |
| 737 | }, |
| 738 | #endif |
| 739 | #ifdef CONFIG_PINCTRL_SUN50I_H5 |
| 740 | { |
| 741 | .compatible = "allwinner,sun50i-h5-pinctrl", |
| 742 | .data = (ulong)&sun50i_h5_pinctrl_desc, |
| 743 | }, |
| 744 | #endif |
| 745 | #ifdef CONFIG_PINCTRL_SUN50I_H6 |
| 746 | { |
| 747 | .compatible = "allwinner,sun50i-h6-pinctrl", |
| 748 | .data = (ulong)&sun50i_h6_pinctrl_desc, |
| 749 | }, |
| 750 | #endif |
| 751 | #ifdef CONFIG_PINCTRL_SUN50I_H6_R |
| 752 | { |
| 753 | .compatible = "allwinner,sun50i-h6-r-pinctrl", |
| 754 | .data = (ulong)&sun50i_h6_r_pinctrl_desc, |
| 755 | }, |
| 756 | #endif |
| 757 | #ifdef CONFIG_PINCTRL_SUN50I_H616 |
| 758 | { |
| 759 | .compatible = "allwinner,sun50i-h616-pinctrl", |
| 760 | .data = (ulong)&sun50i_h616_pinctrl_desc, |
| 761 | }, |
| 762 | #endif |
| 763 | #ifdef CONFIG_PINCTRL_SUN50I_H616_R |
| 764 | { |
| 765 | .compatible = "allwinner,sun50i-h616-r-pinctrl", |
| 766 | .data = (ulong)&sun50i_h616_r_pinctrl_desc, |
| 767 | }, |
| 768 | #endif |
| 769 | {} |
| 770 | }; |
| 771 | |
| 772 | U_BOOT_DRIVER(sunxi_pinctrl) = { |
| 773 | .name = "sunxi-pinctrl", |
| 774 | .id = UCLASS_PINCTRL, |
| 775 | .of_match = sunxi_pinctrl_ids, |
| 776 | .bind = sunxi_pinctrl_bind, |
| 777 | .probe = sunxi_pinctrl_probe, |
| 778 | .plat_auto = sizeof(struct sunxi_pinctrl_plat), |
| 779 | .ops = &sunxi_pinctrl_ops, |
| 780 | }; |