U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Quentin Schulz <quentin.schulz@cherry.de>
To: Lukasz Czechowski <lukasz.czechowski@thaumatec.com>,
	u-boot@lists.denx.de
Cc: Tom Rini <trini@konsulko.com>
Subject: Re: [PATCH v3 0/5] Extend usb_onboard_hub driver to support Cypress HX3 hub family
Date: Wed, 25 Jun 2025 12:08:06 +0200	[thread overview]
Message-ID: <ef2ad96e-3812-486a-a161-fd241b9737b7@cherry.de> (raw)
In-Reply-To: <20250610-usb_onboard_hub_cypress_hx3-v3-0-53f03dbc3017@thaumatec.com>

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@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@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

      parent reply	other threads:[~2025-06-25 10:08 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-10  8:02 [PATCH v3 0/5] Extend usb_onboard_hub driver to support Cypress HX3 hub family Lukasz Czechowski
2025-06-10  8:02 ` [PATCH v3 1/5] usb: onboard-hub: Use the ofnode to check if the peer-hub was probed Lukasz Czechowski
2025-06-10  8:02 ` [PATCH v3 2/5] usb: onboard-hub: Use devm API do automatically free the reset GPIO Lukasz Czechowski
2025-06-24 15:30   ` Quentin Schulz
2025-06-10  8:02 ` [PATCH v3 3/5] usb: onboard-hub: Set the reset gpio pin before freeing Lukasz Czechowski
2025-06-10  8:02 ` [PATCH v3 4/5] usb: onboard-hub: Add support for multiple power supplies Lukasz Czechowski
2025-06-24 15:42   ` Quentin Schulz
2025-06-10  8:02 ` [PATCH v3 5/5] usb: onboard-hub: Add support for Cypress HX3 family Lukasz Czechowski
2025-06-25 10:08 ` Quentin Schulz [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ef2ad96e-3812-486a-a161-fd241b9737b7@cherry.de \
    --to=quentin.schulz@cherry.de \
    --cc=lukasz.czechowski@thaumatec.com \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox