public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [PATCH] USB: dwc2: allow usb start even if usbphy is not found
@ 2026-03-16  9:26 Marius Dinu
  2026-03-16 10:04 ` Jonas Karlman
  0 siblings, 1 reply; 7+ messages in thread
From: Marius Dinu @ 2026-03-16  9:26 UTC (permalink / raw)
  To: u-boot; +Cc: Marius Dinu

RK3288 uses rockchip_usb2_phy, but that driver doesn't register iself
as a usbphy driver and "usb start" fails with this error:

  drivers/usb/host/dwc2.c:1254- dwc2_setup_phy() dwc2_usb usb@ff580000:
  Failed to get USB PHY: -19.

Until a proper fix is made for rockchip_usb2_phy, this patch allows
usb start to continue even if usbphy is not found.

Tested on Asus TinkerBoard.

Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
---
 drivers/usb/host/dwc2.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
index 16f21fa9083..74d71f23d88 100644
--- a/drivers/usb/host/dwc2.c
+++ b/drivers/usb/host/dwc2.c
@@ -1329,7 +1329,7 @@ static int dwc2_usb_probe(struct udevice *dev)
 
 	ret = dwc2_setup_phy(dev);
 	if (ret)
-		return ret;
+		dev_dbg(dev, "Failed to setup PHY: %d. Continuing anyway...\n", ret);
 
 	return dwc2_init_common(dev, priv);
 }
@@ -1345,8 +1345,7 @@ static int dwc2_usb_remove(struct udevice *dev)
 
 	ret = dwc2_shutdown_phy(dev);
 	if (ret) {
-		dev_dbg(dev, "Failed to shutdown USB PHY: %d.\n", ret);
-		return ret;
+		dev_dbg(dev, "Failed to shutdown USB PHY: %d. Continuing anyway...\n", ret);
 	}
 
 	dwc2_uninit_common(priv->regs);
-- 
2.52.0



^ permalink raw reply related	[flat|nested] 7+ messages in thread

* Re: [PATCH] USB: dwc2: allow usb start even if usbphy is not found
  2026-03-16  9:26 [PATCH] USB: dwc2: allow usb start even if usbphy is not found Marius Dinu
@ 2026-03-16 10:04 ` Jonas Karlman
  2026-03-16 14:27   ` Marius Dinu
  2026-03-16 15:12   ` Marius Dinu
  0 siblings, 2 replies; 7+ messages in thread
From: Jonas Karlman @ 2026-03-16 10:04 UTC (permalink / raw)
  To: Marius Dinu; +Cc: u-boot@lists.denx.de

Hi Marius,

On 3/16/2026 10:26 AM, Marius Dinu wrote:
> RK3288 uses rockchip_usb2_phy, but that driver doesn't register iself
> as a usbphy driver and "usb start" fails with this error:
> 
>   drivers/usb/host/dwc2.c:1254- dwc2_setup_phy() dwc2_usb usb@ff580000:
>   Failed to get USB PHY: -19.
> 
> Until a proper fix is made for rockchip_usb2_phy, this patch allows
> usb start to continue even if usbphy is not found.
> 
> Tested on Asus TinkerBoard.

I am not seeing this issue on my TinkerBoard, what U-Boot version are
you testing and have you made any config changes compared to
tinker-rk3288_defconfig?

  => usb start
  starting USB...
  USB DWC2
  USB DWC2
  Bus usb@ff540000: 2 USB Device(s) found
  Bus usb@ff580000: 1 USB Device(s) found
         scanning usb for storage devices... 0 Storage Device(s) found

  => dm tree -e usb
   Class     Seq    Probed  Driver                Name
  -----------------------------------------------------------
   usb           0  [ + ]   dwc2_usb              usb@ff540000
   usb_hub       0  [ + ]   usb_hub               `-- usb_hub
   usb_hub       1  [ + ]   usb_hub                   `-- usb_hub
   usb           1  [ + ]   dwc2_usb              usb@ff580000
   usb_hub       2  [ + ]   usb_hub               `-- usb_hub

Have something changed recently that broke this?

Anyway if something needs fixing it is probably rockchip_usb2_phy.

Regards,
Jonas

> 
> Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
> ---
>  drivers/usb/host/dwc2.c | 5 ++---
>  1 file changed, 2 insertions(+), 3 deletions(-)
> 
> diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
> index 16f21fa9083..74d71f23d88 100644
> --- a/drivers/usb/host/dwc2.c
> +++ b/drivers/usb/host/dwc2.c
> @@ -1329,7 +1329,7 @@ static int dwc2_usb_probe(struct udevice *dev)
>  
>  	ret = dwc2_setup_phy(dev);
>  	if (ret)
> -		return ret;
> +		dev_dbg(dev, "Failed to setup PHY: %d. Continuing anyway...\n", ret);
>  
>  	return dwc2_init_common(dev, priv);
>  }
> @@ -1345,8 +1345,7 @@ static int dwc2_usb_remove(struct udevice *dev)
>  
>  	ret = dwc2_shutdown_phy(dev);
>  	if (ret) {
> -		dev_dbg(dev, "Failed to shutdown USB PHY: %d.\n", ret);
> -		return ret;
> +		dev_dbg(dev, "Failed to shutdown USB PHY: %d. Continuing anyway...\n", ret);
>  	}
>  
>  	dwc2_uninit_common(priv->regs);


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] USB: dwc2: allow usb start even if usbphy is not found
  2026-03-16 10:04 ` Jonas Karlman
@ 2026-03-16 14:27   ` Marius Dinu
  2026-03-16 15:12   ` Marius Dinu
  1 sibling, 0 replies; 7+ messages in thread
From: Marius Dinu @ 2026-03-16 14:27 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Marius Dinu, u-boot@lists.denx.de

On Mon, 2026-03-16 11.04.13 ++0100, Jonas Karlman wrote:
> Hi Marius,
> 
> On 3/16/2026 10:26 AM, Marius Dinu wrote:
> > RK3288 uses rockchip_usb2_phy, but that driver doesn't register iself
> > as a usbphy driver and "usb start" fails with this error:
> > 
> >   drivers/usb/host/dwc2.c:1254- dwc2_setup_phy() dwc2_usb usb@ff580000:
> >   Failed to get USB PHY: -19.
> > 
> > Until a proper fix is made for rockchip_usb2_phy, this patch allows
> > usb start to continue even if usbphy is not found.
> > 
> > Tested on Asus TinkerBoard.
> 
> I am not seeing this issue on my TinkerBoard, what U-Boot version are
> you testing and have you made any config changes compared to
> tinker-rk3288_defconfig?

I'm using the github master branch pulled today + lots and lots of changes
in config. I didn't make a diff, but I expect it to be very very far from
tinker-rk3288_defconfig.

> 
>   => usb start
>   starting USB...
>   USB DWC2
>   USB DWC2
>   Bus usb@ff540000: 2 USB Device(s) found
>   Bus usb@ff580000: 1 USB Device(s) found
>          scanning usb for storage devices... 0 Storage Device(s) found
> 
>   => dm tree -e usb
>    Class     Seq    Probed  Driver                Name
>   -----------------------------------------------------------
>    usb           0  [ + ]   dwc2_usb              usb@ff540000
>    usb_hub       0  [ + ]   usb_hub               `-- usb_hub
>    usb_hub       1  [ + ]   usb_hub                   `-- usb_hub
>    usb           1  [ + ]   dwc2_usb              usb@ff580000
>    usb_hub       2  [ + ]   usb_hub               `-- usb_hub
> 
> Have something changed recently that broke this?

Yes! but not exactly recently...
It broke since commit e17a4bf198510693967644c331ab621fc41ea8b5.
Here's a log on my system without my proposed fix. This is a log that I
saved while I was investigating the failed USB, about a year ago, I think.
But I checked and it still fails with today's git master, I just don't have
the time to enable all the debug options again. It's still ret -19 error.

  => usb start
  starting USB...
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking oscillator
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking clock-controller@ff760000
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: vbus-supply: of_read_u32_index: vbus-supply: (not found)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #phy-cells: 0x0 (0)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usb-phy@334
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usb-phy@334
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usb-phy@334: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usb-phy@334: (none) (ret=-19)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  Bus usb@ff500000: Port not available.
and it repeats for usb@ff540000 and usb@ff580000.

There is no usbphy or usb-phy detected/bound in log when u-boot walks the
devicetree nodes, but the device tree has "usbphy" node
compatible="rockchip,rk3288-usb-phy" with 3 sub-nodes: usb-phy@320,
usb-phy@334, usb-phy@348.
Driver with that compatible string: rockchip_usb2_phy.c.
CONFIG_ROCKCHIP_USB2_PHY is enabled, but "dm compat" lists only these:

  rockchip_usb2phy      rockchip,rk3308-usb2phy
                        rockchip,rk3328-usb2phy
                        rockchip,rk3399-usb2phy
                        rockchip,rk3528-usb2phy
                        rockchip,rk3568-usb2phy
                        rockchip,rk3576-usb2phy
                        rockchip,rk3588-usb2phy

Those compat strings come from phy-rockchip-inno-usb2.c. (I also had that
enabled while debugging.) There are no compat strings from
rockchip_usb2_phy.c.

It's because phy-rockchip-inno-usb2.c has this:

  U_BOOT_DRIVER(rockchip_usb2phy){
    .name = rockchip_usb2phy"

while rockchip_usb2_phy.c does not. So the usb driver finds no compatible
phy driver loaded and fails. Before the commit, it would load anyway.

I didn't use any AI in this investigation!

Here is a log with my patch:
  => usb start
  starting USB...
  drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: disable-over-current: false
  drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: hnp-srp-disable: false
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking oscillator
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking clock-controller@ff760000
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #phy-cells: 0x0 (0)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usb-phy@348
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usb-phy@348
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usb-phy@348: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usb-phy@348: (none) (ret=-19)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/usb/host/dwc2.c:1254-      dwc2_setup_phy() dwc2_usb usb@ff540000: Failed to get USB PHY: -19.
  drivers/usb/host/dwc2.c:1332-      dwc2_usb_probe() dwc2_usb usb@ff540000: Failed to setup PHY: -19. Continuing anyway...
  drivers/usb/host/dwc2.c:1061-          dwc2_reset() dwc2_usb usb@ff540000: Can't get reset: -2
  drivers/usb/host/dwc2.c:1095-    dwc2_init_common() dwc2_usb usb@ff540000: Core Release: 3.10a
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: dr_mode: host
  drivers/usb/common/dwc2_core.c:67-  dwc2_flush_tx_fifo() Flush Tx FIFO 16
  drivers/usb/common/dwc2_core.c:102-  dwc2_flush_rx_fifo() Flush Rx FIFO
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: vbus-supply: of_read_u32_index: vbus-supply: (not found)
  USB DWC2
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: companion: of_read_u32_index: companion: (not found)
  drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: disable-over-current: false
  drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: hnp-srp-disable: false
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking oscillator
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking clock-controller@ff760000
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #phy-cells: 0x0 (0)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usb-phy@320
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usb-phy@320
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usb-phy@320: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usb-phy@320: (none) (ret=-19)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/usb/host/dwc2.c:1254-      dwc2_setup_phy() dwc2_usb usb@ff580000: Failed to get USB PHY: -19.
  drivers/usb/host/dwc2.c:1332-      dwc2_usb_probe() dwc2_usb usb@ff580000: Failed to setup PHY: -19. Continuing anyway...
  drivers/usb/host/dwc2.c:1061-          dwc2_reset() dwc2_usb usb@ff580000: Can't get reset: -2
  drivers/usb/host/dwc2.c:1095-    dwc2_init_common() dwc2_usb usb@ff580000: Core Release: 3.10a
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: dr_mode: otg
  drivers/usb/common/dwc2_core.c:67-  dwc2_flush_tx_fifo() Flush Tx FIFO 16
  drivers/usb/common/dwc2_core.c:102-  dwc2_flush_rx_fifo() Flush Rx FIFO
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
CONFIG_USB_GADGET is not enabled in my config.
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: vbus-supply: of_read_u32_index: vbus-supply: (not found)
  USB DWC2
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: companion: of_read_u32_index: companion: (not found)
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,device-class: of_read_u32_index: usb,device-class: (not found)
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,interface-class: of_read_u32_index: usb,interface-class: (not found)
  drivers/core/device.c:185-  device_bind_common() Bound device usb_hub to usb@ff540000
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  drivers/core/device.c:185-  device_bind_common() Bound device usb_hub to usb_hub
  drivers/core/device.c:185-  device_bind_common() Bound device usb_mass_storage to usb_hub
  drivers/core/device.c:185-  device_bind_common() Bound device usb_mass_storage.lun0 to usb_mass_storage
long delay here
  drivers/core/device.c:185-  device_bind_common() Bound device usb_mass_storage.lun0.bootdev to usb_mass_storage
even longer delay here
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,device-class: of_read_u32_index: usb,device-class: (not found)
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,interface-class: of_read_u32_index: usb,interface-class: (not found)
  drivers/core/device.c:185-  device_bind_common() Bound device usb_hub to usb@ff580000
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  Bus usb@ff540000: 3 USB Device(s) found
  Bus usb@ff580000: 1 USB Device(s) found
         scanning usb for storage devices... 1 Storage Device(s) found

Takes 30s to complete, but it works!
IIRC, that how much it took before the commit that broke it.

Marius

> 
> Anyway if something needs fixing it is probably rockchip_usb2_phy.
> 
> Regards,
> Jonas
> 
> > 
> > Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
> > ---
> >  drivers/usb/host/dwc2.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
> > index 16f21fa9083..74d71f23d88 100644
> > --- a/drivers/usb/host/dwc2.c
> > +++ b/drivers/usb/host/dwc2.c
> > @@ -1329,7 +1329,7 @@ static int dwc2_usb_probe(struct udevice *dev)
> >  
> >  	ret = dwc2_setup_phy(dev);
> >  	if (ret)
> > -		return ret;
> > +		dev_dbg(dev, "Failed to setup PHY: %d. Continuing anyway...\n", ret);
> >  
> >  	return dwc2_init_common(dev, priv);
> >  }
> > @@ -1345,8 +1345,7 @@ static int dwc2_usb_remove(struct udevice *dev)
> >  
> >  	ret = dwc2_shutdown_phy(dev);
> >  	if (ret) {
> > -		dev_dbg(dev, "Failed to shutdown USB PHY: %d.\n", ret);
> > -		return ret;
> > +		dev_dbg(dev, "Failed to shutdown USB PHY: %d. Continuing anyway...\n", ret);
> >  	}
> >  
> >  	dwc2_uninit_common(priv->regs);
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] USB: dwc2: allow usb start even if usbphy is not found
  2026-03-16 10:04 ` Jonas Karlman
  2026-03-16 14:27   ` Marius Dinu
@ 2026-03-16 15:12   ` Marius Dinu
  2026-03-16 21:41     ` Jonas Karlman
  1 sibling, 1 reply; 7+ messages in thread
From: Marius Dinu @ 2026-03-16 15:12 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Marius Dinu, u-boot@lists.denx.de

On Mon, 2026-03-16 11.04.13 ++0100, Jonas Karlman wrote:
> Hi Marius,
> 
> On 3/16/2026 10:26 AM, Marius Dinu wrote:
> > RK3288 uses rockchip_usb2_phy, but that driver doesn't register iself
> > as a usbphy driver and "usb start" fails with this error:
> > 
> >   drivers/usb/host/dwc2.c:1254- dwc2_setup_phy() dwc2_usb usb@ff580000:
> >   Failed to get USB PHY: -19.
> > 
> > Until a proper fix is made for rockchip_usb2_phy, this patch allows
> > usb start to continue even if usbphy is not found.
> > 
> > Tested on Asus TinkerBoard.
> 
> I am not seeing this issue on my TinkerBoard, what U-Boot version are
> you testing and have you made any config changes compared to
> tinker-rk3288_defconfig?

I'm using the github master branch pulled today + lots and lots of changes
in config. I didn't make a diff, but I expect it to be very very far from
tinker-rk3288_defconfig.


> 
>   => usb start
>   starting USB...
>   USB DWC2
>   USB DWC2
>   Bus usb@ff540000: 2 USB Device(s) found
>   Bus usb@ff580000: 1 USB Device(s) found
>          scanning usb for storage devices... 0 Storage Device(s) found
> 
>   => dm tree -e usb
>    Class     Seq    Probed  Driver                Name
>   -----------------------------------------------------------
>    usb           0  [ + ]   dwc2_usb              usb@ff540000
>    usb_hub       0  [ + ]   usb_hub               `-- usb_hub
>    usb_hub       1  [ + ]   usb_hub                   `-- usb_hub
>    usb           1  [ + ]   dwc2_usb              usb@ff580000
>    usb_hub       2  [ + ]   usb_hub               `-- usb_hub
> 
> Have something changed recently that broke this?

Yes! but not exactly recently...
It broke since commit e17a4bf198510693967644c331ab621fc41ea8b5.
Here's a log on my system without my proposed fix. This is a log that I
saved while I was investigating the failed USB, about a year ago, I think.
But I checked and it still fails with today's git master, I just don't have
the time to enable all the debug options again. It's still ret -19 error.

  => usb start
  starting USB...
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking oscillator
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking clock-controller@ff760000
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: vbus-supply: of_read_u32_index: vbus-supply: (not found)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #phy-cells: 0x0 (0)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usb-phy@334
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usb-phy@334
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usb-phy@334: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usb-phy@334: (none) (ret=-19)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  Bus usb@ff500000: Port not available.
and it repeats for usb@ff540000 and usb@ff580000.

There is no usbphy or usb-phy detected/bound in log when u-boot walks the
devicetree nodes, but the device tree has "usbphy" node
compatible="rockchip,rk3288-usb-phy" with 3 sub-nodes: usb-phy@320,
usb-phy@334, usb-phy@348.
Driver with that compatible string: rockchip_usb2_phy.c.
CONFIG_ROCKCHIP_USB2_PHY is enabled, but "dm compat" lists only these:

  rockchip_usb2phy      rockchip,rk3308-usb2phy
                        rockchip,rk3328-usb2phy
                        rockchip,rk3399-usb2phy
                        rockchip,rk3528-usb2phy
                        rockchip,rk3568-usb2phy
                        rockchip,rk3576-usb2phy
                        rockchip,rk3588-usb2phy

Those compat strings come from phy-rockchip-inno-usb2.c. (I also had that
enabled while debugging.) There are no compat strings from
rockchip_usb2_phy.c.

It's because phy-rockchip-inno-usb2.c has this:

  U_BOOT_DRIVER(rockchip_usb2phy){
    .name = rockchip_usb2phy"

while rockchip_usb2_phy.c does not. So the usb driver finds no compatible
phy driver loaded and fails. Before the commit, it would load anyway.

I didn't use any AI in this investigation!

Here is a log with my patch:
  => usb start
  starting USB...
  drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: disable-over-current: false
  drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: hnp-srp-disable: false
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking oscillator
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking clock-controller@ff760000
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #phy-cells: 0x0 (0)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usb-phy@348
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usb-phy@348
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usb-phy@348: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usb-phy@348: (none) (ret=-19)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/usb/host/dwc2.c:1254-      dwc2_setup_phy() dwc2_usb usb@ff540000: Failed to get USB PHY: -19.
  drivers/usb/host/dwc2.c:1332-      dwc2_usb_probe() dwc2_usb usb@ff540000: Failed to setup PHY: -19. Continuing anyway...
  drivers/usb/host/dwc2.c:1061-          dwc2_reset() dwc2_usb usb@ff540000: Can't get reset: -2
  drivers/usb/host/dwc2.c:1095-    dwc2_init_common() dwc2_usb usb@ff540000: Core Release: 3.10a
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: dr_mode: host
  drivers/usb/common/dwc2_core.c:67-  dwc2_flush_tx_fifo() Flush Tx FIFO 16
  drivers/usb/common/dwc2_core.c:102-  dwc2_flush_rx_fifo() Flush Rx FIFO
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: vbus-supply: of_read_u32_index: vbus-supply: (not found)
  USB DWC2
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: companion: of_read_u32_index: companion: (not found)
  drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: disable-over-current: false
  drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: hnp-srp-disable: false
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for clock-controller@ff760000
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking oscillator
  drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking clock-controller@ff760000
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
  drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #phy-cells: 0x0 (0)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usb-phy@320
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usb-phy@320
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usb-phy@320: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usb-phy@320: (none) (ret=-19)
  drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usbphy
  drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
  drivers/usb/host/dwc2.c:1254-      dwc2_setup_phy() dwc2_usb usb@ff580000: Failed to get USB PHY: -19.
  drivers/usb/host/dwc2.c:1332-      dwc2_usb_probe() dwc2_usb usb@ff580000: Failed to setup PHY: -19. Continuing anyway...
  drivers/usb/host/dwc2.c:1061-          dwc2_reset() dwc2_usb usb@ff580000: Can't get reset: -2
  drivers/usb/host/dwc2.c:1095-    dwc2_init_common() dwc2_usb usb@ff580000: Core Release: 3.10a
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: dr_mode: otg
  drivers/usb/common/dwc2_core.c:67-  dwc2_flush_tx_fifo() Flush Tx FIFO 16
  drivers/usb/common/dwc2_core.c:102-  dwc2_flush_rx_fifo() Flush Rx FIFO
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
  drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
CONFIG_USB_GADGET is not enabled in my config.
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: vbus-supply: of_read_u32_index: vbus-supply: (not found)
  USB DWC2
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: companion: of_read_u32_index: companion: (not found)
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,device-class: of_read_u32_index: usb,device-class: (not found)
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,interface-class: of_read_u32_index: usb,interface-class: (not found)
  drivers/core/device.c:185-  device_bind_common() Bound device usb_hub to usb@ff540000
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  drivers/core/device.c:185-  device_bind_common() Bound device usb_hub to usb_hub
  drivers/core/device.c:185-  device_bind_common() Bound device usb_mass_storage to usb_hub
  drivers/core/device.c:185-  device_bind_common() Bound device usb_mass_storage.lun0 to usb_mass_storage
long delay here
  drivers/core/device.c:185-  device_bind_common() Bound device usb_mass_storage.lun0.bootdev to usb_mass_storage
even longer delay here
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,device-class: of_read_u32_index: usb,device-class: (not found)
  drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,interface-class: of_read_u32_index: usb,interface-class: (not found)
  drivers/core/device.c:185-  device_bind_common() Bound device usb_hub to usb@ff580000
  drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
  Bus usb@ff540000: 3 USB Device(s) found
  Bus usb@ff580000: 1 USB Device(s) found
         scanning usb for storage devices... 1 Storage Device(s) found

Takes 30s to complete, but it works!
IIRC, that how much it took before the commit that broke it.

Marius

PS: There is a duplicate of this email sent from the wrong address. Sorry.

> 
> Anyway if something needs fixing it is probably rockchip_usb2_phy.
> 
> Regards,
> Jonas
> 
> > 
> > Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
> > ---
> >  drivers/usb/host/dwc2.c | 5 ++---
> >  1 file changed, 2 insertions(+), 3 deletions(-)
> > 
> > diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
> > index 16f21fa9083..74d71f23d88 100644
> > --- a/drivers/usb/host/dwc2.c
> > +++ b/drivers/usb/host/dwc2.c
> > @@ -1329,7 +1329,7 @@ static int dwc2_usb_probe(struct udevice *dev)
> >  
> >  	ret = dwc2_setup_phy(dev);
> >  	if (ret)
> > -		return ret;
> > +		dev_dbg(dev, "Failed to setup PHY: %d. Continuing anyway...\n", ret);
> >  
> >  	return dwc2_init_common(dev, priv);
> >  }
> > @@ -1345,8 +1345,7 @@ static int dwc2_usb_remove(struct udevice *dev)
> >  
> >  	ret = dwc2_shutdown_phy(dev);
> >  	if (ret) {
> > -		dev_dbg(dev, "Failed to shutdown USB PHY: %d.\n", ret);
> > -		return ret;
> > +		dev_dbg(dev, "Failed to shutdown USB PHY: %d. Continuing anyway...\n", ret);
> >  	}
> >  
> >  	dwc2_uninit_common(priv->regs);
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] USB: dwc2: allow usb start even if usbphy is not found
  2026-03-16 15:12   ` Marius Dinu
@ 2026-03-16 21:41     ` Jonas Karlman
  2026-03-17  7:37       ` Marius Dinu
  2026-03-17  9:20       ` Marius Dinu
  0 siblings, 2 replies; 7+ messages in thread
From: Jonas Karlman @ 2026-03-16 21:41 UTC (permalink / raw)
  To: Marius Dinu; +Cc: u-boot@lists.denx.de

Hi Marius,

On 3/16/2026 4:12 PM, Marius Dinu wrote:
> On Mon, 2026-03-16 11.04.13 ++0100, Jonas Karlman wrote:
>> Hi Marius,
>>
>> On 3/16/2026 10:26 AM, Marius Dinu wrote:
>>> RK3288 uses rockchip_usb2_phy, but that driver doesn't register iself
>>> as a usbphy driver and "usb start" fails with this error:
>>>
>>>   drivers/usb/host/dwc2.c:1254- dwc2_setup_phy() dwc2_usb usb@ff580000:
>>>   Failed to get USB PHY: -19.
>>>
>>> Until a proper fix is made for rockchip_usb2_phy, this patch allows
>>> usb start to continue even if usbphy is not found.
>>>
>>> Tested on Asus TinkerBoard.
>>
>> I am not seeing this issue on my TinkerBoard, what U-Boot version are
>> you testing and have you made any config changes compared to
>> tinker-rk3288_defconfig?
> 
> I'm using the github master branch pulled today + lots and lots of changes
> in config. I didn't make a diff, but I expect it to be very very far from
> tinker-rk3288_defconfig.
> 
>>
>>   => usb start
>>   starting USB...
>>   USB DWC2
>>   USB DWC2
>>   Bus usb@ff540000: 2 USB Device(s) found
>>   Bus usb@ff580000: 1 USB Device(s) found
>>          scanning usb for storage devices... 0 Storage Device(s) found
>>
>>   => dm tree -e usb
>>    Class     Seq    Probed  Driver                Name
>>   -----------------------------------------------------------
>>    usb           0  [ + ]   dwc2_usb              usb@ff540000
>>    usb_hub       0  [ + ]   usb_hub               `-- usb_hub
>>    usb_hub       1  [ + ]   usb_hub                   `-- usb_hub
>>    usb           1  [ + ]   dwc2_usb              usb@ff580000
>>    usb_hub       2  [ + ]   usb_hub               `-- usb_hub
>>
>> Have something changed recently that broke this?
> 
> Yes! but not exactly recently...
> It broke since commit e17a4bf198510693967644c331ab621fc41ea8b5.
> Here's a log on my system without my proposed fix. This is a log that I
> saved while I was investigating the failed USB, about a year ago, I think.
> But I checked and it still fails with today's git master, I just don't have
> the time to enable all the debug options again. It's still ret -19 error.

I did a new runtime test on a Tinker Board R2.0 using master with
tinker-rk3288_defconfig and I am not able to reproduce any issue. Maybe
your config changes introduce a condition that causes an issue? Please
share your savedefconfig.

> 
>   => usb start
>   starting USB...
>   drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
>   drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
>   drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
>   drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for clock-controller@ff760000
>   drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for clock-controller@ff760000
>   drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking oscillator
>   drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking clock-controller@ff760000
>   drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
>   drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
>   drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: vbus-supply: of_read_u32_index: vbus-supply: (not found)
>   drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #phy-cells: 0x0 (0)
>   drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usb-phy@334
>   drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usb-phy@334
>   drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usb-phy@334: (none) (ret=-19)
>   drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usb-phy@334: (none) (ret=-19)
>   drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usbphy
>   drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usbphy
>   drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
>   drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
>   Bus usb@ff500000: Port not available.
> and it repeats for usb@ff540000 and usb@ff580000.
> 
> There is no usbphy or usb-phy detected/bound in log when u-boot walks the
> devicetree nodes, but the device tree has "usbphy" node
> compatible="rockchip,rk3288-usb-phy" with 3 sub-nodes: usb-phy@320,
> usb-phy@334, usb-phy@348.
> Driver with that compatible string: rockchip_usb2_phy.c.
> CONFIG_ROCKCHIP_USB2_PHY is enabled, but "dm compat" lists only these:
> 
>   rockchip_usb2phy      rockchip,rk3308-usb2phy
>                         rockchip,rk3328-usb2phy
>                         rockchip,rk3399-usb2phy
>                         rockchip,rk3528-usb2phy
>                         rockchip,rk3568-usb2phy
>                         rockchip,rk3576-usb2phy
>                         rockchip,rk3588-usb2phy
> 
> Those compat strings come from phy-rockchip-inno-usb2.c. (I also had that
> enabled while debugging.) There are no compat strings from
> rockchip_usb2_phy.c.
> 
> It's because phy-rockchip-inno-usb2.c has this:
> 
>   U_BOOT_DRIVER(rockchip_usb2phy){
>     .name = rockchip_usb2phy"
> 
> while rockchip_usb2_phy.c does not. So the usb driver finds no compatible
> phy driver loaded and fails. Before the commit, it would load anyway.
> 
> I didn't use any AI in this investigation!
> 
> Here is a log with my patch:
>   => usb start
>   starting USB...
>   drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: disable-over-current: false
>   drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: hnp-srp-disable: false
>   drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
>   drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
>   drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
>   drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for clock-controller@ff760000
>   drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for clock-controller@ff760000
>   drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking oscillator
>   drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking clock-controller@ff760000
>   drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
>   drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
>   drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #phy-cells: 0x0 (0)
>   drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usb-phy@348
>   drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usb-phy@348
>   drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usb-phy@348: (none) (ret=-19)
>   drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usb-phy@348: (none) (ret=-19)
>   drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usbphy
>   drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usbphy
>   drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
>   drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
>   drivers/usb/host/dwc2.c:1254-      dwc2_setup_phy() dwc2_usb usb@ff540000: Failed to get USB PHY: -19.
>   drivers/usb/host/dwc2.c:1332-      dwc2_usb_probe() dwc2_usb usb@ff540000: Failed to setup PHY: -19. Continuing anyway...
>   drivers/usb/host/dwc2.c:1061-          dwc2_reset() dwc2_usb usb@ff540000: Can't get reset: -2
>   drivers/usb/host/dwc2.c:1095-    dwc2_init_common() dwc2_usb usb@ff540000: Core Release: 3.10a
>   drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: dr_mode: host
>   drivers/usb/common/dwc2_core.c:67-  dwc2_flush_tx_fifo() Flush Tx FIFO 16
>   drivers/usb/common/dwc2_core.c:102-  dwc2_flush_rx_fifo() Flush Rx FIFO
>   drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: vbus-supply: of_read_u32_index: vbus-supply: (not found)
>   USB DWC2
>   drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: companion: of_read_u32_index: companion: (not found)
>   drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: disable-over-current: false
>   drivers/core/ofnode.c:525-    ofnode_read_bool() ofnode_read_bool: hnp-srp-disable: false
>   drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
>   drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
>   drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #clock-cells: 0x1 (1)
>   drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for clock-controller@ff760000
>   drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for clock-controller@ff760000
>   drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking oscillator
>   drivers/core/uclass.c:406-uclass_find_device_by_ofnode()       - checking clock-controller@ff760000
>   drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
>   drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for clock-controller@ff760000: clock-controller@ff760000 (ret=0)
>   drivers/core/of_access.c:556-   of_read_u32_index() of_read_u32_index: #phy-cells: 0x0 (0)
>   drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usb-phy@320
>   drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usb-phy@320
>   drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usb-phy@320: (none) (ret=-19)
>   drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usb-phy@320: (none) (ret=-19)
>   drivers/core/uclass.c:546-uclass_get_device_by_ofnode() Looking for usbphy
>   drivers/core/uclass.c:397-uclass_find_device_by_ofnode() Looking for usbphy
>   drivers/core/uclass.c:416-uclass_find_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
>   drivers/core/uclass.c:549-uclass_get_device_by_ofnode()    - result for usbphy: (none) (ret=-19)
>   drivers/usb/host/dwc2.c:1254-      dwc2_setup_phy() dwc2_usb usb@ff580000: Failed to get USB PHY: -19.
>   drivers/usb/host/dwc2.c:1332-      dwc2_usb_probe() dwc2_usb usb@ff580000: Failed to setup PHY: -19. Continuing anyway...
>   drivers/usb/host/dwc2.c:1061-          dwc2_reset() dwc2_usb usb@ff580000: Can't get reset: -2
>   drivers/usb/host/dwc2.c:1095-    dwc2_init_common() dwc2_usb usb@ff580000: Core Release: 3.10a
>   drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: dr_mode: otg
>   drivers/usb/common/dwc2_core.c:67-  dwc2_flush_tx_fifo() Flush Tx FIFO 16
>   drivers/usb/common/dwc2_core.c:102-  dwc2_flush_rx_fifo() Flush Rx FIFO
>   drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
>   drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
>   drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
>   drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
>   drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
>   drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
>   drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
>   drivers/usb/host/dwc2.c:230-dwc_otg_core_host_init() dwc2_usb usb@ff580000: dwc_otg_core_host_init: Timeout!
> CONFIG_USB_GADGET is not enabled in my config.
>   drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: vbus-supply: of_read_u32_index: vbus-supply: (not found)
>   USB DWC2
>   drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: companion: of_read_u32_index: companion: (not found)
>   drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,device-class: of_read_u32_index: usb,device-class: (not found)
>   drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,interface-class: of_read_u32_index: usb,interface-class: (not found)
>   drivers/core/device.c:185-  device_bind_common() Bound device usb_hub to usb@ff540000
>   drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
>   drivers/core/device.c:185-  device_bind_common() Bound device usb_hub to usb_hub
>   drivers/core/device.c:185-  device_bind_common() Bound device usb_mass_storage to usb_hub
>   drivers/core/device.c:185-  device_bind_common() Bound device usb_mass_storage.lun0 to usb_mass_storage
> long delay here
>   drivers/core/device.c:185-  device_bind_common() Bound device usb_mass_storage.lun0.bootdev to usb_mass_storage
> even longer delay here
>   drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,device-class: of_read_u32_index: usb,device-class: (not found)
>   drivers/core/ofnode.c:417-ofnode_read_u32_index() ofnode_read_u32_index: usb,interface-class: of_read_u32_index: usb,interface-class: (not found)
>   drivers/core/device.c:185-  device_bind_common() Bound device usb_hub to usb@ff580000
>   drivers/core/ofnode.c:540-    ofnode_read_prop() ofnode_read_prop: assigned-clock-rates: <not found>
>   Bus usb@ff540000: 3 USB Device(s) found
>   Bus usb@ff580000: 1 USB Device(s) found
>          scanning usb for storage devices... 1 Storage Device(s) found
> 
> Takes 30s to complete, but it works!
> IIRC, that how much it took before the commit that broke it.

I have re-run some tests with different Kconfig options related to
GADGET and DWC2 and are not able to reproduce your issue.

As mentioned above, please share your config changes compared to tinker
defconfig, maybe you have some Kconfig option enabled that make DWC2
work differently?


  U-Boot SPL 2026.04-rc4-00007-g010855c5005e (Mar 16 2026 - 21:33:53 +0000)
  Trying to boot from RAM
  ## Checking hash(es) for config conf-1 ... OK
  ## Checking hash(es) for Image firmware-1 ... crc32+ OK
  ## Checking hash(es) for Image fdt-1 ... crc32+ OK
  spl_perform_arch_fixups: could not map BootROM boot device to ofpath
  
  
  U-Boot 2026.04-rc4-00007-g010855c5005e (Mar 16 2026 - 21:33:53 +0000)
  
  SoC: Rockchip rk3288
  Reset cause: POR
  Model: Rockchip RK3288 Asus Tinker Board
  DRAM:  2 GiB
  PMIC:  RK808
  Core:  221 devices, 27 uclasses, devicetree: separate
  MMC:   mmc@ff0c0000: 1, mmc@ff0d0000: 2
  Loading Environment from MMC... Card did not respond to voltage select! : -110
  *** Warning - No block device, using default environment
  
  In:    serial,usbkbd
  Out:   serial,vidconsole
  Err:   serial,vidconsole
  Net:   eth0: ethernet@ff290000
  
  Hit any key to stop autoboot: 0
  => usb start
  starting USB...
  USB DWC2
  USB DWC2
  Bus usb@ff540000: 2 USB Device(s) found
  Bus usb@ff580000: 1 USB Device(s) found
         scanning usb for storage devices... 0 Storage Device(s) found
  => usb tree
  USB device tree:
    1  Hub (480 Mb/s, 0mA)
    |   U-Boot Root Hub
    |
    +-2  Hub (480 Mb/s, 100mA)
          USB2.0 Hub
  
    1  Hub (480 Mb/s, 0mA)
        U-Boot Root Hub
  
  => dm tree -e usb
   Class     Seq    Probed  Driver                Name
  -----------------------------------------------------------
   usb           0  [ + ]   dwc2_usb              usb@ff540000
   usb_hub       0  [ + ]   usb_hub               `-- usb_hub
   usb_hub       1  [ + ]   usb_hub                   `-- usb_hub
   usb           1  [ + ]   dwc2_usb              usb@ff580000
   usb_hub       2  [ + ]   usb_hub               `-- usb_hub
   pinconfig   130  [   ]   pinconfig             usb
   pinconfig   131  [   ]   pinconfig             |-- host-vbus-drv
   pinconfig   132  [   ]   pinconfig             `-- pwr-3g
  =>

Regards,
Jonas

> 
> Marius
> 
> PS: There is a duplicate of this email sent from the wrong address. Sorry.
> 
>>
>> Anyway if something needs fixing it is probably rockchip_usb2_phy.
>>
>> Regards,
>> Jonas
>>
>>>
>>> Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
>>> ---
>>>  drivers/usb/host/dwc2.c | 5 ++---
>>>  1 file changed, 2 insertions(+), 3 deletions(-)
>>>
>>> diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
>>> index 16f21fa9083..74d71f23d88 100644
>>> --- a/drivers/usb/host/dwc2.c
>>> +++ b/drivers/usb/host/dwc2.c
>>> @@ -1329,7 +1329,7 @@ static int dwc2_usb_probe(struct udevice *dev)
>>>  
>>>  	ret = dwc2_setup_phy(dev);
>>>  	if (ret)
>>> -		return ret;
>>> +		dev_dbg(dev, "Failed to setup PHY: %d. Continuing anyway...\n", ret);
>>>  
>>>  	return dwc2_init_common(dev, priv);
>>>  }
>>> @@ -1345,8 +1345,7 @@ static int dwc2_usb_remove(struct udevice *dev)
>>>  
>>>  	ret = dwc2_shutdown_phy(dev);
>>>  	if (ret) {
>>> -		dev_dbg(dev, "Failed to shutdown USB PHY: %d.\n", ret);
>>> -		return ret;
>>> +		dev_dbg(dev, "Failed to shutdown USB PHY: %d. Continuing anyway...\n", ret);
>>>  	}
>>>  
>>>  	dwc2_uninit_common(priv->regs);
>>
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] USB: dwc2: allow usb start even if usbphy is not found
  2026-03-16 21:41     ` Jonas Karlman
@ 2026-03-17  7:37       ` Marius Dinu
  2026-03-17  9:20       ` Marius Dinu
  1 sibling, 0 replies; 7+ messages in thread
From: Marius Dinu @ 2026-03-17  7:37 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Marius Dinu, u-boot@lists.denx.de

On Mon, 2026-03-16 22.41.08 ++0100, Jonas Karlman wrote:
> I did a new runtime test on a Tinker Board R2.0 using master with
> tinker-rk3288_defconfig and I am not able to reproduce any issue. Maybe
> your config changes introduce a condition that causes an issue? Please
> share your savedefconfig.
> 
>
> I have re-run some tests with different Kconfig options related to
> GADGET and DWC2 and are not able to reproduce your issue.
> 
> As mentioned above, please share your config changes compared to tinker
> defconfig, maybe you have some Kconfig option enabled that make DWC2
> work differently?
> 
> 
>   U-Boot SPL 2026.04-rc4-00007-g010855c5005e (Mar 16 2026 - 21:33:53 +0000)
>   Trying to boot from RAM
>   ## Checking hash(es) for config conf-1 ... OK
>   ## Checking hash(es) for Image firmware-1 ... crc32+ OK
>   ## Checking hash(es) for Image fdt-1 ... crc32+ OK
>   spl_perform_arch_fixups: could not map BootROM boot device to ofpath
>   
>   
>   U-Boot 2026.04-rc4-00007-g010855c5005e (Mar 16 2026 - 21:33:53 +0000)
>   
>   SoC: Rockchip rk3288
>   Reset cause: POR
>   Model: Rockchip RK3288 Asus Tinker Board
>   DRAM:  2 GiB
>   PMIC:  RK808
>   Core:  221 devices, 27 uclasses, devicetree: separate
>   MMC:   mmc@ff0c0000: 1, mmc@ff0d0000: 2
>   Loading Environment from MMC... Card did not respond to voltage select! : -110
>   *** Warning - No block device, using default environment
>   
>   In:    serial,usbkbd
>   Out:   serial,vidconsole
>   Err:   serial,vidconsole
>   Net:   eth0: ethernet@ff290000
>   
>   Hit any key to stop autoboot: 0
>   => usb start
>   starting USB...
>   USB DWC2
>   USB DWC2
>   Bus usb@ff540000: 2 USB Device(s) found
>   Bus usb@ff580000: 1 USB Device(s) found
>          scanning usb for storage devices... 0 Storage Device(s) found
>   => usb tree
>   USB device tree:
>     1  Hub (480 Mb/s, 0mA)
>     |   U-Boot Root Hub
>     |
>     +-2  Hub (480 Mb/s, 100mA)
>           USB2.0 Hub
>   
>     1  Hub (480 Mb/s, 0mA)
>         U-Boot Root Hub
>   
>   => dm tree -e usb
>    Class     Seq    Probed  Driver                Name
>   -----------------------------------------------------------
>    usb           0  [ + ]   dwc2_usb              usb@ff540000
>    usb_hub       0  [ + ]   usb_hub               `-- usb_hub
>    usb_hub       1  [ + ]   usb_hub                   `-- usb_hub
>    usb           1  [ + ]   dwc2_usb              usb@ff580000
>    usb_hub       2  [ + ]   usb_hub               `-- usb_hub
>    pinconfig   130  [   ]   pinconfig             usb
>    pinconfig   131  [   ]   pinconfig             |-- host-vbus-drv
>    pinconfig   132  [   ]   pinconfig             `-- pwr-3g
>   =>
> 
> Regards,
> Jonas

That's strage and unexpected... I'll try to start again from defconfig.

My current config:

CONFIG_ARM=y
CONFIG_SPL_SKIP_LOWLEVEL_INIT_ONLY=y
CONFIG_TPL_SKIP_LOWLEVEL_INIT_ONLY=y
CONFIG_DRIVER_GICV2=y
CONFIG_ARCH_CPU_INIT=y
CONFIG_SYS_ARCH_TIMER=y
CONFIG_ARCH_ROCKCHIP=y
CONFIG_TEXT_BASE=0x01000000
CONFIG_SYS_MALLOC_F_LEN=0x4000
CONFIG_SPL_GPIO=y
CONFIG_NR_DRAM_BANKS=1
CONFIG_CUSTOM_SYS_INIT_SP_ADDR=0x100000
CONFIG_ENV_SIZE=0x4000
# CONFIG_SPL_DM_SPI is not set
CONFIG_DEFAULT_DEVICE_TREE="rockchip/rk3288-tinker-s"
CONFIG_OF_LIBFDT_OVERLAY=y
CONFIG_DM_RESET=y
CONFIG_SYS_MONITOR_LEN=614400
CONFIG_ROCKCHIP_RK3288=y
CONFIG_ROCKCHIP_SPL_RESERVE_IRAM=0
# CONFIG_ROCKCHIP_DISABLE_FORCE_JTAG is not set
CONFIG_TPL_LDSCRIPT="arch/arm/mach-rockchip/u-boot-tpl.lds"
CONFIG_TPL_SYS_MALLOC_F_LEN=0x4000
CONFIG_TARGET_TINKER_RK3288=y
# CONFIG_SPL_DRIVERS_MISC is not set
CONFIG_BOOTCOUNT_BOOTLIMIT=3
CONFIG_SPL_TEXT_BASE=0x0
CONFIG_SYS_BOOTM_LEN=0x4000000
CONFIG_SYS_LOAD_ADDR=0x800800
CONFIG_WATCHDOG_TIMEOUT_MSECS=120000
CONFIG_SPL_SIZE_LIMIT=0x4b000
CONFIG_SPL_SIZE_LIMIT_PROVIDE_STACK=0
CONFIG_PRE_CON_BUF_SZ=65536
CONFIG_DEBUG_UART_BASE=0xff690000
CONFIG_DEBUG_UART_CLOCK=24000000
CONFIG_IDENT_STRING="-M95D"
CONFIG_DEBUG_UART=y
CONFIG_LOCALVERSION="-M95D"
CONFIG_CC_OPTIMIZE_FOR_SPEED=y
CONFIG_HAS_BOARD_SIZE_LIMIT=y
CONFIG_BOARD_SIZE_LIMIT=12582912
CONFIG_DYNAMIC_SYS_CLK_FREQ=y
# CONFIG_EFI_LOADER is not set
CONFIG_TIMESTAMP=y
# CONFIG_BOOTSTD_DEFAULTS is not set
# CONFIG_BOOTSTD_BOOTCOMMAND is not set
# CONFIG_TPL_BOOTMETH_VBE is not set
CONFIG_BOOTDELAY=3
CONFIG_OF_ENV_SETUP=y
# CONFIG_ARCH_FIXUP_FDT_MEMORY is not set
CONFIG_USE_BOOTARGS=y
CONFIG_BOOTARGS="earlyprintk console=ttyS2,115200 rootwait root=PARTUUID=3c6300ea-04"
CONFIG_BOOTARGS_SUBST=y
CONFIG_USE_BOOTCOMMAND=y
CONFIG_BOOTCOMMAND="sysboot mmc 1:3 any 0x02000000 /extlinux/extlinux.conf"
CONFIG_USE_PREBOOT=y
CONFIG_PREBOOT=""
CONFIG_DEFAULT_FDT_FILE="rk3288-tinker-s.dtb"
CONFIG_LOGLEVEL=6
CONFIG_CONSOLE_FLUSH_ON_NEWLINE=y
# CONFIG_SYS_DEVICE_NULLDEV is not set
CONFIG_LOGF_FILE=y
CONFIG_LOGF_LINE=y
CONFIG_LOGF_FUNC=y
CONFIG_DISPLAY_BOARDINFO_LATE=y
CONFIG_MISC_INIT_R=y
CONFIG_SPL_NO_BSS_LIMIT=y
CONFIG_SPL_SHOW_ERRORS=y
# CONFIG_SPL_BINMAN_SYMBOLS is not set
CONFIG_SPL_I2C=y
# CONFIG_SYS_MMCSD_FS_BOOT is not set
CONFIG_SPL_POWER=y
# CONFIG_TPL_BINMAN_SYMBOLS is not set
# CONFIG_TPL_SYS_MALLOC_SIMPLE is not set
# CONFIG_TPL_DRIVERS_MISC is not set
CONFIG_HUSH_PARSER=y
CONFIG_SYS_MAXARGS=16
CONFIG_CMD_BDINFO_EXTRA=y
CONFIG_CMD_CONFIG=y
CONFIG_CMD_UFETCH=y
CONFIG_CMD_HISTORY=y
# CONFIG_CMD_HISTORY_USE_CALLOC is not set
CONFIG_CMD_BOOTDEV=y
CONFIG_CMD_BOOTMETH=y
CONFIG_CMD_BOOTSTD=y
CONFIG_CMD_BOOTZ=y
# CONFIG_BOOTM_NETBSD is not set
# CONFIG_BOOTM_PLAN9 is not set
# CONFIG_BOOTM_RTEMS is not set
# CONFIG_BOOTM_VXWORKS is not set
CONFIG_CMD_BOOTMENU=y
CONFIG_CMD_ADTIMG=y
# CONFIG_CMD_ELF is not set
# CONFIG_CMD_GO is not set
# CONFIG_CMD_XIMG is not set
CONFIG_CMD_ASKENV=y
CONFIG_CMD_GREPENV=y
CONFIG_CMD_ERASEENV=y
CONFIG_CMD_ENV_FLAGS=y
CONFIG_CMD_NVEDIT_INDIRECT=y
CONFIG_CMD_NVEDIT_INFO=y
CONFIG_CMD_NVEDIT_LOAD=y
CONFIG_CRC32_VERIFY=y
CONFIG_CMD_EEPROM=y
CONFIG_CMD_EEPROM_LAYOUT=y
CONFIG_SYS_I2C_EEPROM_BUS=2
CONFIG_CMD_MEMINFO=y
CONFIG_CMD_MEMINFO_MAP=y
# CONFIG_CMD_RANDOM is not set
CONFIG_CMD_CLK=y
CONFIG_CMD_GPIO=y
CONFIG_CMD_GPIO_READ=y
CONFIG_CMD_I2C=y
# CONFIG_CMD_LOADB is not set
# CONFIG_CMD_LOADS is not set
CONFIG_CMD_LSBLK=y
CONFIG_CMD_MISC=y
CONFIG_CMD_MMC=y
CONFIG_MMC_SPEED_MODE_SET=y
CONFIG_CMD_PART=y
# CONFIG_CMD_PINMUX is not set
CONFIG_CMD_POWEROFF=y
CONFIG_CMD_SDRAM=y
CONFIG_CMD_USB=y
CONFIG_CMD_WDT=y
CONFIG_CMD_CAT=y
# CONFIG_CMD_SETEXPR is not set
CONFIG_BOOTP_MAY_FAIL=y
# CONFIG_BOOTP_DNS is not set
# CONFIG_BOOTP_GATEWAY is not set
# CONFIG_BOOTP_HOSTNAME is not set
# CONFIG_BOOTP_PXE_DHCP_OPTION is not set
CONFIG_CMD_TFTPPUT=y
CONFIG_CMD_TFTPSRV=y
CONFIG_CMD_NFS=y
CONFIG_CMD_DHCP=y
CONFIG_CMD_PING=y
CONFIG_CMD_PXE=y
CONFIG_CMD_BOOTCOUNT=y
# CONFIG_CMD_BLOCK_CACHE is not set
CONFIG_CMD_TIMER=y
CONFIG_CMD_SYSBOOT=y
CONFIG_CMD_PMIC=y
CONFIG_CMD_REGULATOR=y
CONFIG_CMD_EXT2=y
CONFIG_CMD_EXT4=y
CONFIG_CMD_EXT4_WRITE=y
CONFIG_CMD_FAT=y
CONFIG_CMD_FS_GENERIC=y
# CONFIG_CMD_CYCLIC is not set
CONFIG_CMD_LOG=y
# CONFIG_SPL_DOS_PARTITION is not set
CONFIG_SPL_OF_CONTROL=y
CONFIG_OF_LIVE=y
CONFIG_OF_UPSTREAM=y
CONFIG_OF_SPL_REMOVE_PROPS="clock-names interrupt-parent assigned-clocks assigned-clock-rates assigned-clock-parents"
CONFIG_OF_DTB_PROPS_REMOVE=y
CONFIG_ENV_OVERWRITE=y
CONFIG_ENV_IS_IN_EXT4=y
CONFIG_ENV_EXT4_INTERFACE="mmc"
CONFIG_ENV_EXT4_DEVICE_AND_PART=":3"
CONFIG_ENV_MMC_DEVICE_INDEX=1
CONFIG_USE_HOSTNAME=y
CONFIG_HOSTNAME="TkB"
CONFIG_NET_RETRY_COUNT=3
CONFIG_TFTP_TSIZE=y
CONFIG_UDP_CHECKSUM=y
CONFIG_BOOTP_SERVERIP=y
CONFIG_USE_IPADDR=y
CONFIG_IPADDR="172.27.143.5"
CONFIG_USE_NETMASK=y
CONFIG_NETMASK="255.255.255.0"
CONFIG_NET_RANDOM_ETHADDR=y
CONFIG_SYS_RX_ETH_BUFFER=8
CONFIG_REGMAP=y
CONFIG_SPL_REGMAP=y
CONFIG_SYSCON=y
CONFIG_SPL_SYSCON=y
# CONFIG_SIMPLE_BUS is not set
# CONFIG_SPL_SIMPLE_BUS is not set
# CONFIG_OF_TRANSLATE is not set
# CONFIG_ADC is not set
CONFIG_BOOTCOUNT_LIMIT=y
CONFIG_BOOTCOUNT_ENV=y
CONFIG_BOOTCOUNT_ALTBOOTCMD="ext2load mmc 1:3 $kernel_addr_r vmlinuz.failsafe; ext2load mmc 1:3 $fdt_addr_r $fdtfile.failsafe; bootz $kernel_addr_r - $fdt_addr_r"
CONFIG_SYS_BOOTCOUNT_MAGIC=0xB007C047
CONFIG_BUTTON=y
CONFIG_BUTTON_GPIO=y
CONFIG_CLK=y
CONFIG_SPL_CLK=y
CONFIG_EXTCON=y
CONFIG_ROCKCHIP_GPIO=y
CONFIG_SYS_I2C_ROCKCHIP=y
CONFIG_LED=y
CONFIG_LED_BOOT=y
CONFIG_LED_ACTIVITY=y
CONFIG_LED_SW_BLINK=y
CONFIG_LED_GPIO=y
CONFIG_MEMORY=y
CONFIG_MISC=y
# CONFIG_SPL_MISC is not set
# CONFIG_TPL_MISC is not set
CONFIG_ROCKCHIP_EFUSE=y
CONFIG_PWRSEQ=y
CONFIG_I2C_EEPROM=y
CONFIG_MMC_PWRSEQ=y
CONFIG_MMC_BROKEN_CD=y
CONFIG_SUPPORT_EMMC_BOOT=y
CONFIG_MMC_IO_VOLTAGE=y
CONFIG_MMC_UHS_SUPPORT=y
CONFIG_MMC_HS400_ES_SUPPORT=y
CONFIG_MMC_HS400_SUPPORT=y
CONFIG_MMC_DW=y
CONFIG_MMC_DW_ROCKCHIP=y
# CONFIG_MTD is not set
CONFIG_PHY_GIGE=y
CONFIG_ETH_DESIGNWARE=y
CONFIG_GMAC_ROCKCHIP=y
CONFIG_PHY_ROCKCHIP_INNO_DSIDPHY=y
CONFIG_PHY_ROCKCHIP_INNO_HDMI=y
CONFIG_PINCTRL=y
# CONFIG_PINMUX is not set
CONFIG_PINCONF=y
CONFIG_SPL_PINCTRL=y
# CONFIG_SPL_PINCTRL_FULL is not set
CONFIG_DM_PMIC=y
CONFIG_PMIC_RK8XX=y
CONFIG_SPL_PMIC_RK8XX=y
CONFIG_SPL_DM_REGULATOR=y
CONFIG_DM_REGULATOR_FIXED=y
CONFIG_SPL_DM_REGULATOR_FIXED=y
CONFIG_REGULATOR_RK8XX=y
# CONFIG_DM_PWM is not set
CONFIG_RAM=y
CONFIG_SPL_RAM=y
# CONFIG_RAM_ROCKCHIP_DEBUG is not set
CONFIG_SERIAL_PUTS=y
CONFIG_DEBUG_UART_SHIFT=2
CONFIG_DEBUG_UART_ANNOUNCE=y
CONFIG_SYS_NS16550_MEM32=y
# CONFIG_SPI is not set
CONFIG_SYSRESET=y
CONFIG_USB=y
# CONFIG_SPL_DM_USB is not set
CONFIG_USB_DWC2=y
CONFIG_ROCKCHIP_USB2_PHY=y
CONFIG_USB_STORAGE=y
CONFIG_USB_KEYBOARD=y
CONFIG_USB_KEYBOARD_FN_KEYS=y
CONFIG_VIDEO=y
CONFIG_VIDEO_PCI_DEFAULT_FB_SIZE=0x1FA4000
CONFIG_VIDEO_COPY=y
CONFIG_VIDEO_ANSI=y
CONFIG_I2C_EDID_STANDARD=y
CONFIG_DISPLAY=y
CONFIG_VIDEO_ROCKCHIP=y
CONFIG_DISPLAY_ROCKCHIP_LVDS=y
CONFIG_DISPLAY_ROCKCHIP_HDMI=y
CONFIG_DISPLAY_ROCKCHIP_MIPI=y
CONFIG_DISPLAY_ROCKCHIP_DW_MIPI=y
CONFIG_VIDEO_BRIDGE=y
CONFIG_VIDEO_BRIDGE_LVDS_CODEC=y
CONFIG_CONSOLE_SCROLL_LINES=8
CONFIG_DESIGNWARE_WATCHDOG=y
CONFIG_WDT=y
CONFIG_FAT_RENAME=y
# CONFIG_BINMAN_FDT is not set
CONFIG_CC_OPTIMIZE_LIBS_FOR_SPEED=y
# CONFIG_REGEX is not set
# CONFIG_SPL_SHA1 is not set
CONFIG_ERRNO_STR=y
CONFIG_OF_LIBFDT_ASSUME_MASK=0
# CONFIG_TPL_OF_LIBFDT is not set
# CONFIG_TOOLS_LIBCRYPTO is not set
# CONFIG_TOOLS_KWBIMAGE is not set

Marius


^ permalink raw reply	[flat|nested] 7+ messages in thread

* Re: [PATCH] USB: dwc2: allow usb start even if usbphy is not found
  2026-03-16 21:41     ` Jonas Karlman
  2026-03-17  7:37       ` Marius Dinu
@ 2026-03-17  9:20       ` Marius Dinu
  1 sibling, 0 replies; 7+ messages in thread
From: Marius Dinu @ 2026-03-17  9:20 UTC (permalink / raw)
  To: Jonas Karlman; +Cc: Marius Dinu, u-boot@lists.denx.de

On Mon, 2026-03-16 22.41.08 ++0100, Jonas Karlman wrote:
> Hi Marius,
> 
> On 3/16/2026 4:12 PM, Marius Dinu wrote:
> > On Mon, 2026-03-16 11.04.13 ++0100, Jonas Karlman wrote:
> >> Hi Marius,
> >>
> >> On 3/16/2026 10:26 AM, Marius Dinu wrote:
> >>> RK3288 uses rockchip_usb2_phy, but that driver doesn't register iself
> >>> as a usbphy driver and "usb start" fails with this error:
> >>>
> >>>   drivers/usb/host/dwc2.c:1254- dwc2_setup_phy() dwc2_usb usb@ff580000:
> >>>   Failed to get USB PHY: -19.
> >>>
> >>> Until a proper fix is made for rockchip_usb2_phy, this patch allows
> >>> usb start to continue even if usbphy is not found.
> >>>
> >>> Tested on Asus TinkerBoard.
> >>
> >> I am not seeing this issue on my TinkerBoard, what U-Boot version are
> >> you testing and have you made any config changes compared to
> >> tinker-rk3288_defconfig?
> > 
> > I'm using the github master branch pulled today + lots and lots of changes
> > in config. I didn't make a diff, but I expect it to be very very far from
> > tinker-rk3288_defconfig.
> > 
> >>
> >>   => usb start
> >>   starting USB...
> >>   USB DWC2
> >>   USB DWC2
> >>   Bus usb@ff540000: 2 USB Device(s) found
> >>   Bus usb@ff580000: 1 USB Device(s) found
> >>          scanning usb for storage devices... 0 Storage Device(s) found
> >>
> >>   => dm tree -e usb
> >>    Class     Seq    Probed  Driver                Name
> >>   -----------------------------------------------------------
> >>    usb           0  [ + ]   dwc2_usb              usb@ff540000
> >>    usb_hub       0  [ + ]   usb_hub               `-- usb_hub
> >>    usb_hub       1  [ + ]   usb_hub                   `-- usb_hub
> >>    usb           1  [ + ]   dwc2_usb              usb@ff580000
> >>    usb_hub       2  [ + ]   usb_hub               `-- usb_hub
> >>
> >> Have something changed recently that broke this?
> > 
> > Yes! but not exactly recently...
> > It broke since commit e17a4bf198510693967644c331ab621fc41ea8b5.
> > Here's a log on my system without my proposed fix. This is a log that I
> > saved while I was investigating the failed USB, about a year ago, I think.
> > But I checked and it still fails with today's git master, I just don't have
> > the time to enable all the debug options again. It's still ret -19 error.
> 
> I did a new runtime test on a Tinker Board R2.0 using master with
> tinker-rk3288_defconfig and I am not able to reproduce any issue. Maybe
> your config changes introduce a condition that causes an issue? Please
> share your savedefconfig.
> 
>
>
> I have re-run some tests with different Kconfig options related to
> GADGET and DWC2 and are not able to reproduce your issue.
> 
> As mentioned above, please share your config changes compared to tinker
> defconfig, maybe you have some Kconfig option enabled that make DWC2
> work differently?
> 
> 
>   U-Boot SPL 2026.04-rc4-00007-g010855c5005e (Mar 16 2026 - 21:33:53 +0000)
>   Trying to boot from RAM
>   ## Checking hash(es) for config conf-1 ... OK
>   ## Checking hash(es) for Image firmware-1 ... crc32+ OK
>   ## Checking hash(es) for Image fdt-1 ... crc32+ OK
>   spl_perform_arch_fixups: could not map BootROM boot device to ofpath
>   
>   
>   U-Boot 2026.04-rc4-00007-g010855c5005e (Mar 16 2026 - 21:33:53 +0000)
>   
>   SoC: Rockchip rk3288
>   Reset cause: POR
>   Model: Rockchip RK3288 Asus Tinker Board
>   DRAM:  2 GiB
>   PMIC:  RK808
>   Core:  221 devices, 27 uclasses, devicetree: separate
>   MMC:   mmc@ff0c0000: 1, mmc@ff0d0000: 2
>   Loading Environment from MMC... Card did not respond to voltage select! : -110
>   *** Warning - No block device, using default environment
>   
>   In:    serial,usbkbd
>   Out:   serial,vidconsole
>   Err:   serial,vidconsole
>   Net:   eth0: ethernet@ff290000
>   
>   Hit any key to stop autoboot: 0
>   => usb start
>   starting USB...
>   USB DWC2
>   USB DWC2
>   Bus usb@ff540000: 2 USB Device(s) found
>   Bus usb@ff580000: 1 USB Device(s) found
>          scanning usb for storage devices... 0 Storage Device(s) found
>   => usb tree
>   USB device tree:
>     1  Hub (480 Mb/s, 0mA)
>     |   U-Boot Root Hub
>     |
>     +-2  Hub (480 Mb/s, 100mA)
>           USB2.0 Hub
>   
>     1  Hub (480 Mb/s, 0mA)
>         U-Boot Root Hub
>   
>   => dm tree -e usb
>    Class     Seq    Probed  Driver                Name
>   -----------------------------------------------------------
>    usb           0  [ + ]   dwc2_usb              usb@ff540000
>    usb_hub       0  [ + ]   usb_hub               `-- usb_hub
>    usb_hub       1  [ + ]   usb_hub                   `-- usb_hub
>    usb           1  [ + ]   dwc2_usb              usb@ff580000
>    usb_hub       2  [ + ]   usb_hub               `-- usb_hub
>    pinconfig   130  [   ]   pinconfig             usb
>    pinconfig   131  [   ]   pinconfig             |-- host-vbus-drv
>    pinconfig   132  [   ]   pinconfig             `-- pwr-3g
>   =>
> 
> Regards,
> Jonas

I tested the tinkerboard defconfig. It does work. As far as I can tell, it
doesn't try to load the phy driver at all. The only significant difference
is that I didn't enable OTG/gadget in my config - it's just the usb-host
driver.

So the bug is still there, it's just that the OTG driver doesn't search for
a phy driver.

Marius


> 
> > 
> > Marius
> > 
> > PS: There is a duplicate of this email sent from the wrong address. Sorry.
> > 
> >>
> >> Anyway if something needs fixing it is probably rockchip_usb2_phy.
> >>
> >> Regards,
> >> Jonas
> >>
> >>>
> >>> Signed-off-by: Marius Dinu <m95d+git@psihoexpert.ro>
> >>> ---
> >>>  drivers/usb/host/dwc2.c | 5 ++---
> >>>  1 file changed, 2 insertions(+), 3 deletions(-)
> >>>
> >>> diff --git a/drivers/usb/host/dwc2.c b/drivers/usb/host/dwc2.c
> >>> index 16f21fa9083..74d71f23d88 100644
> >>> --- a/drivers/usb/host/dwc2.c
> >>> +++ b/drivers/usb/host/dwc2.c
> >>> @@ -1329,7 +1329,7 @@ static int dwc2_usb_probe(struct udevice *dev)
> >>>  
> >>>  	ret = dwc2_setup_phy(dev);
> >>>  	if (ret)
> >>> -		return ret;
> >>> +		dev_dbg(dev, "Failed to setup PHY: %d. Continuing anyway...\n", ret);
> >>>  
> >>>  	return dwc2_init_common(dev, priv);
> >>>  }
> >>> @@ -1345,8 +1345,7 @@ static int dwc2_usb_remove(struct udevice *dev)
> >>>  
> >>>  	ret = dwc2_shutdown_phy(dev);
> >>>  	if (ret) {
> >>> -		dev_dbg(dev, "Failed to shutdown USB PHY: %d.\n", ret);
> >>> -		return ret;
> >>> +		dev_dbg(dev, "Failed to shutdown USB PHY: %d. Continuing anyway...\n", ret);
> >>>  	}
> >>>  
> >>>  	dwc2_uninit_common(priv->regs);
> >>
> > 
> 


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2026-03-17  9:20 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-03-16  9:26 [PATCH] USB: dwc2: allow usb start even if usbphy is not found Marius Dinu
2026-03-16 10:04 ` Jonas Karlman
2026-03-16 14:27   ` Marius Dinu
2026-03-16 15:12   ` Marius Dinu
2026-03-16 21:41     ` Jonas Karlman
2026-03-17  7:37       ` Marius Dinu
2026-03-17  9:20       ` Marius Dinu

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox