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!

Reply

Petalinux 2015.2.1 usb not working

Accepted Solution Solved
Adventurer
Posts: 63
Registered: ‎08-16-2007
Accepted Solution

Petalinux 2015.2.1 usb not working

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


Accepted Solutions
Adventurer
Posts: 63
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

[ Edited ]

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


All Replies
Xilinx Employee
Xilinx Employee
Posts: 161
Registered: ‎11-12-2007

Re: Petalinux 2015.2.1 usb not working

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

Adventurer
Posts: 63
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

[ Edited ]

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

Xilinx Employee
Xilinx Employee
Posts: 161
Registered: ‎11-12-2007

Re: Petalinux 2015.2.1 usb not working

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

 

 

Adventurer
Posts: 63
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

[ Edited ]

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

 

Xilinx Employee
Xilinx Employee
Posts: 161
Registered: ‎11-12-2007

Re: Petalinux 2015.2.1 usb not working

[ Edited ]

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.

Adventurer
Posts: 63
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

[ Edited ]

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

Adventurer
Posts: 63
Registered: ‎08-16-2007

Re: Petalinux 2015.2.1 usb not working

[ Edited ]

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

Visitor
Posts: 6
Registered: ‎05-21-2013

Re: Petalinux 2015.2.1 usb not working

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

 

Visitor
Posts: 6
Registered: ‎05-21-2013

Re: Petalinux 2015.2.1 usb not working

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)