Add Allwinner D1 support.
authorkettenis <kettenis@openbsd.org>
Fri, 13 Oct 2023 15:41:25 +0000 (15:41 +0000)
committerkettenis <kettenis@openbsd.org>
Fri, 13 Oct 2023 15:41:25 +0000 (15:41 +0000)
ok mbuhl@, patrick@, dlg@

sys/dev/fdt/sxipio.c
sys/dev/fdt/sxipio_pins.h
sys/dev/fdt/sxipiovar.h

index 93f2e8a..8f87297 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sxipio.c,v 1.16 2023/09/01 16:13:56 kettenis Exp $    */
+/*     $OpenBSD: sxipio.c,v 1.17 2023/10/13 15:41:25 kettenis Exp $    */
 /*
  * Copyright (c) 2010 Miodrag Vallat.
  * Copyright (c) 2013 Artturi Alm
@@ -182,6 +182,10 @@ const struct sxipio_pins sxipio_pins[] = {
                "allwinner,sun9i-a80-r-pinctrl",
                sun9i_a80_r_pins, nitems(sun9i_a80_r_pins)
        },
+       {
+               "allwinner,sun20i-d1-pinctrl",
+               sun20i_d1_pins, nitems(sun20i_d1_pins)
+       },
        {
                "allwinner,sun50i-a64-pinctrl",
                sun50i_a64_pins, nitems(sun50i_a64_pins)
index 03e240c..361b692 100644 (file)
@@ -8325,6 +8325,883 @@ const struct sxipio_pin sun9i_a80_r_pins[] = {
        } },
 };
 
+const struct sxipio_pin sun20i_d1_pins[] = {
+       { SXIPIO_PIN(B, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "pwm3", 2 },
+               { "ir", 3 },
+               { "i2c2", 4 },
+               { "spi1", 5 },
+               { "uart0", 6 },
+               { "uart2", 7 },
+               { "spdif", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "pwm4", 2 },
+               { "i2s2_dout", 3 },
+               { "i2c2", 4 },
+               { "i2s2_din", 5 },
+               { "uart0", 6 },
+               { "uart2", 7 },
+               { "ir", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "i2s2_dout", 3 },
+               { "i2c0", 4 },
+               { "i2s2_din", 5 },
+               { "lcd0", 6 },
+               { "uart4", 7 },
+               { "can0", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "i2s2_dout", 3 },
+               { "i2c0", 4 },
+               { "i2s2_din", 5 },
+               { "lcd0", 6 },
+               { "uart4", 7 },
+               { "can0", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "i2s2_dout", 3 },
+               { "i2c1", 4 },
+               { "i2s2_din", 5 },
+               { "lcd0", 6 },
+               { "uart5", 7 },
+               { "can1", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "i2s2", 3 },
+               { "i2c1", 4 },
+               { "pwm0", 5 },
+               { "lcd0", 6 },
+               { "uart5", 7 },
+               { "can1", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "i2s2", 3 },
+               { "i2c3", 4 },
+               { "pwm1", 5 },
+               { "lcd0", 6 },
+               { "uart3", 7 },
+               { "bist0", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 7), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "i2s2", 3 },
+               { "i2c3", 4 },
+               { "ir", 5 },
+               { "lcd0", 6 },
+               { "uart3", 7 },
+               { "bist1", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 8), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "dmic", 2 },
+               { "pwm5", 3 },
+               { "i2c2", 4 },
+               { "spi1", 5 },
+               { "uart0", 6 },
+               { "uart1", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 9), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "dmic", 2 },
+               { "pwm6", 3 },
+               { "i2c2", 4 },
+               { "spi1", 5 },
+               { "uart0", 6 },
+               { "uart1", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 10), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "dmic", 2 },
+               { "pwm7", 3 },
+               { "i2c0", 4 },
+               { "spi1", 5 },
+               { "clk", 6 },
+               { "uart1", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 11), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "dmic", 2 },
+               { "pwm2", 3 },
+               { "i2c0", 4 },
+               { "spi1", 5 },
+               { "clk", 6 },
+               { "uart1", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(B, 12), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "dmic", 2 },
+               { "pwm0", 3 },
+               { "spdif", 4 },
+               { "spi1", 5 },
+               { "clk", 6 },
+               { "ir", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(C, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2c2", 3 },
+               { "ledc", 4 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(C, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2c2", 3 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(C, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "spi0", 2 },
+               { "mmc2", 3 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(C, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "spi0", 2 },
+               { "mmc2", 3 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(C, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "spi0", 2 },
+               { "mmc2", 3 },
+               { "boot", 4 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(C, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "spi0", 2 },
+               { "mmc2", 3 },
+               { "boot", 4 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(C, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "spi0", 2 },
+               { "mmc2", 3 },
+               { "uart3", 4 },
+               { "i2c3", 5 },
+               { "pll", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(C, 7), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "spi0", 2 },
+               { "mmc2", 3 },
+               { "uart3", 4 },
+               { "i2c3", 5 },
+               { "tcon", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "i2c0", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "uart2", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "uart2", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "uart2", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "uart2", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "uart5", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "uart5", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 7), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "uart4", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 8), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "uart4", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 9), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds0", 3 },
+               { "dsi", 4 },
+               { "pwm6", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 10), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "spi1", 4 },
+               { "uart3", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 11), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "spi1", 4 },
+               { "uart3", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 12), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "spi1", 4 },
+               { "i2c0", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 13), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "spi1", 4 },
+               { "uart3", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 14), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "spi1", 4 },
+               { "uart3", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 15), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "spi1", 4 },
+               { "ir", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 16), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "dmic", 4 },
+               { "pwm0", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 17), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "dmic", 4 },
+               { "pwm1", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 18), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "dmic", 4 },
+               { "pwm2", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 19), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "lvds1", 3 },
+               { "dmic", 4 },
+               { "pwm3", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 20), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "i2c2", 3 },
+               { "dmic", 4 },
+               { "pwm4", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 21), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "lcd0", 2 },
+               { "i2c2", 3 },
+               { "uart1", 4 },
+               { "pwm5", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(D, 22), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "spdif", 2 },
+               { "ir", 3 },
+               { "uart1", 4 },
+               { "pwm7", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart2", 3 },
+               { "i2c1", 4 },
+               { "lcd0", 5 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart2", 3 },
+               { "i2c1", 4 },
+               { "lcd0", 5 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart2", 3 },
+               { "i2c0", 4 },
+               { "clk", 5 },
+               { "uart0", 6 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart2", 3 },
+               { "i2c0", 4 },
+               { "clk", 5 },
+               { "uart0", 6 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart4", 3 },
+               { "i2c2", 4 },
+               { "clk", 5 },
+               { "d_jtag", 6 },
+               { "r_jtag", 7 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart4", 3 },
+               { "i2c2", 4 },
+               { "ledc", 5 },
+               { "d_jtag", 6 },
+               { "r_jtag", 7 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart5", 3 },
+               { "i2c3", 4 },
+               { "spdif", 5 },
+               { "d_jtag", 6 },
+               { "r_jtag", 7 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 7), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart5", 3 },
+               { "i2c3", 4 },
+               { "spdif", 5 },
+               { "d_jtag", 6 },
+               { "r_jtag", 7 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 8), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart1", 3 },
+               { "pwm2", 4 },
+               { "uart3", 5 },
+               { "jtag", 6 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 9), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart1", 3 },
+               { "pwm3", 4 },
+               { "uart3", 5 },
+               { "jtag", 6 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 10), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart1", 3 },
+               { "pwm4", 4 },
+               { "ir", 5 },
+               { "jtag", 6 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 11), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ncsi0", 2 },
+               { "uart1", 3 },
+               { "i2s0_dout", 4 },
+               { "i2s0_din", 5 },
+               { "jtag", 6 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 12), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2c2", 2 },
+               { "ncsi0", 3 },
+               { "i2s0_dout", 4 },
+               { "i2s0_din", 5 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 13), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2c2", 2 },
+               { "pwm5", 3 },
+               { "i2s0_dout", 4 },
+               { "i2s0_din", 5 },
+               { "dmic", 6 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 14), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2c1", 2 },
+               { "d_jtag", 3 },
+               { "i2s0_dout", 4 },
+               { "i2s0_din", 5 },
+               { "dmic", 6 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 15), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2c1", 2 },
+               { "d_jtag", 3 },
+               { "pwm6", 4 },
+               { "i2s0", 5 },
+               { "dmic", 6 },
+               { "emac", 8 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 16), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2c3", 2 },
+               { "d_jtag", 3 },
+               { "pwm7", 4 },
+               { "i2s0", 5 },
+               { "dmic", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(E, 17), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2c3", 2 },
+               { "d_jtag", 3 },
+               { "ir", 4 },
+               { "i2s0", 5 },
+               { "dmic", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(F, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "jtag", 3 },
+               { "r_jtag", 4 },
+               { "i2s2_dout", 5 },
+               { "i2s2_din", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(F, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "jtag", 3 },
+               { "r_jtag", 4 },
+               { "i2s2_dout", 5 },
+               { "i2s2_din", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(F, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "uart0", 3 },
+               { "i2c0", 4 },
+               { "ledc", 5 },
+               { "spdif", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(F, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "jtag", 3 },
+               { "r_jtag", 4 },
+               { "i2s2", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(F, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "uart0", 3 },
+               { "i2c0", 4 },
+               { "pwm6", 5 },
+               { "ir", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(F, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "jtag", 3 },
+               { "r_jtag", 4 },
+               { "i2s2", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(F, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "spdif", 3 },
+               { "ir", 4 },
+               { "i2s2", 5 },
+               { "pwm5", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "uart3", 3 },
+               { "emac", 4 },
+               { "pwm7", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "uart3", 3 },
+               { "emac", 4 },
+               { "pwm6", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "uart3", 3 },
+               { "emac", 4 },
+               { "uart4", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "uart3", 3 },
+               { "emac", 4 },
+               { "uart4", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "uart5", 3 },
+               { "emac", 4 },
+               { "pwm5", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "uart5", 3 },
+               { "emac", 4 },
+               { "pwm4", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart1", 2 },
+               { "i2c2", 3 },
+               { "emac", 4 },
+               { "pwm1", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 7), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart1", 2 },
+               { "i2c2", 3 },
+               { "emac", 4 },
+               { "spdif", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 8), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart1", 2 },
+               { "i2c1", 3 },
+               { "emac", 4 },
+               { "uart3", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 9), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart1", 2 },
+               { "i2c1", 3 },
+               { "emac", 4 },
+               { "uart3", 5 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 10), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "pwm3", 2 },
+               { "i2c3", 3 },
+               { "emac", 4 },
+               { "clk", 5 },
+               { "ir", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 11), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s1", 2 },
+               { "i2c3", 3 },
+               { "emac", 4 },
+               { "clk", 5 },
+               { "tcon", 6 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 12), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s1", 2 },
+               { "i2c0", 3 },
+               { "emac", 4 },
+               { "clk", 5 },
+               { "pwm0", 6 },
+               { "uart1", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 13), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s1", 2 },
+               { "i2c0", 3 },
+               { "emac", 4 },
+               { "pwm2", 5 },
+               { "ledc", 6 },
+               { "uart1", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 14), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s1_din", 2 },
+               { "i2c2", 3 },
+               { "emac", 4 },
+               { "i2s1_dout", 5 },
+               { "spi0", 6 },
+               { "uart1", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 15), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s1_dout", 2 },
+               { "i2c2", 3 },
+               { "emac", 4 },
+               { "i2s1_din", 5 },
+               { "spi0", 6 },
+               { "uart1", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 16), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ir", 2 },
+               { "tcon", 3 },
+               { "pwm5", 4 },
+               { "clk", 5 },
+               { "spdif", 6 },
+               { "ledc", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 17), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2c3", 3 },
+               { "pwm7", 4 },
+               { "clk", 5 },
+               { "ir", 6 },
+               { "uart0", 7 },
+               { "irq", 14 },
+       } },
+       { SXIPIO_PIN(G, 18), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2c3", 3 },
+               { "pwm6", 4 },
+               { "clk", 5 },
+               { "spdif", 6 },
+               { "uart0", 7 },
+               { "irq", 14 },
+       } },
+};
+
 const struct sxipio_pin sun50i_a64_pins[] = {
        { SXIPIO_PIN(B, 0), {
                { "gpio_in", 0 },
index 6b0da03..d260b40 100644 (file)
@@ -1,4 +1,4 @@
-/*     $OpenBSD: sxipiovar.h,v 1.1 2017/01/21 08:26:49 patrick Exp $   */
+/*     $OpenBSD: sxipiovar.h,v 1.2 2023/10/13 15:41:25 kettenis Exp $  */
 /*
  * Copyright (c) 2013 Artturi Alm
  *
@@ -25,7 +25,7 @@ struct sxipio_func {
 struct sxipio_pin {
        const char *name;
        int port, pin;
-       struct sxipio_func funcs[8];
+       struct sxipio_func funcs[10];
 };
 
 #define SXIPIO_PORT_A  0