cancel
Showing results for 
Search instead for 
Did you mean: 
Highlighted
Adventurer
Adventurer
21,569 Views
Registered: ‎08-16-2007

Petalinux 2015.2.1 usb not working

Jump to solution

Hi,

I have updated to Petalinux 2015.2.1 from 2014.4.

USB is not working anymore.

The host controller is detected but not the PHY (USB3320).

I enabled the Generic ULPI Transceiver Driver

in the kernel configuration and disabled NOP USB Transceiver Driver

I don't know why in 2015.2.1 the selection is different from 2014.4.

I managed to build Petalinux 2014.4 for exectly the same system (hdf created in Vivado 2015.1) and USB works as expected.

The pcw.dtsi, system-conf.dtsi and system-top.dts are practically the same for both versions.

Any idea what's wrong with 2015.2.1?

Thanks!
Ben

0 Kudos
1 Solution

Accepted Solutions
Highlighted
Adventurer
Adventurer
37,244 Views
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

Jump to solution

I finally got  this to work. In addition to forcing the 5V on, the following lines must be added to system-top.dts:

/{
	usb_phy0: usb_phy@0 {
		compatible = "usb-nop-xceiv";
		#phy-cells = <0>;
	};
};

&usb0 {
	dr_mode = "host";
	usb-phy = <&usb_phy0>;
};

This comes with the ZC702 bsp but if you are working on your own board like me, you have to add those lines.

I would make a comment here that I believe Xilinx can do a better job at documenting changes like this.

This link http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver is only partially good, it made be aware that something extra is needed but it wasn't clear until I found the ZC702 example.

If anyone has a better link please post it.

Thanks,

Ben

View solution in original post

19 Replies
Highlighted
Xilinx Employee
Xilinx Employee
21,566 Views
Registered: ‎11-12-2007

Re: Petalinux 2015.2.1 usb not working

Jump to solution

Hi,

 

In 2015.2.x we have transitioned to an existing mainined kernel driver for the USB controller in the Zynq devices. We've identified an issue where this mainline driver always acts as an OTG driver even if the DTS is configured for host-only operation. In practice, what this means is that if you plug in a device-type cable the PHY will negotiate as a device type endpoint and disable the CPEN output, which will turn off the +5V power to the connector.

 

Xilinx is working with the Linux community to enable a patch, but until that makes it into the kernel tree you can work around the issue by writing directly to the PHY through the ULPI keyhole register in the controller memory space. Assuming you're using USB0, the command is:

 

devmem 0xe0002170 32 0x600a0067

 

You can also use the attached PetaLinux component to script this write at system startup. Add this to the components/apps directory under your PetaLinux project and then enable it in the menuconfig utility (petalinux-config -c rootfs).

 

Hope this helps!

 

--Rob

Highlighted
Adventurer
Adventurer
21,556 Views
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

Jump to solution

Indeed the 5V USB supply is not turned on.

Thank you for looking into this but the suggested command doesn't appear to be doing anything. The USB power is still down.

The primary problem is that the PHY is not detected at all.

Regards,

Ben

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
21,549 Views
Registered: ‎11-12-2007

Re: Petalinux 2015.2.1 usb not working

Jump to solution

You do need to use the NOP xceiver driver as in the example system. When I read through your initial post I glossed over the fact that you had disabled it.

 

The NOP xceiver driver is essentially a dummy driver for a passthrough PHY, but it lets the ChipIdea driver get through setup properly.

 

--Rob

 

 

0 Kudos
Highlighted
Adventurer
Adventurer
21,509 Views
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

Jump to solution

Hi,

Thanks for your help.

I included the NOP xceiver driver as you said and enabled the chipidea driver like in the ZC702 example.

I can get 5V now, but the port is still not working. No device is detected when I plug something like a usb stick.

I also tried to include the provided script following your instructions:

- copied the script and the other files in commponnets/apps

- ran petalinux-confog c rootfs but this script doesn't show up under Apps. I wonder what I am missing.

 

Anyway, I have to say it again, I believe the primary problem is that the PHY is not found.

2014.4 reports this as follows:

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
ULPI transceiver vendor/product ID 0x0424/0x0007
Found SMSC USB3320 ULPI transceiver.
ULPI integrity check: passed.
zynq-ehci zynq-ehci.0: Xilinx Zynq USB EHCI Host Controller
zynq-ehci zynq-ehci.0: new USB bus registered, assigned bus number 1
zynq-ehci zynq-ehci.0: irq 53, io mem 0x00000000
zynq-ehci zynq-ehci.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected

while

2015.2.1 says:

usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb

and later:

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage

Thanks again for looking into this.

Ben

 

0 Kudos
Highlighted
Xilinx Employee
Xilinx Employee
21,500 Views
Registered: ‎11-12-2007

Re: Petalinux 2015.2.1 usb not working

Jump to solution

The messages printed during bootup will be different with the new driver. You won't see the information about ULPI PHYs, even if it's working.

 

Have you verified the presence of +5V at the USB connector on the board? I wouldn't expect to see it without enabling the component. The component (scripts, etc.) shoudl be installed as-is under components/apps. So your directory structure should look like this:

 

  • components
    • apps
      • force_usb_power
        • Makefile
        • Kconfig
        • force_usb_power.sh

After setting it up this way you should see the component under apps in 'petalinux-config -c rootfs'. You could also run the command in the script manually from the command line.

 

I have to stress that with the new driver, the phy will never be found as the NOP driver is essentially a dummy driver that sets up a virtual "passthrough" PHY.

0 Kudos
Highlighted
Adventurer
Adventurer
21,495 Views
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

Jump to solution

Hi,

I can confirm that 5V is present by measuring.

I also managed to include the script and have it running:

Forcing USB OTG to host mode (enabling +5V power rail): OK

Built with PetaLinux v2015.2.1 (Yocto 1.8) g4lin9 /dev/ttyPS0
g4lin9 login: root
Password:
login[999]: root login on 'ttyPS0'

As I said, I measured 5V in the USB connector, but nothing happens when I plug a USB stick.

Thanks!
Ben

0 Kudos
Highlighted
Adventurer
Adventurer
37,245 Views
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

Jump to solution

I finally got  this to work. In addition to forcing the 5V on, the following lines must be added to system-top.dts:

/{
	usb_phy0: usb_phy@0 {
		compatible = "usb-nop-xceiv";
		#phy-cells = <0>;
	};
};

&usb0 {
	dr_mode = "host";
	usb-phy = <&usb_phy0>;
};

This comes with the ZC702 bsp but if you are working on your own board like me, you have to add those lines.

I would make a comment here that I believe Xilinx can do a better job at documenting changes like this.

This link http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver is only partially good, it made be aware that something extra is needed but it wasn't clear until I found the ZC702 example.

If anyone has a better link please post it.

Thanks,

Ben

View solution in original post

Highlighted
Observer
Observer
21,198 Views
Registered: ‎05-21-2013

Re: Petalinux 2015.2.1 usb not working

Jump to solution

I'm running into the same problem. In my case the custom board USB (host mode) was working fine with the same PHY(USB3320) with Xilinx Kernel. We migrated to Petalinux (2014.4 and then to 2015.2) and I didn't test the USB as it was least or not used so far.

1) I was under the same impression as Ben that PHY chip was the problem until I bumped on to this. I made the script as suggested to turn on the USB power and I'm getting the following lines during boot up

==========================================

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
usbcore: registered new interface driver usbserial
usbcore: registered new interface driver ftdi_sio
usbserial: USB Serial support registered for FTDI USB Serial Device
e0002000.ps7-usb supply vbus not found, using dummy regulator
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected

=============================

And I made the changes to the device tree too

 

However I didn't see any USB devices populated under the devices or to that matter if lsusb doesn't identify any new USB other than the following

====================================

Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

=======================================================

I wasn't sure what this means? Does it still sits as OTG

The turning on the USB power takes place after the kernel initialization of driver. Do we need to do it before the initialization(through fsbl?)

I'm lost here. Any help is much appreciated

-Ram

 

0 Kudos
Highlighted
Observer
Observer
21,160 Views
Registered: ‎05-21-2013

Re: Petalinux 2015.2.1 usb not working

Jump to solution

Answering to my question and hope it will help some one.

I wasn't measure the output voltage earlier and when I measure 5V wasn't there and it turned out to be that the USB3320 was in reset state. The reset was wired to MIO[7] and once I set it USB started to work fine. My only concern is how it was working earlier with previous kernel as at one point I commented the turn on of this MIO pin in the code.

Couple of observations

- As mentioned earlier the boot log wont't print about identifying PHY chip(it would have been nice if Xilinx mentioned explicitly about the driver change, impact of it in ZynqLinuxUSBDriver)

- The order is not important. In my current working scenerio, the driver initialized first(kernel booting) and then turn on the host mode(turn on 5V in file system start up) and finally taking it out from reset through user space application(writing GPIO through sysfs)

0 Kudos
Highlighted
Adventurer
Adventurer
14,526 Views
Registered: ‎02-04-2014

Re: Petalinux 2015.2.1 usb not working

Jump to solution

Hello,

 

I have the same problem with the USB. I am not using the petalinux but xilinx linux kernel 4.0. I have also configure the kernel according to http://www.wiki.xilinx.com/Zynq+Linux+USB+Device+Driver#Testing-Related Links. My device tree for the USB node is as follows: 

 

usb@e0002000 {
compatible = "xlnx,zynq-usb-2.20a", "chipidea,usb2";
status = "okay";
clocks = <0x1 0x1c>;
interrupt-parent = <0x3>;
interrupts = <0x0 0x15 0x4>;
reg = <0xe0002000 0x1000>;
phy_type = "ulpi";
dr_mode = "host";
usb-phy = <0xb>;
};

phy0 {
compatible = "usb-nop-xceiv";
#phy-cells = <0>;
reg = <0xe0002000 0x1000>;
view-port = <0x0170>;
drv-vbus;
linux,phandle = <0xb>;
phandle = <0xb>;
};

 

 

My linux boot log reports following: 

 

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver
usbcore: registered new interface driver usb-storage
platform e0002000.usb: Driver chipidea-usb2 requests probe deferral

usbcore: registered new interface driver usbhid
usbhid: USB HID core driver

 

But I don't see the usb node at /dev/.

 

So I changed my devicetree and use

 

compatible = "ulpi-phy";

Now I got following boot log.

 

ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
ehci-pci: EHCI PCI platform driver

usbcore: registered new interface driver usb-storage
e0002000.usb supply vbus not found, using dummy regulator
ULPI transceiver vendor/product ID 0x0424/0x0009
Found SMSC USB334x ULPI transceiver.
ULPI integrity check: passed.
ci_hdrc ci_hdrc.0: EHCI Host Controller
ci_hdrc ci_hdrc.0: new USB bus registered, assigned bus number 1
ci_hdrc ci_hdrc.0: USB 2.0 started, EHCI 1.00
hub 1-0:1.0: USB hub found
hub 1-0:1.0: 1 port detected

 

still I don't see any usb node at /dev/

 

Any reason why I am unable to see the usb. 

 

Thanks

 

 

 

0 Kudos
Highlighted
Explorer
Explorer
10,402 Views
Registered: ‎04-23-2013

Re: Petalinux 2015.2.1 usb not working

Jump to solution

We are still having a hard time with USB.

When using the ZC702 BSP, we can see devices (such as a mouse), but not other hosts (ZC702 as a peripheral device).

When using our own hdf, no USB power unless a host is connected (providing power), so no devices can connect, and hosts can't connect to us.

 

I have seen in this post and others, talk of "force_usb_power".

What is this?

Also force_usb_power.tar.gz ‏2 KB

I downloaded this, but could not open it w/ 7ZIP.

 

I am attaching a summary of all the forum posts we're following.

Our ultimate goal is OTG with petalinux and our own hdf.

 

Thanks,

Emmett

0 Kudos
Highlighted
Adventurer
Adventurer
10,028 Views
Registered: ‎04-22-2015

Re: Petalinux 2015.2.1 usb not working

Jump to solution

What is the status of this? I just tried to use the USB port on the Zedboard with the mainline 4.9 kernel, and it doesn't seem to be working. dmesg shows:

root@zedboard:/# dmesg | grep -i usb
[    0.074244] usbcore: registered new interface driver usbfs
[    0.074316] usbcore: registered new interface driver hub
[    0.074376] usbcore: registered new device driver usb
[    1.082260] pegasus: v0.9.3 (2013/04/25), Pegasus/Pegasus II USB Ethernet driver
[    1.089655] usbcore: registered new interface driver pegasus
[    1.095308] usbcore: registered new interface driver asix
[    1.100678] usbcore: registered new interface driver ax88179_178a
[    1.106753] usbcore: registered new interface driver cdc_ether
[    1.112589] usbcore: registered new interface driver smsc75xx
[    1.118322] usbcore: registered new interface driver smsc95xx
[    1.124043] usbcore: registered new interface driver net1080
[    1.129684] usbcore: registered new interface driver cdc_subset
[    1.135591] usbcore: registered new interface driver zaurus
[    1.141164] usbcore: registered new interface driver cdc_ncm
[    1.148086] ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
[    1.189607] ohci_hcd: USB 1.1 'Open' Host Controller (OHCI) Driver
[    1.222923] usbcore: registered new interface driver usb-storage
[    1.229106] e0002000.usb supply vbus not found, using dummy regulator
[    1.350604] usbcore: registered new interface driver usbhid
[    1.353379] usbhid: USB HID core driver
root@zedboard:/# lsusb
unable to initialize libusb: -99
root@zedboard:/# ls /sys/bus/usb/devices/
root@zedboard:/#

 

I've attached the .config as well.

 

I think this might be the same issue, but I can create a new thread if needed.

 

thanks,

Paul

0 Kudos
Highlighted
Participant
Participant
9,977 Views
Registered: ‎11-22-2016

Re: Petalinux 2015.2.1 usb not working

Jump to solution

Hello,

 

I have the same problem in Petalinux 2016.4 and the z-Turn board (Zynq 7020).  The Linux is running but there is not +5V on the OTG (the board uses the USB3320C driver). As on your board, the reset pin is connected to MIO[7]. I have changed the devicetree but no change.

The problem seems to be the same as yours. Could you (or anyone else) suggest to me what I have to do to change the reset pin state, please? What to do to bring the USB +5V up (I do not know what to write to the .sh script)? 

 

Also, I have found the suggestion to write the following code for USB reset into the fbsl_hooks.c:

// Reset USB

XEmacPs Emac;

 

       Status = XEmacPs_PhyWrite(&Emac, 0x1A, 0x07, 0x0010);
       Status = XEmacPs_PhyWrite(&Emac, 0x1A, 0x07, 0x0000);
       if (Status != XST_SUCCESS) {
           fsbl_printf(DEBUG_INFO,"Error reset phy \r\n");
       return XST_FAILURE;
       }

 

I placed this code into the FsblHookBeforeHandoff and rebuilt the FSBL but the board does not boot at all with no message on the terminal screen (the DEBUG and DEBUG_INFO symbols are set).  Perhaps, I have wrong parameters for XEmacPs_PhyWrite function but I don't know where to determine the right ones... If I comment this code then Petlinux boots up without problem.

 

I am a beginner with Zynq...and I have spent already much time trying to make the USB work... 

 

Please, answer my questions and help me to make the USB working...

 

Thank you in advance for your help,

 

Jirka

Kindly note: please mark the Answer as "Accept as solution" if information provided is helpful and/or give Kudos to a post. Thank you!
0 Kudos
Highlighted
Explorer
Explorer
9,968 Views
Registered: ‎04-23-2013

Re: Petalinux 2015.2.1 usb not working

Jump to solution

After weeks of trying, my colleague has made some progress, but still not working.

You can search his post by name teastham.

Here is the latest:

https://forums.xilinx.com/t5/Embedded-Linux/How-to-Setup-Bulk-In-Out-USB-Endpoints-for-OTG-peripheral-in/m-p/742923/highlight/true#M18076

 

Thanks,

Emmett

0 Kudos
Highlighted
9,790 Views
Registered: ‎02-01-2017

Re: Petalinux 2015.2.1 usb not working

Jump to solution

Hi,

 

I have the same problem, and this workaround work. Is there a patch on the mainline Kernel now ? Or maybe on the Xlilinx kernel ? I want to correct this on properly on the corresponding driver.

 

Regards,

Math

0 Kudos
Highlighted
9,787 Views
Registered: ‎02-01-2017

Re: Petalinux 2015.2.1 usb not working

Jump to solution
0 Kudos
Highlighted
Adventurer
Adventurer
9,774 Views
Registered: ‎04-22-2015

Re: Petalinux 2015.2.1 usb not working

Jump to solution

To get the mainline kernel working I had to copy the way the xilinx kernel does the ulpi-phy, you can see the patch here:

https://forums.xilinx.com/t5/Embedded-Linux/Zynq-7000-USB-with-mainline-kernel-is-broken/td-p/744026

 

thanks,

Paul

0 Kudos
Highlighted
Observer
Observer
7,653 Views
Registered: ‎03-17-2008

Re: Petalinux 2015.2.1 usb not working

Jump to solution

Though not using PetaLinux, I have had similar problems as others getting USB Host working. My platform is the PicoZed Carrier Card with a PicoZed 7015/7030. My kernel is 4.9.0 from the Xilinx github site.

 

After getting the device tree files correct as described previously in this thread (and here), I was able to see the ULPI driver report the presence of the USB3320 chip:

ULPI transceiver vendor/product ID 0x0424/0x0007
Found SMSC USB3320 ULPI transceiver.
ULPI integrity check: passed.

But no devices plugged into the USB port were ever seen. I traced the problem down to an apparently faulty NC7SZ66 switch, which is U15 on the PicoZed Carrier Card. The input voltage was 5 V, but the output voltage was 3.7 V, which is out of the USB spec. The output enable pin was 5 V, as well, so the VBUS was being turned on correctly.

 

I put a solder bridge across pins 1 and 2 (signals A and B) of that chip, essentially bypassing the switch chip, and USB Host started working.

 

So, if you're struggling getting USB Host working, make sure that VBUS is the correct voltage to the USB connector. There may be problems other than software.

 

Aric.

0 Kudos
Highlighted
Adventurer
Adventurer
1,250 Views
Registered: ‎10-14-2013

Re: Petalinux 2015.2.1 usb not working

Jump to solution

This is still relevant @ 2019.1 - not fixed?

Ultrascale+ Zynq with TUSB1210 and not succeeded to enable the VBUS by the petalinux drivers. USB-port works if 5V supply switch is overriden with jumper (forced VBUS supply).

0 Kudos