cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
schaeferk
Observer
Observer
744 Views
Registered: ‎04-16-2018

ZynqMP Yocto no USB with 2021.1

Hi,

I'm currently facing the problem that USB on my ZynqMP isn't working anymore after upgrading my toolchain to 2021.1.

I have two different custom ZynqMP boards running Linux built with Yocto. On one board I use USB0 (2.0) in host mode on the other one in device mode. Everything was working fine with Linux 5.4 & Vivado 2020.2 but after upgrading to 2021.1 I encounter the following problems:

  • In USB host mode, if I attach a USB drive I get a lot of errors like this :

 

[   69.594783] usb 1-1: reset high-speed USB device number 2 using xhci-hcd                                                                                                                                                                                                             [   69.754519] Buffer I/O error on dev sdb, logical block 1966064, async page read                                                                                                                                                                                                      [   69.771659]  sdb: sdb1 ​

 

  • In device mode, a s soon as I configure the device I get follwing error:

 

dwc3 fe200000.dwc3: failed to enable ep0out​

 

If I replace the kernel Image with the old 5.4 Kernel everything works fine again. I tried a couple of different kernel & devicetree configuration nothing helps, furthermore if I try to enable OTG capabilties the kernel won't build at all.

Did anybody else encounter these problems? Is there a solution?

 

Best regards,

Konstantin

0 Kudos
10 Replies
aravindb
Moderator
Moderator
698 Views
Registered: ‎02-07-2018

HI @schaeferk 

Looks we have issue at 2021.1 which USB2.0 does not work. Can you please test with attached patch along with below device tree changes.

Deselect the PIPE clock when operating in USB2.0 only mode. Due to USB controller getting reset, the pipe clock control register was by
default selecting the Serdes as the clock source. This was causing the issue when the Serdes is disabled and only USB2.0 mode is selected.
Fixed this issue in the 2021.2 s/w release.

For 2021.1 Petalinux driver please use attached patch - "0001-usb-dwc3-xilinx-Deselect-the-PIPE-clock-for-USB2.0-o.patch"

 

&usb0 {
status = "okay";
};
&dwc3_0 {
dr_mode = "host";
maximum-speed = "high-speed";
/delete-property/ snps,usb2_lpm_capable;
/delete-property/ snps,usb3_lpm_capable;
};

&usb1 {
status = "okay";
};

&dwc3_1 {
dr_mode = "peripheral";
maximum-speed = "high-speed";
/delete-property/ snps,usb2_lpm_capable;
/delete-property/ snps,usb3_lpm_capable;
};

 

Thanks & Regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
------------------------------------------------------------------------------------------

pmdcube
Visitor
Visitor
667 Views
Registered: ‎11-04-2020

Hello, 

I posted a similar issue (not the same error in my case) in this topic and I tried the patch and made the modifications in the device tree with no luck...

Pierre

0 Kudos
schaeferk
Observer
Observer
598 Views
Registered: ‎04-16-2018

Hi @aravindb ,

thanks for your quick response. Just like @pmdcube  I didn't have any luck applying the patch and the devicetree snippet.

The system configured as peripheral device  doesn't recognize any UDC after the patch and on the system configured as host I only get

usb usb1-port1: connect-debounce failed

Do you have another solution for this problem? I also tried patching the dwc3-xilinx driver to the "for-next" and the "master" branch version but then I ran into power management/reset failures.
Is there a way to use the old dwc3-simple driver with 2021.1?

 

Regards,

Konstantin

0 Kudos
pmdcube
Visitor
Visitor
592 Views
Registered: ‎11-04-2020

In addition to the last reply of @schaeferk, the message he observed is identical to the one I had (without the patch) and have (with the patch).

The patch did not change anything for me.

0 Kudos
przebienda
Observer
Observer
458 Views
Registered: ‎02-11-2019

Fixed this issue in the 2021.2 s/w release. Is this petalinux-v2021.2 or another s/w release. If petalinux-v2021.2 can you provide a link to the s/w release?

0 Kudos
pmdcube
Visitor
Visitor
405 Views
Registered: ‎11-04-2020

Hello @przebienda,

I don't see the link to 2021.2. Could you please provide it? 

Thank you

0 Kudos
przebienda
Observer
Observer
400 Views
Registered: ‎02-11-2019

I do not see petalinux 2021.2 available at the Xilinx website and a link to it has yet been provided. A service request SR# 10522442 has been started regarding this issue. 

0 Kudos
aravindb
Moderator
Moderator
348 Views
Registered: ‎02-07-2018

HI @schaeferk  @przebienda  @pmdcube 

I just verified usb2.0 only host mode with 2021.1 SW & it is working & we can see the flash drive detecting.

This is a known issue in 2021.1 & we need to apply this attached patch to work it along with below device tree changes.

 

vim "project-spec/meta-user/recipes-bsp/device-tree/files/system-user.dtsi"

 

  &usb0 {

      status = "okay";

   };

 

&dwc3_0 {

   status = "okay";

   dr_mode = "host";

};

I have not verified the device mode, I am going to verify & update you the respective device tree changes. Looks need to modify the device tree changes for device mode.

 

Thanks& Regards

Aravind

----------------------------------------------------------------------------------------------
Kindly note- Please mark the Answer as "Accept as solution" if information provided is helpful.
Give Kudos to a post which you think is helpful and reply oriented.
------------------------------------------------------------------------------------------

 

przebienda
Observer
Observer
272 Views
Registered: ‎02-11-2019

Moderator Aravindb provided the following details in service record 10522442 that did solve the problem.  We do now see the USB 2 device.

The following details help in applying the patch.

  1. Create an inux-xlnx directory if not present.

         mkdir -p project-spec/meta-user/recipes-kernel/linux/linux-xlnx

     2. Create the recipe file shown below and copy to the following folder.

         file name:

linux-xlnx_%.bbappend

         file contents:

SRC_URI_append += "file://0001-usb-dwc3-xilinx-Deselect-the-PIPE-clock-for-USB2.0-o.patch"
FILESEXTRAPATHS_prepend := "${THISDIR}/${PN}:"

         cp -rf linux-xlnx_%.bbappend project-spec/meta-user/recipes-kernel/linux/.

     3. Copy the patch file to the following folder.

      cp -rf 0001-usb-dwc3-xilinx-Deselect-the-PIPE-clock-for-USB2.0-o.patch project-spec/meta-user/recipes-kernel/linux/linux-xlnx/petalinux-build

     4.  Run petalinux-build

przebienda
Observer
Observer
224 Views
Registered: ‎02-11-2019

accepted solution

0 Kudos