report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

Next Topic
 
classic Classic list List threaded Threaded
11 messages Options
Reply | Threaded
Open this post in threaded view
|

report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

SASANO Takayoshi
Hello,

I bought OrangePi One Plus (Allwinner H6) and tried to boot -current.
Hanged up at attaching a root device, and maybe we have to add some codes to
sxipio(4) and sxiccmu(4).

Here is the log.

----
U-Boot SPL 2019.07 (Sep 04 2019 - 11:18:21 +0900)
DRAM: 1024 MiB
Trying to boot from MMC1
NOTICE:  BL31: v2.1(debug):v2.1-604-g3441952f
NOTICE:  BL31: Built : 11:13:26, Sep  4 2019
NOTICE:  BL31: Detected Allwinner H6 SoC (1728)
NOTICE:  BL31: Found U-Boot DTB at 0xc0775d8, model: OrangePi One Plus
INFO:    ARM GICv2 driver initialized
NOTICE:  PMIC: Probing AXP805
NOTICE:  PMIC: AXP805 detected
INFO:    BL31: Platform setup done
INFO:    BL31: Initializing runtime services
INFO:    BL31: cortex_a53: CPU workaround for 855873 was applied
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x4a000000
INFO:    SPSR = 0x3c9


U-Boot 2019.07 (Sep 04 2019 - 11:18:21 +0900) Allwinner Technology

CPU:   Allwinner H6 (SUN50I)
Model: OrangePi One Plus
DRAM:  1 GiB
MMC:   mmc@4020000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   No ethernet found.
starting USB...
No working controllers found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found EFI removable media binary efi/boot/bootaa64.efi
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk [hidden email]...
Found 3 disks
BootOrder not defined
EFI boot manager: Cannot load any image
161090 bytes read in 23 ms (6.7 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
disks: sd0*
>> OpenBSD/arm64 BOOTAA64 0.19
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 7400836+1595608+520544+844216 [619961+109+862056+523774]=0xd37270
type 0x2 pa 0x40000000 va 0x40000000 pages 0x4000 attr 0x8
type 0x7 pa 0x44000000 va 0x44000000 pages 0x3ef9 attr 0x8
type 0x4 pa 0x47ef9000 va 0x47ef9000 pages 0xe attr 0x8
type 0x7 pa 0x47f07000 va 0x47f07000 pages 0x323ee attr 0x8
type 0x2 pa 0x7a2f5000 va 0x7a2f5000 pages 0xc0f attr 0x8
type 0x1 pa 0x7af04000 va 0x7af04000 pages 0x28 attr 0x8
type 0x0 pa 0x7af2c000 va 0x7af2c000 pages 0x9 attr 0x8
type 0x6 pa 0x7af35000 va 0x3e024be000 pages 0x1 attr 0x8000000000000008
type 0x0 pa 0x7af36000 va 0x7af36000 pages 0x1 attr 0x8
type 0x6 pa 0x7af37000 va 0x3e024c0000 pages 0x1 attr 0x8000000000000008
type 0x2 pa 0x7af38000 va 0x7af38000 pages 0x5018 attr 0x8
type 0x5 pa 0x7ff50000 va 0x3e074d9000 pages 0x10 attr 0x8000000000000008
type 0x2 pa 0x7ff60000 va 0x7ff60000 pages 0xa0 attr 0x8
[ using 2006872 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2019 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.6-beta (GENERIC) #0: Wed Sep  4 15:50:19 JST 2019
    [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC
real mem  = 976121856 (930MB)
avail mem = 916107264 (873MB)
warning: no entropy supplied by boot loader
mainbus0 at root: OrangePi One Plus
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: Das U-Boot rev 0x20190700
apm0 at mainbus0
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
"internal-osc-clk" at mainbus0 not configured
"osc24M_clk" at mainbus0 not configured
"osc32k_clk" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
simplebus0 at mainbus0: "soc"
sxisyscon0 at simplebus0
ampintc0 at simplebus0 nirq 192, ncpu 4: "interrupt-controller"
"display-engine" at simplebus0 not configured
"video-codec" at simplebus0 not configured
"clock" at simplebus0 not configured
"sid" at simplebus0 not configured
"pinctrl" at simplebus0 not configured
sximmc0 at simplebus0
sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
com0 at simplebus0: ns16550, no working fifo
com0: console
"usb" at simplebus0 not configured
"phy" at simplebus0 not configured
ehci0 at simplebus0
ehci0: halt timeout
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
uhub0: no ports, hub ignored
usb0: root device is not a hub
ohci0 at simplebus0: version 0.0
ohci0: unsupported OHCI revision
ehci1 at simplebus0
ehci1: halt timeout
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
uhub1: no ports, hub ignored
usb1: root device is not a hub
ohci1 at simplebus0: version 0.0
ohci1: unsupported OHCI revision
"hdmi-phy" at simplebus0 not configured
"tcon-top" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"clock" at simplebus0 not configured
"interrupt-controller" at simplebus0 not configured
"pinctrl" at simplebus0 not configured
sxitwi0 at simplebus0: unknown clock frequency
"leds" at mainbus0 not configured
"vcc5v" at mainbus0 not configured
"binman" at mainbus0 not configured
vscsi0 at root
scsibus0 at vscsi0: 256 targets
softraid0 at root
scsibus1 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: lookup sd0a:/bsd failed
root device: <-- hanged up here

--
SASANO Takayoshi (JG1UAA) <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

Mark Kettenis
> Date: Wed, 04 Sep 2019 17:11:43 +0900
> From: SASANO Takayoshi <[hidden email]>
>
> Hello,
>
> I bought OrangePi One Plus (Allwinner H6) and tried to boot -current.
> Hanged up at attaching a root device, and maybe we have to add some codes to
> sxipio(4) and sxiccmu(4).

Yes, we'll defenitely need to add H6 support to those drivers for
things to work.

Below is a diff that adds H6 support to sxipio(4).  Is it possible for
you to test this?

Index: dev/fdt/sxipio.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/sxipio.c,v
retrieving revision 1.10
diff -u -p -r1.10 sxipio.c
--- dev/fdt/sxipio.c 10 Feb 2019 12:25:28 -0000 1.10
+++ dev/fdt/sxipio.c 4 Sep 2019 09:31:27 -0000
@@ -177,6 +177,14 @@ struct sxipio_pins sxipio_pins[] = {
  "allwinner,sun50i-h5-pinctrl",
  sun50i_h5_pins, nitems(sun50i_h5_pins)
  },
+ {
+ "allwinner,sun50i-h6-pinctrl",
+ sun50i_h6_pins, nitems(sun50i_h6_pins)
+ },
+ {
+ "allwinner,sun50i-h6-r-pinctrl",
+ sun50i_h6_r_pins, nitems(sun50i_h6_r_pins)
+ },
 };
 
 int
Index: dev/fdt/sxipio_pins.h
===================================================================
RCS file: /cvs/src/sys/dev/fdt/sxipio_pins.h,v
retrieving revision 1.6
diff -u -p -r1.6 sxipio_pins.h
--- dev/fdt/sxipio_pins.h 10 Feb 2019 12:25:28 -0000 1.6
+++ dev/fdt/sxipio_pins.h 4 Sep 2019 09:31:27 -0000
@@ -9091,3 +9091,770 @@ struct sxipio_pin sun50i_h5_pins[] = {
  { "irq", 6 },
  } },
 };
+
+struct sxipio_pin sun50i_h6_pins[] = {
+ { SXIPIO_PIN(A, 0), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(A, 1), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(A, 2), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(A, 3), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(A, 4), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(A, 5), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(A, 6), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(A, 7), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(A, 8), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(A, 9), {
+ { "emac", 2 },
+ } },
+ { SXIPIO_PIN(B, 0), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 1), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 2), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 3), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 4), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 5), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 6), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 7), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 8), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 9), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 10), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 11), {
+ { "ccir", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 12), {
+ { "i2s3", 2 },
+ { "h_i2s3", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 13), {
+ { "i2s3", 2 },
+ { "h_i2s3", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 14), {
+ { "i2s3", 2 },
+ { "h_i2s3", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 15), {
+ { "i2s3", 2 },
+ { "h_i2s3", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 16), {
+ { "i2s3", 2 },
+ { "h_i2s3", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 17), {
+ { "i2c3", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 18), {
+ { "i2c3", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 19), {
+ { "pwm1", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(B, 20), {
+ { "gpio_in", 0 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(C, 0), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "spi0", 4 },
+ } },
+ { SXIPIO_PIN(C, 1), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ } },
+ { SXIPIO_PIN(C, 2), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "spi0", 4 },
+ } },
+ { SXIPIO_PIN(C, 3), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "spi0", 4 },
+ } },
+ { SXIPIO_PIN(C, 4), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ } },
+ { SXIPIO_PIN(C, 5), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ { "spi0", 4 },
+ } },
+ { SXIPIO_PIN(C, 6), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ { "spi0", 4 },
+ } },
+ { SXIPIO_PIN(C, 7), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ { "spi0", 4 },
+ } },
+ { SXIPIO_PIN(C, 8), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ } },
+ { SXIPIO_PIN(C, 9), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ } },
+ { SXIPIO_PIN(C, 10), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ } },
+ { SXIPIO_PIN(C, 11), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ } },
+ { SXIPIO_PIN(C, 12), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ } },
+ { SXIPIO_PIN(C, 13), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ } },
+ { SXIPIO_PIN(C, 14), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ { "mmc2", 3 },
+ } },
+ { SXIPIO_PIN(C, 15), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ } },
+ { SXIPIO_PIN(C, 16), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "nand0", 2 },
+ } },
+ { SXIPIO_PIN(D, 0), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 1), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 2), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 3), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 4), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 5), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 6), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 7), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 8), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 9), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 10), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 11), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts0", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 12), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts1", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 13), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts1", 3 },
+ { "csi", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 14), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts1", 3 },
+ { "dmic", 4 },
+ { "csi", 5 },
+ } },
+ { SXIPIO_PIN(D, 15), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts1", 3 },
+ { "dmic", 4 },
+ { "csi", 5 },
+ } },
+ { SXIPIO_PIN(D, 16), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts1", 3 },
+ { "dmic", 4 },
+ } },
+ { SXIPIO_PIN(D, 17), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts2", 3 },
+ { "dmic", 4 },
+ } },
+ { SXIPIO_PIN(D, 18), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts2", 3 },
+ { "dmic", 4 },
+ } },
+ { SXIPIO_PIN(D, 19), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts2", 3 },
+ { "uart2", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 20), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts2", 3 },
+ { "uart2", 4 },
+ { "emac", 5 },
+ } },
+ { SXIPIO_PIN(D, 21), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "lcd0", 2 },
+ { "ts2", 3 },
+ { "uart2", 4 },
+ } },
+ { SXIPIO_PIN(D, 22), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "pwm", 2 },
+ { "ts3", 3 },
+ { "uart2", 4 },
+ } },
+ { SXIPIO_PIN(D, 23), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2c2", 2 },
+ { "ts3", 3 },
+ { "uart3", 4 },
+ { "jtag", 5 },
+ } },
+ { SXIPIO_PIN(D, 24), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2c2", 2 },
+ { "ts3", 3 },
+ { "uart3", 4 },
+ { "jtag", 5 },
+ } },
+ { SXIPIO_PIN(D, 25), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2c0", 2 },
+ { "ts3", 3 },
+ { "uart3", 4 },
+ { "jtag", 5 },
+ } },
+ { SXIPIO_PIN(D, 26), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2c0", 2 },
+ { "ts3", 3 },
+ { "uart3", 4 },
+ { "jtag", 5 },
+ } },
+ { 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 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(G, 7), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "uart1", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(G, 8), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "uart1", 2 },
+ { "sim0", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(G, 9), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "uart1", 2 },
+ { "sim0", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(G, 10), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2s2", 2 },
+ { "h_i2s2", 3 },
+ { "sim0", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(G, 11), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2s2", 2 },
+ { "h_i2s2", 3 },
+ { "sim0", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(G, 12), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2s2", 2 },
+ { "h_i2s2", 3 },
+ { "sim0", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(G, 13), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2s2", 2 },
+ { "h_i2s2", 3 },
+ { "sim0", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(G, 14), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "i2s2", 2 },
+ { "h_i2s2", 3 },
+ { "sim0", 4 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 0), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "uart0", 2 },
+ { "i2s0", 3 },
+ { "h_i2s0", 4 },
+ { "sim1", 5 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 1), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "uart0", 2 },
+ { "i2s0", 3 },
+ { "h_i2s0", 4 },
+ { "sim1", 5 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 2), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "ir_tx", 2 },
+ { "i2s0", 3 },
+ { "h_i2s0", 4 },
+ { "sim1", 5 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 3), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "spi1", 2 },
+ { "i2s0", 3 },
+ { "h_i2s0", 4 },
+ { "sim1", 5 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 4), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "spi1", 2 },
+ { "i2s0", 3 },
+ { "h_i2s0", 4 },
+ { "sim1", 5 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 5), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "spi1", 2 },
+ { "spdif", 3 },
+ { "i2c1", 4 },
+ { "sim1", 5 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 6), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "spi1", 2 },
+ { "spdif", 3 },
+ { "i2c1", 4 },
+ { "sim1", 5 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 7), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "spdif", 3 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 8), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "hdmi", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 9), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "hdmi", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(H, 10), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "hdmi", 2 },
+ { "irq", 6 },
+ } },
+};
+
+struct sxipio_pin sun50i_h6_r_pins[] = {
+ { SXIPIO_PIN(L, 0), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_i2c", 3 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 1), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_i2c", 3 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 2), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_uart", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 3), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_uart", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 4), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_jtag", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 5), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_jtag", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 6), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_jtag", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 7), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_jtag", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 8), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_pwm", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 9), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_cir_rx", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(L, 10), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "s_w1", 2 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(M, 0), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(M, 1), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(M, 2), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "irq", 6 },
+ { "1wire", 3 },
+ } },
+ { SXIPIO_PIN(M, 3), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "irq", 6 },
+ } },
+ { SXIPIO_PIN(M, 4), {
+ { "gpio_in", 0 },
+ { "gpio_out", 1 },
+ { "irq", 6 },
+ } },
+};

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

SASANO Takayoshi
hello,

Here is the log that your patch applied kernel.
It looks sxipio0 and sxipio1 is enabled.

Regards,

----
U-Boot SPL 2019.07 (Sep 04 2019 - 11:18:21 +0900)
DRAM: 1024 MiB
Trying to boot from MMC1
NOTICE:  BL31: v2.1(debug):v2.1-604-g3441952f
NOTICE:  BL31: Built : 11:13:26, Sep  4 2019
NOTICE:  BL31: Detected Allwinner H6 SoC (1728)
NOTICE:  BL31: Found U-Boot DTB at 0xc0775d8, model: OrangePi One Plus
INFO:    ARM GICv2 driver initialized
NOTICE:  PMIC: Probing AXP805
NOTICE:  PMIC: AXP805 detected
INFO:    BL31: Platform setup done
INFO:    BL31: Initializing runtime services
INFO:    BL31: cortex_a53: CPU workaround for 855873 was applied
INFO:    BL31: Preparing for EL3 exit to normal world
INFO:    Entry point address = 0x4a000000
INFO:    SPSR = 0x3c9


U-Boot 2019.07 (Sep 04 2019 - 11:18:21 +0900) Allwinner Technology

CPU:   Allwinner H6 (SUN50I)
Model: OrangePi One Plus
DRAM:  1 GiB
MMC:   mmc@4020000: 0
Loading Environment from FAT... *** Warning - bad CRC, using default environment

In:    serial@5000000
Out:   serial@5000000
Err:   serial@5000000
Net:   No ethernet found.
starting USB...
No working controllers found
Hit any key to stop autoboot:  0
switch to partitions #0, OK
mmc0 is current device
Scanning mmc 0:1...
Found EFI removable media binary efi/boot/bootaa64.efi
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
Scanning disk [hidden email]...
Found 3 disks
BootOrder not defined
EFI boot manager: Cannot load any image
161090 bytes read in 23 ms (6.7 MiB/s)
libfdt fdt_check_header(): FDT_ERR_BADMAGIC
disks: sd0*
>> OpenBSD/arm64 BOOTAA64 0.19
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 7396528+1596536+536944+847960 [619600+109+862104+523806]=0xd3c000
type 0x2 pa 0x40000000 va 0x40000000 pages 0x4000 attr 0x8
type 0x7 pa 0x44000000 va 0x44000000 pages 0x3ef9 attr 0x8
type 0x4 pa 0x47ef9000 va 0x47ef9000 pages 0xe attr 0x8
type 0x7 pa 0x47f07000 va 0x47f07000 pages 0x323ea attr 0x8
type 0x2 pa 0x7a2f1000 va 0x7a2f1000 pages 0xc13 attr 0x8
type 0x1 pa 0x7af04000 va 0x7af04000 pages 0x28 attr 0x8
type 0x0 pa 0x7af2c000 va 0x7af2c000 pages 0x9 attr 0x8
type 0x6 pa 0x7af35000 va 0x3e024be000 pages 0x1 attr 0x8000000000000008
type 0x0 pa 0x7af36000 va 0x7af36000 pages 0x1 attr 0x8
type 0x6 pa 0x7af37000 va 0x3e024c0000 pages 0x1 attr 0x8000000000000008
type 0x2 pa 0x7af38000 va 0x7af38000 pages 0x5018 attr 0x8
type 0x5 pa 0x7ff50000 va 0x3e074d9000 pages 0x10 attr 0x8000000000000008
type 0x2 pa 0x7ff60000 va 0x7ff60000 pages 0xa0 attr 0x8
[ using 2006584 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2019 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.6-beta (GENERIC) #1: Wed Sep  4 19:18:23 JST 2019
    [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC
real mem  = 976105472 (930MB)
avail mem = 916074496 (873MB)
warning: no entropy supplied by boot loader
mainbus0 at root: OrangePi One Plus
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: Das U-Boot rev 0x20190700
apm0 at mainbus0
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
"internal-osc-clk" at mainbus0 not configured
"osc24M_clk" at mainbus0 not configured
"osc32k_clk" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
simplebus0 at mainbus0: "soc"
sxisyscon0 at simplebus0
sxipio0 at simplebus0: 108 pins
ampintc0 at simplebus0 nirq 192, ncpu 4: "interrupt-controller"
sxipio1 at simplebus0: 16 pins
"display-engine" at simplebus0 not configured
"video-codec" at simplebus0 not configured
"clock" at simplebus0 not configured
"sid" at simplebus0 not configured
sximmc0 at simplebus0
sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
com0 at simplebus0: ns16550, no working fifo
com0: console
"usb" at simplebus0 not configured
"phy" at simplebus0 not configured
ehci0 at simplebus0
ehci0: halt timeout
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
uhub0: no ports, hub ignored
usb0: root device is not a hub
ohci0 at simplebus0: version 0.0
ohci0: unsupported OHCI revision
ehci1 at simplebus0
ehci1: halt timeout
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
uhub1: no ports, hub ignored
usb1: root device is not a hub
ohci1 at simplebus0: version 0.0
ohci1: unsupported OHCI revision
"hdmi-phy" at simplebus0 not configured
"tcon-top" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"clock" at simplebus0 not configured
"interrupt-controller" at simplebus0 not configured
sxitwi0 at simplebus0: unknown clock frequency
gpio0 at sxipio0: 32 pins
gpio1 at sxipio0: 32 pins
gpio2 at sxipio0: 32 pins
gpio3 at sxipio0: 32 pins
gpio4 at sxipio0: 32 pins
gpio5 at sxipio0: 32 pins
gpio6 at sxipio0: 32 pins
gpio7 at sxipio0: 32 pins
gpio8 at sxipio1: 32 pins
gpio9 at sxipio1: 32 pins
"leds" at mainbus0 not configured
"vcc5v" at mainbus0 not configured
"binman" at mainbus0 not configured
sdmmc0: can't supply clock
sdmmc0: can't enable card
vscsi0 at root
scsibus0 at vscsi0: 256 targets
softraid0 at root
scsibus1 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: lookup sd0a:/bsd failed
root device:

--
SASANO Takayoshi (JG1UAA) <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

Mark Kettenis
> Date: Wed, 04 Sep 2019 19:30:34 +0900
> From: SASANO Takayoshi <[hidden email]>
>
> hello,
>
> Here is the log that your patch applied kernel.
> It looks sxipio0 and sxipio1 is enabled.

Here is a start for H6 support in sxiccmu(4).  Can you try this and
send me new console output?

Thanks,

Mark


Index: dev/fdt/sxiccmu.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/sxiccmu.c,v
retrieving revision 1.23
diff -u -p -r1.23 sxiccmu.c
--- dev/fdt/sxiccmu.c 2 Sep 2019 13:08:49 -0000 1.23
+++ dev/fdt/sxiccmu.c 5 Sep 2019 14:55:35 -0000
@@ -144,7 +144,9 @@ sxiccmu_match(struct device *parent, voi
     OF_is_compatible(node, "allwinner,sun9i-a80-mmc-config-clk") ||
     OF_is_compatible(node, "allwinner,sun50i-a64-ccu") ||
     OF_is_compatible(node, "allwinner,sun50i-a64-r-ccu") ||
-    OF_is_compatible(node, "allwinner,sun50i-h5-ccu"));
+    OF_is_compatible(node, "allwinner,sun50i-h5-ccu") ||
+    OF_is_compatible(node, "allwinner,sun50i-h6-ccu") ||
+    OF_is_compatible(node, "allwinner,sun50i-h6-r-ccu"));
 }
 
 void
@@ -255,6 +257,22 @@ sxiccmu_attach(struct device *parent, st
  sc->sc_nresets = nitems(sun50i_a64_resets);
  sc->sc_get_frequency = sxiccmu_a64_get_frequency;
  sc->sc_set_frequency = sxiccmu_a64_set_frequency;
+ } else if (OF_is_compatible(node, "allwinner,sun50i-h6-ccu")) {
+ KASSERT(faa->fa_nreg > 0);
+ sc->sc_gates = sun50i_h6_gates;
+ sc->sc_ngates = nitems(sun50i_h6_gates);
+ sc->sc_resets = sun50i_h6_resets;
+ sc->sc_nresets = nitems(sun50i_h6_resets);
+ sc->sc_get_frequency = sxiccmu_nop_get_frequency;
+ sc->sc_set_frequency = sxiccmu_nop_set_frequency;
+ } else if (OF_is_compatible(node, "allwinner,sun50i-h6-r-ccu")) {
+ KASSERT(faa->fa_nreg > 0);
+ sc->sc_gates = sun50i_h6_r_gates;
+ sc->sc_ngates = nitems(sun50i_h6_r_gates);
+ sc->sc_resets = sun50i_h6_r_resets;
+ sc->sc_nresets = nitems(sun50i_h6_r_resets);
+ sc->sc_get_frequency = sxiccmu_nop_get_frequency;
+ sc->sc_set_frequency = sxiccmu_nop_set_frequency;
  } else {
  for (node = OF_child(node); node; node = OF_peer(node))
  sxiccmu_attach_clock(sc, node, faa->fa_nreg);
Index: dev/fdt/sxiccmu_clocks.h
===================================================================
RCS file: /cvs/src/sys/dev/fdt/sxiccmu_clocks.h,v
retrieving revision 1.26
diff -u -p -r1.26 sxiccmu_clocks.h
--- dev/fdt/sxiccmu_clocks.h 2 Sep 2019 15:24:39 -0000 1.26
+++ dev/fdt/sxiccmu_clocks.h 5 Sep 2019 14:55:35 -0000
@@ -387,6 +387,50 @@ struct sxiccmu_ccu_bit sun8i_h3_r_gates[
  [H3_R_CLK_APB0_I2C] = { 0x0028, 6, H3_R_CLK_APB0 },
 };
 
+/* H6 */
+
+#define H6_CLK_MMC0 64
+#define H6_CLK_MMC1 65
+#define H6_CLK_MMC2 66
+#define H6_CLK_BUS_MMC0 67
+#define H6_CLK_BUS_MMC1 68
+#define H6_CLK_BUS_MMC2 69
+#define H6_CLK_BUS_UART0 70
+#define H6_CLK_BUS_UART1 71
+#define H6_CLK_BUS_UART2 72
+#define H6_CLK_BUS_UART3 73
+#define H6_CLK_USB_OHCI0 104
+#define H6_CLK_USB_OHCI3 107
+#define H6_CLK_BUS_OHCI0 111
+#define H6_CLK_BUS_OHCI3 112
+#define H6_CLK_BUS_EHCI0 113
+#define H6_CLK_BUS_EHCI3 115
+
+struct sxiccmu_ccu_bit sun50i_h6_gates[] = {
+ [H6_CLK_MMC0] = { 0x0830, 31 },
+ [H6_CLK_MMC1] = { 0x0834, 31 },
+ [H6_CLK_MMC2] = { 0x0838, 31 },
+ [H6_CLK_BUS_MMC0] = { 0x084c, 0 },
+ [H6_CLK_BUS_MMC1] = { 0x084c, 1 },
+ [H6_CLK_BUS_MMC2] = { 0x084c, 2 },
+ [H6_CLK_BUS_UART0] = { 0x090c, 0 },
+ [H6_CLK_BUS_UART1] = { 0x090c, 1 },
+ [H6_CLK_BUS_UART2] = { 0x090c, 2 },
+ [H6_CLK_BUS_UART3] = { 0x090c, 3 },
+ [H6_CLK_USB_OHCI0] = { 0x0a70, 31 },
+ [H6_CLK_USB_OHCI3] = { 0x0a7c, 31 },
+ [H6_CLK_BUS_OHCI0] = { 0x0a8c, 0 },
+ [H6_CLK_BUS_OHCI3] = { 0x0a8c, 3 },
+ [H6_CLK_BUS_EHCI0] = { 0x0a8c, 4 },
+ [H6_CLK_BUS_EHCI3] = { 0x0a8c, 7 },
+};
+
+#define H6_R_CLK_APB2_I2C 8
+
+struct sxiccmu_ccu_bit sun50i_h6_r_gates[] = {
+ [H6_R_CLK_APB2_I2C] = { 0x019c, 1 },
+};
+
 /* R40 */
 
 #define R40_CLK_PLL_PERIPH0 11
@@ -722,6 +766,40 @@ struct sxiccmu_ccu_bit sun8i_h3_resets[]
 struct sxiccmu_ccu_bit sun8i_h3_r_resets[] = {
  [H3_R_RST_APB0_RSB] = { 0x00b0, 3 },
  [H3_R_RST_APB0_I2C] = { 0x00b0, 6 },
+};
+
+/* H6 */
+
+#define H6_RST_BUS_MMC0 18
+#define H6_RST_BUS_MMC1 19
+#define H6_RST_BUS_MMC2 20
+#define H6_RST_BUS_UART0 21
+#define H6_RST_BUS_UART1 22
+#define H6_RST_BUS_UART2 23
+#define H6_RST_BUS_UART3 24
+#define H6_RST_BUS_OHCI0 48
+#define H6_RST_BUS_OHCI3 49
+#define H6_RST_BUS_EHCI0 50
+#define H6_RST_BUS_EHCI3 52
+
+struct sxiccmu_ccu_bit sun50i_h6_resets[] = {
+ [H6_RST_BUS_MMC0] = { 0x084c, 16 },
+ [H6_RST_BUS_MMC1] = { 0x084c, 17 },
+ [H6_RST_BUS_MMC2] = { 0x084c, 18 },
+ [H6_RST_BUS_UART0] = { 0x090c, 16 },
+ [H6_RST_BUS_UART1] = { 0x090c, 17 },
+ [H6_RST_BUS_UART2] = { 0x090c, 18 },
+ [H6_RST_BUS_UART3] = { 0x090c, 19 },
+ [H6_RST_BUS_OHCI0] = { 0x0a8c, 16 },
+ [H6_RST_BUS_OHCI3] = { 0x0a8c, 19 },
+ [H6_RST_BUS_EHCI0] = { 0x0a8c, 20 },
+ [H6_RST_BUS_EHCI3] = { 0x0a8c, 23 },
+};
+
+#define H6_R_RST_APB2_I2C 4
+
+struct sxiccmu_ccu_bit sun50i_h6_r_resets[] = {
+ [H6_R_RST_APB2_I2C] = { 0x019c, 16 },
 };
 
 /* R40 */

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

SASANO Takayoshi
Hi,

> Here is a start for H6 support in sxiccmu(4).  Can you try this and
> send me new console output?

here is the log,

>> OpenBSD/arm64 BOOTAA64 0.19
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 7387744+1595656+539688+846616 [613289+109+862200+523876]=0xd3ad80
type 0x2 pa 0x40000000 va 0x40000000 pages 0x4000 attr 0x8
type 0x7 pa 0x44000000 va 0x44000000 pages 0x3ef9 attr 0x8
type 0x4 pa 0x47ef9000 va 0x47ef9000 pages 0xe attr 0x8
type 0x7 pa 0x47f07000 va 0x47f07000 pages 0x323ee attr 0x8
type 0x2 pa 0x7a2f5000 va 0x7a2f5000 pages 0xc0f attr 0x8
type 0x1 pa 0x7af04000 va 0x7af04000 pages 0x28 attr 0x8
type 0x0 pa 0x7af2c000 va 0x7af2c000 pages 0x9 attr 0x8
type 0x6 pa 0x7af35000 va 0x3e024be000 pages 0x1 attr 0x8000000000000008
type 0x0 pa 0x7af36000 va 0x7af36000 pages 0x1 attr 0x8
type 0x6 pa 0x7af37000 va 0x3e024c0000 pages 0x1 attr 0x8000000000000008
type 0x2 pa 0x7af38000 va 0x7af38000 pages 0x5018 attr 0x8
type 0x5 pa 0x7ff50000 va 0x3e074d9000 pages 0x10 attr 0x8000000000000008
type 0x2 pa 0x7ff60000 va 0x7ff60000 pages 0xa0 attr 0x8
[ using 2000448 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2019 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.6-beta (GENERIC) #2: Fri Sep  6 22:13:47 JST 2019
    [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC
real mem  = 976121856 (930MB)
avail mem = 916094976 (873MB)
warning: no entropy supplied by boot loader
mainbus0 at root: OrangePi One Plus
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: Das U-Boot rev 0x20190700
apm0 at mainbus0
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
"internal-osc-clk" at mainbus0 not configured
"osc24M_clk" at mainbus0 not configured
"osc32k_clk" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
simplebus0 at mainbus0: "soc"
sxisyscon0 at simplebus0
sxiccmu0 at simplebus0
sxipio0 at simplebus0sxiccmu_ccu_enable: 0x0000001a
: 108 pins
ampintc0 at simplebus0 nirq 192, ncpu 4: "interrupt-controller"
sxiccmu1 at simplebus0
sxipio1 at simplebus0sxiccmu_ccu_enable: 0x00000003
sxiccmu_ccu_enable: 0x00000002
: 16 pins
"display-engine" at simplebus0 not configured
"video-codec" at simplebus0 not configured
"sid" at simplebus0 not configured
sximmc0 at simplebus0
sxiccmu_nop_set_frequency: 0x00000040
sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
com0 at simplebus0sxiccmu_nop_get_frequency: 0x00000046
: ns16550, no working fifo
com0: console
"usb" at simplebus0 not configured
"phy" at simplebus0 not configured
ehci0 at simplebus0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
ohci0 at simplebus0: version 1.0
ehci1 at simplebus0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
ohci1 at simplebus0: version 1.0
"hdmi-phy" at simplebus0 not configured
"tcon-top" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"interrupt-controller" at simplebus0 not configured
sxitwi0 at simplebus0sxiccmu_nop_get_frequency: 0x00000008
: unknown clock frequency
gpio0 at sxipio0: 32 pins
gpio1 at sxipio0: 32 pins
gpio2 at sxipio0: 32 pins
gpio3 at sxipio0: 32 pins
gpio4 at sxipio0: 32 pins
gpio5 at sxipio0: 32 pins
gpio6 at sxipio0: 32 pins
gpio7 at sxipio0: 32 pins
gpio8 at sxipio1: 32 pins
gpio9 at sxipio1: 32 pins
usb2 at ohci0: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
"leds" at mainbus0 not configured
"vcc5v" at mainbus0 not configured
"binman" at mainbus0 not configured
sxiccmu_nop_set_frequency: 0x00000040
sdmmc0: can't supply clock
sdmmc0: can't enable card
vscsi0 at root
scsibus0 at vscsi0: 256 targets
softraid0 at root
scsibus1 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: lookup sd0a:/bsd failed
root device: <-- hang up here

---

And, I have a question about previous sxipio(4) diff.

Allwinner H6 datasheet says that GPIO port C, D, F, G, H, L and M are
configuable. Your diff codes port A and B, are they required?
Please tell me.
--
SASANO Takayoshi (JG1UAA) <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

Mark Kettenis
> Date: Fri, 06 Sep 2019 23:08:18 +0900
> From: SASANO Takayoshi <[hidden email]>
>
> Hi,
>
> > Here is a start for H6 support in sxiccmu(4).  Can you try this and
> > send me new console output?
>
> here is the log,

Some progress, as now the USB controllers initialize properly.  Below
is a new diff that should help with the SD/MMC devices.

> ---
>
> And, I have a question about previous sxipio(4) diff.
>
> Allwinner H6 datasheet says that GPIO port C, D, F, G, H, L and M are
> configuable. Your diff codes port A and B, are they required?

I don't know.  The tables are generated by a bit of code that directly
uses the mainline Linux code:

  https://github.com/kettenis/sxipins

the port A and B pins aren't used anywhere in the device trees so
they're currently unused.


Index: dev/fdt/sxiccmu.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/sxiccmu.c,v
retrieving revision 1.23
diff -u -p -r1.23 sxiccmu.c
--- dev/fdt/sxiccmu.c 2 Sep 2019 13:08:49 -0000 1.23
+++ dev/fdt/sxiccmu.c 7 Sep 2019 11:33:18 -0000
@@ -101,6 +101,9 @@ int sxiccmu_a80_set_frequency(struct sxi
 uint32_t sxiccmu_h3_get_frequency(struct sxiccmu_softc *, uint32_t);
 int sxiccmu_h3_set_frequency(struct sxiccmu_softc *, uint32_t, uint32_t);
 uint32_t sxiccmu_h3_r_get_frequency(struct sxiccmu_softc *, uint32_t);
+uint32_t sxiccmu_h6_get_frequency(struct sxiccmu_softc *, uint32_t);
+int sxiccmu_h6_set_frequency(struct sxiccmu_softc *, uint32_t, uint32_t);
+uint32_t sxiccmu_h6_r_get_frequency(struct sxiccmu_softc *, uint32_t);
 uint32_t sxiccmu_r40_get_frequency(struct sxiccmu_softc *, uint32_t);
 int sxiccmu_r40_set_frequency(struct sxiccmu_softc *, uint32_t, uint32_t);
 uint32_t sxiccmu_v3s_get_frequency(struct sxiccmu_softc *, uint32_t);
@@ -144,7 +147,9 @@ sxiccmu_match(struct device *parent, voi
     OF_is_compatible(node, "allwinner,sun9i-a80-mmc-config-clk") ||
     OF_is_compatible(node, "allwinner,sun50i-a64-ccu") ||
     OF_is_compatible(node, "allwinner,sun50i-a64-r-ccu") ||
-    OF_is_compatible(node, "allwinner,sun50i-h5-ccu"));
+    OF_is_compatible(node, "allwinner,sun50i-h5-ccu") ||
+    OF_is_compatible(node, "allwinner,sun50i-h6-ccu") ||
+    OF_is_compatible(node, "allwinner,sun50i-h6-r-ccu"));
 }
 
 void
@@ -255,6 +260,22 @@ sxiccmu_attach(struct device *parent, st
  sc->sc_nresets = nitems(sun50i_a64_resets);
  sc->sc_get_frequency = sxiccmu_a64_get_frequency;
  sc->sc_set_frequency = sxiccmu_a64_set_frequency;
+ } else if (OF_is_compatible(node, "allwinner,sun50i-h6-ccu")) {
+ KASSERT(faa->fa_nreg > 0);
+ sc->sc_gates = sun50i_h6_gates;
+ sc->sc_ngates = nitems(sun50i_h6_gates);
+ sc->sc_resets = sun50i_h6_resets;
+ sc->sc_nresets = nitems(sun50i_h6_resets);
+ sc->sc_get_frequency = sxiccmu_h6_get_frequency;
+ sc->sc_set_frequency = sxiccmu_h6_set_frequency;
+ } else if (OF_is_compatible(node, "allwinner,sun50i-h6-r-ccu")) {
+ KASSERT(faa->fa_nreg > 0);
+ sc->sc_gates = sun50i_h6_r_gates;
+ sc->sc_ngates = nitems(sun50i_h6_r_gates);
+ sc->sc_resets = sun50i_h6_r_resets;
+ sc->sc_nresets = nitems(sun50i_h6_r_resets);
+ sc->sc_get_frequency = sxiccmu_h6_r_get_frequency;
+ sc->sc_set_frequency = sxiccmu_nop_set_frequency;
  } else {
  for (node = OF_child(node); node; node = OF_peer(node))
  sxiccmu_attach_clock(sc, node, faa->fa_nreg);
@@ -975,13 +996,13 @@ sxiccmu_a23_get_frequency(struct sxiccmu
 #define A64_PLL_CPUX_LOCK (1 << 28)
 #define A64_PLL_CPUX_OUT_EXT_DIVP(x) (((x) >> 16) & 0x3)
 #define A64_PLL_CPUX_OUT_EXT_DIVP_MASK (0x3 << 16)
-#define A64_PLL_CPUX_FACTOR_N(x) (((x) >> 8) & 0x1f)
+#define A64_PLL_CPUX_FACTOR_N(x) (((x) >> 8) & 0x1f)
 #define A64_PLL_CPUX_FACTOR_N_MASK (0x1f << 8)
 #define A64_PLL_CPUX_FACTOR_N_SHIFT 8
-#define A64_PLL_CPUX_FACTOR_K(x) (((x) >> 4) & 0x3)
+#define A64_PLL_CPUX_FACTOR_K(x) (((x) >> 4) & 0x3)
 #define A64_PLL_CPUX_FACTOR_K_MASK (0x3 << 4)
 #define A64_PLL_CPUX_FACTOR_K_SHIFT 4
-#define A64_PLL_CPUX_FACTOR_M(x) (((x) >> 0) & 0x3)
+#define A64_PLL_CPUX_FACTOR_M(x) (((x) >> 0) & 0x3)
 #define A64_PLL_CPUX_FACTOR_M_MASK (0x3 << 0)
 #define A64_CPUX_AXI_CFG_REG 0x0050
 #define A64_CPUX_CLK_SRC_SEL (0x3 << 16)
@@ -1243,6 +1264,39 @@ sxiccmu_h3_r_get_frequency(struct sxiccm
 }
 
 uint32_t
+sxiccmu_h6_get_frequency(struct sxiccmu_softc *sc, uint32_t idx)
+{
+ switch (idx) {
+ case H6_CLK_PLL_PERIPH0:
+ /* Not hardcoded, but recommended. */
+ return 600000000;
+ case H6_CLK_PLL_PERIPH0_2X:
+ return sxiccmu_h6_get_frequency(sc, H6_CLK_PLL_PERIPH0) * 2;
+ case H6_CLK_APB2:
+ /* XXX Controlled by a MUX. */
+ return 24000000;
+ break;
+ }
+
+ printf("%s: 0x%08x\n", __func__, idx);
+ return 0;
+}
+
+uint32_t
+sxiccmu_h6_r_get_frequency(struct sxiccmu_softc *sc, uint32_t idx)
+{
+ switch (idx) {
+ case H6_R_CLK_APB2:
+ /* XXX Controlled by a MUX. */
+ return 24000000;
+ break;
+ }
+
+ printf("%s: 0x%08x\n", __func__, idx);
+ return 0;
+}
+
+uint32_t
 sxiccmu_r40_get_frequency(struct sxiccmu_softc *sc, uint32_t idx)
 {
  uint32_t parent;
@@ -1553,6 +1607,76 @@ sxiccmu_h3_set_frequency(struct sxiccmu_
  return -1;
 }
 
+#define H6_SMHC0_CLK_REG 0x0830
+#define H6_SMHC1_CLK_REG 0x0834
+#define H6_SMHC2_CLK_REG 0x0838
+#define H6_SMHC_CLK_SRC_SEL (0x3 << 24)
+#define H6_SMHC_CLK_SRC_SEL_OSC24M (0x0 << 16)
+#define H6_SMHC_CLK_SRC_SEL_PLL_PERIPH0_2X (0x1 << 16)
+#define H6_SMHC_FACTOR_N_MASK (0x3 << 8)
+#define H6_SMHC_FACTOR_N_SHIFT 8
+#define H6_SMHC_FACTOR_M_MASK (0xf << 0)
+#define H6_SMHC_FACTOR_M_SHIFT 0
+
+int
+sxiccmu_h6_mmc_set_frequency(struct sxiccmu_softc *sc, bus_size_t offset,
+    uint32_t freq)
+{
+ uint32_t parent_freq;
+ uint32_t reg, m, n;
+ uint32_t clk_src;
+
+ switch (freq) {
+ case 400000:
+ n = 2, m = 15;
+ clk_src = H6_SMHC_CLK_SRC_SEL_OSC24M;
+ break;
+ case 20000000:
+ case 25000000:
+ case 26000000:
+ case 50000000:
+ case 52000000:
+ n = 0, m = 0;
+ clk_src = H6_SMHC_CLK_SRC_SEL_PLL_PERIPH0_2X;
+ parent_freq =
+    sxiccmu_h6_get_frequency(sc, H6_CLK_PLL_PERIPH0_2X);
+ while ((parent_freq / (1 << n) / 16) > freq)
+ n++;
+ while ((parent_freq / (1 << n) / (m + 1)) > freq)
+ m++;
+ break;
+ default:
+ return -1;
+ }
+
+ reg = SXIREAD4(sc, offset);
+ reg &= ~H6_SMHC_CLK_SRC_SEL;
+ reg |= clk_src;
+ reg &= ~H6_SMHC_FACTOR_N_MASK;
+ reg |= n << H6_SMHC_FACTOR_N_SHIFT;
+ reg &= ~H6_SMHC_FACTOR_M_MASK;
+ reg |= m << H6_SMHC_FACTOR_M_SHIFT;
+ SXIWRITE4(sc, offset, reg);
+
+ return 0;
+}
+
+int
+sxiccmu_h6_set_frequency(struct sxiccmu_softc *sc, uint32_t idx, uint32_t freq)
+{
+ switch (idx) {
+ case H6_CLK_MMC0:
+ return sxiccmu_h6_mmc_set_frequency(sc, H6_SMHC0_CLK_REG, freq);
+ case H6_CLK_MMC1:
+ return sxiccmu_h6_mmc_set_frequency(sc, H6_SMHC1_CLK_REG, freq);
+ case H6_CLK_MMC2:
+ return sxiccmu_h6_mmc_set_frequency(sc, H6_SMHC2_CLK_REG, freq);
+ }
+
+ printf("%s: 0x%08x\n", __func__, idx);
+ return -1;
+}
+
 int
 sxiccmu_r40_set_frequency(struct sxiccmu_softc *sc, uint32_t idx, uint32_t freq)
 {
@@ -1619,6 +1743,10 @@ sxiccmu_ccu_enable(void *cookie, uint32_
  printf("%s: 0x%08x\n", __func__, cells[0]);
  return;
  }
+
+ /* If the clock can't be gated, simply return. */
+ if (sc->sc_gates[idx].reg == 0xffff && sc->sc_gates[idx].bit == 0xff)
+ return;
 
  reg = sc->sc_gates[idx].reg;
  bit = sc->sc_gates[idx].bit;
Index: dev/fdt/sxiccmu_clocks.h
===================================================================
RCS file: /cvs/src/sys/dev/fdt/sxiccmu_clocks.h,v
retrieving revision 1.26
diff -u -p -r1.26 sxiccmu_clocks.h
--- dev/fdt/sxiccmu_clocks.h 2 Sep 2019 15:24:39 -0000 1.26
+++ dev/fdt/sxiccmu_clocks.h 7 Sep 2019 11:33:18 -0000
@@ -387,6 +387,59 @@ struct sxiccmu_ccu_bit sun8i_h3_r_gates[
  [H3_R_CLK_APB0_I2C] = { 0x0028, 6, H3_R_CLK_APB0 },
 };
 
+/* H6 */
+
+#define H6_CLK_PLL_PERIPH0 3
+#define H6_CLK_PLL_PERIPH0_2X 4
+#define H6_CLK_APB1 26
+#define H6_CLK_APB2 27
+#define H6_CLK_MMC0 64
+#define H6_CLK_MMC1 65
+#define H6_CLK_MMC2 66
+#define H6_CLK_BUS_MMC0 67
+#define H6_CLK_BUS_MMC1 68
+#define H6_CLK_BUS_MMC2 69
+#define H6_CLK_BUS_UART0 70
+#define H6_CLK_BUS_UART1 71
+#define H6_CLK_BUS_UART2 72
+#define H6_CLK_BUS_UART3 73
+#define H6_CLK_USB_OHCI0 104
+#define H6_CLK_USB_OHCI3 107
+#define H6_CLK_BUS_OHCI0 111
+#define H6_CLK_BUS_OHCI3 112
+#define H6_CLK_BUS_EHCI0 113
+#define H6_CLK_BUS_EHCI3 115
+
+struct sxiccmu_ccu_bit sun50i_h6_gates[] = {
+ [H6_CLK_PLL_PERIPH0] = { 0x0020, 31 },
+ [H6_CLK_APB1] = { 0xffff, 0xff },
+ [H6_CLK_MMC0] = { 0x0830, 31 },
+ [H6_CLK_MMC1] = { 0x0834, 31 },
+ [H6_CLK_MMC2] = { 0x0838, 31 },
+ [H6_CLK_BUS_MMC0] = { 0x084c, 0 },
+ [H6_CLK_BUS_MMC1] = { 0x084c, 1 },
+ [H6_CLK_BUS_MMC2] = { 0x084c, 2 },
+ [H6_CLK_BUS_UART0] = { 0x090c, 0, H6_CLK_APB2 },
+ [H6_CLK_BUS_UART1] = { 0x090c, 1, H6_CLK_APB2 },
+ [H6_CLK_BUS_UART2] = { 0x090c, 2, H6_CLK_APB2 },
+ [H6_CLK_BUS_UART3] = { 0x090c, 3, H6_CLK_APB2 },
+ [H6_CLK_USB_OHCI0] = { 0x0a70, 31 },
+ [H6_CLK_USB_OHCI3] = { 0x0a7c, 31 },
+ [H6_CLK_BUS_OHCI0] = { 0x0a8c, 0 },
+ [H6_CLK_BUS_OHCI3] = { 0x0a8c, 3 },
+ [H6_CLK_BUS_EHCI0] = { 0x0a8c, 4 },
+ [H6_CLK_BUS_EHCI3] = { 0x0a8c, 7 },
+};
+
+#define H6_R_CLK_APB1 2
+#define H6_R_CLK_APB2 3
+#define H6_R_CLK_APB2_I2C 8
+
+struct sxiccmu_ccu_bit sun50i_h6_r_gates[] = {
+ [H6_R_CLK_APB1] = { 0xffff, 0xff },
+ [H6_R_CLK_APB2_I2C] = { 0x019c, 1, H6_R_CLK_APB2 },
+};
+
 /* R40 */
 
 #define R40_CLK_PLL_PERIPH0 11
@@ -722,6 +775,40 @@ struct sxiccmu_ccu_bit sun8i_h3_resets[]
 struct sxiccmu_ccu_bit sun8i_h3_r_resets[] = {
  [H3_R_RST_APB0_RSB] = { 0x00b0, 3 },
  [H3_R_RST_APB0_I2C] = { 0x00b0, 6 },
+};
+
+/* H6 */
+
+#define H6_RST_BUS_MMC0 18
+#define H6_RST_BUS_MMC1 19
+#define H6_RST_BUS_MMC2 20
+#define H6_RST_BUS_UART0 21
+#define H6_RST_BUS_UART1 22
+#define H6_RST_BUS_UART2 23
+#define H6_RST_BUS_UART3 24
+#define H6_RST_BUS_OHCI0 48
+#define H6_RST_BUS_OHCI3 49
+#define H6_RST_BUS_EHCI0 50
+#define H6_RST_BUS_EHCI3 52
+
+struct sxiccmu_ccu_bit sun50i_h6_resets[] = {
+ [H6_RST_BUS_MMC0] = { 0x084c, 16 },
+ [H6_RST_BUS_MMC1] = { 0x084c, 17 },
+ [H6_RST_BUS_MMC2] = { 0x084c, 18 },
+ [H6_RST_BUS_UART0] = { 0x090c, 16 },
+ [H6_RST_BUS_UART1] = { 0x090c, 17 },
+ [H6_RST_BUS_UART2] = { 0x090c, 18 },
+ [H6_RST_BUS_UART3] = { 0x090c, 19 },
+ [H6_RST_BUS_OHCI0] = { 0x0a8c, 16 },
+ [H6_RST_BUS_OHCI3] = { 0x0a8c, 19 },
+ [H6_RST_BUS_EHCI0] = { 0x0a8c, 20 },
+ [H6_RST_BUS_EHCI3] = { 0x0a8c, 23 },
+};
+
+#define H6_R_RST_APB2_I2C 4
+
+struct sxiccmu_ccu_bit sun50i_h6_r_resets[] = {
+ [H6_R_RST_APB2_I2C] = { 0x019c, 16 },
 };
 
 /* R40 */

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

SASANO Takayoshi
Hello,

here is the log, axp805 is recognized but SD is not recognized.

>> OpenBSD/arm64 BOOTAA64 0.19
boot>
cannot open sd0a:/etc/random.seed: No such file or directory
booting sd0a:/bsd: 7394236+1599040+520816+847744 [616986+109+862248+523950]=0xd37718
type 0x2 pa 0x40000000 va 0x40000000 pages 0x4000 attr 0x8
type 0x7 pa 0x44000000 va 0x44000000 pages 0x3ef9 attr 0x8
type 0x4 pa 0x47ef9000 va 0x47ef9000 pages 0xe attr 0x8
type 0x7 pa 0x47f07000 va 0x47f07000 pages 0x323ee attr 0x8
type 0x2 pa 0x7a2f5000 va 0x7a2f5000 pages 0xc0f attr 0x8
type 0x1 pa 0x7af04000 va 0x7af04000 pages 0x28 attr 0x8
type 0x0 pa 0x7af2c000 va 0x7af2c000 pages 0x9 attr 0x8
type 0x6 pa 0x7af35000 va 0x3e024be000 pages 0x1 attr 0x8000000000000008
type 0x0 pa 0x7af36000 va 0x7af36000 pages 0x1 attr 0x8
type 0x6 pa 0x7af37000 va 0x3e024c0000 pages 0x1 attr 0x8000000000000008
type 0x2 pa 0x7af38000 va 0x7af38000 pages 0x5018 attr 0x8
type 0x5 pa 0x7ff50000 va 0x3e074d9000 pages 0x10 attr 0x8000000000000008
type 0x2 pa 0x7ff60000 va 0x7ff60000 pages 0xa0 attr 0x8
[ using 2004264 bytes of bsd ELF symbol table ]
Copyright (c) 1982, 1986, 1989, 1991, 1993
        The Regents of the University of California.  All rights reserved.
Copyright (c) 1995-2019 OpenBSD. All rights reserved.  https://www.OpenBSD.org

OpenBSD 6.6-beta (GENERIC) #4: Sun Sep  8 16:17:10 JST 2019
    [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC
real mem  = 976121856 (930MB)
avail mem = 916107264 (873MB)
warning: no entropy supplied by boot loader
mainbus0 at root: OrangePi One Plus
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: Das U-Boot rev 0x20190700
apm0 at mainbus0
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
"internal-osc-clk" at mainbus0 not configured
"osc24M_clk" at mainbus0 not configured
"osc32k_clk" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
simplebus0 at mainbus0: "soc"
sxisyscon0 at simplebus0
sxiccmu0 at simplebus0
ampintc0 at simplebus0 nirq 192, ncpu 4: "interrupt-controller"
sxiccmu1 at simplebus0
"display-engine" at simplebus0 not configured
"video-codec" at simplebus0 not configured
"sid" at simplebus0 not configured
"pinctrl" at simplebus0 not configured
sximmc0 at simplebus0
sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
com0 at simplebus0: ns16550, no working fifo
com0: console
"usb" at simplebus0 not configured
"phy" at simplebus0 not configured
ehci0 at simplebus0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
ohci0 at simplebus0: version 1.0
ehci1 at simplebus0
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
ohci1 at simplebus0: version 1.0
"hdmi-phy" at simplebus0 not configured
"tcon-top" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"interrupt-controller" at simplebus0 not configured
"pinctrl" at simplebus0 not configured
sxitwi0 at simplebus0
iic0 at sxitwi0
"x-powers,axp805" at iic0 addr 0x36 not configured
usb2 at ohci0: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
"leds" at mainbus0 not configured
"vcc5v" at mainbus0 not configured
"binman" at mainbus0 not configured
ohci1: 1 scheduling overruns
vscsi0 at root
scsibus0 at vscsi0: 256 targets
softraid0 at root
scsibus1 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: lookup sd0a:/bsd failed
root device: <-- hang up here


Regards,
--
SASANO Takayoshi (JG1UAA) <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

Mark Kettenis
> Date: Sun, 08 Sep 2019 17:55:12 +0900
> From: SASANO Takayoshi <[hidden email]>
>
> Hello,
>
> here is the log, axp805 is recognized but SD is not recognized.

Thanks.  I've committed the driver with a small fix.  Maybe that'll
fix the detection of the SD card.

Support for the axp805 will have to be added to axpmic(4), but as far
as I can tell that isn't crucial.

One question:

> >> OpenBSD/arm64 BOOTAA64 0.19
> boot>
> cannot open sd0a:/etc/random.seed: No such file or directory
> booting sd0a:/bsd: 7394236+1599040+520816+847744 [616986+109+862248+523950]=0xd37718
> type 0x2 pa 0x40000000 va 0x40000000 pages 0x4000 attr 0x8
> type 0x7 pa 0x44000000 va 0x44000000 pages 0x3ef9 attr 0x8
> type 0x4 pa 0x47ef9000 va 0x47ef9000 pages 0xe attr 0x8
> type 0x7 pa 0x47f07000 va 0x47f07000 pages 0x323ee attr 0x8
> type 0x2 pa 0x7a2f5000 va 0x7a2f5000 pages 0xc0f attr 0x8
> type 0x1 pa 0x7af04000 va 0x7af04000 pages 0x28 attr 0x8
> type 0x0 pa 0x7af2c000 va 0x7af2c000 pages 0x9 attr 0x8
> type 0x6 pa 0x7af35000 va 0x3e024be000 pages 0x1 attr 0x8000000000000008
> type 0x0 pa 0x7af36000 va 0x7af36000 pages 0x1 attr 0x8
> type 0x6 pa 0x7af37000 va 0x3e024c0000 pages 0x1 attr 0x8000000000000008
> type 0x2 pa 0x7af38000 va 0x7af38000 pages 0x5018 attr 0x8
> type 0x5 pa 0x7ff50000 va 0x3e074d9000 pages 0x10 attr 0x8000000000000008
> type 0x2 pa 0x7ff60000 va 0x7ff60000 pages 0xa0 attr 0x8
> [ using 2004264 bytes of bsd ELF symbol table ]
> Copyright (c) 1982, 1986, 1989, 1991, 1993
>         The Regents of the University of California.  All rights reserved.
> Copyright (c) 1995-2019 OpenBSD. All rights reserved.  https://www.OpenBSD.org
>
> OpenBSD 6.6-beta (GENERIC) #4: Sun Sep  8 16:17:10 JST 2019
>     [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC
> real mem  = 976121856 (930MB)
> avail mem = 916107264 (873MB)
> warning: no entropy supplied by boot loader
> mainbus0 at root: OrangePi One Plus
> cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
> cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
> cpu0: 512KB 64b/line 16-way L2 cache
> efi0 at mainbus0: UEFI 2.7
> efi0: Das U-Boot rev 0x20190700
> apm0 at mainbus0
> psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
> "internal-osc-clk" at mainbus0 not configured
> "osc24M_clk" at mainbus0 not configured
> "osc32k_clk" at mainbus0 not configured
> agtimer0 at mainbus0: tick rate 24000 KHz
> simplebus0 at mainbus0: "soc"
> sxisyscon0 at simplebus0
> sxiccmu0 at simplebus0
> ampintc0 at simplebus0 nirq 192, ncpu 4: "interrupt-controller"
> sxiccmu1 at simplebus0
> "display-engine" at simplebus0 not configured
> "video-codec" at simplebus0 not configured
> "sid" at simplebus0 not configured
> "pinctrl" at simplebus0 not configured
> sximmc0 at simplebus0
> sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
> com0 at simplebus0: ns16550, no working fifo
> com0: console
> "usb" at simplebus0 not configured
> "phy" at simplebus0 not configured
> ehci0 at simplebus0
> usb0 at ehci0: USB revision 2.0
> uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
> ohci0 at simplebus0: version 1.0
> ehci1 at simplebus0
> usb1 at ehci1: USB revision 2.0
> uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
> ohci1 at simplebus0: version 1.0
> "hdmi-phy" at simplebus0 not configured
> "tcon-top" at simplebus0 not configured
> "lcd-controller" at simplebus0 not configured
> "interrupt-controller" at simplebus0 not configured
> "pinctrl" at simplebus0 not configured
> sxitwi0 at simplebus0
> iic0 at sxitwi0
> "x-powers,axp805" at iic0 addr 0x36 not configured
> usb2 at ohci0: USB revision 1.0
> uhub2 at usb2 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
> usb3 at ohci1: USB revision 1.0
> uhub3 at usb3 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
> "leds" at mainbus0 not configured
> "vcc5v" at mainbus0 not configured
> "binman" at mainbus0 not configured
> ohci1: 1 scheduling overruns
> vscsi0 at root
> scsibus0 at vscsi0: 256 targets
> softraid0 at root
> scsibus1 at softraid0: 256 targets
> bootfile: sd0a:/bsd
> boot device: lookup sd0a:/bsd failed
> root device: <-- hang up here

Does it accept input at that point?

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

Mark Kettenis
> Date: Sun, 8 Sep 2019 19:03:01 +0200 (CEST)
> From: Mark Kettenis <[hidden email]>
>
> > Date: Sun, 08 Sep 2019 17:55:12 +0900
> > From: SASANO Takayoshi <[hidden email]>
> >
> > Hello,
> >
> > here is the log, axp805 is recognized but SD is not recognized.
>
> Thanks.  I've committed the driver with a small fix.  Maybe that'll
> fix the detection of the SD card.
>
> Support for the axp805 will have to be added to axpmic(4), but as far
> as I can tell that isn't crucial.

Also, does the attached diff help with making the USB ports work?

Index: dev/fdt/ehci_fdt.c
===================================================================
RCS file: /cvs/src/sys/dev/fdt/ehci_fdt.c,v
retrieving revision 1.6
diff -u -p -r1.6 ehci_fdt.c
--- dev/fdt/ehci_fdt.c 11 Aug 2019 11:16:05 -0000 1.6
+++ dev/fdt/ehci_fdt.c 8 Sep 2019 17:29:37 -0000
@@ -175,6 +175,7 @@ struct ehci_phy ehci_phys[] = {
  { "allwinner,sun8i-r40-usb-phy", sun4i_phy_init },
  { "allwinner,sun8i-v3s-usb-phy", sun4i_phy_init },
  { "allwinner,sun50i-a64-usb-phy", sun4i_phy_init },
+ { "allwinner,sun50i-h6-usb-phy", sun4i_phy_init },
  { "allwinner,sun9i-a80-usb-phy", sun9i_phy_init },
 };
 

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

SASANO Takayoshi
In reply to this post by Mark Kettenis
hi,

On Mon, 09 Sep 2019 02:03:01 +0900,
Mark Kettenis wrote:
> One question:
>
> > >> OpenBSD/arm64 BOOTAA64 0.19
> > boot>
> > cannot open sd0a:/etc/random.seed: No such file or directory
> > booting sd0a:/bsd: 7394236+1599040+520816+847744 [616986+109+862248+523950]=0xd37718
> > type 0x2 pa 0x40000000 va 0x40000000 pages 0x4000 attr 0x8
(snip)
> > boot device: lookup sd0a:/bsd failed
> > root device: <-- hang up here
>
> Does it accept input at that point?

Yes, simply press Enter, message flood has occured like this:

bootfile: sd0a:/bsd
boot device: lookup sd0a:/bsd failed
root device: <-- press enter here
ohci1: 1193 scheduling overruns
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:
use one of: exit
root device:

and this flood can stop by pressing Ctrl-C.
simply hit a key, it looks many times pressed.

use one of: exit
root device: aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa

--
SASANO Takayoshi (JG1UAA) <[hidden email]>

Reply | Threaded
Open this post in threaded view
|

Re: report: OpenBSD-current on OrangePi One Plus (Allwinner H6)

SASANO Takayoshi
In reply to this post by Mark Kettenis
hello,

> Also, does the attached diff help with making the USB ports work?
>
> Index: dev/fdt/ehci_fdt.c
> ===================================================================
> RCS file: /cvs/src/sys/dev/fdt/ehci_fdt.c,v
> retrieving revision 1.6
> diff -u -p -r1.6 ehci_fdt.c
> --- dev/fdt/ehci_fdt.c 11 Aug 2019 11:16:05 -0000 1.6
> +++ dev/fdt/ehci_fdt.c 8 Sep 2019 17:29:37 -0000
> @@ -175,6 +175,7 @@ struct ehci_phy ehci_phys[] = {
>   { "allwinner,sun8i-r40-usb-phy", sun4i_phy_init },
>   { "allwinner,sun8i-v3s-usb-phy", sun4i_phy_init },
>   { "allwinner,sun50i-a64-usb-phy", sun4i_phy_init },
> + { "allwinner,sun50i-h6-usb-phy", sun4i_phy_init },
>   { "allwinner,sun9i-a80-usb-phy", sun9i_phy_init },
>  };

I attach USB2.0 SD card reader and booted OpenBSD with your patch,
it looks uhub3(OHCI) detects device presence but not configured
correctly. Even if I attach USB1.1 USB-UART adapter, the result is same.

----
OpenBSD 6.6-beta (GENERIC) #5: Mon Sep  9 21:48:41 JST 2019
    [hidden email]:/usr/src/sys/arch/arm64/compile/GENERIC
real mem  = 976138240 (930MB)
avail mem = 916127744 (873MB)
warning: no entropy supplied by boot loader
mainbus0 at root: OrangePi One Plus
cpu0 at mainbus0 mpidr 0: ARM Cortex-A53 r0p4
cpu0: 32KB 64b/line 2-way L1 VIPT I-cache, 32KB 64b/line 4-way L1 D-cache
cpu0: 512KB 64b/line 16-way L2 cache
efi0 at mainbus0: UEFI 2.7
efi0: Das U-Boot rev 0x20190700
apm0 at mainbus0
psci0 at mainbus0: PSCI 1.1, SMCCC 1.1
"internal-osc-clk" at mainbus0 not configured
"osc24M_clk" at mainbus0 not configured
"osc32k_clk" at mainbus0 not configured
agtimer0 at mainbus0: tick rate 24000 KHz
simplebus0 at mainbus0: "soc"
sxisyscon0 at simplebus0
sxiccmu0 at simplebus0
ampintc0 at simplebus0 nirq 192, ncpu 4: "interrupt-controller"
sxiccmu1 at simplebus0
"display-engine" at simplebus0 not configured
"video-codec" at simplebus0 not configured
"sid" at simplebus0 not configured
"pinctrl" at simplebus0 not configured
sximmc0 at simplebus0
sdmmc0 at sximmc0: 4-bit, sd high-speed, mmc high-speed, dma
com0 at simplebus0: ns16550, no working fifo
com0: console
"usb" at simplebus0 not configured
"phy" at simplebus0 not configured
ehci0 at simplebus0
usb0 at ehci0: USB revision 2.0
uhub0 at usb0 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
ohci0 at simplebus0: version 1.0
ehci1 at simplebus0
sxiccmu_ccu_enable: 0x0000006c
sxiccmu_ccu_reset: 0x0000002e
usb1 at ehci1: USB revision 2.0
uhub1 at usb1 configuration 1 interface 0 "Generic EHCI root hub" rev 2.00/1.00 addr 1
ohci1 at simplebus0: version 1.0
"hdmi-phy" at simplebus0 not configured
"tcon-top" at simplebus0 not configured
"lcd-controller" at simplebus0 not configured
"interrupt-controller" at simplebus0 not configured
"pinctrl" at simplebus0 not configured
sxitwi0 at simplebus0
iic0 at sxitwi0
"x-powers,axp805" at iic0 addr 0x36 not configured
usb2 at ohci0: USB revision 1.0
uhub2 at usb2 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
usb3 at ohci1: USB revision 1.0
uhub3 at usb3 configuration 1 interface 0 "Generic OHCI root hub" rev 1.00/1.00 addr 1
"leds" at mainbus0 not configured
"vcc5v" at mainbus0 not configured
"binman" at mainbus0 not configured
uhub3: device problem, disabling port 1 <--- ***
vscsi0 at root
scsibus0 at vscsi0: 256 targets
softraid0 at root
scsibus1 at softraid0: 256 targets
bootfile: sd0a:/bsd
boot device: lookup sd0a:/bsd failed
root device:

--
SASANO Takayoshi (JG1UAA) <[hidden email]>