[mainline kernel] USB not working

Hi,

I am currently trying to run a mainline kernel 4.7-rc4 with tegra_defconfig, but I cannot get USB running. From what I can see in the kernel this seems to be power management related:

[    1.057595] +USB0_VBUS_SW: Failed to request enable GPIO108: -517
[    1.062463] reg-fixed-voltage regulators:regulator@7: Failed to register regulator: -517
[    1.070714] +5V_USB_HS: Failed to request enable GPIO109: -517
[    1.076495] reg-fixed-voltage regulators:regulator@8: Failed to register regulator: -517
[    1.084870] +1.05V_RUN_AVDD_HDMI_PLL: Failed to request enable GPIO63: -517
[    1.091663] reg-fixed-voltage regulators:regulator@11: Failed to register regulator: -517
[    1.100003] +5V_HDMI_CON: Failed to request enable GPIO86: -517
[    1.105874] reg-fixed-voltage regulators:regulator@12: Failed to register regulator: -517
[    1.114217] +5V_SATA: Failed to request enable GPIO242: -517
[    1.119828] reg-fixed-voltage regulators:regulator@13: Failed to register regulator: -517
[    1.128168] +12V_SATA: Failed to request enable GPIO242: -517
[    1.133867] reg-fixed-voltage regulators:regulator@14: Failed to register regulator: -517
(...)
[    4.847150] usb2-0 supply vbus not found, using dummy regulator
[    4.853347] usb2-1 supply vbus not found, using dummy regulator
[    4.859827] usb3-0 supply vbus not found, using dummy regulator

Maybe the device-tree config needs some changes to get USB runnning?

Regards,
Josef

I found the issue:

The Tegra XHCI module tries to load a firmware blob which failed. Currently you have to either build the firmware blob into the kernel image or set CONFIG_USB_XHCI_TEGRA=m to build it as a kernel module and launch the driver after rootfs is mounted. Then it will find the firmware and USB works.

(more details: https://lkml.org/lkml/2014/9/16/665)

I see a similar thing using the mainline 4.7.2 kernel. I use the straight jetpack 21.5 release but simply drop in the zImage and tegra124-jetson-tk1.dtb file that is built from the mainline 4.7.2 Linux release using “make tegra_defconfig”.

Everything seems to work except USB. I also see a “usb2-0 supply vbus not found, using dummy regulator”. Look at my output from lsusb on my jetson-tk1 board:

ubuntu@tegra-ubuntu:~ uname -a Linux tegra-ubuntu 4.7.2 #16 SMP PREEMPT Wed Sep 7 15:54:04 PDT 2016 armv7l armv7l armv7l GNU/Linux ubuntu@tegra-ubuntu:~ lsusb
Bus 002 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

So the jetson-tk1 can see its own hubs but NOT devices connected to the external connectors (and there ARE devices plugged in there.

My suspicion given the errors:
usb2-0 supply vbus not found, using dummy regulator
usb2-1 supply vbus not found, using dummy regulator

is that the external USB ports are not being supplied with power and so the devices plugged in there cannot respond there.

Is perhaps the device tree in 4.7.2 older than the current jetson-tk1 hardware? Have some pins been juggled lately (ones that might affect power to the external USB slots)?

I did use CONFIG_USB_XHCI_TEGRA=m and the driver is being loaded fine:

ubuntu@tegra-ubuntu:~$ lsmod
Module Size Used by
xhci_tegra 10432 0

but I still get the errors:
usb2-0 supply vbus not found, using dummy regulator
usb2-1 supply vbus not found, using dummy regulator

But I still do see the “failed to request firmware” and “failed to load firmware” upon loading driver:

ubuntu@tegra-ubuntu:~$ sudo rmmod xhci_tegra
sudo insmod /lib/modules/4.7.2/kernel/drivers/usb/host/s/usb/host/xhci_tegra.ko
[ 1534.270429] tegra-xusb 70090000.usb: failed to request firmware: -2
[ 1534.276776] tegra-xusb 70090000.usb: failed to load firmware: -2

Firmware seems to be present:
ubuntu@tegra-ubuntu:~ ll /lib/firmware/ total 240 drwxr-xr-x 5 root root 4096 Sep 7 22:22 ./ drwxrwxr-x 22 root root 4096 Sep 8 19:02 ../ drwxr-xr-x 2 root root 4096 Jul 29 00:36 fpga/ drwxr-xr-x 2 root root 4096 Apr 1 2015 hp/ -rw-rw-r-- 1 root root 15900 Sep 7 22:22 nvavp_os_0ff00000.bin -rw-rw-r-- 1 root root 15900 Sep 7 22:22 nvavp_os_8ff00000.bin -rw-rw-r-- 1 root root 15900 Sep 7 22:22 nvavp_os_eff00000.bin -rw-rw-r-- 1 root root 39980 Sep 7 22:22 nvavp_vid_ucode_alt.bin drwxr-xr-x 2 root root 4096 Sep 7 22:22 tegra12x/ -rw-rw-r-- 1 root root 134656 Sep 7 22:22 tegra_xusb_firmware ubuntu@tegra-ubuntu:~

I AM assuming that these firmware blobs taken from jetpack intended for the 3.10 kernel have no Linux version dependence.

If they do users have no way to generate these for themselves and so the mailing kernels for tegra are of no value.

The “/lib/firmware” files essentially load into the device they are firmware for. There is no direct kernel version dependency, but the dtb file and the driver files have to behave essentially as using the same API…if the driver changes but the API did not change, it would still work…as soon as some schema changes in any one of those files the others may still use the information as if it were correct and cause failing or bad behavior (parts of the system could crash or interact in unintended ways).

Thanks. Both the driver and the dtb tree are built out of the same Linux 4.7.2 release so those two should match one another. If there is some mismatch of those with the contents of the firmware blob there is nothing users can do. Then USB would simply be broken for the mainline kernels for tegra- correct?

This may be the case, but not necessarily. Firmware within a hardware device does not change often. An example of when it does change is for WiFi hardware shipping to different countries where wireless regulation has different rules. For USB most fixes to bugs would be in the driver, and most changes for different surrounding support hardware (the board support package) would be in the dtb file. The “/lib/firmware” file may not change despite a lot of other changes, so long as the hardware did not need a firmware change for a bug or regulatory change…USB does not worry about regulatory changes. Even in cases where USB firmware might be loaded, it could be that the load is only for USB3 mode, or only for USB2 mode…in which case the other mode would work on mainline.

Okay I got the USB to work now. The name and location of the USB firmware blob has apparently moved. What I did on my jetson-tk1:

sudo mkdir -p /lib/firmware/nvidia/tegra124
sudo cp /lib/firmware/tegra_xusb_firmware /lib/firmware/nvidia/tegra124/xusb.bin

I also needed to define:
CONFIG_FW_LOADER=y

in my _defconfig file.