USB Power Disabled on Custom Board

Hi, I am trying to get USB working on a custom board. At startup, there is 5V present at the USB connector, but it’s eventually disabled towards the end of the boot process. I am using the same USB 3 config as the developer kit. Any tips on why this might happen?

See below log:

nvidia@linux:~$ dmesg | grep "usb"
[    0.000000] Kernel command line: console=ttyS0,115200 androidboot.presilicon=true firmware_class.path=/etc/firmware root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 loglevel=8 fbcon=map:0 net.ifnames=0 isolcpus=1-2  video=tegrafb earlycon=uart8250,mmio32,0x3100000 nvdumper_reserved=0x2772e0000 gpt rootfs.slot_suffix= tegra_fbmem2=0x800000@0x96085000 lut_mem2=0x2008@0x96081000 usbcore.old_scheme_first=1 tegraid=18.1.2.0.0 maxcpus=6 no_console_suspend boot.slot_suffix= boot.ratchetvalues=0.2031647.1 vpr_resize bl_prof_dataptr=0x10000@0x275840000 sdhci_tegra.en_boot_part_access=1 quiet root=/dev/mmcblk0p1 rw rootwait rootfstype=ext4 console=ttyS0,115200n8 console=tty0 loglevel=8 fbcon=map:0 net.ifnames=0 isolcpus=1-2 
[    0.500872] usbcore: registered new interface driver usbfs
[    0.500915] usbcore: registered new interface driver hub
[    0.500951] usbcore: registered new device driver usb
[   20.875842] vdd-usb0-5v: 5000 mV 
[   20.876143] vdd-usb1-5v: 5000 mV 
[   21.309423] tegra-xusb-padctl 3520000.xusb_padctl: VBUS over-current detection enabled
[   23.967460] usbcore: registered new interface driver r8152
[   23.967488] usbcore: registered new interface driver asix
[   23.967516] usbcore: registered new interface driver ax88179_178a
[   23.967543] usbcore: registered new interface driver cdc_ether
[   23.967571] usbcore: registered new interface driver net1080
[   23.967598] usbcore: registered new interface driver cdc_subset
[   23.967623] usbcore: registered new interface driver zaurus
[   23.967656] usbcore: registered new interface driver cdc_ncm
[   23.972506] tegra-xusb 3530000.xhci: USB2 port 0 has OTG_CAP
[   23.974102] tegra-xusb 3530000.xhci: extcon 0: ffffffc1eb319400 id
[   23.974497] usbcore: registered new interface driver uas
[   23.974528] usbcore: registered new interface driver usb-storage
[   23.974585] usbcore: registered new interface driver usbserial
[   23.976742] tegra-xusb 3530000.xhci: Firmware timestamp: 2020-07-06 13:39:28 UTC, Version: 55.18 release
[   23.979475] usbcore: registered new interface driver xpad
[   24.002304] tegra-xusb 3530000.xhci: xHCI Host Controller
[   24.002317] tegra-xusb 3530000.xhci: new USB bus registered, assigned bus number 1
[   24.003012] tegra-xusb 3530000.xhci: hcc params 0x0184fd25 hci version 0x100 quirks 0x00050810
[   24.003037] tegra-xusb 3530000.xhci: irq 71, io mem 0x03530000
[   24.003166] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[   24.003170] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   24.003173] usb usb1: Product: xHCI Host Controller
[   24.003176] usb usb1: Manufacturer: Linux 4.9.253+ xhci-hcd
[   24.003179] usb usb1: SerialNumber: 3530000.xhci
[   24.003842] tegra-xusb 3530000.xhci: xHCI Host Controller
[   24.003849] tegra-xusb 3530000.xhci: new USB bus registered, assigned bus number 2
[   24.003980] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[   24.003984] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[   24.003987] usb usb2: Product: xHCI Host Controller
[   24.003990] usb usb2: Manufacturer: Linux 4.9.253+ xhci-hcd
[   24.003992] usb usb2: SerialNumber: 3530000.xhci
[   24.004759] tegra-xusb 3530000.xhci: Upgrade port 0 to USB3.0
[   24.004763] tegra-xusb 3530000.xhci: Upgrade port 1 to USB3.0
[   24.106508] usb usb1: usb_suspend_both: status 0
[   24.106563] usb usb2: usb_suspend_both: status 0
[   26.010273] tegra-xusb 3530000.xhci: entering ELPG
[   26.013282] tegra-xusb 3530000.xhci: entering ELPG done
[   35.027145] usbcore: registered new interface driver usbhid
[   35.032729] usbhid: USB HID core driver
[   76.521004] usbcore: registered new interface driver snd-usb-audio
[   79.447028] usb0: HOST MAC 1a:da:05:a7:b3:ee
[   79.447056] usb0: MAC 1a:da:05:a7:b3:ef
[   79.480420] l4tbr0: port 2(usb0) entered blocking state
[   79.480425] l4tbr0: port 2(usb0) entered disabled state
[   79.480581] device usb0 entered promiscuous mode
[   79.489079] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[  107.603354] vdd-usb0-5v: disabling
[  107.603364] vdd-usb1-5v: disabling

The regulator will be set to disabled if this regulator is not in use.

Also, you need to tell the device tree which regulator is in use for vbus.

If this sounds unfamiliar to you, please refer to the adaptation guide for usb porting.

If I am using the same configuration as the TX2 developer kit, I am assuming I don’t need to modify the USB1 configuration, right?

If I am using the same configuration as the TX2 developer kit, I am assuming I don’t need to modify the USB1 configuration, right?

This is not 100% correct.

If the power configuration is different, then you have to change the device tree.

For example, on the devkit, we usually use a GPIO to control the power, but if you are using a always-on design on your board, then you have to give the vbus-supply a dummy regulator like battery_reg.

Got it. I am using the same power configuration as well. I’ll double check the DeviceTree to make sure the USB configuration matches my hardware.

I am still not able to get USB working on my custom board. Since I am able to flash the TX2 over USB0, I am assuming I should be able to at least get the USB0 interface working in 2.0 mode. I am using L4T 32.6.1.

My board has two USB ports:

  • USB3-0 (USB_SS0_x on module) paired with USB2-0 (USB0_Dx on module), host mode only. Oc pin = VBUS_EN0
  • USB3-1 (PEX_RFU_x on module) paired with USB2-1 (USB1_Dx on module), host mode only. Oc pin = VBUS_EN1

I made the following changes so far:

  • XHCI node:
xhci@3530000 {
		status = "okay";
		phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>,
			<&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-1}>,
			<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-0}>,
			<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-1}>;
		phy-names = "usb2-0", "usb2-1", "usb3-0", "usb3-1";
		nvidia,xusb-padctl = <&xusb_padctl>; 
};
  • Padctl
xusb_padctl@3520000 {
		status = "okay";
		pinctrl-0 = <&vbus_en0_default_state>;
		pinctrl-1 = <&vbus_en1_default_state>;
		pinctrl-2 = <&vbus_en0_sfio_tristate_state>;
		pinctrl-3 = <&vbus_en1_sfio_tristate_state>;
		pinctrl-4 = <&vbus_en0_sfio_passthrough_state>;
		pinctrl-5 = <&vbus_en1_sfio_passthrough_state>;
		pinctrl-names = "vbus_en0_default", "vbus_en1_default",
			"vbus_en0_sfio_tristate", "vbus_en1_sfio_tristate",
			"vbus_en0_sfio_passthrough", "vbus_en1_sfio_passthrough";

		pads {
			usb2 {
				lanes {
					usb2-0 {
						nvidia,function = "xusb";
						status = "okay";
					};
					usb2-1 {
						nvidia,function = "xusb";
						status = "okay";
					};
				};
			};
			usb3 {
				lanes {
					usb3-0 {
						nvidia,function = "xusb";
						status = "okay";
					};
					usb3-1 {
						nvidia,function = "xusb";
						status = "okay";
					};
				};
			};
		};

		ports {
			usb2-0 {
				status = "okay";
				mode = "host";
				vbus-supply = <&vdd_usb0_5v>;
				nvidia,oc-pin = <0>;
			};
			usb2-1 {
				status = "okay";
				mode = "host";
				vbus-supply = <&vdd_usb1_5v>;
				nvidia,oc-pin = <1>;
			};
			usb3-0 {
				nvidia,usb2-companion = <0>;
				status = "okay";
			};
			usb3-1 {
				nvidia,usb2-companion = <1>;
				status = "okay";
			};
		};
	};
  • Pinctl
pinctrl@3520000 {
		status = "okay";
		pinctrl-0 = <&tegra_xusb_padctl_pinmux_default>;
		pinctrl-1 = <&vbus_en0_sfio_tristate_state>;
		pinctrl-2 = <&vbus_en1_sfio_tristate_state>;
		pinctrl-3 = <&vbus_en0_sfio_passthrough_state>;
		pinctrl-4 = <&vbus_en1_sfio_passthrough_state>;
		pinctrl-5 = <&vbus_en0_default_state>;
		pinctrl-6 = <&vbus_en1_default_state>;
		pinctrl-names = "default",
			"vbus_en0_sfio_tristate", "vbus_en1_sfio_tristate",
			"vbus_en0_sfio_passthrough", "vbus_en1_sfio_passthrough",
			"vbus_en0_default", "vbus_en1_default";
		tegra_xusb_padctl_pinmux_default: pinmux {
			/* Viewscreen USB 2 interface: USB0 OTG */
			usb2-micro-AB {
				nvidia,lanes = "otg-0";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <0>;
				status = "okay";
			};

			/* Peripheral USB 2 interface: USB1 */
			usb2-1 {
				nvidia,lanes = "otg-1";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				status = "okay";
				nvidia,oc-pin = <1>;
			};

			/* Viewscreen USB 3 interface: USB_SS0 */
			usb3-0 {
				nvidia,lanes = "usb3-0";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <0>;
				status = "okay";
			};

			/* Peripheral USB 3 interface: PEX1 */
			usb3-1 {
				nvidia,lanes = "usb3-1";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <1>;
				status = "okay"; 
			};
		};
	};

  • ODMDATA = 0x7090000

  • Upstream regulator powering the USB current limit ICs is set to always on in the power tree.

  • I commented out the USB sections in tegra186-quill-p3310-1000-a00-plugin-manager.dtsi and tegra186-quill-p3310-1000-c03-00-base.dtsithat I thought might override my settings.

  • lsusb gives:

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/3p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 480M

Any help or tips would be appreciated!

  1. Did you ever change the setting for pcie? Default pcie is x4,0,x1. Read the adaptation guide thoroughly please. PEX and USB are sharing the uphy pin on TX2. Thus, if you want to use that pin for usb function, you need to change pcie too.

  2. Are you using config 6? But your ODMDATA looks like for config #4.

Yes, changed PCIe settings. I will double check them though.

I am using config #4.

Here’s my PCIe config:

pcie-controller@10003000 {
		status = "okay";
		pci@1,0 {
			nvidia,num-lanes = <1>;
			status = "okay";
		};
		pci@2,0 {
			nvidia,num-lanes = <1>;
			status = "okay";
		};
		pci@3,0 {
			nvidia,num-lanes = <1>;
			status = "disabled";
		};
	};

Which document are you referring to?

Please check that one from developer guide but not the download center. That adaptation document published on 2018 is for rel-28 software, not for rel-32.

Also, few mistakes here

  1. There is no 1,1,1 pcie lane here, only 2,1,1 and 4,0,1 supported. Document has such info.

  2. config #4 is for 3x usb3 but your device tree says you only have 2x usb3, which one is correct?

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.