Hi all,
I can see many discussions in the forums about getting USB host-mode working on a Microzed (Zynq 7020). In particular, here's a selection of links that I've already read:
- http://zedboard.org/content/usb-host-microzed-petalinux-20172
- http://zedboard.org/zh-hant/node/8651
- https://forums.xilinx.com/t5/Embedded-Processor-System-Design/Cannot-get-USB-to-work-on-microzed-7010-with-arch-linux-using/td-p/652816
- http://zedboard.org/content/access-usb-microzed-board
- https://forums.xilinx.com/t5/Embedded-Linux/Petalinux-2015-2-1-usb-not-working/td-p/654349
- https://forums.xilinx.com/t5/Embedded-Linux/USB-works-in-device-mode-but-not-in-host-mode/td-p/679097
I've spent a lot of time googling, but have so far not been successful. I'm using Petalinux 2018 and the Zedboard metadata layers to build the image. I added a device tree layer similar to what is presented here: https://xilinx-wiki.atlassian.net/wiki/spaces/A/pages/18842272/Zynq+Linux+USB+Device+Driver
By itself, that doesn't work. No USB bus is available. However, I changed the bus's "compatible" property and moved "drv-vbus" from the phy to the bus itself, so now I have
/ {
usb_phy0: phy0 {
compatible = "usb-nop-xceiv";
#phy-cells = <0>;
reg = <0xe0002000 0x1000>;
view-port = <0x170>;
};
};
&usb0 {
dr_mode = "host";
usb-phy = <&usb_phy0>;
drv-vbus;
};
When I use this device tree, the USB bus appears to be available:
# lsusb
Bus 001 Device 001: ID 1d6b:0002
# dmesg | grep -i usb
usbcore: registered new interface driver usbfs
usbcore: registered new interface driver hub
usbcore: registered new device driver usb
usb_phy_generic e0002000.phy0: e0002000.phy0 supply vcc not found, using dummy regulator
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver usb-storage
chipidea-usb2 e0002000.usb: e0002000.usb supply vbus not found, using dummy regulator
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
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
However, the board still does not recognize any USB devices plugged into it. If I plug in a USB flash drive, for example, the LED on the drive does light up, but nothing new is available in lsusb, no new messages appear in dmesg, and no new block device appears in /dev.
I've tried everything in the links above, I've tried different USB devices, I've tried a powered USB hub, and all I can figure is that there's still some device between the OS and the port that isn't configured correctly. In particular, I'd like to know more about the following:
- Is there a requirement to toggle the reset on the USB3320 chip after power comes up? I have seen some mention of this in similar posts.
- Sometimes this is handled by the first-stage bootloader. Can AVnet confirm?
- If not the first-stage bootloader, does this need to be done some other way?
- Does USB need to be enabled by setting a GPIO? If so, which GPIO?
- In older versions of the linux kernel/device tree, a USB PHY configuration was not needed. Now, a PHY element must be added to the device tree in order for the system to recognize the USB root hub. This is not done in the stock Zynq-7000 metadata.
- Can you confirm that usb-nop-xceiv is appropriate for this PHY?
- Does the PHY require configuration of clocks or regulators in order to function correctly?
- When USB devices are inserted, the kernel does not fire uevents. Is there any configuration beyond default that is needed to enable this, or is there a hardware/device tree configuration issue blocking this?
- In the current configuration, the EHCI is correctly detected
- Is there any kernel configuration required to ensure that hub IRQs are handled correctly?
- Is there any kernel configuration required to ensure that hub events are handled correctly?
Has anyone managed to get this working on a Microzed, and if so, can you share your method?
Thanks!