Problems modifying the device tree to set up usb 3.0 on Orin NX 16GB

Hi!

We are designing a custom carrier board for the Jetson Orin NX 16GB with the following interfaces:

  • 1 USB 3.0

  • 2 USB 2

  • 2 UARTs

  • 1 I2C

The USB 3 is to be used with a Stereolabs Zed Mini, which requires a usb connection of that type.

The configuration we designed for the USBs is the following:


In order to adapt the device tree to configure all the USBs, we took as starting point the dts of the carrier board P3768 related with the USB DT (tegra234-p3768-0000-a0.dtsi). The main differences with that carrier board are:

  • We do not have eeprom
  • We do not have a USB C (OTG)
  • We do not have a USB hub (our USBs are directly connected to the SOM)

Accordingly, we modified the .dts file as follows:

1 - Remove the eeprom-manager (our carrier board does not have it)

PREV:

eeprom-manager {
		data-size = <0x100>;
		bus@0 {
			i2c-bus = <&gen1_i2c>;
			eeprom@1 {
				slave-address = <0x57>;
				label = "cvb";
			};
		};

		bus@1 {
			i2c-bus = <&gen2_i2c>;
			eeprom@1 {
				slave-address = <0x50>;
				label = "super-module";
			};
		};
	};

POST:

[REMOVED]

2 - Modify xusb_padctl: xusb_padctl@352000

  • Remove usb3-1 from pads and ports.
  • Modify usb2-0 (previously connected to the USB C as OTG, now used as a regular USB 2) in ports. usb-role-switch removed.
  • Modify usb2-1 vbus supply.

PREV:

xusb_padctl: 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-0 {
						nvidia,function = "xusb";
						status = "okay";
					};
					usb3-1 {
						nvidia,function = "xusb";
						status = "okay";
					};
				};
			};
		};

		ports {
			usb2-0 {/* Goes to recovery port */
				mode = "otg";
				status = "okay";
				vbus-supply = <&p3768_vdd_5v_sys>;
				usb-role-switch;
				port {
					typec_p0: endpoint {
						remote-endpoint = <&fusb_p0>;
					};
				};
			};
			usb2-1 {/* Goes to hub */
				mode = "host";
				vbus-supply = <&p3768_vdd_av10_hub>;
				status = "okay";
			};
			usb2-2 {/* Goes to M2.E */
				mode = "host";
				vbus-supply = <&p3768_vdd_5v_sys>;
				status = "okay";
			};
			usb3-0 {/* Goes to hub */
				nvidia,usb2-companion = <1>;
				status = "okay";
			};
			usb3-1 {/* Goes to J5 */
				nvidia,usb2-companion = <0>;
				status = "okay";
			};
		};
	};

POST:

	xusb_padctl: 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-0 {
						nvidia,function = "xusb";
						status = "okay";
					};
				};
			};
		};

		ports {
			usb2-0 {/* First usb 2.0 */
				mode = "host";
				status = "okay";
				vbus-supply = <&p3768_vdd_5v_sys>;
			};
			usb2-1 {/* To USB 3.0 */
				mode = "host";
				vbus-supply = <&p3768_vdd_5v_sys>;
				status = "okay";
			};
			usb2-2 {/* Second usb 2.0 */
				mode = "host";
				vbus-supply = <&p3768_vdd_5v_sys>;
				status = "okay";
			};
			usb3-0 {/* To USB 3.0 */
				nvidia,usb2-companion = <1>;
				status = "okay";
			};
		};
	};

3 - Remove tegra_xudc: xudc@3550000

PREV:

	tegra_xudc: 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", "usb3-1";
		nvidia,xusb-padctl = <&xusb_padctl>;
	};

POST:

[REMOVED]

4 - Modify tegra_xhci: xhci@3610000, removing usb3-1

PREV:

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

POST:

	tegra_xhci: xhci@3610000 {
		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-0}>;
		phy-names = "usb2-0", "usb2-1", "usb2-2", "usb3-0";
		nvidia,xusb-padctl = <&xusb_padctl>;
	};

After those modifications:

  1. We first flash everything in the external NVME with the original .dts using the original carrier board P3768. The camera works fine.
  2. After that, we compiled the kernel with the new .dts file, generating a new dtb file: tegra234-p3767-0000-p3768-0000-a0.dtb
  3. We also checked that the changes have taken effect, generating a tegra234-p3767-0000-p3768-0000-a0_converted.dts. The changes seem to be there.
  4. Finally, we replace the file /boot/dtb/kernel_tegra234-p3767-0000-p3768-0000-a0.dtb with the new dtb generated file.
  5. The SOM is placed in the custom carrier board.

Doing that, the camera is detected, but won’t work. The dmesg tells:

[   18.032610] fuse: init (API version 7.32)
[   44.296810] usb 1-2: new full-speed USB device number 4 using tegra-xusb
[   44.450474] usb 1-2: New USB device found, idVendor=2b03, idProduct=f681, bcdDevice= 2.05
[   44.450479] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=3
[   44.450481] usb 1-2: Product: ZED-M Hid Device
[   44.450482] usb 1-2: Manufacturer: STEREOLABS
[   44.450483] usb 1-2: SerialNumber: 10710912
[   44.453436] hid-generic 0003:2B03:F681.0001: hiddev96,hidraw0: USB HID v1.11 Device [STEREOLABS ZED-M Hid Device] on usb-3610000.xhci-2/input0

which apparently indicates that the USB is type 2, with which the Zed camera is not able to work.

What are we missing?

Files attached (txt type to be uploaded):

Hi,
So usb2-1 and usb3-0 are paired and designed as a type-A port. When you connect ZED camera to the type-A port, it is only enumerated to USB2. Do we understand it correctly?

Yes, exactly as you said.

Hi,
Please do compliance test on the custom board. The guidance is at download center:
https://developer.nvidia.com/downloads/jetson-orin-nx-series-orin-nano-series-tuning-complinace-guide

The default setting is for on Orin Nano developer kit. Please do it with custom board to ensure signal quality is good.

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