[PATCH 0/6] Allwinner H6 USB3 support

Samuel Holland samuel at sholland.org
Sat Apr 17 16:17:45 CEST 2021


On 2/9/21 4:46 AM, Andre Heider wrote:
> Hi Samuel,
> 
> On 08/02/2021 06:57, Samuel Holland wrote:
>> This series adds clock, PHY, and XHCI driver support for the USB3
>> controller found in the Allwinner H6 SoC. Below is a log showing it
>> functioning on the Orange Pi 3.
>>
>> Cheers,
>> Samuel
>>
>> U-Boot 2021.04-rc1-00068-g6b8f4e0d060 (Jan 01 1970 - 00:00:00 +0000)
>> Allwinner Technology
>>
>> CPU:   Allwinner H6 (SUN50I)
>> Model: OrangePi 3
>> DRAM:  2 GiB
>> MMC:   mmc at 4020000: 0, mmc at 4021000: 2, mmc at 4022000: 1
>> Loading Environment from FAT... Unable to use mmc 1:0... In:   
>> serial at 5000000
>> Out:   serial at 5000000
>> Err:   serial at 5000000
>> Net:   No ethernet found.
>> starting USB...
>> Bus usb at 5101000: USB EHCI 1.00
>> Bus usb at 5101400: USB OHCI 1.0
>> Bus usb at 5200000: Register 2000140 NbrPorts 2
>> Starting the controller
>> USB XHCI 1.00
>> Bus usb at 5311000: USB EHCI 1.00
>> Bus usb at 5311400: USB OHCI 1.0
>> scanning bus usb at 5101000 for devices... 1 USB Device(s) found
>> scanning bus usb at 5101400 for devices... 1 USB Device(s) found
>> scanning bus usb at 5200000 for devices... 4 USB Device(s) found
>> scanning bus usb at 5311000 for devices... 1 USB Device(s) found
>> scanning bus usb at 5311400 for devices... 1 USB Device(s) found
>>         scanning usb for storage devices... 1 Storage Device(s) found
>> Hit any key to stop autoboot:  0
> 
> on my OrangePi3 I get this upon power up (with an usb3 flash drive as
> well as a SD card reader):
> 
> starting USB...
> Bus usb at 5101000: USB EHCI 1.00
> Bus usb at 5101400: USB OHCI 1.0
> Bus usb at 5200000: Register 2000140 NbrPorts 2
> Starting the controller
> USB XHCI 1.00
> Bus usb at 5311000: USB EHCI 1.00
> Bus usb at 5311400: USB OHCI 1.0
> scanning bus usb at 5101000 for devices... 1 USB Device(s) found
> scanning bus usb at 5101400 for devices... 1 USB Device(s) found
> scanning bus usb at 5200000 for devices... cannot reset port 2!?
> Device NOT ready
>    Request Sense returned 02 3A 00
> 4 USB Device(s) found
> scanning bus usb at 5311000 for devices... 1 USB Device(s) found
> scanning bus usb at 5311400 for devices... 1 USB Device(s) found
>        scanning usb for storage devices... 1 Storage Device(s) found
> Hit any key to stop autoboot:  0
> 
> 
> 
> A second retry makes the usb at 5200000 pass though.
> 
> May be related, but sometimes it can then boot off the usb device, but
> sometimes I get this:
> 
> => setenv boot_targets usb0
> => boot
> 
> Device 0: Vendor: Generic- Rev: 1.00 Prod: USB3.0 CRW   -SD
>             Type: Removable Hard Disk
>             Capacity: 1876.0 MB = 1.8 GB (3842048 x 512)
> ... is now current device
> Scanning usb 0:1...
> WARN halted endpoint, queueing URB anyway.
> Unexpected XHCI event TRB, skipping... (bbf55f10 00000000 13000000
> 03008401)
> BUG at drivers/usb/host/xhci-ring.c:500/abort_td()!
> BUG!
> resetting ...
> 
> 
> 
> And sometimes it get further but then fails shortly after:
> 
> => setenv boot_targets usb0
> => boot
> 
> Device 0: Vendor: Generic- Rev: 1.00 Prod: USB3.0 CRW   -SD
>             Type: Removable Hard Disk
>             Capacity: 1876.0 MB = 1.8 GB (3842048 x 512)
> ... is now current device
> Scanning usb 0:1...
> Found /extlinux/extlinux.conf
> Retrieving file: /extlinux/extlinux.conf
> 206 bytes read in 4 ms (49.8 KiB/s)
> 1:    LibreELEC
> Retrieving file: /KERNEL
> 23058440 bytes read in 1135 ms (19.4 MiB/s)
> append: boot=UUID=1111-5929
> disk=UUID=bb4dea68-a794-4306-ac3e-c6d585ec2a6b console=ttyS0,115200
> console=tty1 systemd.debug_shell=ttyS0 quiet
> Retrieving file: /sun50i-h6-orangepi-3.dtb
> WARN halted endpoint, queueing URB anyway.
> Unexpected XHCI event TRB, skipping... (bbf55f10 00000000 13000000
> 03008400)
> BUG at drivers/usb/host/xhci-ring.c:500/abort_td()!
> BUG!
> resetting ...

I don't know what the issue could be. I am not familiar with XHCI
internals, and it works reliably for me. I have tried both a USB3 flash
drive and a bus-powered USB3-to-SATA cable:

starting USB...
Bus usb at 5101000: USB EHCI 1.00
Bus usb at 5101400: USB OHCI 1.0
Bus usb at 5200000: Register 2000140 NbrPorts 2
Starting the controller
USB XHCI 1.00
Bus usb at 5311000: USB EHCI 1.00
Bus usb at 5311400: USB OHCI 1.0
scanning bus usb at 5101000 for devices... 1 USB Device(s) found
scanning bus usb at 5101400 for devices... 1 USB Device(s) found
scanning bus usb at 5200000 for devices... cannot reset port 3!?
4 USB Device(s) found
scanning bus usb at 5311000 for devices... 1 USB Device(s) found
scanning bus usb at 5311400 for devices... 1 USB Device(s) found
       scanning usb for storage devices... 1 Storage Device(s) found
Hit any key to stop autoboot:  0
=> usb tree
USB device tree:
  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller

  1  Hub (12 Mb/s, 0mA)
      U-Boot Root Hub

  1  Hub (5 Gb/s, 0mA)
  |  U-Boot XHCI Host Controller
  |
  +-2  Hub (5 Gb/s, 0mA)
  | |  GenesysLogic USB3.1 Hub
  | |
  | +-4  Mass Storage (5 Gb/s, 36mA)
  |      ASUS ASUS USB3.0 to SATAIII Cable 0123456789ABCDEF02CC
  |
  +-3  Hub (480 Mb/s, 100mA)
       GenesysLogic USB2.1 Hub

  1  Hub (480 Mb/s, 0mA)
     u-boot EHCI Host Controller

  1  Hub (12 Mb/s, 0mA)
      U-Boot Root Hub

=> boot
switch to partitions #0, OK
mmc1(part 0) is current device
** No partition table - mmc 1 **
MMC: no card present

Device 0: Vendor: ASMT     Rev: 0    Prod: 2105
            Type: Hard Disk
            Capacity: 122104.3 MB = 119.2 GB (250069680 x 512)
... is now current device
Scanning usb 0:1...
Found U-Boot script /boot.scr
1020 bytes read in 3 ms (332 KiB/s)
## Executing script at 4fc00000
300 bytes read in 3 ms (97.7 KiB/s)
18870784 bytes read in 81 ms (222.2 MiB/s)
26321 bytes read in 4 ms (6.3 MiB/s)
Moving Image from 0x40080000 to 0x40200000, end=41460000
## Flattened Device Tree blob at 4fa00000
   Booting using the fdt blob at 0x4fa00000
EHCI failed to shut down host controller.
Host not halted after 16000 microseconds.
   Loading Device Tree to 0000000049ff6000, end 0000000049fff6d0 ... OK

Starting kernel ...

[    0.000000] Booting Linux on physical CPU 0x0000000000 [0x410fd034]

Samuel


More information about the U-Boot mailing list