[PATCH v3 0/5] Extend usb_onboard_hub driver to support Cypress HX3 hub family

Quentin Schulz quentin.schulz at cherry.de
Wed Jun 25 12:08:06 CEST 2025


Hi Lukasz,

On 6/10/25 10:02 AM, Lukasz Czechowski wrote:
> This patch series extends the usb_onboard_hub driver to allow for
> support of more types of onboard hub devices, and adds the Cypress
> HX3 hub family.
> 
> First patch in the series updates the bind function, so that it no
> longer uses hardcoded compatible strings.
> Next patch simplifies the code, by removing unnecessary dm_gpio
> function call.
> Third patch updates the remove function, which allows the prevent
> issues with usb devices reenumeration, in case of calling
> "usb reset". Although the issue could still occur in case of invalid
> initial state of reset gpio, it is minimized with no impact on main
> usb_hub driver.
> Fourth patch extends the driver with support for multiple power
> supplies, the same way it is done in kernel driver.
> Finally, last patch provides hub data and of_match table entries
> for Cypress HX3
> 
> Signed-off-by: Lukasz Czechowski <lukasz.czechowski at thaumatec.com>

For general information: this patch series is required for RK3399 Puma 
once devicetree-rebasing is updated to 6.16+ since we have 
non-backward-compatible DT changes. We should be able to anticipate the 
breakage by simply enabling USB_ONBOARD_HUB in 
configs/puma-rk3399_defconfig. I'll send a patch once this gets merged.

For the whole series:

Tested-by: Quentin Schulz <quentin.schulz at cherry.de> # RK3399 Puma Haikou

How I tested:

- Apply the series on top of master
- Set config to puma-rk3399_defconfig
- Enable USB_ONBOARD_HUB via menuconfig
- tools/update-subtree.sh pick dts 0fe42d171081426ab119ca5c0eb130e5f3a9a805
- tools/update-subtree.sh pick dts 53aacaed0ad140b017c803d9777473c6c62f5352
- tools/update-subtree.sh pick dts 932da7a8df7b6b43453d640b383d0076d5a7d9a5

Connect a USB stick to Q7 USB P0, P2 and P3.

When in U-Boot run:

"""
=> usb tree
USB device tree:
   1  Hub (480 Mb/s, 0mA)
      u-boot EHCI Host Controller

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

   1  Hub (5 Gb/s, 0mA)
   |  U-Boot XHCI Host Controller
   |
   +-2  Hub (480 Mb/s, 0mA)
   | |
   | +-4  Mass Storage (480 Mb/s, 0mA)
   | |    SanDisk USB Extreme Pro 54A45678CACF
   | |
   | +-7  Vendor specific (12 Mb/s, 100mA)
   |      Theobroma Systems Mule USB/CAN Adapter 002A00244356530720323439
   |
   +-3  Hub (5 Gb/s, 0mA)
     |
     +-5  Mass Storage (5 Gb/s, 224mA)
     |     USB  SanDisk 3.2Gen1 0101b5ceeeaf252dc220834775927a7
     |
     +-6  Mass Storage (5 Gb/s, 224mA)
           USB  SanDisk 3.2Gen1 01013e8773b9dc4a14a4278d7dd42fc

=> usb storage
   Device 0: Vendor: SanDisk  Rev: 0    Prod: Extreme Pro
             Type: Removable Hard Disk
             Capacity: 122112.0 MB = 119.2 GB (250085376 x 512)
   Device 1: Vendor:  USB Rev: 1.00 Prod:  SanDisk 3.2Gen1
             Type: Removable Hard Disk
             Capacity: 29340.0 MB = 28.6 GB (60088320 x 512)
   Device 2: Vendor:  USB Rev: 1.00 Prod:  SanDisk 3.2Gen1
             Type: Removable Hard Disk
             Capacity: 29358.0 MB = 28.6 GB (60125184 x 512)
=> usb info
1: Hub,  USB Revision 2.0
  - u-boot EHCI Host Controller
  - Class: Hub
  - PacketSize: 64  Configurations: 1
  - Vendor: 0x0000  Product 0x0000 Version 1.0
    Configuration: 1
    - Interfaces: 1 Self Powered 0mA
      Interface: 0
      - Alternate Setting 0, Endpoints: 1
      - Class Hub
      - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

1: Hub,  USB Revision 2.0
  - u-boot EHCI Host Controller
  - Class: Hub
  - PacketSize: 64  Configurations: 1
  - Vendor: 0x0000  Product 0x0000 Version 1.0
    Configuration: 1
    - Interfaces: 1 Self Powered 0mA
      Interface: 0
      - Alternate Setting 0, Endpoints: 1
      - Class Hub
      - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

1: Hub,  USB Revision 3.0
  - U-Boot XHCI Host Controller
  - Class: Hub
  - PacketSize: 512  Configurations: 1
  - Vendor: 0x0000  Product 0x0000 Version 1.0
    Configuration: 1
    - Interfaces: 1 Self Powered 0mA
      Interface: 0
      - Alternate Setting 0, Endpoints: 1
      - Class Hub
      - Endpoint 1 In Interrupt MaxPacket 8 Interval 255ms

2: Hub,  USB Revision 2.10
  - Class: Hub
  - PacketSize: 64  Configurations: 1
  - Vendor: 0x04b4  Product 0x6502 Version 80.16
    Configuration: 1
    - Interfaces: 1 Self Powered Remote Wakeup 0mA
      Interface: 0
      - Alternate Setting 0, Endpoints: 1
      - Class Hub
      - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms
      - Endpoint 1 In Interrupt MaxPacket 1 Interval 12ms

4: Mass Storage,  USB Revision 2.10
  - SanDisk USB Extreme Pro 54A45678CACF
  - Class: (from Interface) Mass Storage
  - PacketSize: 64  Configurations: 1
  - Vendor: 0x0781  Product 0x5588 Version 1.0
    Configuration: 1
    - Interfaces: 1 Self Powered 0mA
      Interface: 0
      - Alternate Setting 0, Endpoints: 2
      - Class Mass Storage, Transp. SCSI, Bulk only
      - Endpoint 1 In Bulk MaxPacket 512
      - Endpoint 2 Out Bulk MaxPacket 512

7: Vendor specific,  USB Revision 2.0
  - Theobroma Systems Mule USB/CAN Adapter 002A00244356530720323439
  - Class: (from Interface) Vendor specific
  - PacketSize: 64  Configurations: 2
  - Vendor: 0x2294  Product 0x425a Version 3.4
    Configuration: 1
    - Interfaces: 1 Self Powered 100mA
      Interface: 0
      - Alternate Setting 0, Endpoints: 2
      - Class Vendor specific
      - String: "UCAN Interface"
      - Endpoint 1 In Bulk MaxPacket 64
      - Endpoint 1 Out Bulk MaxPacket 16

3: Hub,  USB Revision 3.0
  - Class: Hub
  - PacketSize: 512  Configurations: 1
  - Vendor: 0x04b4  Product 0x6500 Version 80.16
    Configuration: 1
    - Interfaces: 1 Self Powered Remote Wakeup 0mA
      Interface: 0
      - Alternate Setting 0, Endpoints: 1
      - Class Hub
      - Endpoint 1 In Interrupt MaxPacket 2 Interval 8ms

5: Mass Storage,  USB Revision 3.20
  -  USB  SanDisk 3.2Gen1 0101b5ceeeaf252dc220834775927a7
  - Class: (from Interface) Mass Storage
  - PacketSize: 512  Configurations: 1
  - Vendor: 0x0781  Product 0x5591 Version 1.0
    Configuration: 1
    - Interfaces: 1 Bus Powered 224mA
      Interface: 0
      - Alternate Setting 0, Endpoints: 2
      - Class Mass Storage, Transp. SCSI, Bulk only
      - Endpoint 1 In Bulk MaxPacket 1024
      - Endpoint 2 Out Bulk MaxPacket 1024

6: Mass Storage,  USB Revision 3.20
  -  USB  SanDisk 3.2Gen1 01013e8773b9dc4a14a4278d7dd42fc
  - Class: (from Interface) Mass Storage
  - PacketSize: 512  Configurations: 1
  - Vendor: 0x0781  Product 0x5591 Version 1.0
    Configuration: 1
    - Interfaces: 1 Bus Powered 224mA
      Interface: 0
      - Alternate Setting 0, Endpoints: 2
      - Class Mass Storage, Transp. SCSI, Bulk only
      - Endpoint 1 In Bulk MaxPacket 1024
      - Endpoint 2 Out Bulk MaxPacket 102
"""

and

"""
for dev in 0 1 2; do usb reset; random $loadaddr 0x8000; mw.q 
$kernel_addr_r 0xffffffffffffffff 0x1000; usb dev ${dev}; usb write 
$loadaddr 0 0x40; usb read $kernel_addr_r 0 0x40; cmp.q $loadaddr 
$kernel_addr_r 0x1000; done
"""

which writes random data to and reads back from each USB stick, you 
should have three occurrences of:

Total of 4096 double word(s) were the same

The reset isn't technically required for each device (only one `usb 
start` or `usb reset` should be enough) but it allows to make sure it 
actually works (since one of the patches in this series claimed it 
wasn't working before).

Thanks!
Quentin


More information about the U-Boot mailing list