> Date: Sat, 28 Mar 2020 23:03:00 +0000
> From: "Nicholas Helke" <open...@nicholas.hel.ke>
> 
> Hi,
> 
> I managed to get OpenBSD to boot on a NanoPi R1S by following Frederic
> Cambus' post[1]. I can't however seem to get USB to work even though I
> was expecting it to work using ehci(4). This rather defeats the utility
> of the R1S, as the second ethernet port is on the USB bus.
> 
> One message seen during boot (cf. appendix) which I suspect is relevant
> is:
> 
> > EHCI failed to shut down host controller.

That message is annoying but harmless.

> I tracked this message down to U-Boot [3]. I do not however know what it
> means or why this would prevent OpenBSD from initialising the USBI don't
> see anything in dmesg(8) (cf. appendix) that implies that the ehci(4)
> driver hasn't successfully loaded. However the umass(4) device I have
> plugged in doesn't power up and does not show in usbdevs(8):

The fact that a device plugged into the usb ports doesn't power up
suggests that the USB bus isn't powered.  I think I know why...

> Controller /dev/usb0:
> addr 01: 0000:0000 Generic, EHCI root hub
> Controller /dev/usb1:
> addr 01: 0000:0000 Generic, EHCI root hub
> Controller /dev/usb2:
> addr 01: 0000:0000 Generic, OHCI root hub
> Controller /dev/usb3:
> addr 01: 0000:0000 Generic, OHCI root hub
> 
> Can anyone suggest something for me to try next? I don't mind patching
> my kernel to help figure this out, but I'm afraid I don't know what to
> look at next without guidance.

Yes, see below...

> Appendix -- Boot messages through end of dmesg:
> 
> U-Boot SPL 2019.10 (Oct 11 2019 - 15:49:48 -0600)
> DRAM: 512 MiB
> Trying to boot from MMC1
> NOTICE:  BL31: v2.1(debug):2.1
> NOTICE:  BL31: Built : 15:24:56, Oct 11 2019
> NOTICE:  BL31: Detected Allwinner H5 SoC (1718)
> NOTICE:  BL31: Found U-Boot DTB at 0x408b7b0, model: FriendlyARM NanoPi NEO 2
> INFO:    ARM GICv2 driver initialized
> INFO:    Configuring SPC Controller
> NOTICE:  BL31: PMIC: Defaulting to PortL GPIO according to H5 reference 
> design.
> INFO:    BL31: Platform setup done
> INFO:    BL31: Initializing runtime services
> WARNING: BL31: cortex_a53: CPU workaround for 819472 was missing!
> WARNING: BL31: cortex_a53: CPU workaround for 824069 was missing!
> WARNING: BL31: cortex_a53: CPU workaround for 827319 was missing!
> INFO:    BL31: cortex_a53: CPU workaund for 855873 was applied
> INFO:    BL31: Preparing for EL3 exit to normal world
> INFO:    Entry point address = x4a000000
> INFO:    SPSR = 0x3c9
> 
> 
> U-Boot 2019.10 (Oct 11 2019 - 15:49:48 -0600) Allwinner Technology
> 
> CPU:   Allwinner H5 (SUN50I)
> Model: FriendlyARM NanoPi NEO 2

You're using a U-Boot for a different device than you have...

> DRAM:  512 MiB
> MMC:   mmc@1c0f000: 0
> Loading Environment from FAT... *** Warning - bad CRC, using default 
> environment
> 
> In:    serial
> Out:   serial
> Err:   serial
> Net:   phy interface7
> Could not get PHY for ethernet@1c30000: addr 7
> eth-1: ethernet@1c30000
> starting USB...
> Bus usb@1c1a000: USB EHCI 1.00
> Bus usb@1c1a400: USB OHCI 1.0
> Bus usb@1c1d000: USB EHCI 1.00
> Bus usb@1c1d400: USB OHCI 1.0
> scanning bus usb@1c1a000 for devices... 1 USB Device(s) found
> scanning bus usb@1c1a400 for devices... 1 USB Device(s) found
> scanning bus usb@1c1d000 for devices... 1 USB Device(s) found
> scanning bus usb@1c1d400 for devices... 1 USB Device(s) found
>        scanning usb for storage devices... 0 Storage Device(s) found
> Hit any key to stop autoboot:  0 
> switch to partitions #0, OK
> mmc0 is current device
> Scanning mmc 0:1...
> 17280 bytes read in 4 ms (4.1 MiB/s)
> Found EFI removable media binary efi/boot/bootaa64.efi
> Scanning disk m...@1c0f000.blk...
> Found 3 disks
> phy interface7
> mdio_register: non unique device name 'ethernet@1c30000'
> Found 3 disks
> phy interface7
> mdio_register: non unique device name 'ethernet@1c30000'
> Could not get PHY for ethernet@1c30000: addr 7
> BootOrder not defined
> EFI boot manager: Cannot load any image
> 161090 bytes read in 12 ms (12.8 MiB/s)
> disks: sd0*
> >> OpenBSD/arm64 BOOTAA64 0.19
> boot> 
> booting sd0a:/bsd: 7473584+1601952+537168+849040 
> [621352+109+867816+526421]=0xd3ec78
> EHCI failed to shut down host controller.
> type 0x2 pa 0x40000000 va 0x40000000 pages 0x4000 attr 0x8
> type 0x7 pa 0x44000000 va 0x44000000 pages 0x3ef8 attr 0x8
> type 0x4 pa 0x47ef8000 va 0x47ef8000 pages 0x10 attr 0x8
> type 0x7 pa 0x47f08000 va 0x47f08000 pages 0x103c0 attr 0x8
> type 0x2 pa 0x582c8000 va 0x582c8000 pages 0xb32 attr 0x8
> type 0x7 pa 0x58dfa000 va 0x58dfa000 pages 0x1 attr 0x8
> type 0x2 pa 0x58dfb000 va 0x58dfb000 pages 0x100 attr 0x8
> type 0x1 pa 0x58efb000 va 0x58efb000 pages 0x28 attr 0x8
> type 0x0 pa 0x58f23000 va 0x58f23000 pages 0x5 attr 0x8
> type 0x4 pa 0x58f28000 va 0x58f28000 pages 0x1 attr 0x8
> type 0x0 pa 0x58f29000 va 0x58f29000 pages 0x2 attr 0x8
> type 0x6 pa 0x58f2b000 va 0x325caa2000 pages 0x1 attr 0x8000000000000008
> type 0x0 pa 0x58f2c000 va 0x58f2c000 pages 0x1 attr 0x8
> type 0x4 pa 0x58f2d000 va 0x58f2d000 pages 0x2 attr 0x8
> type 0x0 pa 0x58f2f000 va 0x58f2f000 pages 0x2 attr 0x8
> type 0x6 pa 0x58f31000 va 0x325caa8000 pages 0x1 attr 0x8000000000000008
> type 0x0 pa 0x58f32000 va 0x58f32000 pages 0x1 attr 0x8
> type 0x2 pa 0x58f33000 va 0x58f33000 pages 0x501d attr 0x8
> type 0x5 pa 0x5df50000 va 0x3261ac7000 pages 0x10 attr 0x8000000000000008
> type 0x2 pa 0x5df60000 va 0x5df60000 pages 0x20a0 attr 0x8
> [ using 2016664 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 (GENERIC.MP) #4: Tue Dec 17 14:55:16 MST 2019
>     
> r...@syspatch-66-arm64.openbsd.org:/usr/src/sys/arch/arm64/compile/GENERIC.MP
> real mem  = 405504000 (386MB)
> avail mem = 362999808 (346MB)
> mainbus0 at root: FriendlyARM NanoPi NEO 2

And also a device tree (DTB) for the wrong device.  The device tree
has the information on how to power up the USB bus.  You need to get
yourself a device tree for this particular board.  This may be a
starting point:

https://github.com/friendlyarm/linux/blob/sunxi-4.14.y/arch/arm64/boot/dts/allwinner/sun50i-h5-nanopi-r1s.dts

Reply via email to