-
Notifications
You must be signed in to change notification settings - Fork 1
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
USB host port sometimes unpowered after boot #3
Comments
Raising priority to high. We are seeing 4-5 people with issues right now. |
We did some investigation and the results are: When the system is starting linux kernel tries to detect USB phy and if this detection fails it will never retry it after boot is finished. We noticed that if during booting process we had long cable (about 80 cm) connected to USB port the phy was always detected w/o problems. It may be only USB extension cord without any device at the end to get the phy working. Without it or with short (10 cm) micro USB to type A adapter we often had problems with proper detection of the USB phy. We have theory that long cable somehow dampens the jitters on the USB lines, thus it can start without problems. Please try running your boards with longer cable attached to USB and give us feedback if you notice similar behavior. |
Karol, Thanks!! This is very interesting, we'll check. |
IMO, the "noise" prevent the phy from being properly detected and initialized by software, thus the "EN" signal is not driven. I don't think if there is possibility to force this to always stay on, since the phy is not even detected. I will look at it. Right now we are forcing host mode. I was using it with powered hub with long connecting cable and everything was working fine. If I find some hub with short cables I will test it and give you feedback. |
I've tested USB with powered hub and short cable i sometimes it remains unpowered after boot. Only cable length influences USB phy detection. |
karol, can you help me understand the situation? |
Yes, IMO there is some noise on the USB lines that in some way prevents USB phy (ULPI) from being properly detected during powerup, thus init procedure do not even start because Linux do not finds ULPI. I don't know exactly how the noise influences ULPI chip, but somehow it prevents it from being detected. Maybe the device hangs due to some jitters. If the ULPI is not detected in the Linux log we have only:
otherwise
If there is nothing plugged into the USB port at boot it tends to fail. Only plugging long cable improves the situation. The host mode is set by the Linux - it is forced in devicetree. The U-boot do not even touch USB. FSBL only configures internals Zynq's clock generators and enables ehci-hcd. Forcing 5V to USB power line do not change anything if the ULPI is not detected. Lack of voltage on the USB line is the effect of failure, not the cause. We have theory that adding shotky diodes to the USB lines it may improve the stability of the device. We will design and assembly small PCB that could be attached to USB port - it will act as adapter and will provide additions stabilization on those lines. Of course it will take some time to produce and test it but it may help. |
I'm able to confirm this behavior on one board I have but another works all the time. Not sure if this helps, see last two messages in this thread: |
We have not seen any stability issues during normal operations, only this initialization issue. I noticed the general file does not use the GPIO. Not sure if this has any effect since we are not using the GPIO? Interfering with other things? Can you try recompiling the kernel with the updated driver from Xilinx to see if it improves things? Also, please see the following issue: https://github.com/Xilinx/linux-xlnx/issues/19 parallella-linux-adi/drivers/usb/host/xusbps-dr-of.c https://github.com/Xilinx/linux-xlnx/blob/master/drivers/usb/host/xusbps-dr-of.c |
I've checked the board with reset pin attached to the ULPI chip and resetting code in the driver and still USB phy tends to hang during bootup. Only attaching long cable or adding additional ESD protection stabilizes the device. |
Can you help us understand the relationship between the fsbl, uboot, and linux when it comes to the USB (otg vs host mode). Are we sure that there are not some things in the fsbl that could affect behavior. For example, should we try with 14.7 to see what happens in case there is some inter relationship between the uboot and linux. |
FSBL configures clock and basic features of the CPU. Now in 14.7 if USB is configured to reset the ULPI via GPIO the FSBL does it by setting '0' and then '1' on this output. The old version (the one implemented in official parallella binaries) does not reset the USB. U-boot do not use USB and do nothing with it. However U-boot that we are using resets the ULPI during startup using GPIO but nothing else. Linux kernel configures and enables USB and ULPI. It reads configuration from the device tree and configures USB subsystem to be host or device according to it. Note that the reset pin has to be physically connected to the ULPI chip to enable resetting the chip by the software (FSBL, U-boot and Linux). On the parallella board this pin is not connected to the Zynq GPIO, thus software cannot reset the ULPI (the code has no affect). However on one of the boards I have I connected the reset pin to the proper GPIO pin, enabling ULPI resetting, but it does not change the behavior of the USB - as I wrote before. We can update the U-boot to the newest version provided by Xilinx, but it IMO won't fix the USB, because there is no code doing anything with USB in it. Note that updating the bootloader may cause some problems with other peripherals. Actually I noticed strange behaviour of the UART in newest U-Boot on the Zedboard. |
Thanks for the explanation..makes sense. This is what one of the engineers came back with from Xilinx. He said he tested it and it worked? Can you verify? In your kernel device tree you would have: usb@e0002000 { interrupts = <0x0 0x15 0x4>; phy_type = "ulpi"; This changes to (note the phy_type field): usb@e0002000 { reg = <0xe0002000 0x1000>; interrupt-parent = <0x1>; dr_mode = "host"; xlnx,phy-reset-gpio = <0x4 0x55 0x0>; Rebuild the devicetree/kernel and give it a boot. You will no longer see a phy id/etc message in the boot log, instead it should just look like: ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver |
I checked this suggestion and it turns out that it works sometimes. Sometimes the USB won't work even with long cable (which is worse than with "normal" devicetree). The log always looks good - even if USB is not working after boot. This may be problematic because if you end up with not working USB you don't have any info what went wrong. |
Thanks! |
Pushing the reset do not change the behavior - sometimes it works after reset sometimes not. I was testing it with U13, as I do not have the board with it desoldered. The lack of voltage on the lines is caused by improper work of the ULPI, if we hardwire VBUS to SYS_5P0V it won't change anything because the PHY will still be hanging and will be unable to talk with the usb devices - even if they will be powered all the time. Note that ULPI tends to hang with or without USB device connected to the port - so forcing power on the lines IMO will not impact this issue. |
Hi. |
@tony-gh0, feeling the pain. Digikey has delivered and I got mine assembled and put in an aluminum box within the last two days and the first thing I noticed was more often than not, the micro usb does not work. Too bad this issue wasn't solved before Adapteva closed doors. |
When booting, the enable signal for the USB switch sometimes fails to go high after resert, so there is no power fed out of the Parallella USB port. (thus no way to connect unpowered peripherals).
Since we are only using the Parallella in host mode, is there a way to force the USB phy to always assert this signal high after reset? Or perhaps some other workaround?
The text was updated successfully, but these errors were encountered: