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: 
Adventurer
Adventurer
6,797 Views
Registered: ‎05-07-2008

Zynqmp USB2.0

Hi all,

Having troubles getting USB 2.0 working.Hope someone can help.

Trying to operate USB0 in device mode. Using xilinx linux 4.9 from github (not using Petalinux)

 

My device tree is per: Wiki Zynq Ultrascale MPSOC Linux USB device driver

but I have dr_mode = "peripheral";

 

I do not have USB 3.0 selected in my Vivado build, only USB 2.0

 

I have a USB3320 USB PHY connected to Zynqmp. Oscillator is at the right frequency and the PHY is outputting a 60 MHz clock on it's clockout pin. I've used this circuit many times on other Zynq-7000 designs I've done.

 

kernel crashes and leaves a long trail of messages. Here's the very top of it:

 

[    3.001373] xilinx-psgtr fd400000.zynqmp_phy: Lane:1 type:8 protocol:4 pll_locked:yes
[    3.009487] xilinx-drm-dp fd4a0000.dp: device found, version 4.010
[    3.015660] xilinx-drm-dp fd4a0000.dp: Display Port, version 1.0200 (tx)
[    3.023264] dwc3 fe200000.dwc3: failed to register ULPI interface
[    3.029348] dwc3 fe200000.dwc3: failed to initialize core
[    3.034782] Unable to handle kernel NULL pointer dereference at virtual address 00000032
[    3.042933] pgd = ffffff8008bc0000
[    3.046344] [00000032] *pgd=000000006fffe003[    3.050460] , *pud=000000006fffe003
, *pmd=0000000000000000[    3.055981]
[    3.057475] Internal error: Oops: 96000005 [#1] SMP
[    3.062385] Modules linked in:
[    3.065454] CPU: 0 PID: 513 Comm: kworker/0:1 Not tainted 4.9.0-00283-ge51604b-dirty #23
[    3.073614] Hardware name: xlnx,zynqmp (DT)
[    3.077821] Workqueue: events deferred_probe_work_func
[    3.082987] task: ffffffc06dbf9200 task.stack: ffffffc06d39c000
[    3.088955] PC is at device_del+0x18/0x218
[    3.093073] LR is at device_unregister+0x14/0x30
[    3.097719] pc : [<ffffff80084cf598>] lr : [<ffffff80084cf7ac>] pstate: 00000045
[    3.105177] sp : ffffffc06d39f790
[    3.108502] x29: ffffffc06d39f790 x28: 0000000000000000
[    3.113848] x27: 00000000000007ba x26: 0000000000000001
[    3.119196] x25: ffffffc06cf39c00 x24: ffffffc06cf2ae68
[    3.124545] x23: 00000000ffffff92 x22: ffffffffffffffff
[    3.129893] x21: ffffffc06d10d300 x20: ffffffffffffffaa
[    3.135241] x19: ffffffffffffffaa x18: 0000000000000010
[    3.140590] x17: 0000000000000000 x16: 0000000000000000
[    3.145938] x15: 0000000000000006 x14: ffffff8088b6b8d7
[    3.151286] x13: ffffff8008b6b8e5 x12: 00000000000000fc
[    3.156634] x11: ffffffc06d39f470 x10: 00000040674cb000
[    3.161983] x9 : 000000000007de53 x8 : ffffff8008b61000
[    3.167331] x7 : ffffff8008b61000 x6 : 00000000ffffffc3
[    3.172679] x5 : 0000000000000001 x4 : 0000ffffffff0007
[    3.178028] x3 : 0000000000000000 x2 : 0000000000000001
[    3.183376] x1 : ffffffffffffff92 x0 : ffffffffffffffaa
[    3.188723]
[    3.190216] Process kworker/0:1 (pid: 513, stack limit = 0xffffffc06d39c020)
[    3.197321] Stack: (0xffffffc06d39f790 to 0xffffffc06d3a0000)
[    3.203108] f780:                                   ffffffc06d39f7e0 ffffff80084cf7ac

 

 

 

Here's what I have enabled in my kernel:

 

  --- USB support                                                             
    <*>   Support for Host-side USB                                           
    [*]     USB announce new devices                                          
            *** Miscellaneous USB options ***                                 
    [ ]     Enable USB persist by default                                     
    [ ]     Dynamic USB minor allocation                                      
    [ ]     OTG support                                                       
    [ ]     Rely on OTG and EH Targeted Peripherals List                      
    [ ]     Disable external hubs                                             
    < >     USB port LED trigger                                              
    < >     USB Monitor                                                       
    < >     Support WUSB Cable Based Association (CBA)                        
            *** USB Host Controller Drivers ***                               
    < >     Cypress C67x00 HCD support                                        
    <*>     xHCI HCD (USB 3.0) support                                        
    -*-       Generic xHCI driver for a platform device                       
    < >     EHCI HCD (USB 2.0) support                                        
    < >     OXU210HP HCD support                                              
    < >     ISP116X HCD support                                               
    < >     ISP1362 HCD support                                               
    < >     FOTG210 HCD support                                               
    < >     MAX3421 HCD (USB-over-SPI) support                                
    < >     OHCI HCD (USB 1.1) support                                        
    < >     SL811HS HCD support                                               
    < >     R8A66597 HCD support                                              
    [ ]     HCD test mode support                                             
            *** USB Device Class drivers ***                                  
    < >     USB Modem (CDC ACM) support                                       
    < >     USB Printer support                                               
    < >     USB Wireless Device Management support                            
    < >     USB Test and Measurement Class support                            
            *** NOTE: USB_STORAGE depends on SCSI but BLK_DEV_SD may ***      
            *** also be needed; see USB_STORAGE Help for more info ***        
    <*>     USB Mass Storage support                                          
    [ ]       USB Mass Storage verbose debug                                  
    < >       Realtek Card Reader support                                     
    < >       Datafab Compact Flash Reader support                            
    < >       Freecom USB/ATAPI Bridge support                                
    < >       ISD-200 USB/ATA Bridge support                                  
    < >       USBAT/USBAT02-based storage support                             
    < >       SanDisk SDDR-09 (and other SmartMedia, including DPCM) support  
    < >       SanDisk SDDR-55 SmartMedia support                              
    < >       Lexar Jumpshot Compact Flash Reader                             
    < >       Olympus MAUSB-10/Fuji DPC-R1 support                            
    < >       Support OneTouch Button on Maxtor Hard Drives                   
    < >       Support for Rio Karma music player                              
    < >       SAT emulation on Cypress USB/ATA Bridge with ATACB              
    < >       USB ENE card reader support                                     
    <*>       USB Attached SCSI                                               
            *** USB Imaging devices ***                                       
    < >     USB Mustek MDC800 Digital Camera support                          
    < >     Microtek X6USB scanner support                                    
    < >     USB/IP support                                                    
    < >   Inventra Highspeed Dual Role Controller (TI, ADI, AW, ...)          
    <*>   DesignWare USB3 DRD Core Support                                    
    [*]     Register ULPI PHY Interface                                       
            DWC3 Mode Selection (Dual Role mode)  --->                        
            *** Platform Glue Driver Support ***
    <*>     Generic OF Simple Glue Layer                                      
    < >   DesignWare USB2 DRD Core Support                                    
    < >   ChipIdea Highspeed Dual Role Controller                             
    < >   NXP ISP 1760/1761 support                                           
        *** USB port drivers ***                                              
    < >   USB Serial Converter support  ----                                  
        *** USB Miscellaneous drivers ***                                     
    < >   EMI 6|2m USB Audio interface support                                
    < >   EMI 2|6 USB Audio interface support                                 
    < >   ADU devices from Ontrak Control Systems                             
    < >   USB 7-Segment LED Display                                           
    < >   USB Diamond Rio500 support                                          
    < >   USB Lego Infrared Tower support                                     
    < >   USB LCD driver support                                              
    < >   Cypress CY7C63xxx USB driver support                                
    < >   Cypress USB thermometer driver support                              
    < >   Siemens ID USB Mouse Fingerprint sensor support                     
    < >   Elan PCMCIA CardBus Adapter USB Client                              
    < >   Apple Cinema Display support                                        
    < >   USB LD driver                                                       
    < >   PlayStation 2 Trance Vibrator driver support                        
    < >   IO Warrior driver support                                           
    < >   USB testing driver                                                  
    < >   USB EHSET Test Fixture driver                                       
    < >   iSight firmware loading support                                     
    < >   USB YUREX driver support                                            
    < >   Functions for loading firmware on EZUSB chips                       
    < >   USB3503 HSIC to USB20 Driver                                        
    < >   USB4604 HSIC to USB20 Driver                                        
    < >   USB Link Layer Test driver                                          
        USB Physical Layer drivers  --->                                      
    <*>   USB Gadget Support  --->                                            
    [ ]   USB LED Triggers                                                    
    <*>   USB ULPI PHY interface support
    
under "USB Physical layer drivers"

            <*> NOP USB Transceiver Driver
            < > GPIO based peripheral-only VBUS sensing 'transceiver'
            < > NXP ISP1301 USB transceiver support
            [*] Generic ULPI Transceiver Driver


 

 

0 Kudos
22 Replies
Adventurer
Adventurer
6,745 Views
Registered: ‎05-07-2008

Re: Zynqmp USB2.0

Observation: If a USB cable is plugged in providing VBUS then the kernel does not crash, but USB is still not working and no messages about the USB3320 PHY driver loading

0 Kudos
Adventurer
Adventurer
6,631 Views
Registered: ‎12-02-2014

Re: Zynqmp USB2.0

 I'm having a similar issue with a USB3340 and peripheral mode.  Having the USB cable plugged in doesn't seem to help in my case however.  Did you get anywhere with this?

0 Kudos
Adventurer
Adventurer
6,595 Views
Registered: ‎05-07-2008

Re: Zynqmp USB2.0

Hello,

Unfortunately I have not gotten any further. I have a case submitted with Xilinx, but that not going anywhere thus far. If I get it working I will definitely post what I find out. If you find something out please post here.

 

FYI, for me, host mode will cause the board to reset about the time it loads the drivers.

0 Kudos
Adventurer
Adventurer
6,583 Views
Registered: ‎12-02-2014

Re: Zynqmp USB2.0

The thing that's confusing to me, is that I don't see Xilinx using the DWC3 ULPI integration in their examples.  I don't know if it's actually needed here or not.

 

With the standard kernel config options, we get the following error:

dwc3 fe200000.dwc3: failed to enable ep0out

 

Enabling ULPI dwc3 integration (CONFIG_USB_DWC3_ULPI=y) gets a different set of issues:

[    4.947666] dwc3 fe200000.dwc3: node

[    4.951162] dwc3 fe200000.dwc3: usb2_phy: ret == -ENXIO || ret == -ENODEV

[    4.958404] dwc3 fe200000.dwc3: failed to register ULPI interface

[    4.964424] dwc3 fe200000.dwc3: dwc3_phy_setup

[    4.968847] dwc3 fe200000.dwc3: failed to initialize core

[    4.974262] dwc3: probe of fe200000.dwc3 failed with error -110

 

It’s failing in the dwc3_phy_setup() function, as it’s expecting a usb2 and usb3 phy node to be defined in the device tree.

0 Kudos
Adventurer
Adventurer
6,475 Views
Registered: ‎05-07-2008

Re: Zynqmp USB2.0

Not a lot to update, but this is the latest

 

I have CONFIG_USB_DWC3_ULPI enabled in my .config

I am booting with USB in Host mode now.

 

lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

 

however;

1) there are no messages in dmesg with dwc3

2) there are no messages in dmesg with ULPI

 

I too was wondering if a usb phy node had to be added, similar to what had to be done for Zynq-7000?

 

 

0 Kudos
Adventurer
Adventurer
6,433 Views
Registered: ‎05-07-2008

Re: Zynqmp USB2.0

Little more information regarding this.

I've gotten USB working. To do so I had to do the following (these steps may not work for other boards):

 

1) Double click Zynq Ultrascale+ from your block diagram and select "I/O Configuration"

2) Under High Speed / USB 0 I checked the USB 3.0 box (even though I do not use it)

3) Navigate to "Clock Configuration / GT Lane Reference frequecny

4) Select a Ref Clk for USB0 and set frequency to 26MHz

 

My hardware has a multi-channel configurable clock generator and I was able to reprogram it with the appropriate rate for USB0

Rebuild and export the hardware to SDK as usual.

After SDK has rebuilt the appropriate code ensure that file psu_init.c is modified according to this

I've only done thus far:

USB2 phy suspend disable
For this workaround please update GUSB2PHYCFG to 0x2417

 

Save and remake the fsbl and then boot.bin

 

I've since been told about some fsbl code that is not in any AR that one must do so that you do not have to do what I described. Supposedly it will be made public soon. When I undo the above and add that code USB fails like it did originally.

 

 

 

 

Participant pillinj1
Participant
6,025 Views
Registered: ‎02-11-2014

Re: Zynqmp USB2.0

Thanks jawbone,

 

Just encountered this exact same problem in Vivado 2017.3.1. I was trying to use the USB1 port in 2.0 mode and it wasn't working. I tried your workaround of enabling USB 3.0 in the GUI (i.e PSU__USB3_1__PERIPHERAL__ENABLE {1}) and that along with the GUSB2PHYCFG update got it to work. I just left the GT Lane and GT Reference Clock to what Vivado set them.

 

FYI, instead of modifying psu_init.tcl, you can add "snps,dis_u2_susphy_quirk;" to the devicetree for the dwc node.

 

Hopefully this is fixed in an upcoming Vivado release.

Adventurer
Adventurer
5,988 Views
Registered: ‎05-07-2008

Re: Zynqmp USB2.0

Thanks pillinj1 for the info regarding adding "snps,dis_u2_susphy_quirk"

That will be much easier than remembering to modify the init file.

0 Kudos
Moderator
Moderator
5,979 Views
Registered: ‎10-06-2016

Re: Zynqmp USB2.0

Hi @jawbone_101

 

In the older releases of Petalinux there was a known issue with USB 2.0 in the MPSoC and the AR69533 was required to make it work.

 

In 2017.3 this issue is fixed but still the following changes are required in the DTS entry of the USB node:

&dwc3_0 {
    maximum-speed = "high-speed";
    /delete-property/phy-names;
    /delete-property/phys;
    /delete-property/snps,usb3_lpm_capable;
};

Regards,

Ibai


Ibai
Don’t forget to reply, kudo, and accept as solution.
0 Kudos
Adventurer
Adventurer
3,596 Views
Registered: ‎12-02-2014

Re: Zynqmp USB2.0

@ibaie, We've upgraded from v2017.2 to v2017.4 (uboot, kernel, vivado). 

 

Thus far I've only been able to get USB2.0 working by using the psu_init files from v2017.2 with the device tree modifications required for v2017.2 and below:

 

&dwc3_0 {

  status = "okay";

  dr_mode = "peripheral";

  snps,dis_u2_susphy_quirk;

  snps,dis_u3_susphy_quirk;

  maximum-speed = "high-speed";

} ;

&usb0 {

    status = "okay";

    /delete-property/clocks;

    /delete-property/clock-names;

    clocks = <0x3 0x20>;

    clock-names = "bus_clk";

};

 

&serdes{

 status = "disabled";

};

 

I'm thinking there must be some other changes required for the new version?

 

Justin D.

0 Kudos
Moderator
Moderator
3,572 Views
Registered: ‎02-07-2018

Re: Zynqmp USB2.0

Hi jdefields,

Can you try with below device tree changes. It should work for you. 

For more info you can refer this AR: https://www.xilinx.com/support/answers/70625.html

 

&dwc3_0 {
dr_mode = "peripheral";
maximum-speed = "high-speed";
snps,dis_u2_susphy_quirk;
snps,dis_u3_susphy_quirk;
/delete-property/ phy-names;
/delete-property/ phys;
};

&usb0{
/delete-property/clocks;
/delete-property/clock-names;
clocks = <0x3 0x20>;
clock-names = "bus_clk";
};

 

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.
----------------------------------------------------------------------------------------------

0 Kudos
Adventurer
Adventurer
3,565 Views
Registered: ‎12-02-2014

Re: Zynqmp USB2.0

@aravindb, no that doesn't work.

 

I get the original error:

dwc3 fe200000.dwc3: failed to enable ep0out

0 Kudos
Scholar milosoftware
Scholar
3,305 Views
Registered: ‎10-26-2012

Re: Zynqmp USB2.0

Has there been any progress? We're facing the exact same issue, and cannot get the USB2 device to work in peripheral mode.

 

Host mode works, peripheral just displays the "failed to enable ep0out" error.

0 Kudos
Moderator
Moderator
3,299 Views
Registered: ‎05-10-2017

Re: Zynqmp USB2.0

Which version of the tools are you using?

Make sure RESETB is being toggled. Take a look at this AR as well

 

https://www.xilinx.com/support/answers/69533.html

 

-------------------------------------------------------------------------
Don’t forget to reply, kudo, and accept as solution.
-------------------------------------------------------------------------
0 Kudos
Adventurer
Adventurer
1,629 Views
Registered: ‎12-02-2014

Re: Zynqmp USB2.0

Anyone have this working in 2018.x yet?

0 Kudos
Adventurer
Adventurer
1,604 Views
Registered: ‎12-02-2014

Re: Zynqmp USB2.0

@jovitac, In 2018.2 kernel, if I revert the drivers/usb/dwc3 folder to the source code from 2017.4 (with a code comment to fix a compile error), the USB port works in peripheral mode.

Can you explain what changes are required in the device tree (or in uboot/FSBL) to support the driver updates?

 

0 Kudos
Adventurer
Adventurer
1,568 Views
Registered: ‎12-02-2014

Re: Zynqmp USB2.0

There is some kind of bug in drivers/usb/dwc3/gadget.c

In dwc3_gadget_set_speed, you will get requests to set the speed higher than both dwc->maximum_speed or gadget.max_speed.  This should not be possible, or there should be some kind of check there.

Putting this check at the top of the function resolved the issue for me in 2018.2, but I'm not sure that's the proper/complete solution:

if (speed > dwc->maximum_speed)
{
   dev_info(dwc->dev, "set_speed: Forcing dwc->maximum_speed\n");
   speed = dwc->maximum_speed;
}

 

@jawbone_101@jovitac@milosoftware@aravindb  can you check this out?

 

0 Kudos
Adventurer
Adventurer
1,510 Views
Registered: ‎12-02-2014

Re: Zynqmp USB2.0

This upstream fix may be the solution (rather than what I posted above, though that check is probably still a good idea):

https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/drivers/usb/gadget/udc/core.c?h=v4.14.114&id=28ddc2b45f5f409b905dc78e79d959377789fc12

0 Kudos
Adventurer
Adventurer
880 Views
Registered: ‎05-07-2008

Re: Zynqmp USB2.0

Thanks @jdefields
We are facing USB 2.0 peripheral mode issues with our newest design and 2018.2.
Will keep an eye on this thread.
0 Kudos
Adventurer
Adventurer
797 Views
Registered: ‎05-07-2008

Re: Zynqmp USB2.0

Mostly a status update.

We are using 2018.3 (Vivado and kernel tag). In our design, we have USB0 as 2.0 (going through a HUB chip) in device mode AND USB1 as 3.0 going straight to a Type A connector. So far we are not able to get either port to work in either mode. Using USB3320 PHYs in both cases. PHY resets are being toggled by the fsbl (seems 2018.3 is not toggling them without the need for exra code). I checked the kernel driver and we have the latest fix pointed out by @jdefields

Both USB ports have USB3.0 checked in the Vivado configuration.

Neither port is working for us in any mode

 

Highlighted
Adventurer
Adventurer
774 Views
Registered: ‎05-07-2008

Re: Zynqmp USB2.0

Update: Got USB0 peripheral mode working with 2018.3. This is what worked for me. Hope it is useful to someone else. (This is a custom board and I am NOT using PetaLinux)

Devicetree:

&usb0 {
	status = "okay";
	xlnx,usb-polarity = <0x0>;
	xlnx,usb-reset-io = <0x4c>;
	xlnx,usb-reset-mode = <0x2>;
};
&dwc3_0 {
	status = "okay";
	dr_mode = "peripheral";
	snps,dis_u2_susphy_quirk;
	snps,dis_u3_susphy_quirk;
	maximum-speed = "high-speed";
};

Vivado:

image.pngI/O Configuration

 

image.pngClock Configuration

Linux Kernel:

Used this link to ensure I had the right kernel config.

https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18841729/Zynq+Ultrascale+MPSOC+Linux+USB+device+driver

However, in my case, I could not get Dual Role to appear when configuring "Designware USB3 DRD Core support". It would only show "Host only" or "Device only." I had to go to Device drivers and enable "External Connector Class (extcon) support." I also enabled "USB ULPI PHY interface suport" and then that enables "Register ULPI PHY Interface" under "Designware USB3 DRD Core support." Not sure if all that is needed or not, but that's what I have configured.

YMMV

Now to get USB1 to work in USB 3.0 Host mode

Participant perencia-wc
Participant
579 Views
Registered: ‎10-03-2017

Re: Zynqmp USB2.0

In case anyone tries with 2018.2, the "snps,dis_u2_susphy_quirk" has already been been integrated, but you still need to enable USB 3.0 on Vivado, even if you are not using it.
0 Kudos