USB3.0 device mode in Jetson TX2 NX

Hi Everyone ,

I want to configure the USB 3.0 pins of the NVIDIA Jetson TX2 NX custom board as device mode. The following diagram shows the hardware logic used:
d69fd0a309be680257a5032123cf0544b2754d35_2_690x408

I have modified device tree as follows.

xudc@3550000 {
status = “okay”;
phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>,
<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-1}>;
phy-names = “usb2-0”, “usb2-1”, “usb2-2”, “usb3-1”;
//phy-names = “usb2”;
nvidia,boost-cpu-freq = <1200>;
};

usb_cd {
	status = "disabled";
	phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>;
	phy-names = "otg-phy";
	nvidia,xusb-padctl = <&xusb_padctl>;
};

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/usb2/lanes/usb2-2}>,
		<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-1}>;
	phy-names = "usb2-0", "usb2-1", "usb2-2", "usb3-1";
};

xusb_padctl@3520000 {
	status = "okay";

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

	ports {
		usb2-0 {
			status = "okay";
			mode = "otg";
		};
		usb2-1 {
			status = "okay";
			mode = "host";
		};
		usb2-2 {
			status = "okay";
			mode = "host";
		};
		usb3-1 {
			nvidia,usb2-companion = <0>;
			status = "okay";
		};
	};
};

However, after flashing, when I connect the board to a PC using both USB 2.0 and USB 3.0 ports, the NVIDIA device is not being detected, and the dmesg log on the PC shows the following messages:

[696639.117711] usb usb1-port2: Cannot enable. Maybe the USB cable is bad?
[696639.117867] usb usb1-port2: unable to enumerate USB device
[697007.690650] usb usb1-port3: Cannot enable. Maybe the USB cable is bad?
[697008.666688] usb usb1-port3: Cannot enable. Maybe the USB cable is bad?
[697008.666847] usb usb1-port3: attempt power cycle
[697009.962730] usb usb1-port3: Cannot enable. Maybe the USB cable is bad?
[697010.942655] usb usb1-port3: Cannot enable. Maybe the USB cable is bad?
[697010.942728] usb usb1-port3: unable to enumerate USB device

Cable is working cable.

Could anyone please help me make USB 3.0 work in device mode on the Jetson TX2 NX?

Hi,
For a type C port, please check the AGX Xavier developer kit. The PD controller is used for handling direction, and connect to one pair of USB2/USB3 pins. In your design, two sets of USB3 pins and one set of USB2 pins are used. This design may not work properly in default release.

And only one set of USB3 pin can be enabled for device mode enumeration. So in this design, one direction can be either host mode or device mode, and the other direction is host mode only.

It would be better to refer to AGX Xavier developer kit to design type C port.

Hi @DaneLLL ,

Thank you for the quick response.

We have utilized only one set of usb3 pins, and a MUX/DEMUX is employed to select the USB set according to the orientation of the USB.

You mentioned, ‘And only one set of USB3 pins can be enabled for device mode enumeration. So in this design, one direction can be either host mode or device mode, and the other direction is host mode only.’ Could you please provide more details and elaborate on this point?

Hi,
Sorry I thought you have two sets of USB3 pins in the design. And there’s only usb3-1. So it should be valid. Please refer to
Device tree changes for USB3-0 device mode Support in Jetson TX2 NX - #4 by WayneWWW

And if extcon state is well configured, please check tuning guide of compliance test to adjust the signals. The error print can be because power supply is not stable or signals are not good.

Hi @DaneLLL ,

Actually I referred the same link to modify the device tree.There had an hardware connection issue.Now with the above device tree , nvidia is detecting as usb 3 device when connected to PC USB 3 port.Please see the output of lsusb -v
Bus 002 Device 002: ID 0955:7020 NVIDIA Corp. L4T (Linux for Tegra) running on Tegra
Couldn’t open device, some information will be missing
Device Descriptor:
bLength 18
bDescriptorType 1
bcdUSB 3.20
bDeviceClass 239 Miscellaneous Device
bDeviceSubClass 2
bDeviceProtocol 1 Interface Association
bMaxPacketSize0 9
idVendor 0x0955 NVIDIA Corp.
idProduct 0x7020 L4T (Linux for Tegra) running on Tegra
bcdDevice 0.02
iManufacturer 1
iProduct 2
iSerial 3
bNumConfigurations 1

But when NVIDIA is connected to PC USB 2.0 , it is not getting detected.
Could you please guide me ?

Hi,
In the device tree, usb2-0 and usb3-1 are in pair. If it meets your design, it should be correct and the issue may be in signal quality. Please do compliance test to tune the signals.

Hi @DaneLLL ,

Does this mean the device tree is configured correctly?

Hi,
The device tree should fit the custom board and suggest you do compliance test.

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