TX2 config#4 for USB LANE MAPPING

Hi All:

Our carrier board has three USB3.0 type A port.

I follow the https://elinux.org/Jetson/TX2_USB instructions. this is what i have done as below:
1.modify ODMDATA to 0x7090000 to use config#4 USB lane mapping.
2.comment out

[    0.142498] node /plugin-manager/fragment-500-pcie-config match with board >=3310-1000-500
[    0.142936] node /plugin-manager/fragment-500-xusb-config match with board >=3310-1000-500
[    0.143213] node /plugin-manager/fragment-500-e3325-pcie match with board >=3310-1000-500

3.change power tree
Change vbus-2-supply from vdd_usb2_5v to battery_reg. The modifications are as follows:

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

I try to modify kernel-dts/tegra186-quill-p3310-1000-c03-00-base.dts file to enable USB3.0 for three of them, and get the following result.

4.change device tree
hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base.dts.

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>;
};
pcie-controller@10003000 {
    pci@1,0 {
            nvidia,num-lanes = <1>;
            nvidia,disable-clock-request;
            status = "okay";
    };
    pci@2,0 {
            nvidia,num-lanes = <1>;
            status = "okay";
    };
    pci@3,0 {
            nvidia,num-lanes = <1>;
            status = "disabled";
    };
};
xhci@3530000 {
    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 {
    pinmux {
        usb2-micro {
            nvidia,lanes = "otg-0";
            nvidia,function = "xusb";
            nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
        };
        usb3-micro {
            nvidia,lanes = "usb3-0";
            nvidia,function = "xusb";
            nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
        };
        usb2-1 {
            nvidia,lanes = "otg-1";
            nvidia,function = "xusb";
            nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
        };
        usb2-2 {
            nvidia,lanes = "otg-2";
            nvidia,function = "xusb";
            nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
        };
        usb3-1 {
            nvidia,lanes = "usb3-1";
            nvidia,function = "xusb";
            nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
        };
        usb3-2 {
            nvidia,lanes = "usb3-2";
            nvidia,function = "xusb";
            nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
        };
    };
};

then i flash the dtb to target board

sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk1pl

then i use the command dmesg | grep usb

[    0.301135] usbcore: registered new interface driver usbfs
[    0.301194] usbcore: registered new interface driver hub
[    0.301307] usbcore: registered new device driver usb
[    0.360197] vdd-usb0-5v: 5000 mV 
[    0.360367] vdd-usb1-5v: 5000 mV 
[    2.616491] usbcore: registered new interface driver r8152
[    2.616523] usbcore: registered new interface driver asix
[    2.616555] usbcore: registered new interface driver ax88179_178a
[    2.616579] usbcore: registered new interface driver cdc_ether
[    2.616613] usbcore: registered new interface driver smsc75xx
[    2.616638] usbcore: registered new interface driver net1080
[    2.616684] usbcore: registered new interface driver cdc_subset
[    2.616711] usbcore: registered new interface driver zaurus
[    2.616753] usbcore: registered new interface driver cdc_ncm
[    2.617109] tegra-xotg xotg: usb2 phy is not available yet
[    2.617879] usbcore: registered new interface driver cdc_acm
[    2.617923] usbcore: registered new interface driver usb-storage
[    2.617978] usbcore: registered new interface driver usbserial
[    2.618001] usbcore: registered new interface driver cp210x
[    2.618021] usbserial: USB Serial support registered for cp210x
[    2.618044] usbcore: registered new interface driver ftdi_sio
[    2.618064] usbserial: USB Serial support registered for FTDI USB Serial Device
[    2.618087] usbcore: registered new interface driver option
[    2.618104] usbserial: USB Serial support registered for GSM modem (1-port)
[    2.618129] usbcore: registered new interface driver pl2303
[    2.618145] usbserial: USB Serial support registered for pl2303
[    2.618397] tegra-usb-cd usb_cd: otg phy is not available yet
[    2.620765] tegra-xudc-new 3550000.xudc: usb3 phy is not available yet
[    2.756959] usbcore: registered new interface driver gspca_zc3xx
[    2.766088] usbcore: registered new interface driver usbhid
[    2.766089] usbhid: USB HID core driver
[    4.199515] tegra186-padctl 3520000.pinctrl: invalid group "usb3-0" for function "xusb"
[    4.208476] tegra186-padctl 3520000.pinctrl: invalid group "usb3-1" for function "xusb"
[    4.217408] tegra186-padctl 3520000.pinctrl: invalid group "usb3-2" for function "xusb"
[    4.948970] xhci-tegra 3530000.xhci: Direct firmware load for tegra18x_xusb_firmware failed with error -2
[    5.047632] vdd-usb0-5v: disabling
[    5.047634] vdd-usb1-5v: disabling
[    7.701666] usb0: HOST MAC 5a:d9:d3:3f:e4:72
[    7.706692] usb0: MAC 9a:d2:87:39:81:f8
[    7.711566] usb1: HOST MAC 4e:7c:f6:38:e5:ef
[    7.716552] usb1: MAC aa:8e:4c:f0:87:60
[    7.874932] device usb0 entered promiscuous mode
[    7.884752] IPv6: ADDRCONF(NETDEV_UP): usb0: link is not ready
[    7.898182] device usb1 entered promiscuous mode
[    7.921922] IPv6: ADDRCONF(NETDEV_UP): usb1: link is not ready
[    7.921928] l4tbr0: port 2(usb1) entered forwarding state
[    7.921943] l4tbr0: port 2(usb1) entered forwarding state
[    7.923766] usb usb1: New USB device found, idVendor=1d6b, idProduct=0002
[    7.923769] usb usb1: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    7.923771] usb usb1: Product: xHCI Host Controller
[    7.923773] usb usb1: Manufacturer: Linux 4.4.38 xhci-hcd
[    7.923774] usb usb1: SerialNumber: 3530000.xhci
[    7.940971] usb usb2: New USB device found, idVendor=1d6b, idProduct=0003
[    7.940974] usb usb2: New USB device strings: Mfr=3, Product=2, SerialNumber=1
[    7.940976] usb usb2: Product: xHCI Host Controller
[    7.940978] usb usb2: Manufacturer: Linux 4.4.38 xhci-hcd
[    7.940979] usb usb2: SerialNumber: 3530000.xhci
[    8.704827] l4tbr0: port 2(usb1) entered disabled state

just one usb 3.0 is work now.
can anyone give me some advice?
thanks a lot.

The shematic connect pin as follows

[USB3 typeA]
USB1_D (A38, A39)
USB_SS (C43, C44, F43, F44)

[USB3 typeA]
USB2_D (B42, B43)
USB_SS (D42, D43, G42, G43)

[USB3 typeA]
USB0_D (B39, B40)
USB_SS (D39, D40, G39, G40)

my question is :
what’s mean by

[    4.199515] tegra186-padctl 3520000.pinctrl: invalid group "usb3-0" for function "xusb"
[    4.208476] tegra186-padctl 3520000.pinctrl: invalid group "usb3-1" for function "xusb"
[    4.217408] tegra186-padctl 3520000.pinctrl: invalid group "usb3-2" for function "xusb"

and

[    4.948970] xhci-tegra 3530000.xhci: Direct firmware load for tegra18x_xusb_firmware failed with error -2

can anyone give me some advice?
thanks a lot.

Hi,
Please check adaptation guide. There are two versions. One is for r28 and the other is for r32.
[r28]
https://developer.nvidia.com/embedded/dlc/l4t-driver-package-tx2-adaptation-guide
[r32]
https://developer.nvidia.com/embedded/dlc/Tegra_Linux_Driver_Package_TX2_Adaptation_Guide

head -n 1 /etc/nv_tegra_release

R28 (release), REVISION: 2.1, GCID: 11272647, BOARD: t186ref, EABI: aarch64, DATE: Thu May 17 07:29:06 UTC 2018

jetpack version is:
JetPack-L4T-3.3-linux-x64_b39.run

You don’t need “nvidia,function = “xusb”;” for usb3.0 port.

[    4.948970] xhci-tegra 3530000.xhci: Direct firmware load for tegra18x_xusb_firmware failed with error -2

I am not sure if this is error because you only shared partial log. If xusb fw still not load up after it, then please check if you have usb firmware under /lib/firmware.

thanks for your replay.
[r28] is the version of nvidia kernel?

is r28 is not supoort three usb?

ubuntu@tegra-ubuntu:~$ ll /lib/firmware/
total 212
drwxr-xr-x  6 root root   4096 Dec  6 01:45 ./
drwxr-xr-x 22 root root   4096 Dec 12 00:04 ../
-rw-rw-r--  1 root root  64552 Dec  6 01:45 bcm4354.hcd
drwxr-xr-x  2 root root   4096 Dec  6 01:45 brcm/
drwxr-xr-x  2 root root   4096 Dec  6 01:45 gp10b/
drwxr-xr-x  2 root root   4096 Apr  7  2016 hp/
-rw-rw-r--  1 root root      9 Dec  6 01:45 nv-BT-Version
drwxr-xr-x  2 root root   4096 Dec  6 01:45 tegra18x/
-rw-rw-r--  1 root root 122368 Dec  6 01:45 tegra18x_xusb_firmware

Hi,
r28 means the version in /etc/nv_tegra_release. Yours is r28.2.1.

Two more suggestions:
1 Please run xxd to check correctness of device tree. Here is an example:
https://devtalk.nvidia.com/default/topic/1048285/jetson-tx2/how-to-setup-usb-config-4-for-tx2-l4t-28-2-1-/post/5320806/#5320806
2 Chekc if VBUS is turned on too early:
https://devtalk.nvidia.com/default/topic/1043644/jetson-tx2/usb1-and-installing-kernel-modules-for-lte-modem/post/5294983/#5294983

thanks for your replay .
is r28 is not supoort three usb3.0?
i found the l4t-driver-package-tx2-adaptation-guide is not mention.
just mention
ODMDATA=0x1090000 while flashing for Jetson TX2 for Configuration #2
ODMDATA=0x90000 for Configuration #1
ODMDATA=0x6090000 for Configuration #3

It supports. Please calculate the odmdata for #4,5,6 by yourself.

You can find many topics same to your issue on this forum too.

which the relation between tegra186-quill-p3310-1000-a00-00-base.dts and tegra186-quill-p3310-1000-c03-00-base.dts
i follow the article
https://elinux.org/Jetson/TX2_USB
after do that ,my board can not detect any usb 3.0.
then i cd to /sys/firmware/devicetree/base/pinctrl@3520000/pinmux
i found that

drwxr-xr-x 2 root root 0 Dec 12 06:11 e3325-usb3-std-A-HS/
-r--r--r-- 1 root root 4 Dec 12 06:11 linux,phandle
-r--r--r-- 1 root root 7 Dec 12 06:11 name
-r--r--r-- 1 root root 4 Dec 12 06:11 phandle
drwxr-xr-x 2 root root 0 Dec 12 06:11 usb2-1/
drwxr-xr-x 2 root root 0 Dec 12 06:11 usb2-2/
drwxr-xr-x 2 root root 0 Dec 12 06:11 usb2-micro/
drwxr-xr-x 2 root root 0 Dec 12 06:11 usb3-std-A-port2/
drwxr-xr-x 2 root root 0 Dec 12 06:11 usb3-std-A-port3/
drwxr-xr-x 2 root root 0 Dec 12 06:11 usb3-std-A-port4/

the pinmux nodes of device tree is the sum of tegra186-quill-p3310-1000-a00-00-base.dts and tegra186-quill-p3310-1000-c03-00-base.dts
is that right ?

which the relation between tegra186-quill-p3310-1000-a00-00-base.dts and tegra186-quill-p3310-1000-c03-00-base.dts

The c03 base dts includes the a00-base dts. The nodes in c03 are able to override the ones from a00.

For example, if you put one node status to “disabled” in a00 and write it to “enabled” in c03, then result of runtime is “enabled”.

thanks for your replay.
files hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-c03-00-base.dts
modification as follow:

xudc@3550000 {
    status = "okay";
    phys = <&tegra_xusb_padctl TEGRA_PADCTL_PHY_UTMI_P(1)>,
        <&tegra_xusb_padctl TEGRA_PADCTL_PHY_USB3_P(0)>;
    phy-names = "usb2", "usb3";
};
pcie-controller@10003000 {
    pci@1,0 {
            nvidia,num-lanes = <1>;
            nvidia,disable-clock-request;
            status = "okay";
    };
    pci@2,0 {
            nvidia,num-lanes = <1>;
            status = "okay";
    };
    pci@3,0 {
            nvidia,num-lanes = <1>;
            status = "disabled";
    };
};
xhci@3530000 {
    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 {
		pinmux {
			usb2-micro {
			    nvidia,lanes = "otg-0";
			    nvidia,function = "xusb";
			    nvidia,port-cap = <TEGRA_PADCTL_PORT_OTG_CAP>;
			};
			usb2-1 {
			    nvidia,lanes = "otg-1";
			    nvidia,function = "xusb";
			    nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
			};
			usb2-2 {
			    nvidia,lanes = "otg-2";
			    nvidia,function = "xusb";
			    nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
			};
			usb3-std-A-port2 {
				nvidia,lanes = "usb3-0";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				status = "okay";
			};
			usb3-std-A-port3 {
				nvidia,lanes = "usb3-2";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				status = "okay";
			};
			usb3-std-A-port4 {
				nvidia,lanes = "usb3-1";
				nvidia,port-cap = <TEGRA_PADCTL_PORT_HOST_ONLY>;
				status = "okay";
			};
		};
	};

and three usb 3.0 works all.

BTW, pcie should be <2,1,1> instead of <1,1,1>. It has some tricks inside the driver, though it is actually running in 3x1-lane.