usb 3.0 can not work with xavier

We design a carrier board for xavier.
We delete type C function, and only use usb 3.0.
Our usb hardware connectivity as follow:

  1. USB 3.0 group 1<------------> uphy lane 1 + usb2
  2. USB 3.0 group 2<------------> uphy lane 6 + usb1
  3. we use USB 0 as otg.

Problem:
USB 3.0 group 1 and USB 3.0 group 2 can not work as USB 3.0.
titan@titan-desktop:~$ lsusb -t
/: Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 10000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 480M
|__ Port 1: Dev 2, If 0, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 1: Dev 2, If 1, Class=Human Interface Device, Driver=usbhid, 12M
|__ Port 2: Dev 3, If 0, Class=Mass Storage, Driver=usb-storage, 480M

Our question:
1.how to config uphy lane
Form the <Tegra_Linux_Driver_Package_AGX_Xavier_Adaptation_Guide.pdf>, we know that we have to config ODMDATA in p2972-0000.conf.common.
But we do not know the ODMDATA value we can use.
I read these register values as follow:
titan@titan-desktop:~/devmem2$ sudo ./devmem2 0x02da0388
/dev/mem opened.
Memory mapped at address 0x7faadd4000.
Value at address 0x2DA0388 (0x7faadd4388): 0x200000200

titan@titan-desktop:~/devmem2$ sudo ./devmem2 0x02d30388
[sudo] password for titan:
/dev/mem opened.
Memory mapped at address 0x7fb030e000.
Value at address 0x2D30388 (0x7fb030e388): 0x200000200

2.What else have I left behind? like device tree?

Could you help us?

Hi,
You should not need to modify ODMDATA. In device tree, you may check if your usb2/usb3 companion is correct, and if VBUS is turned on too early. There are certain enumeration issues caused by VBUS being turned on in bootloader. It is better to be on after xhci initialization in kernel.

This is our device-tree about USB.

#include "dt-bindings/extcon-ids.h"
#include "dt-bindings/gpio/tegra194-gpio.h"
#include "tegra194-p2888-0000-a00.dtsi"
#include <t19x-common-platforms/tegra194-platforms-eqos.dtsi>
#include "tegra194-p2822-0000-a00.dtsi"
#include "tegra194-power-tree-p2888-0001-p2822-1000.dtsi"
#include <t19x-common-platforms/tegra194-comms.dtsi>
#include "tegra194-thermal-p2888.dtsi"
#include "tegra194-plugin-manager-p2888-0000.dtsi"
#include "tegra194-plugin-manager-p2822-0000.dtsi"
#include "tegra194-super-module-e2614-p2888-0000.dtsi"

#define EXTCON_NONE                            0
#define EXTCON_USB                     1
#define EXTCON_USB_Host                2

/ {
	nvidia,dtsfilename = __FILE__;
	nvidia,dtbbuildtime = __DATE__, __TIME__;
	nvidia,fastboot-usb-vid = <0x0955>;
	nvidia,fastboot-usb-pid = <0xee1e>;

	model = "jetson-xavier";
	compatible = "nvidia,jetson-xavier", "nvidia,tegra194";

	chosen {
		bootargs ="console=ttyTCU0,115200";
		board-has-eeprom;
	};

	firmware {
		android {
			compatible = "android,firmware";
			hardware = "jetson-xavier";
			vbmeta {
				compatible = "android,vbmeta";
				parts = "vbmeta,kernel,kernel-dtb,APP,vendor,SOS";
			};
			fstab {
				compatible = "android,fstab";
				vendor {
					compatible = "android,vendor";
					dev = "/dev/block/platform/3460000.sdhci/by-name/vendor";
					type = "ext4";
					mnt_flags = "ro";
					fsmgr_flags = "wait,avb";
				};
				odm {
					compatible = "android,odm";
					dev = "/dev/block/platform/3460000.sdhci/by-name/odm";
					type = "ext4";
					mnt_flags = "ro";
					fsmgr_flags = "wait,avb";
				};
			};
		};
	};

	spi@c260000 {
		status = "disabled";
	};

	spi@3270000 {
		status = "disabled";
	};

	spi@3300000 {
		status = "disabled";
	};

	pmc@c370000 {
		nvidia,invert-interrupt;
	};

	i2c@c240000 {
		bmi160@69 {
			compatible = "bmi,bmi160";
			reg = <0x69>;
			interrupt-parent = <&tegra_aon_gpio>;
			interrupts = <TEGRA194_AON_GPIO(AA, 2) GPIO_ACTIVE_LOW>;
			accelerometer_matrix    = [01 00 00 00 01 00 00 00 01];
			gyroscope_matrix        = [01 00 00 00 01 00 00 00 01];
			accelerometer_delay_us_min = <1250>;
			gyroscope_delay_us_min = <1250>;
			status = "okay";
		};
		ucsi_ccg: ucsi_ccg@8 {
			//status = "okay";
			status = "disabled";
			typec-extcon {
				typec_port0: port-0 {
					status = "okay";
					#extcon-cells = <1>;
				};
				typec_port1: port-1 {
					status = "okay";
					#extcon-cells = <1>;
				};
			};
			typec-pd {
				typec_pd: pd {
					status = "okay";
					#extcon-cells = <1>;
				};
			};
		};
	};

#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2

	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";
					};
					usb2-3 {
						nvidia,function = "xusb";
						status = "okay";
					};
				};
			};
			usb3 {
				lanes {
					usb3-0 {
						nvidia,function = "xusb";
						status = "okay";
					};
					usb3-2 {
						nvidia,function = "xusb";
						status = "okay";
					};
					usb3-3 {
						nvidia,function = "xusb";
						status = "okay";
					};
				};
			};
		};

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

       external-connection {
               vbus_id_extcon: extcon@1 {
                       compatible = "extcon-gpio-states";
                       reg = <0x01>;
                       extcon-gpio,name = "VBUS";
                       extcon-gpio,wait-for-gpio-scan = <0>;
                       extcon-gpio,cable-states = <0x3 0x0
                                                   0x0 0x2
                                                   0x1 0x2
                                                   0x2 0x1>;
                       gpios = <&tegra_aon_gpio TEGRA194_AON_GPIO(BB, 2) 0
                               &tegra_main_gpio TEGRA194_MAIN_GPIO(Q, 0) 0>;
                       extcon-gpio,out-cable-name-strings = "USB", "USB-Host";
                       extcon-gpio,out-cable-names = <EXTCON_USB EXTCON_USB_HOST EXTCON_NONE>;
                       wakeup-source;
                       #extcon-cells = <1>;
               };
       };
       
        tegra_xudc: xudc@3550000 {
                extcon-cables = <&vbus_id_extcon 0>; 
                extcon-cable-names = "vbus";
                #extcon-cells = <1>;
               
#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2
		phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>,
			<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-2}>;
		phy-names = "usb2", "usb3";
		nvidia,xusb-padctl = <&xusb_padctl>;
#endif
		status = "okay";
	};

	tegra_xhci: xhci@3610000 {
		extcon-cables = <&vbus_id_extcon 1>;
		extcon-cable-names = "id";
		#extcon-cells = <1>;
#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2
		phys = <&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-0}>,
			<&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-1}>,
			<&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-3}>,
			<&{/xusb_padctl@3520000/pads/usb2/lanes/usb2-2}>,
			<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-2}>,
			<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-0}>,
			<&{/xusb_padctl@3520000/pads/usb3/lanes/usb3-3}>;
		phy-names = "usb2-0", "usb2-1", "usb2-3", "usb2-2",
			"usb3-2", "usb3-0", "usb3-3";
		nvidia,xusb-padctl = <&xusb_padctl>;
#endif
		status = "okay";
	};

	arm-pmu {
		status = "okay";
	};

	power-domain {
		status = "disabled";
	};

	interrupt-controller {
		status = "disabled";
	};

	mods-simple-bus {
		status = "disabled";
	};

	eeprom-manager {
		status = "disabled";
	};

	cpuidle {
		compatible = "nvidia,tegra19x-cpuidle";
		status = "okay";
	};

	thermal-zones {
		status = "disabled";
	};

	reserved-memory {
		ramoops_carveout {
			status = "okay";
		};
	};

	mttcan@c310000 {
		status = "okay";
	};

	mttcan@c320000 {
		status = "okay";
	};

	serial@3110000 {
		status = "okay";
	};

	pwm@32c0000 {
		status = "okay";
	};

	pwm@32f0000 {
		status = "okay";
	};

	i2c@31e0000 {
		pinctrl-names = "default";
		pinctrl-0 = <&dpaux_default>;
		bmi160@69 {
			compatible = "bmi,bmi160";
			reg = <0x69>;
			accelerometer_matrix    = [01 00 00 00 01 00 00 00 01];
			gyroscope_matrix        = [01 00 00 00 01 00 00 00 01];
			status = "okay";
		};
	};

	host1x {
		dpaux@155F0000 {
			status = "okay";
			compatible = "nvidia,tegra194-dpaux3-padctl";
			/delete-property/ power-domains;
			dpaux_default: pinmux@0 {
				dpaux3_pins {
					pins = "dpaux3-3";
					function = "i2c";
				};
			};
		};
	};

	hardwood {
		compatible = "nvidia,denver-hardwood";
		interrupts = <0 24 0x4>;
	};

	ufshci@2450000 {
		nvidia,enable-hs-mode;
	};
};

&head0 {
//	extcon-cables = <&typec_port0 2 &typec_port1 2>;
//	extcon-cable-names = "typec0", "typec1";
//	#extcon-cells = <1>;
};

&head1 {
//	extcon-cables = <&typec_port0 2 &typec_port1 2>;
//	extcon-cable-names = "typec0", "typec1";
//	#extcon-cells = <1>;
};

&head2 {
//	extcon-cables = <&typec_port0 2 &typec_port1 2>;
//	extcon-cable-names = "typec0", "typec1";
//	#extcon-cells = <1>;
};

&sor0 {
	nvidia,typec-port = /bits/ 8 <0>;
};

&sor1 {
	nvidia,typec-port = /bits/ 8 <1>;
};

#if LINUX_VERSION >= 414
#include <tegra194-linux-4.14.dtsi>
#endif

Hi,
In the device tree, uphy lane 6(usb3-0) is with usb2-1. uphy lane 1(usb3-2) is with usb2-0. Please check if it matches your hardware layout. Besides, you have to put vbus-supply in usb2-* accordingly. VBUS has to be on after booting to kernel.

I checked ,it matches our hardware layout.
Vbus have put on ,and we can now use USB2.0 normally.

lsusb -t

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 10000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=tegra-xusb/4p, 480M
    |__ Port 1: Dev 6, If 0, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 1: Dev 6, If 1, Class=Human Interface Device, Driver=usbhid, 12M
    |__ Port 4: Dev 3, If 1, Class=Vendor Specific Class, Driver=option, 480M
    |__ Port 4: Dev 3, If 4, Class=Vendor Specific Class, Driver=, 480M
    |__ Port 4: Dev 3, If 2, Class=Vendor Specific Class, Driver=option, 480M
    |__ Port 4: Dev 3, If 0, Class=Vendor Specific Class, Driver=option, 480M
    |__ Port 4: Dev 3, If 3, Class=Vendor Specific Class, Driver=option, 480M

Hi,
If the device tree is good, you may try to disable and enable VBUS after booting to kernel. See if enumeration is triggered. Also try other USB3 devices to see if it is specific to certain device.

Not sure but it is still more like VBUS is turned on too early.

Hi,
Here is an example of adding vbus-supply:
[url]TX2 JetPack4.2, After reboot TX2 can't recogonize USB3.0 Camera, but USB3.0 UDisk can be recogonized... - Jetson TX2 - NVIDIA Developer Forums

Besides, it seems not right uphy lane 1(usb3-2) is with usb2-0, usb2-0 looks to be otg port, not type-A port.