USB ports not working using Jetpack 4.2.1

https://elinux.org/Jetson/TX2_USBHello,

I’m unable to get USB3.0 port 0 and USB2.0 port 0 working on my custom Jetson
TX2 carrier card using Jetpack 4.2.1. My carrier card works fine using Jetpack
3.2.1.

I’ve read:

I’m using a display port and thus I’m flashing tegra186-quill-p3310-1000-c03-00-dsi-dp.dtb. The display port is working fine.

I have two USB ports on my carrier card. The USB3.0 port is connected to pins
A38, A39, C43, C44, F43 and F44. The USB2.0 port is connected to pins B39 and B40.

To turn the USB power on I modified the power-tree with

tegra186-quill-power-tree-p3310-1000-a00-00.dtsi

pinctrl@3520000 {
		vbus-0-supply = <&vdd_usb0_5v>;
		vbus-1-supply = <&vdd_usb1_5v>;
		vbus-2-supply = <&vdd_usb2_5v>;
		vbus-3-supply = <&vdd_usb0_5v>; // <-- changed this
		vddio-hsic-supply = <&battery_reg>;
		avdd_usb-supply = <&spmic_sd3>;
		vclamp_usb-supply = <&spmic_sd2>;
		avdd_pll_erefeut-supply = <&spmic_sd2>;
	};

and turned the regulators always on with.

tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi

vdd_usb1_5v: regulator@5 {
			compatible = "regulator-fixed-sync";
			reg = <5>;
			regulator-name = "vdd-usb1-5v";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(L, 5) 0>;
			gpio-open-drain;
			enable-active-high;
        	regulator-always-on; /* JML 20190801 */
			regulator-boot-on; /* JML 20190801 */
		};

		en_vdd_ts_1v8: regulator@6 {
			compatible = "regulator-fixed-sync";
			reg = <6>;
			regulator-name = "en-vdd-ts-1v8";
			regulator-min-microvolt = <1800000>;
			regulator-max-microvolt = <1800000>;
			gpio = <&gpio_i2c_0_74 1 1>;
			enable-active-high;
			regulator-always-on;
			regulator-boot-on;
		};

That works fine.

Then I configured the USB ports by removing unused ports and re-configuring OTG
as a HOST port

tegra186-quill-p3310-1000-c03-00-base.dts

#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2
	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";
					};
				};
			};
			usb3 {
				lanes {
					usb3-0 {
						nvidia,function = "xusb";
						status = "okay";
					};
				};
			};
		};

		ports {
			usb2-0 {
				status = "okay";
    		    mode = "host";
				vbus-supply = <&vdd_usb0_5v>;
				nvidia,oc-pin = <0>;
			};
			usb3-0 {
				nvidia,usb2-companion = <2>;
   				status = "okay";   
			};
		};
	};
#endif
	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 {
			/* Quill does not support usb3-micro AB */
			usb2-micro-AB {
				nvidia,lanes = "otg-0";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <0>;
			};
			usb2-std-A-port2 {
				nvidia,lanes = "otg-1";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <1>;
			};
			usb3-std-A-port2 {
				nvidia,lanes = "usb3-1";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				nvidia,oc-pin = <1>;
			};

			e3325-usb3-std-A-HS {
				nvidia,lanes = "otg-2";
				nvidia,function = "xusb";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				status = "disabled";
			};

			e3325-usb3-std-A-SS {
				nvidia,lanes = "usb3-0";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				status = "disabled";
			};
		};
	};

When I boot, on the display I get the final configuration GUI. I can’t finish
the configuration because neither USB port works. On the debug serial console I
get:

Starting kernel …

[    0.000000] Booting Linux on physical CPU 0x100
[    0.000000] Linux version 4.9.140-tegra (buildbrain@mobile-u64-922) (gcc version 7.3.1 20180425 [linaro-7.3-2018.05 revision d29120a424ecfbc167ef90065c0eeb7f91977701] (Linaro GCC 7.3-2018.05) ) #1 SMP PREEMPT Tue Jul 16 17:09:53 PDT 2019
[    0.000000] Boot CPU: AArch64 Processor [411fd073]
[    0.000000] OF: fdt:memory scan node memory@80000000, reg size 16416,
[    0.000000] OF: fdt: - 80000000 ,  70000000
[    0.000000] OF: fdt: - f0200000 ,  185600000
[    0.000000] OF: fdt: - 275e00000 ,  200000
[    0.000000] OF: fdt: - 276600000 ,  200000
[    0.000000] OF: fdt: - 277000000 ,  200000
[    0.000000] earlycon: uart8250 at MMIO32 0x0000000003100000 (options '')
[    0.000000] bootconsole [uart8250] enabled
<hit enter to activate fiq debugger>
[    0.525304] pca953x 0-0074: failed reading register
[    0.525766] pca953x 0-0077: failed reading register
[    1.151336] tegra-xusb-padctl 3520000.xusb_padctl: no port found for USB3 lane 0
[    1.159846] tegra-xusb-padctl 3520000.xusb_padctl: no port found for USB3 lane 0
[    1.167308] phy phy-usb3.1: phy init failed --> -19
[    1.172243] tegra-xusb 3530000.xhci: failed to enable PHYs: -19
[    1.333567] FAN: coudln't get the regulator
[    1.373010] ina3221x 0-0042: ina3221 reset failure status: 0xffffff87
[    1.379930] ina3221x 0-0043: ina3221 reset failure status: 0xffffff87
[    2.159000] cgroup: cgroup2: unknown option "nsdelegate"
[    7.654059] random: crng init done
[    7.657510] random: 7 urandom warning(s) missed due to ratelimiting
[    7.808916] using random self ethernet address
[    7.813775] using random host ethernet address
[    7.869981] using random self ethernet address
[    7.874668] using random host ethernet address
[    8.968721] Please complete system configuration setup on desktop to proceed...

What do I need to do to get the USB ports working properly? I need help getting xusb_padctl@3520000 and pinctrl@3520000 configured properly.

Thanks

Hi,
Please refer to
[url]https://devtalk.nvidia.com/default/topic/1057885/jetson-tx2/usb-not-working-in-jetson-tx2-r32-2/post/5364464/#5364464[/url]