UPGRADE YOUR BROWSER

We have detected your current browser version is not the latest one. Xilinx.com uses the latest web technologies to bring you the best online experience possible. Please upgrade to a Xilinx.com supported browser:Chrome, Firefox, Internet Explorer 11, Safari. Thank you!

cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Explorer
Explorer
3,231 Views
Registered: ‎11-24-2013

USB3 ZynqMP Linux Problems

Hello everyone,

 

I'm having trouble getting USB3 working in a board developed by my company wich has a Zynq® UltraScale+™ MPSoC on it. An Embedded Linux runs on the board. It is not the first "custom board" I work with, and I have never had such problems with USB3. Since I am building the Embedded Linux the same way as before, I don't really know if this is a software or hardware problem (signal integrity of the USB signals).

 

Description of the problem:

USB2 devices work properly, but USB3 devices are not working at all (the kernel does not even recognize that something was connected).

 

If I change the device tree and leave a USB2 configuration (removing the text in bold on the attached device tree text), then USB2 devices work properly and USB3 devices work as USB2 also properly.

 

I am missing something about the device-tree/kernel configuration? With this configuration, my previous projects were working fine...

 

Thanks in advance for your time!

 

Regards,

Ignacio

 

---

 

These are the configuration I am using (complete dmesg is attached):

  

Vivado Project

Regarding USB, I configured the IO pins and the clock used for the GT transceivers.

usb_io_config.png

usb_io_config.png

 

Device Tree

The USB part of the device tree includes the mode (host) and the phy (gt transceiver).

 

USB part:

 

usb0 {
	#address-cells = <0x2>;
	#size-cells = <0x2>;
	status = "okay";
	compatible = "xlnx,zynqmp-dwc3";
	reg = <0x0 0xff9d0000 0x0 0x100>;
	clock-names = "bus_clk", "ref_clk";
	#stream-id-cells = <0x1>;
	iommus = <0x7 0x860>;
	power-domains = <0x24>;
	ranges;
	nvmem-cells = <0x17>;
	nvmem-cell-names = "soc_revision";
	clocks = <0x3 0x20 0x3 0x22>;

	dwc3@fe200000 {
		compatible = "snps,dwc3";
		status = "okay";
		reg = <0x0 0xfe200000 0x0 0x40000>;
		interrupt-parent = <0x4>;
		interrupts = <0x0 0x41 0x4 0x0 0x45 0x4>;
		snps,quirk-frame-length-adjustment = <0x20>;
		snps,refclk_fladj;
		dr_mode = "host";
		snps,usb3_lpm_capable;
		phy-names = "usb3-phy";
		phys = <&lane1 0x4 0x0 0x3 0x5f5e100>;
	};
};

 

 

What the kernel says regarding USB when booting:

[    1.334667] usbcore: registered new interface driver usbfs
[    1.334707] usbcore: registered new interface driver hub
[    1.334749] usbcore: registered new device driver usb
[    2.559014] usbcore: registered new interface driver asix
[    2.564447] usbcore: registered new interface driver ax88179_178a
[    2.570557] usbcore: registered new interface driver cdc_ether
[    2.576442] usbcore: registered new interface driver net1080
[    2.582129] usbcore: registered new interface driver cdc_subset
[    2.588091] usbcore: registered new interface driver zaurus
[    2.593711] usbcore: registered new interface driver cdc_ncm
[    2.599898] usbcore: registered new interface driver uas
[    2.605226] usbcore: registered new interface driver usb-storage
[    2.635103] usbcore: registered new interface driver uvcvideo
[    2.693627] usbcore: registered new interface driver bcm203x
[    2.699323] usbcore: registered new interface driver bpa10x
[    2.704934] usbcore: registered new interface driver bfusb
[    2.710459] usbcore: registered new interface driver btusb
[    2.721700] usbcore: registered new interface driver ath3k
[    2.878842] usbcore: registered new interface driver usbhid
[    2.884395] usbhid: USB HID core driver
[    3.098390] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:0 protocol:3 pll_locked:yes
[    3.128601] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    3.134087] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 1
[    3.142045] xhci-hcd xhci-hcd.0.auto: hcc params 0x0238f625 hci version 0x100 quirks 0x00010810
[    3.150801] xhci-hcd xhci-hcd.0.auto: irq 215, io mem 0xfe200000
[    3.156922] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    3.163713] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.170991] usb usb1: Product: xHCI Host Controller
[    3.175894] usb usb1: Manufacturer: Linux 4.9.0-00442-gca1d7a1-dirty xhci-hcd
[    3.183084] usb usb1: SerialNumber: xhci-hcd.0.auto
[    3.188286] hub 1-0:1.0: USB hub found
[    3.192022] hub 1-0:1.0: 1 port detected
[    3.196099] xhci-hcd xhci-hcd.0.auto: xHCI Host Controller
[    3.201575] xhci-hcd xhci-hcd.0.auto: new USB bus registered, assigned bus number 2
[    3.209396] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[    3.216187] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    3.223465] usb usb2: Product: xHCI Host Controller
[    3.228368] usb usb2: Manufacturer: Linux 4.9.0-00442-gca1d7a1-dirty xhci-hcd
[    3.235558] usb usb2: SerialNumber: xhci-hcd.0.auto
[    3.240721] hub 2-0:1.0: USB hub found
[    3.244456] hub 2-0:1.0: 1 port detected 

 

Tags (3)
0 Kudos
7 Replies
Observer ahavens
Observer
3,175 Views
Registered: ‎08-04-2016

Re: USB3 ZynqMP Linux Problems

I think we are seeing the same thing with our custom board. 

 

On our board we have two controllers, one connected to in internal hub, the other to a USB-C connector. On both of them devices are get detected as USB2 even thought they should be USB3. 

 

# lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=, Driver=usb-storage, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
    |__ Port 1: Dev 2, If 0, Class=, Driver=hub/5p, 480M
        |__ Port 2: Dev 3, If 0, Class=, Driver=, 480M
        |__ Port 4: Dev 4, If 0, Class=, Driver=usb-storage, 480M

 

That is about as far as I have gotten.

0 Kudos
Explorer
Explorer
3,159 Views
Registered: ‎11-24-2013

Re: USB3 ZynqMP Linux Problems

Hi @ahavens,

 

did you add on the device tree the configuration for the phys? What do you see if you type:

 

dmesg | grep pll

I am still having this issue and don't really now if the problem is in the HW or in the configuration of the Embedded Linux...

 

Regards,

Ignacio

0 Kudos
Observer ahavens
Observer
3,142 Views
Registered: ‎08-04-2016

Re: USB3 ZynqMP Linux Problems

dmesg | grep pll
[ 3.166266] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:8 protocol:4 pll_locked:yes

 

But on second thought that is not enough for our board, we have display port on lane one, and we should have two other lanes of USB3 but I am not seeing that. I am going to have to look into that in the dts. 

 

I notice that in your dts you are using a 100 MHz clock and in all the examples I have seen they use a 26 MHz clock for USB3  but the documentation implies that 100 MHz should be okay (http://www.wiki.xilinx.com/Zynq+Ultrascale+MPSOC+Linux+SIOU+driver).

 

Also, do you know anything about the "LANE_NUM"  field of the "phys" property? phys = <PHANDLE CONTOLLER_TYPE CONTROLLER_INSTANCE LANE_NUM LANE_FREQ>;

 

In your dts is does not match the lane, but in the documentation example it does.

 

0 Kudos
Observer ahavens
Observer
3,139 Views
Registered: ‎08-04-2016

Re: USB3 ZynqMP Linux Problems

I updated my dts for the phys, but it did not solve the problem.

 

root@raptor-zynqmp:~# dmesg | grep pll
[ 3.186209] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:8 protocol:4 pll_locked:yes
[ 3.207732] xilinx-psgtr fd400000.zynqmp_phy: Lane:0 type:0 protocol:3 pll_locked:yes
[ 3.355818] xilinx-psgtr fd400000.zynqmp_phy: Lane:3 type:1 protocol:3 pll_locked:yes
root@raptor-zynqmp:~# lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=, Driver=usb-storage, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=, Driver=hub/5p, 480M
|__ Port 2: Dev 3, If 0, Class=, Driver=, 480M
|__ Port 4: Dev 4, If 0, Class=, Driver=usb-storage, 480M

0 Kudos
Explorer
Explorer
3,131 Views
Registered: ‎11-24-2013

Re: USB3 ZynqMP Linux Problems

Hi @ahavens,

 

thanks for the info!

 

You are right, the lane configuration of this post was not correct. I noticed that error later but didn't update that line here. Unfortunately that didn't solve the problem... I put lane 3 since that's where I get the clock from, as indicated on the wiki page of Xilinx.

 

I had worked previously with ZynqMP and USB3 was working including the PHY configuration on the device tree. That's what I thought it must be there. It also makes sense... But now I'm not sure about that. I posted on another forum a question about a module with ZynqMP (Trenz Electronics) and they answered me that they didn't need to change the "default" device tree for USB3 to work (here is the conversation).

 

What you say about the clock frequency is an interesting point... Actually, the other ZynqMP boards I worked with had a 26 MHz clock. Since my current board uses a configurable clock generator, I will reconfigure it and try.

 

In my case, when I add the PHY info to the device tree, USB3 devices doesn't work always, but USB2 devices do. I just got once a USB3 device working with this configuration, and it was being recognized as USB2.

 

I will also investigate if this problem is related to the signal integrity of the USB3 signals.

 

I will update with my results.

 

Regards

Ignacio

0 Kudos
Observer ahavens
Observer
3,063 Views
Registered: ‎08-04-2016

Re: USB3 ZynqMP Linux Problems

Hi @imgignacio,

 

I tried two other boards from the same batch and the USB3 is working fine on the type C port on those boards. The onboard hub is still getting detected as USB2.0. After looking at the data sheet for the hub it looks like it disables USB 3 when a type C connector is not used, and you have to pull the C_ATTACH pins high on the board to use a type A connector, we will look at this on our next rev of boards.

 

Here are the dts fragments I am using that has the USB-C working on our board. On our board we are using lane3 from the Serdes for the C port and lane 0 goes to the internal hub. We have a 26 MHz preprogrammed clock input to lane 3 should be shared with lane 0.

 

&serdes{
    status = "okay";
};

 

/* internal hub */
&usb0 {
    status = "okay";
};

&dwc3_0 {
    status = "okay";
    dr_mode = "host";
    snps,usb3_lpm_capable;
    phy-names = "usb3-phy";
    phys = <&lane0 4 0 3 26000000>;
    maximum-speed = "super-speed";
};

 

/* Type C port */

&usb1 {
     status = "okay";
};
&dwc3_1 {
    status = "okay";
    dr_mode = "host";
    snps,usb3_lpm_capable;
    phy-names = "usb3-phy";
    phys = <&lane3 4 1 3 26000000>;
    maximum-speed = "super-speed";
};

 

I hope that helps.

Austin

Explorer
Explorer
3,039 Views
Registered: ‎11-24-2013

Re: USB3 ZynqMP Linux Problems

Hi @ahavens,

 

thank you very much for the information!

 

Regards

Ignacio

0 Kudos