IMX8QXP custom model USB 3.0 does not active in linux 5.10.72

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

IMX8QXP custom model USB 3.0 does not active in linux 5.10.72

Jump to solution
4,097 Views
thepnimit
Contributor III

Dear NXP

I have IMX8QXP custom model and use with linux kernel version 5.4.47.

When I try to upgrade to version 5.10.72 for use USB camera sensor driver sony IMX290, IMX477, I found USB hub doesn't work

I think USB otg1 no problem, but USB otg3 doesn't work

In linux version 5.4.47 with command lsusb

Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 010: ID 0c45:6366 Microdia Webcam Vitade AF
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 003 Device 012: ID 0c45:6366 Microdia Webcam Vitade AF
Bus 003 Device 002: ID 04b4:6570 Cypress Semiconductor Corp. Unprogrammed CY7C65632/34 hub HX2VL
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

dmesg

[ 0.531330] usbcore: registered new interface driver usbfs
[ 0.536513] usbcore: registered new interface driver hub
[ 0.541839] usbcore: registered new device driver usb
[ 1.394647] usbcore: registered new interface driver uas
[ 1.400032] usbcore: registered new interface driver usb-storage
[ 1.406095] usbcore: registered new interface driver usb_ehset_test
[ 1.446913] usbcore: registered new interface driver uvcvideo
[ 1.640933] usbcore: registered new interface driver usbhid
[ 1.646626] usbhid: USB HID core driver
[ 1.963300] mxs_phy 5b100000.usbphy: 5b100000.usbphy supply phy-3p0 not found, using dummy regulator
[ 1.985811] usb_phy_generic bus@5b000000:usb3-phy: bus@5b000000:usb3-phy supply vcc not found, using dummy regulator
[ 2.180362] usb usb2: We don't know the algorithms for LPM for this host, disabling LPM.
[ 2.198288] imx_usb 5b0d0000.usb: 5b0d0000.usb supply vbus not found, using dummy regulator
[ 2.499404] usb 1-1: new high-speed USB device number 2 using cdns-usb3
[ 2.589371] usb 3-1: new high-speed USB device number 2 using ci_hdrc
[ 3.057384] usb 3-1.2: new high-speed USB device number 3 using ci_hdrc
[ 3.273865] input: USB 2.0 Camera: USB 2.0 Camera as /devices/platform/bus@5b000000/5b0d0000.usb/ci_hdrc.0/usb3/3-1/3-1.2/3-1.2:1.0/input/input0
[ 3.369379] usb 3-1.4: new full-speed USB device number 4 using ci_hdrc
[ 3.791437] input: USB 2.0 Camera: USB 2.0 Camera as /devices/platform/bus@5b000000/5b110000.usb3/xhci-cdns3/usb1/1-1/1-1:1.0/input/input1

DTS

&usbphy1 {
status = "okay";
};

&usbotg1 {
srp-disable;
hnp-disable;
adp-disable;
disable-over-current;
status = "okay";
};

&usb3phynop1 {
status = "okay";
};

&usbotg3 {
dr_mode = "host";
status = "okay";
};


In linux version 5.10.72 with command lsusb

Bus 001 Device 003: ID 8087:0a2b Intel Corp. Bluetooth wireless interface
Bus 001 Device 002: ID 04b4:6570 Cypress Semiconductor Corp. Unprogrammed CY7C65632/34 hub HX2VL
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

dmesg

[ 0.462565] usbcore: registered new interface driver usbfs
[ 0.467758] usbcore: registered new interface driver hub
[ 0.473044] usbcore: registered new device driver usb
[ 1.390230] usbcore: registered new interface driver uas
[ 1.395630] usbcore: registered new interface driver usb-storage
[ 1.401699] usbcore: registered new interface driver usb_ehset_test
[ 1.420539] usbcore: registered new interface driver i2c-tiny-usb
[ 1.449775] usbcore: registered new interface driver uvcvideo
[ 1.591127] usbcore: registered new interface driver usbhid
[ 1.597857] usbhid: USB HID core driver
[ 1.948681] mxs_phy 5b100000.usbphy: supply phy-3p0 not found, using dummy regulator
[ 2.464759] usb 1-1: new high-speed USB device number 2 using ci_hdrc
[ 2.928755] usb 1-1.4: new full-speed USB device number 3 using ci_hdrc

DTS

&usbphy1 {
status = "okay";
};

&usbotg1 {
srp-disable;
hnp-disable;
adp-disable;
disable-over-current;
status = "okay";
};

&usb3_phy {
status = "okay";
};

&usbotg3 {
status = "okay";
};

&usbotg3_cdns3 {
dr_mode = "otg";
usb-role-switch;
status = "okay";

};


I try to change dr_mode from otg to host, It does not work

Do you have some suggest in this problem?

 

Regards,

Thepnimit

0 Kudos
1 Solution
4,051 Views
thepnimit
Contributor III

Dear,

Thank you for you suggestion, After I review code I found cadence USB split physical driver

In the make menuconfig Device Drivers->PHY Subsystem->Cadence Salvo PHY Driver

If we are upgrade kernel with old .config this flag won’t enable

After enable Cadence Salvo PHY Driver otg3 worked.

 

Thanks

Thepnimit

View solution in original post

10 Replies
3,836 Views
tperrot
Contributor II

The same issue occurs after updating the kernel to 5.10, did you find a solution ?

 

I enabled CONFIG_PHY_CADENCE_SALVO and applied the following change on my dts:

&usb3_phy {

status = "okay";

};

&usbotg3 {

status = "okay";

};

&usbotg3_cdns3 {

dr_mode = "host";

usb-role-switch;

status = "okay";

};

 

But only the USB controller is correctly enumerated, when I tried to use dr_mode=otg as on the 5.4 then any usb device, including the controller are enumerated:


lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux 5.10.72-dev+g7a8a5fe41b2a xhci-hcd xHCI Host Controller
Bus 001 Device 001: ID 1d6b:0002 Linux 5.10.72-dev+g7a8a5fe41b2a xhci-hcd xHCI Host Controller

0 Kudos
4,056 Views
oferausterlitz
Senior Contributor II

Hi NXP

Migrating from kernel 5.4.142 to kernel 5.10.72 on iMX8QM and iMX8QXP platforms, the usb otg3 doesen't working even for me.

Reverting only dts and dtsi files to the previous version of the kernel doesen't fixes the issue.

I thinks that relevant changes are even in the drivers/usb/cdns3/core.c

For example I noticed that the " compatible = "Cadence,usb3"; is missing in the drivers/usb/cdns3/core.c file from kernel 5.10.72

Regards

Ofer

0 Kudos
4,052 Views
thepnimit
Contributor III

Dear,

Thank you for you suggestion, After I review code I found cadence USB split physical driver

In the make menuconfig Device Drivers->PHY Subsystem->Cadence Salvo PHY Driver

If we are upgrade kernel with old .config this flag won’t enable

After enable Cadence Salvo PHY Driver otg3 worked.

 

Thanks

Thepnimit

4,042 Views
oferausterlitz
Senior Contributor II

Hi Thepnimit

I enabled Cadence Salvo PHY Driver as you seggest but otg3 driver doesen't working

In attached you can see my log where the kernel crashes

You can see my dts changes at link: https://github.com/FrancescoFerraro/linux-imx/blob/dde26f9d90e9ce0a4a0806aff8345aa8ec498812/arch/arm...

Thanks

Ofer

0 Kudos
4,034 Views
thepnimit
Contributor III

Dear,

I'm not sure for model for variscite model amd IMX8QM

1. because I don't have that hardware

2. My hardware dosen't use USB type C

But the cadense USB 3.0 is chip driver from NXP (not sure)

If you try to enable only USB 3.0 looklike this

&usb3_phy {
status = "okay";
};

&usbotg3 {
status = "okay";
};

&usbotg3_cdns3 {
dr_mode = "host";
status = "okay";
};

 

The USB 3.0 on your board is active or not?

Thanks

Thepnimit

0 Kudos
4,022 Views
oferausterlitz
Senior Contributor II

Hi Thepnimit

I followed your suggests

With "dr_mode = otg"

I see cdns_imx_probe probe OK, cdns_probe OK and extcon-ptn5150 that checks correct status.

However, g_ether fails and I don't see never USB storage detected.

While if i leave "dr_mode = host" I see kernel crashes

Regards

Ofer

0 Kudos
4,078 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

Changing dr_mode should be the way to do it, please try by commenting usb-role-switch; as well, i.e

&usbotg3_cdns3 {
dr_mode = "host";
//usb-role-switch;
status = "okay";
};

Best regards,
Aldo.

0 Kudos
4,073 Views
thepnimit
Contributor III

Dear Aldo

I try to commenting usb-role-switch and change 3 dr_mode (host, otg, peripheral), System still not found USB3.0 port

I check inside file imx8-ss-conn.dtsi and found the differrent 2 version

5.4.47

mlb: mlb@5b060000 {
compatible = "fsl,imx8qxp-mlb150";
reg = <0x5B060000 0x10000>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 265 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 266 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&mlb_lpcg 0>,
<&mlb_lpcg 1>,
<&mlb_lpcg 2>;
clock-names = "mlb", "hclk", "ipg";
power-domains = <&pd IMX_SC_R_MLB_0>;
status = "disabled";
};

usb3phynop1: usb3-phy {
compatible = "usb-nop-xceiv";
clocks = <&usb3_lpcg 4>;
clock-names = "main_clk";
power-domains = <&pd IMX_SC_R_USB_2_PHY>;
status = "disabled";
};

usbotg3: usb3@5b110000 {
compatible = "Cadence,usb3";
reg = <0x5B110000 0x10000>,
<0x5B130000 0x10000>,
<0x5B140000 0x10000>,
<0x5B160000 0x40000>,
<0x5B120000 0x10000>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&usb3_lpcg 1>,
<&usb3_lpcg 0>,
<&usb3_lpcg 5>,
<&usb3_lpcg 2>,
<&usb3_lpcg 3>;
clock-names = "usb3_lpm_clk", "usb3_bus_clk", "usb3_aclk",
"usb3_ipg_clk", "usb3_core_pclk";
assigned-clocks = <&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_PER>,
<&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MISC>,
<&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MST_BUS>;
assigned-clock-rates = <125000000>, <12000000>, <250000000>;
power-domains = <&pd IMX_SC_R_USB_2>;
cdns3,usbphy = <&usb3phynop1>;
status = "disabled";
};

 

5.10.72

usb3_phy: usb-phy@5b160000 {
compatible = "nxp,salvo-phy";
reg = <0x5B160000 0x40000>;
clocks = <&usb3_lpcg 4>;
clock-names = "salvo_phy_clk";
power-domains = <&pd IMX_SC_R_USB_2_PHY>;
#phy-cells = <0>;
status = "disabled";
};

usbotg3: usb@5b110000 {
compatible = "fsl,imx8qm-usb3";
#address-cells = <1>;
#size-cells = <1>;
ranges;
reg = <0x5B110000 0x10000>;
clocks = <&usb3_lpcg 1>,
<&usb3_lpcg 0>,
<&usb3_lpcg 5>,
<&usb3_lpcg 2>,
<&usb3_lpcg 3>;
clock-names = "usb3_lpm_clk", "usb3_bus_clk", "usb3_aclk",
"usb3_ipg_clk", "usb3_core_pclk";
assigned-clocks = <&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_PER>,
<&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MISC>,
<&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MST_BUS>;
assigned-clock-rates = <125000000>, <12000000>, <250000000>;
power-domains = <&pd IMX_SC_R_USB_2>;
status = "disabled";

usbotg3_cdns3: usb@5b120000 {
compatible = "cdns,usb3";
#address-cells = <1>;
#size-cells = <1>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>;
interrupt-names = "host", "peripheral", "otg", "wakeup";
reg = <0x5B130000 0x10000>, /* memory area for HOST registers */
<0x5B140000 0x10000>, /* memory area for DEVICE registers */
<0x5B120000 0x10000>; /* memory area for OTG/DRD registers */
reg-names = "xhci", "dev", "otg";
phys = <&usb3_phy>;
phy-names = "cdns3,usb3-phy";
status = "disabled";
};
};

 

Do config make this problem?

Regards,

Thepnimit

0 Kudos
4,066 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

It may be possible that when changing for upstream USB3 driver something broke.


Please refer to the following commit:

https://source.codeaurora.org/external/imx/linux-imx/commit/?h=lf-5.10.y&id=32e0ba4e796ccbc14f1fd550...

 

Please try by reverting the following one:

https://source.codeaurora.org/external/imx/linux-imx/diff/arch/arm64/boot/dts/freescale/imx8-ss-conn...

 

Also, in your board dts make the following changes:

 

-&usb3_phy {

+&usb3phynop1 {

status = "okay";

};

 

&usbotg3 {

- status = "okay";

-};

-

-&usbotg3_cdns3 {

-dr_mode = "otg";

- usb-role-switch;

-status = "okay";

+dr_mode = "host";

+status = "okay";

 

};

 

Please try it and let me know if this work.

 

Best regards,

Aldo.

0 Kudos
4,061 Views
thepnimit
Contributor III

Dear Aldo,

I tryed to revert to same version 5.4.47 but USB still not work

// imx8-ss-conn.dtsi
usb3phynop1: usb3-phy {
compatible = "usb-nop-xceiv";
clocks = <&usb3_lpcg 4>;
clock-names = "main_clk";
power-domains = <&pd IMX_SC_R_USB_2_PHY>;
status = "disabled";
};

usbotg3: usb3@5b110000 {
compatible = "cdns,usb3";
reg = <0x5B110000 0x10000>,
<0x5B130000 0x10000>,
<0x5B140000 0x10000>,
<0x5B160000 0x40000>,
<0x5B120000 0x10000>;
interrupt-parent = <&gic>;
interrupts = <GIC_SPI 271 IRQ_TYPE_LEVEL_HIGH>;
clocks = <&usb3_lpcg 1>,
<&usb3_lpcg 0>,
<&usb3_lpcg 5>,
<&usb3_lpcg 2>,
<&usb3_lpcg 3>;
clock-names = "usb3_lpm_clk", "usb3_bus_clk", "usb3_aclk",
"usb3_ipg_clk", "usb3_core_pclk";
assigned-clocks = <&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_PER>,
<&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MISC>,
<&clk IMX_SC_R_USB_2 IMX_SC_PM_CLK_MST_BUS>;
assigned-clock-rates = <125000000>, <12000000>, <250000000>;
power-domains = <&pd IMX_SC_R_USB_2>;
cdns3,usbphy = <&usb3phynop1>;
status = "disabled";
};

// imx8x-mek.dtsi

&usb3phynop1 {
status = "okay";
};

&usbotg3 {
dr_mode = "host";
status = "okay";
};

 

 Do you have any suggest?

Regards

Thepnimit

0 Kudos