Skip to contentSkip to conversation

arm64: dts: imx8: fix USB 3.0 Gadget Failure in QM & QXPB0 at super speed

PATCH In review Frank Li 2 participants 4 messages Apr 13, 2023 – May 13, 2023

Subsystems (2)
lore
Share & tools
lore

Frank Li

author maintainer
#0 lore raw

PATCH 1/1 arm64: dts: imx8: fix USB 3.0 Gadget Failure in QM & QXPB0 at super speed

Resolve USB 3.0 gadget failure for QM and QXPB0 in super speed mode with single IN and OUT endpoints, like mass storage devices, due to incorrect ACTUAL_MEM_SIZE in ep_cap2 (32k instead of actual 18k). Implement dt property cdns,on-chip-buff-size to override ep_cap2 and set it to 18k for imx8QM and imx8QXP chips. No adverse effects for 8QXP C0.

Fixes dce49449e04ff ("usb: cdns3: allocate TX FIFO size according to composite EP number")
---
 arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi +1 -0
index b32c2e199c160..030c273c8be40 100644
@@ -171,6 +171,7 @@ usbotg3_cdns3: usb@5b120000 {
 			interrupt-names = "host", "peripheral", "otg", "wakeup";
 			phys = <&usb3_phy>;
 			phy-names = "cdns3,usb3-phy";
+			cdns,on-chip-buff-size = /bits/ 16 <18>;
 			status = "disabled";
 		};
 	};
Signature · 1 line
2.34.1
author maintainer
#1 lore raw
Quoted 13 lines

Caution: EXT Email

Resolve USB 3.0 gadget failure for QM and QXPB0 in super speed mode with single
IN and OUT endpoints, like mass storage devices, due to incorrect ACTUAL_MEM_SIZE in ep_cap2 (32k instead of actual 18k). Implement dt property
cdns,on-chip-buff-size to override ep_cap2 and set it to 18k for imx8QM and imx8QXP chips. No adverse effects for 8QXP C0.

Quoted 5 lines
Fixes dce49449e04ff ("usb: cdns3: allocate TX FIFO size according to

composite EP number")

---

Shawn:
Ping, it is important fixes for 8qm.

Quoted 18 lines
 arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi +1 -1
index b32c2e199c160..030c273c8be40 100644
@@ -171,6 +171,7 @@ usbotg3_cdns3: usb@5b120000 {
                        interrupt-names = "host", "peripheral", "otg", "wakeup";
                        phys = <&usb3_phy>;
                        phy-names = "cdns3,usb3-phy";
+                       cdns,on-chip-buff-size = /bits/ 16 <18>;
                        status = "disabled";
                };
        };
--

2.34.1

#2 lore raw
In reply to Frank Li
Quoted 9 lines · Frank Li

Resolve USB 3.0 gadget failure for QM and QXPB0 in super speed mode with single IN and OUT endpoints, like mass storage devices, due to incorrect ACTUAL_MEM_SIZE in ep_cap2 (32k instead of actual 18k). Implement dt property cdns,on-chip-buff-size to override ep_cap2 and set it to 18k for imx8QM and imx8QXP chips. No adverse effects for 8QXP C0.

Fixes dce49449e04ff ("usb: cdns3: allocate TX FIFO size according to composite EP number")

There are a couple of check patch warnings on commit log.

WARNING: Possible unwrapped commit description (prefer a maximum 75 chars per line) #7:
Resolve USB 3.0 gadget failure for QM and QXPB0 in super speed mode with single

WARNING: Please use correct Fixes: style 'Fixes: <12 chars of sha1> ("<title line>")' - ie: 'Fixes: dce49449e04f ("usb: cdns3: allocate TX FIFO size according to composite EP number")' #13:

Fixes dce49449e04ff ("usb: cdns3: allocate TX FIFO size according to composite EP number")

arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi usbotg3_cdns3: usb@5b120000 { · line 174

Quoted 13 lines
---
 arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi | 1 +
 1 file changed, 1 insertion(+)
arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi +1 -0
index b32c2e199c160..030c273c8be40 100644
@@ -171,6 +171,7 @@ usbotg3_cdns3: usb@5b120000 {
 			interrupt-names = "host", "peripheral", "otg", "wakeup";
 			phys = <&usb3_phy>;
 			phy-names = "cdns3,usb3-phy";
+			cdns,on-chip-buff-size = /bits/ 16 <18>;

The property is defined as uint32 in the bindings. Not sure why we need to enforce 16-bits here.

Shawn

Quoted 6 lines
arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi +0 -0
 			status = "disabled";
 		};
 	};
Signature · 1 line
2.34.1
author maintainer
#3 lore raw
Quoted 8 lines

Review

Quoted 7 lines

---
 arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi | 1 +
 1 file changed, 1 insertion(+)
(quoted diff) +0 -0

b/arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi

Quoted 11 lines

arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi usbotg3_cdns3: usb@5b120000 { · line 174

Quoted 8 lines

index b32c2e199c160..030c273c8be40 100644

arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi +1 -0
@@ -171,6 +171,7 @@ usbotg3_cdns3: usb@5b120000 {
                      interrupt-names = "host", "peripheral", "otg", "wakeup";
                      phys = <&usb3_phy>;
                      phy-names = "cdns3,usb3-phy";
+                     cdns,on-chip-buff-size = /bits/ 16 <18>;

The property is defined as uint32 in the bindings. Not sure why we need to enforce 16-bits here.

Driver code use 16bit, if use 32bit here, it will be zero. I have not checked bindings doc. Next version will fix binding doc.

Frank

Quoted 9 lines

Shawn

Quoted 6 lines
arch/arm64/boot/dts/freescale/imx8-ss-conn.dtsi +0 -1
                      status = "disabled";
              };
      };
--

2.34.1