> From: Tobias Fiebig <tob...@reads-this-mailinglist.com>
> Date: Mon, 05 Feb 2024 22:46:41 +0100

Hi Tobias,

> Moin,
> i got my hands on a small stack of OrangPi Zero 3 2GB.
> 
> After having a working Armbian setup, i thought i'd
> give OpenBSD 7.4 a go. I borrowed the DTB and uboot from my
> armbian builds, and prepared a miniroot. The kernel loads
> fine, but the serial seems to not work. It prints on input
> but is garbled. It looks a bit like not matching serial
> settings; However, i cycled through all already, to no avail.
> 
> Does anyone have a hint in wich direction to ideally look here?

At this point the Allwinner H616 SoC isn't supported by OpenBSD.  But
it is fairly close the the H6, so it shouldn't be very difficult to
add support for it.

The particular problem you're seeing is caused by the lack of a clock
controller driver.  This means that com(4) assumes a default clock
value that doesn't match what's needed for your board.  This makes it
switch to some weird baud rate after the "WARNING: CHECK AND RESET THE
DATE!".

I can have a stab at adding support for the H616 SoC.  In fact I
already have a diff to fix the:

> "pinctrl" at simplebus0 not configured

If by any chance you're willing to donate one of your boards, let me
know.  Having a board would help us with adding support for this SoC.

Cheers,

Mark


Index: dev/fdt/sxipio.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/sxipio.c,v
retrieving revision 1.17
diff -u -p -r1.17 sxipio.c
--- dev/fdt/sxipio.c    13 Oct 2023 15:41:25 -0000      1.17
+++ dev/fdt/sxipio.c    6 Feb 2024 13:12:59 -0000
@@ -206,6 +206,14 @@ const struct sxipio_pins sxipio_pins[] =
                "allwinner,sun50i-h6-r-pinctrl",
                sun50i_h6_r_pins, nitems(sun50i_h6_r_pins)
        },
+       {
+               "allwinner,sun50i-h616-pinctrl",
+               sun50i_h616_pins, nitems(sun50i_h616_pins)
+       },
+       {
+               "allwinner,sun50i-h616-r-pinctrl",
+               sun50i_h616_r_pins, nitems(sun50i_h616_r_pins)
+       },
 };
 
 int
Index: dev/fdt/sxipio_pins.h
===================================================================
RCS file: /cvs/src/sys/dev/fdt/sxipio_pins.h,v
retrieving revision 1.10
diff -u -p -r1.10 sxipio_pins.h
--- dev/fdt/sxipio_pins.h       13 Oct 2023 15:41:25 -0000      1.10
+++ dev/fdt/sxipio_pins.h       6 Feb 2024 13:12:59 -0000
@@ -11299,3 +11299,600 @@ const struct sxipio_pin sun50i_h6_r_pins
                { "irq", 6 },
        } },
 };
+
+const struct sxipio_pin sun50i_h616_pins[] = {
+       { SXIPIO_PIN(A, 0), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 1), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 2), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 3), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 4), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 5), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 6), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 7), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 8), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 9), {
+               { "emac1", 2 },
+       } },
+       { SXIPIO_PIN(A, 10), {
+               { "i2c3", 2 },
+       } },
+       { SXIPIO_PIN(A, 11), {
+               { "i2c3", 2 },
+       } },
+       { SXIPIO_PIN(A, 12), {
+               { "pwm5", 2 },
+       } },
+       { SXIPIO_PIN(C, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "spi0", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "spi0", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "spi0", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "spi0", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 7), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "spi0", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 8), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 9), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 10), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 11), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 12), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 13), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 14), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 15), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "spi0", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(C, 16), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "nand0", 2 },
+               { "mmc2", 3 },
+               { "spi0", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(F, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "jtag", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(F, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "jtag", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(F, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "uart0", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(F, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "jtag", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(F, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "uart0", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(F, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc0", 2 },
+               { "jtag", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(F, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "mmc1", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart1", 2 },
+               { "jtag", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 7), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart1", 2 },
+               { "jtag", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 8), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart1", 2 },
+               { "clock", 3 },
+               { "jtag", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 9), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart1", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 10), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s2", 2 },
+               { "clock", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 11), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s2", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 12), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s2", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 13), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s2", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 14), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s2", 2 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 15), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2c4", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 16), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2c4", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 17), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2c3", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 18), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2c3", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(G, 19), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "pwm1", 4 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart0", 2 },
+               { "pwm3", 4 },
+               { "i2c1", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart0", 2 },
+               { "pwm4", 4 },
+               { "i2c1", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart5", 2 },
+               { "spdif", 3 },
+               { "pwm2", 4 },
+               { "i2c2", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart5", 2 },
+               { "pwm1", 4 },
+               { "i2c2", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "spdif", 3 },
+               { "i2c3", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2s3", 3 },
+               { "spi1", 4 },
+               { "i2c3", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2s3", 3 },
+               { "spi1", 4 },
+               { "i2c4", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 7), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2s3", 3 },
+               { "spi1", 4 },
+               { "i2c4", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 8), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "uart2", 2 },
+               { "i2s3_dout0", 3 },
+               { "spi1", 4 },
+               { "i2s3_din1", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 9), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "i2s3_din0", 3 },
+               { "spi1", 4 },
+               { "i2s3_dout1", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(H, 10), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "ir_rx", 3 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "dmic", 3 },
+               { "i2s0", 4 },
+               { "hdmi", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "dmic", 3 },
+               { "i2s0", 4 },
+               { "hdmi", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 2), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "dmic", 3 },
+               { "i2s0", 4 },
+               { "hdmi", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 3), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "dmic", 3 },
+               { "i2s0_dout0", 4 },
+               { "i2s0_din1", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 4), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "dmic", 3 },
+               { "i2s0_din0", 4 },
+               { "i2s0_dout1", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 5), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart2", 3 },
+               { "ts0", 4 },
+               { "i2c0", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 6), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart2", 3 },
+               { "ts0", 4 },
+               { "i2c0", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 7), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart2", 3 },
+               { "ts0", 4 },
+               { "i2c1", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 8), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart2", 3 },
+               { "ts0", 4 },
+               { "i2c1", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 9), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart3", 3 },
+               { "ts0", 4 },
+               { "i2c2", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 10), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart3", 3 },
+               { "ts0", 4 },
+               { "i2c2", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 11), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart3", 3 },
+               { "ts0", 4 },
+               { "pwm1", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 12), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart3", 3 },
+               { "ts0", 4 },
+               { "pwm2", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 13), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart4", 3 },
+               { "ts0", 4 },
+               { "pwm3", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 14), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart4", 3 },
+               { "ts0", 4 },
+               { "pwm4", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 15), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart4", 3 },
+               { "ts0", 4 },
+               { "clock", 5 },
+               { "irq", 6 },
+       } },
+       { SXIPIO_PIN(I, 16), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "emac0", 2 },
+               { "uart4", 3 },
+               { "ts0", 4 },
+               { "clock", 5 },
+               { "irq", 6 },
+       } },
+};
+
+const struct sxipio_pin sun50i_h616_r_pins[] = {
+       { SXIPIO_PIN(L, 0), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "s_rsb", 2 },
+               { "s_i2c", 3 },
+       } },
+       { SXIPIO_PIN(L, 1), {
+               { "gpio_in", 0 },
+               { "gpio_out", 1 },
+               { "s_rsb", 2 },
+               { "s_i2c", 3 },
+       } },
+};

Reply via email to