Linux - Embedded & Single-board computerThis forum is for the discussion of Linux on both embedded devices and single-board computers (such as the Raspberry Pi, BeagleBoard and PandaBoard). Discussions involving Arduino, plug computers and other micro-controller like devices are also welcome.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
I've got a MicroZed evaluation board with a Zynq 7020 SoC on it. I'm trying to get the USB port to work in a petalinux distro, and I can't quite figure out what the issue is. I'm using Avnet's own BSP, so I expect that it should "just work."
Please note that that I am confident that the hardware is OK.
In particular, I had to make some changes to the device tree in order to get the host bus to be recognized. That is, out-of-the-box, lsusb returns nothing. When I alter the device tree a bit, I can get lsusb to return one device, the bus itself. So that seems like a positive step.
However, plugging in a USB mass storage device, for example, does nothing. I get no messages in dmesg, and nothing new in lsusb. It seems likely that I'm missing something either at the kernel level or above, but I'm not sure how to go about diagnosing and working through it. Anyone got any advice?
USB support is definitely enabled in the kernel. I can confirm that the usbcore module is inserted on boot, as is ehci_hcd. Other modules specific to USB mass storage are not loaded, but can be inserted manually without error (usb_storage, sd_mod, scsi_mod).
Still, if you plug in a USB drive, nothing happens. No messages in dmesg, nothing reported by udevadm monitor. It seems like the device tree is correctly configured, because the root hub DOES get recognized and there are some messages in dmesg about it. But no uevents get fired. Udevd is running, but if nothing's firing a uevent, that doesn't help.
I think that's what's so confusing... if the USB root hub device exists, what else needs to happen to get uevents to fire when devices are attached/detached?
On boot, without a device attached, it looks like the root hub & EHCI are ok:
Code:
# dmesg | tail -n 20
of_cfs_init: OK
ALSA device list:
No soundcards found.
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address 1388
mmcblk0: mmc0:1388 USD00 14.7 GiB
mmcblk0: p1 p2
EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
udevd[726]: starting version 3.2.2
udevd[727]: starting eudev-3.2.2
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
macb e000b000.ethernet eth0: link up (1000/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
# 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 usb_phy@0: usb_phy@0 supply vcc not found, using dummy regulator
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
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
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.14.0-xilinx-v2018.2 ehci_hcd
usb usb1: SerialNumber: ci_hdrc.0
hub 1-0:1.0: USB hub found
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
# lsusb
Bus 001 Device 001: ID 1d6b:0002
Then I plugged in a regular USB mass storage device. The output is identical to the above:
Code:
# dmesg | tail -n 20
of_cfs_init: OK
ALSA device list:
No soundcards found.
Waiting for root device /dev/mmcblk0p2...
mmc0: new high speed SDHC card at address 1388
mmcblk0: mmc0:1388 USD00 14.7 GiB
mmcblk0: p1 p2
EXT4-fs (mmcblk0p2): couldn't mount as ext3 due to feature incompatibilities
EXT4-fs (mmcblk0p2): recovery complete
EXT4-fs (mmcblk0p2): mounted filesystem with ordered data mode. Opts: (null)
VFS: Mounted root (ext4 filesystem) on device 179:2.
devtmpfs: mounted
Freeing unused kernel memory: 1024K
udevd[726]: starting version 3.2.2
udevd[727]: starting eudev-3.2.2
FAT-fs (mmcblk0p1): Volume was not properly unmounted. Some data may be corrupt. Please run fsck.
EXT4-fs (mmcblk0p2): re-mounted. Opts: data=ordered
IPv6: ADDRCONF(NETDEV_UP): eth0: link is not ready
macb e000b000.ethernet eth0: link up (1000/Full)
IPv6: ADDRCONF(NETDEV_CHANGE): eth0: link becomes ready
# 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 usb_phy@0: usb_phy@0 supply vcc not found, using dummy regulator
ehci_hcd: USB 2.0 'Enhanced' Host Controller (EHCI) Driver
usbcore: registered new interface driver cdc_acm
cdc_acm: USB Abstract Control Model driver for USB modems and ISDN adapters
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
usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
usb usb1: Product: EHCI Host Controller
usb usb1: Manufacturer: Linux 4.14.0-xilinx-v2018.2 ehci_hcd
usb usb1: SerialNumber: ci_hdrc.0
hub 1-0:1.0: USB hub found
usbcore: registered new interface driver usbhid
usbhid: USB HID core driver
# lsusb
Bus 001 Device 001: ID 1d6b:0002
Quote:
For each usb device you support, you need
The appropiate kernel configuration
The appropiate kernel driver module.
Firmware if needed.
Since it's a regular old USB mass storage device, no firmware is needed. Regarding the kernel configuration, as far as I can tell, everything is set up correctly. I can manually modprobe all the modules I should need (in particular, usb-storage inserts just fine, but still no devices are detected). My understanding is that, when a device is inserted, a userspace event should be fired. Udev should then handle creating device nodes and inserting the required modules. However, I'm not getting anything in dmesg or in lsusb, no modules get inserted, etc. In fact, `udevadm monitor` doesn't show any activity at all when a device is attached/detached.
Those are both quirks of this device. A different image for this board DOES have a working USB system, and both of those messages are present in dmesg on that system also.
The question I'm sure you want to ask, then, is "what's different between the two images?" Unfortunately, I don't know. The hardware, kernel configuration, and device tree are all the same in the working and non-working images. They even use the same rootfs. That's doesn't leave much else, which is what has me so stumped.
The mmcblk error sounds like a sdcard issue, probably ext2 filesystem not unmounted. You can update that to ext3/4, but fsck it anyway.
The 'no power on vcc' IS a hardware issue. It can happen that something old-fashioned wants 5V and is only getting 3.3V. You may be able to power the port externally via the devices plugged in, or the design may be lacking. I don't really care, if you don't, but all serious thinking on usb stops until those errors go. You looked for a possible usb fault; I found 2. Your move.
I understand those issues look bad, but I can confirm that they are not related (as I mentioned in the previous post, an older version of PetaLinux creates images for which the USB port works fine, and those messages appear there too).
In fact, my most recent tests seem to indicate that the FPGA program may actually be at fault. I'm getting the FPGA team involved at this point to see if we can find a problem there. The same kernel, device tree, and rootfs can all be used, and USB works fine (those dmesg errors are still present). The only change is that I used the BOOT.BIN file from the vendor BSP.
Let's see what the FPGA nerds come up with. They should fix those errors while they're at it. You could be powering something with a logic high, which is bad for business and lousy engineering. Post when they pass it back to you with their results.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.