]> git.ipfire.org Git - thirdparty/u-boot.git/commitdiff
pinctrl: sunxi: add Allwinner A523 pinctrl description
authorAndre Przywara <andre.przywara@arm.com>
Thu, 12 Sep 2024 00:54:56 +0000 (01:54 +0100)
committerAndre Przywara <andre.przywara@arm.com>
Sun, 27 Jul 2025 21:57:35 +0000 (22:57 +0100)
The new DT pinctrl binding would allow us to read the pinmux values from
the DT, but it is actually easier to just continue with hardcoding the
mux values in the driver, and matching them against the "function" name.

Add the values for the primary and secondary pin controller on the A523.

Signed-off-by: Andre Przywara <andre.przywara@arm.com>
drivers/pinctrl/sunxi/Kconfig
drivers/pinctrl/sunxi/pinctrl-sunxi.c

index 65e8192a99a125b12f43b39a23cbb9d06307e906..543149922998d2525f8d09aaadebb05ca225c80f 100644 (file)
@@ -139,4 +139,14 @@ config PINCTRL_SUN20I_D1
        default MACH_SUN8I_R528
        select PINCTRL_SUNXI
 
+config PINCTRL_SUN55I_A523
+       bool "Support for the Allwinner A523 PIO"
+       default MACH_SUN55I_A523
+       select PINCTRL_SUNXI
+
+config PINCTRL_SUN55I_A523_R
+       bool "Support for the Allwinner A523 R-PIO"
+       default MACH_SUN55I_A523
+       select PINCTRL_SUNXI
+
 endif
index c38edf7d4f52d5e8f55f74170a672ca2b9fd0142..03cfe23aaf83911c21f1410c9ccf71fa03178db5 100644 (file)
@@ -759,6 +759,29 @@ static const struct sunxi_pinctrl_desc __maybe_unused sun50i_h616_pinctrl_desc =
        .num_banks      = 9,
 };
 
+static const struct sunxi_pinctrl_function sun55i_a523_pinctrl_functions[] = {
+       { "emac0",      5 },    /* PI0-PI16 */
+       { "gpio_in",    0 },
+       { "gpio_out",   1 },
+       { "mmc0",       2 },    /* PF0-PF5 */
+       { "mmc1",       2 },    /* PG0-PG5 */
+       { "mmc2",       3 },    /* PC0-PC16 */
+       { "spi0",       4 },    /* PC0-PC7, PC15-PC16 */
+#if IS_ENABLED(CONFIG_UART0_PORT_F)
+       { "uart0",      3 },    /* PF2-PF4 */
+#else
+       { "uart0",      2 },    /* PH0-PH1 */
+#endif
+       { "uart1",      2 },    /* PG6-PG7 */
+};
+
+static const struct sunxi_pinctrl_desc __maybe_unused sun55i_a523_pinctrl_desc = {
+       .functions      = sun55i_a523_pinctrl_functions,
+       .num_functions  = ARRAY_SIZE(sun55i_a523_pinctrl_functions),
+       .first_bank     = SUNXI_GPIO_A,
+       .num_banks      = 11,
+};
+
 static const struct sunxi_pinctrl_function sun50i_h616_r_pinctrl_functions[] = {
        { "gpio_in",    0 },
        { "gpio_out",   1 },
@@ -809,6 +832,21 @@ static const struct sunxi_pinctrl_desc __maybe_unused sun50i_a100_r_pinctrl_desc
        .num_banks      = 1,
 };
 
+static const struct sunxi_pinctrl_function sun55i_a523_r_pinctrl_functions[] = {
+       { "gpio_in",    0 },
+       { "gpio_out",   1 },
+       { "r_i2c0",     2 },    /* PL0-PL1 */
+       { "r_spi",      6 },    /* PL10-PL13 */
+       { "r_uart",     2 },    /* PL2-PL3 */
+};
+
+static const struct sunxi_pinctrl_desc __maybe_unused sun55i_a523_r_pinctrl_desc = {
+       .functions      = sun55i_a523_r_pinctrl_functions,
+       .num_functions  = ARRAY_SIZE(sun55i_a523_r_pinctrl_functions),
+       .first_bank     = SUNXI_GPIO_L,
+       .num_banks      = 2,
+};
+
 static const struct udevice_id sunxi_pinctrl_ids[] = {
 #ifdef CONFIG_PINCTRL_SUNIV_F1C100S
        {
@@ -983,6 +1021,18 @@ static const struct udevice_id sunxi_pinctrl_ids[] = {
                .compatible = "allwinner,sun50i-a100-r-pinctrl",
                .data = (ulong)&sun50i_a100_r_pinctrl_desc,
        },
+#endif
+#ifdef CONFIG_PINCTRL_SUN55I_A523
+       {
+               .compatible = "allwinner,sun55i-a523-pinctrl",
+               .data = (ulong)&sun55i_a523_pinctrl_desc,
+       },
+#endif
+#ifdef CONFIG_PINCTRL_SUN55I_A523_R
+       {
+               .compatible = "allwinner,sun55i-a523-r-pinctrl",
+               .data = (ulong)&sun55i_a523_r_pinctrl_desc,
+       },
 #endif
        {}
 };