Skip to contentSkip to conversation

Fix 'no USB device found' error.

PATCH In review Julien Panis 6 participants 12 messages Jul 6, 2023 – Aug 21, 2023

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

v4 cover Fix 'no USB device found' error.

This series fixes the "No USB device found" error for am335x-icev2 and am335x-evmsk. USB0 dual-role feature is now handled as peripheral only in the driver.

The error was not produced for am335x-evm because usb0 dr_mode was configured as peripheral in 'am335x-evm-u-boot.dtsi'. This fragment is no longer needed.

---
Changes in v4:
- Handle usb dual-role feature as peripheral in ti-musb driver.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Remove usb0 dr_mode configuration from 'am335x-evm-u-boot.dtsi'.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Drop the modification made in arch/arm/mach-omap2/am33xx/board.c
- Configure usb0 dr_mode as peripheral in 'am335x-icev2-u-boot.dtsi'
and 'am335x-evmsk-u-boot.dtsi' device trees.
- Link to v1: https://lore.kernel.org/r/[email protected]

---
Julien Panis (2):
musb-new: ti-musb: Handle usb dual-role feature as peripheral
arm: dts: am335x-evm-u-boot: Remove usb0 mode configuration

 arch/arm/dts/am335x-evm-u-boot.dtsi | 4 ----
 drivers/usb/musb-new/ti-musb.c      | 1 +
 2 files changed, 1 insertion(+), 4 deletions(-)

---
base-commit: 19b77d3d23966a0d6dbb3c86187765f11100fb6f
change-id: 20230621-fix_usb_ether_init-4bf4f1135113

Best regards,

Signature · 1 line
Julien Panis <[email protected]>
#1 lore raw

PATCH v4 1/2 musb-new: ti-musb: Handle usb dual-role feature as peripheral

This prevents from getting some 'No USB device found' error, in usb_ether_init() function for instance.

---
 drivers/usb/musb-new/ti-musb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/musb-new/ti-musb.c +1 -0
index 3be3f93dd85d..44697dc31387 100644
@@ -302,6 +302,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
 		dr_mode = usb_get_dr_mode(node);
 		switch (dr_mode) {
 		case USB_DR_MODE_PERIPHERAL:
+		case USB_DR_MODE_OTG:
 			/* Bind MUSB device */
 			ret = device_bind_driver_to_node(parent,
 							 "ti-musb-peripheral",
Signature · 1 line
2.37.3
Reviewed-by on v4 1/2
#2 lore raw

Re: [PATCH v4 1/2] musb-new: ti-musb: Handle usb dual-role feature as peripheral

Quoted 2 lines · Julien Panis

This prevents from getting some 'No USB device found' error, in usb_ether_init() function for instance.

Looks good to me:

Reviewed-by on v4 1/2
#3 lore raw

Re: [PATCH v4 1/2] musb-new: ti-musb: Handle usb dual-role feature as peripheral

In reply to Julien Panis
Quoted 24 lines · Julien Panis

This prevents from getting some 'No USB device found' error, in usb_ether_init() function for instance.

---
 drivers/usb/musb-new/ti-musb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/musb-new/ti-musb.c +1 -0
index 3be3f93dd85d..44697dc31387 100644
@@ -302,6 +302,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
 		dr_mode = usb_get_dr_mode(node);
 		switch (dr_mode) {
 		case USB_DR_MODE_PERIPHERAL:
+		case USB_DR_MODE_OTG:
 			/* Bind MUSB device */
 			ret = device_bind_driver_to_node(parent,
 							 "ti-musb-peripheral",
Signature · 2 lines
-- 
2.37.3
Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
#4 lore raw

Re: [PATCH v4 1/2] musb-new: ti-musb: Handle usb dual-role feature as peripheral

In reply to Julien Panis
Quoted 15 lines · Julien Panis

This prevents from getting some 'No USB device found' error, in usb_ether_init() function for instance.

---
 drivers/usb/musb-new/ti-musb.c | 1 +
 1 file changed, 1 insertion(+)
drivers/usb/musb-new/ti-musb.c +0 -0
index 3be3f93dd85d..44697dc31387 100644

drivers/usb/musb-new/ti-musb.c static int ti_musb_wrapper_bind(struct udevice *parent) · line 308

Quoted 7 lines
drivers/usb/musb-new/ti-musb.c +1 -0
@@ -302,6 +302,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
 		dr_mode = usb_get_dr_mode(node);
 		switch (dr_mode) {
 		case USB_DR_MODE_PERIPHERAL:
+		case USB_DR_MODE_OTG:
 			/* Bind MUSB device */
 			ret = device_bind_driver_to_node(parent,
 							 "ti-musb-peripheral",

Julien, why don't we support OTG mode here instead?

Signature · 1 line
Tom
#5 lore raw

Re: [PATCH v4 1/2] musb-new: ti-musb: Handle usb dual-role feature as peripheral

Quoted 12 lines · Tom Rini
Quoted 10 lines · Julien Panis

This prevents from getting some 'No USB device found' error, in usb_ether_init() function for instance.

---
  drivers/usb/musb-new/ti-musb.c | 1 +
  1 file changed, 1 insertion(+)
Quoted 14 lines

drivers/usb/musb-new/ti-musb.c static int ti_musb_wrapper_bind(struct udevice *parent) · line 308

Quoted 12 lines
drivers/usb/musb-new/ti-musb.c +1 -0
index 3be3f93dd85d..44697dc31387 100644
@@ -302,6 +302,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
  		dr_mode = usb_get_dr_mode(node);
  		switch (dr_mode) {
  		case USB_DR_MODE_PERIPHERAL:
+		case USB_DR_MODE_OTG:
  			/* Bind MUSB device */
  			ret = device_bind_driver_to_node(parent,
  							 "ti-musb-peripheral",

Julien, why don't we support OTG mode here instead?

Roger, can this be achieved with this controller ?

#6 lore raw

Re: [PATCH v4 1/2] musb-new: ti-musb: Handle usb dual-role feature as peripheral

Hi Julien,

Quoted 28 lines · Julien Panis
Quoted 12 lines · Tom Rini
Quoted 10 lines · Julien Panis

This prevents from getting some 'No USB device found' error, in usb_ether_init() function for instance.

---
  drivers/usb/musb-new/ti-musb.c | 1 +

  1 file changed, 1 insertion(+)
Quoted 14 lines
Quoted 7 lines
drivers/usb/musb-new/ti-musb.c +0 -0
index 3be3f93dd85d..44697dc31387 100644
@@ -302,6 +302,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
           dr_mode = usb_get_dr_mode(node);
           switch (dr_mode) {
Quoted 5 lines

          case USB_DR_MODE_PERIPHERAL:
+        case USB_DR_MODE_OTG:
              /* Bind MUSB device */
              ret = device_bind_driver_to_node(parent, "ti-musb-peripheral",

Julien, why don't we support OTG mode here instead?

Quoted 1 line

Roger, can this be achieved with this controller ?

The Controller supports OTG mode but I'm not sure of the u-boot driver.

Bin / Stephan might know.

Signature · 2 lines
cheers,
-roger
#7 lore raw

Re: [PATCH v4 1/2] musb-new: ti-musb: Handle usb dual-role feature as peripheral

Quoted 31 lines · Roger Quadros

Hi Julien,

Quoted 28 lines · Julien Panis
Quoted 26 lines · Tom Rini
Quoted 15 lines · Julien Panis

This prevents from getting some 'No USB device found' error, in usb_ether_init() function for instance.

---
   drivers/usb/musb-new/ti-musb.c | 1 +
   1 file changed, 1 insertion(+)
drivers/usb/musb-new/ti-musb.c +0 -0
index 3be3f93dd85d..44697dc31387 100644

drivers/usb/musb-new/ti-musb.c static int ti_musb_wrapper_bind(struct udevice *parent) · line 308

Quoted 7 lines
drivers/usb/musb-new/ti-musb.c +1 -0
@@ -302,6 +302,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
           dr_mode = usb_get_dr_mode(node);
           switch (dr_mode) {
           case USB_DR_MODE_PERIPHERAL:
+        case USB_DR_MODE_OTG:
               /* Bind MUSB device */
               ret = device_bind_driver_to_node(parent,
                                "ti-musb-peripheral",

Julien, why don't we support OTG mode here instead?

Quoted 5 lines
Quoted 1 line

Roger, can this be achieved with this controller ?

The Controller supports OTG mode but I'm not sure of the u-boot driver.

Bin / Stephan might know.

Surely the controller supports both Host and Peripheral mode.

#8 lore raw

Re: [PATCH v4 1/2] musb-new: ti-musb: Handle usb dual-role feature as peripheral

Quoted 32 lines · Marek Vasut
Quoted 31 lines · Roger Quadros

Hi Julien,

Quoted 28 lines · Julien Panis
Quoted 26 lines · Tom Rini
Quoted 15 lines · Julien Panis

This prevents from getting some 'No USB device found' error, in usb_ether_init() function for instance.

---
   drivers/usb/musb-new/ti-musb.c | 1 +
   1 file changed, 1 insertion(+)
drivers/usb/musb-new/ti-musb.c +0 -0
index 3be3f93dd85d..44697dc31387 100644

drivers/usb/musb-new/ti-musb.c static int ti_musb_wrapper_bind(struct udevice *parent) · line 308

Quoted 7 lines
drivers/usb/musb-new/ti-musb.c +1 -0
@@ -302,6 +302,7 @@ static int ti_musb_wrapper_bind(struct udevice *parent)
           dr_mode = usb_get_dr_mode(node);
           switch (dr_mode) {
           case USB_DR_MODE_PERIPHERAL:
+        case USB_DR_MODE_OTG:
               /* Bind MUSB device */
               ret = device_bind_driver_to_node(parent,
                                "ti-musb-peripheral",

Julien, why don't we support OTG mode here instead?

Quoted 7 lines
Quoted 5 lines
Quoted 1 line

Roger, can this be achieved with this controller ?

The Controller supports OTG mode but I'm not sure of the u-boot driver.

Bin / Stephan might know.

Surely the controller supports both Host and Peripheral mode.

And perhaps the other half of the disconnect here is that DWC2/DWC3 at least behave in U-Boot as Marek is asking.

Signature · 1 line
Tom
#9 lore raw

PATCH v4 2/2 arm: dts: am335x-evm-u-boot: Remove usb0 mode configuration

In reply to Julien Panis

USB0 dual-role feature is now handled as peripheral only in ti-musb driver.

---
 arch/arm/dts/am335x-evm-u-boot.dtsi | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/dts/am335x-evm-u-boot.dtsi +0 -4
index 82a483ae3e28..42eeca8c0499 100644
@@ -23,10 +23,6 @@
 	status = "disabled";
 };
 
-&usb0 {
-	dr_mode = "peripheral";
-};
-
 &i2c0 {
 	bootph-all;
 };
Signature · 1 line
2.37.3
Reviewed-by on v4 2/2
#10 lore raw

Re: [PATCH v4 2/2] arm: dts: am335x-evm-u-boot: Remove usb0 mode configuration

Quoted 27 lines · Julien Panis

USB0 dual-role feature is now handled as peripheral only in ti-musb driver.

---
 arch/arm/dts/am335x-evm-u-boot.dtsi | 4 ----
 1 file changed, 4 deletions(-)
arch/arm/dts/am335x-evm-u-boot.dtsi +0 -4
index 82a483ae3e28..42eeca8c0499 100644
@@ -23,10 +23,6 @@
 	status = "disabled";
 };
 
-&usb0 {
-	dr_mode = "peripheral";
-};
-
 &i2c0 {
 	bootph-all;
 };
Signature · 2 lines
-- 
2.37.3
Signature · 3 lines
Regards,
Nishanth Menon
Key (0xDDB5849D1736249D) / Fingerprint: F8A2 8693 54EB 8232 17A3  1A34 DDB5 849D 1736 249D
Reviewed-by on the v4 series
#11 lore raw
In reply to Julien Panis

Hi Julien,

Quoted 26 lines · Julien Panis

This series fixes the "No USB device found" error for am335x-icev2 and am335x-evmsk. USB0 dual-role feature is now handled as peripheral only in the driver.

The error was not produced for am335x-evm because usb0 dr_mode was configured as peripheral in 'am335x-evm-u-boot.dtsi'. This fragment is no longer needed.

---
Changes in v4:
- Handle usb dual-role feature as peripheral in ti-musb driver.
- Link to v3: https://lore.kernel.org/r/[email protected]

Changes in v3:
- Remove usb0 dr_mode configuration from 'am335x-evm-u-boot.dtsi'.
- Link to v2: https://lore.kernel.org/r/[email protected]

Changes in v2:
- Drop the modification made in arch/arm/mach-omap2/am33xx/board.c
- Configure usb0 dr_mode as peripheral in 'am335x-icev2-u-boot.dtsi'
and 'am335x-evmsk-u-boot.dtsi' device trees.
- Link to v1: https://lore.kernel.org/r/[email protected]

Quoted 4 lines

---
Julien Panis (2):
musb-new: ti-musb: Handle usb dual-role feature as peripheral
arm: dts: am335x-evm-u-boot: Remove usb0 mode configuration

for this series:

I also see other boards doing the wrong thing. i.e. replacing 'otg' with 'peripheral'.

dra71-evm-u-boot.dtsi: dr_mode = "peripheral";
dra72-evm-revc-u-boot.dtsi: dr_mode = "peripheral";
dra72-evm-u-boot.dtsi: dr_mode = "peripheral";
dra76-evm-u-boot.dtsi: dr_mode = "peripheral";
dra7-evm-u-boot.dtsi: dr_mode = "peripheral";
k3-am642-evm-u-boot.dtsi: dr_mode="peripheral";
k3-am654-r5-base-board-u-boot.dtsi: dr_mode = "peripheral";
k3-am654-r5-base-board-u-boot.dtsi: dr_mode = "peripheral";
k3-j7200-common-proc-board-u-boot.dtsi: dr_mode = "peripheral";
k3-j721e-common-proc-board-u-boot.dtsi: dr_mode = "peripheral";
keystone-k2e-evm-u-boot.dtsi: dr_mode = "peripheral";

Is this something you can fix (in dwc3 driver) as it is on similar lines ;). Thanks!

Signature · 2 lines
cheers,
-roger