USB problem of Jetson TX2 Custom board

Hello.

I made a Jetson tx2 custom board.

I checked each port on the custom board after installing OS.
Ethernet and HDMI is ok .USB is don’t work.

The custom board has one usb 2.0 micro-b and two usb 3.0 type-a.
USB2.0 micro

  • USB0_VBUS_DET(B37)
  • USB0_OTG_ID(A36)
  • USB0_D(B39, B40)
  • USB0_EN_OC(A17)

USB3.0 Type-A 1

  • USB_SS0_RX(F43, F44)
  • USB_SS0_TX(C43, C44)
  • USB1_D(A38, A39)
  • USB1_EN_OC(A18)

USB3.0 Type-A 2

  • USB_SS1_RX(G42, G43)
  • USB_SS1_TX(D42, D43)
  • USB2_D(B42, B43)
  • USB2_EN_OC(A19)

When the device tree was modified in the following order, ‘USB2.0 micro’ and ‘USB3.0 Type-A 1’ worked in host mode.
[L4T r28.2.1]

  1. Modify ODMDATA in p2771-0000.conf.common file
    ODMDATA=0x7090000

  2. Modify ‘tegra186-quill-p3310-1000-a00-00-base.dts’

xhci@3530000 {
status = “okay”;
phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(1)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(2)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(0)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(1)>,
<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(2)>;
phy-names = “utmi-0”, “utmi-1”,“utmi-2”, “usb3-0”, “usb3-1”, “usb3-2”;
};

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 {

		usb2-micro {
		    nvidia,lanes = "otg-0";
		    nvidia,function = "xusb";
		    nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
		    status = "okay";
		};
		
		usb2-1 {
		    nvidia,lanes = "otg-1";
		    nvidia,function = "xusb";
		    nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
		    status = "okay";
		};
		usb2-2 {
		    nvidia,lanes = "otg-2";
		    nvidia,function = "xusb";
		    nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
		    status = "okay";
		};
		usb3-0 {
		    nvidia,lanes = "usb3-0";
		    nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
		    status = "okay";
		};
		usb3-1 {
		    nvidia,lanes = "usb3-1";
		    nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
		    status = "okay";
		};
		usb3-2 {
		    nvidia,lanes = "usb3-2";
		    nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
		    status = "okay";
		};
	};

};

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

usb_cd {
status = “okay”;
phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>;
phy-names = “otg-phy”;
};

xotg {
		status = "okay";
		phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>;
	 phy-names = "otg-usb2";
};

xudc@3550000 {
		status = "okay";
		phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(0)>,
    		<&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(0)>;
	 phy-names = "usb2", "usb3";
		emc-frequency = <150000000>;
};
  1. Modify ‘tegra186-quill-p3310-1000-c03-00-base.dts’
    gpio@2200000 {
    status = “okay”;

     sdmmc-wake-support-input {
     	status = "okay";
     };
    
     sdmmc-wake-support-output {
     	status = "okay";
     };
    
     pcie0_lane2_mux {
     	status = "disabled";
     };
    

    };

  2. Comment out at tegra186-quill-p3310-1000-c03-00-base.dts
    xhci@3530000, pcie-controller@10003000 and pinctrl@3520000

  3. Modify ‘tegra186-quill-power-tree-p3310-1000-a00-00.dtsi’
    vbus-2-supply = <&vdd_usb2_5v> → vbus-2-supply = <&battery_reg>;

  4. Comment out the details below in tegra186-quill-p3310-1000-a00-plugin-manager.dtsi
    “fragment-500-pcie-config”, “fragment-500-xusb-config”, “fragment-500-e3325-pcie”

Upload the modified file and kernel log.
tegra186-quill-p3310-1000-a00-00-base.dts.txt (5.9 KB) tegra186-quill-p3310-1000-a00-plugin-manager.dtsi.txt (6.8 KB) tegra186-quill-p3310-1000-c03-00-base.dts.txt (2.4 KB) tegra186-quill-power-tree-p3310-1000-a00-00.dtsi.txt (8.8 KB)

kernel.log (71.7 KB)

How do I modify the device tree to operate the remaining one usb(USB3.0 Type-A 2)?

Hi,

I think the patch looks good. Below page I wrote years ago should still work for rel-28.2.1 case.

https://elinux.org/Jetson/TX2_USB

You could also check the device tree on test device after boot up by /proc/device-tree.
I would suggest you to check the final dts here and see if it really meets your expectation.

I tried the method of the link you uploaded.
I upload the kernel log at this time.
kernel.log (63.0 KB)

(USB3.0 Type-A 2) still doesn’t work.

What is the problem?
What should I check?

Hi,

Have you checked the device tree content in /proc/device-tree?

I checked xhci@3530000 in /proc/device-tree

I think it is no problem.

Please check files of xhci@3530000.
hvdd_usb-supply.txt (4 Bytes) avddio_usb-supply.txt (4 Bytes) clock-names.txt (63 Bytes) clocks.txt (72 Bytes) compatible.txt (21 Bytes) hvdd_usb-supply.txt (4 Bytes) interrupt-parent.txt (4 Bytes) interrupts.txt (24 Bytes) phandle.txt (4 Bytes) mboxes.txt (4 Bytes) mbox-names.txt (5 Bytes) name.txt (5 Bytes) otg-controller.txt (4 Bytes) phandle.txt (4 Bytes) phy-names.txt (42 Bytes) phys.txt (48 Bytes) reg.txt (32 Bytes) status.txt (5 Bytes) #stream-id-cells.txt (4 Bytes)

The easier way to post that would be to export the entire device tree from the running system. You could do this instead of posting individual files:
dtc -I fs -O dts -o extracted.dts /proc/device-tree
(and then for the forum you’d likely rename “extracted.dts” to “extracted.txt”)

I tried dtc commad and got the dts files.extracted.txt (388.9 KB)

Please check this file.

And This is the log obtained through the dmesg command.
kernel_log.txt (61.0 KB)

Hi,

It looks like only some ports have issue but not every port, right?

In that case, could you disabled the working port and leave only those have problems and share the log again?

Could you share the schematic of your board and tell us which port is not working now?

In the xhci@3530000 and pinctrl@3520000, Only usb3-1 was enable and got the kernel log.
kernel_log.txt

Then upload the schematic of my custom board.

When measuring voltage, the USB1_VBUS_EN pin is 5V.
But the USB2_VBUS_EN pin is 0V. So i think USB2_VBUS_EN does not work.

How do i enable USB2_VBUS_EN(A19)?

Hi,

You should write a regulator as what you’ve done on USB1_VBUS_EN for USB2_VBUS_EN.

Then, you need to assign this regulator to vbus-supply for usb3-2.

In the circuit, USB2_VBUS_EN is connected to [pin A19].
Is there anything wrong with the circuit configuration?

Hi,

Then what you need is software configuration…
Please do read my previous comment and check your dts

For assignment regulator, I modified ‘tegra186-quill-power-tree-p3310-1000-a00-00.dtsi’ and ‘tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi’ files.

  • tegra186-quill-power-tree-p3310-1000-a00-00.dtsi
    -vbus-2-supply = <&battery_reg>;
    +vbus-2-supply = <&vdd_usb2_5v>;

  • tegra186-cvb-prod-p2597-b00-p3310-1000-a00-00.dtsi
    vdd_usb2_5v: regulator@17 {
    compatible = “regulator-fixed-sync”;
    reg = <17>;
    regulator-name = “vdd-usb2-5v”;
    regulator-min-microvolt = <5000000>;
    regulator-max-microvolt = <5000000>;
    - gpio = <&gpio_i2c_0_74 0 0>;
    + gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(L, 6) 0>;
    + gpio-open-drain;
    + enable-active-high;
    };

One port(USB3.0 Type-A connector B in schematic) still doesn’t work.
Is there something wrong I modified?

I don’t know. Anything new in dmesg?

This is new dmesg.
kernel_log2.txt (61.4 KB)

In the new dmesg I found the log below.
[ 0.364953] vdd-usb0-5v: 5000 mV
[ 0.365146] vdd-usb1-5v: 5000 mV
[ 0.365882] vdd-usb2-5v: 5000 mV

Could you share the output of below?

• UPHY Lane 0: ./devmem2 0x02520284
• UPHY Lane 1: ./devmem2 0x02530284
• UPHY Lane 2: ./devmem2 0x02540284
• UPHY Lane 3: ./devmem2 0x02550284
• UPHY Lane 4: ./devmem2 0x02560284
• UPHY Lane 5: ./devmem2 0x02570284

How can I get them?
I searched in dmesg but none of them.

Hi,

devmem2 is a tool and I want you to use this tool to dump the register value.

This step is listed on TX2 adaptation guide.

I usb devmem2 tool.

The devmem2 command and result I entered are as follows.

sudo devmem2 0x02520284

/dev/mem opened.
Memory mapped at address 0x7f81192000.
Bus error (core dumped)

So I tried again with the mapped address.
sudo devmem2 0x7f81192000

/dev/mem opened.
Memory mapped at address 0x7f931a3000.
Value at address 0x81192000 (0x7f931a3000): 0x0

UPHY Lane 0~5, All value at address are 0x0.

Hi,

Please install busybox and then run

sudo busybox devmem 0x02520284