TX2 USB Lane Mapping configs #4

Hi Sir/Madam,

I would like to config USB Lane Mapping to #4 so I follow other threads to modify ODMDATA to 0x07090000 in “p2771-0000.conf.common” and modify the following parts in “tegra186-quill-p3310-1000-a00-00-base.dts” and “tegra186-quill-p3310-1000-c03-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_USB3_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(2)>;
		phy-names = "utmi-0", "utmi-1", "usb3-1", "utmi-2","usb3-0", "usb3-2";
		nvidia,boost_cpu_freq = <800>;
	};

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

But I saw the log, the pcie and usb3 still not correct. Are these modifications above correct?

tegra-pcie 10003000.pcie-controller: 4x1, 1x1 configuration

Attachment is the log

Thank you
0124.log (200 KB)

After I add modification in tegra186-quill-p3310-1000-a00-plugin-manager.dtsi

PCI starus become as below

tegra-pcie 10003000.pcie-controller: 1x1, 1x1, 1x1 configuration

USB status

nvidia@tegra-ubuntu:~$ lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-tegra/3p, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-tegra/4p, 480M
    |__ Port 1: Dev 3, If 0, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 3, If 1, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 3, If 2, Class=Human Interface Device, Driver=usbhid, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M

Our custom board uses PCIe#0_0 for PCIe-USB bridge and USB_SS#0, USB_SS#2 for USB3.0.
PCIE looks fine now but not sure USB settings are correct or not?

0124_2.log (214 KB)

Hi JasonFan,

This is due to plugin-manager overwrite the device tree again.

Could you try to comment out those that would overwrite pcie/usb in plugin-manager?

tegra186-quill-p3310-1000-a00-plugin-manager.dtsi

[    0.143374] node /plugin-manager/fragment-500-pcie-config match with board >=3310-1000-500
[    0.143815] node /plugin-manager/fragment-500-xusb-config match with board >=3310-1000-500
[    0.144097] node /plugin-manager/fragment-500-e3325-pcie match with board >=3310-1000-500

Hi WayneWWW,

After I comment out “fragment-500-pcie-config”, “fragment-500-xusb-config” and “fragment-500-e3325-pcie” in tegra186-quill-p3310-1000-a00-plugin-manager.dtsi, all pci and usb are gone.

0125.log (211 KB)

/proc/device-tree would show all the status of current device node.

Could you check it? If you don’t use those overwrite in plugin-manager, you should write your config in tegra186-quill-p3310-1000-c03-00-base.dts

Hi WayneWWW,

Could you help check USB parts if I need to config USB Lane Mapping to #4

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_USB3_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(2)>;
		phy-names = "utmi-0", "utmi-1", "usb3-1", "utmi-2","usb3-0", "usb3-2";
		nvidia,boost_cpu_freq = <800>;
	};

I will keep trying which dts file I should modify.

Thanks

You also need to enable those usb under

pinctrl@3520000 {
 		pinmux {
 			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";
 			};
 		};
 	};

I’ve updated this wiki page. This is for config#4. Hope it can help.
https://elinux.org/Jetson/TX2_USB#USB-Lane_Mapping

Hi WayneWWW,

Thanks for update. (The wiki page is for config#3 not config#4)
I try to find the rules by config#3 but still have some problems.

On our custom board, we will use the following interfaces

  1. USB hub bridge over PCIe
    “PEX0”(A44, A45, H44, H45, E44, E45)

  2. USB2.0
    2.1 USB1_D (A38, A39)
    2.2 USB2_D(B42, B43)

  3. USB3.0
    3.1 “USB_SS0” (F43, F44, C43, C44)
    3.2 “USB_SS1” (G43, G44, D43, D44)

For those usage, I think I need to config USB Lane Mapping to #4 (one PCIe lane and two USB3.0 including USB_SS0)

I try to add the followings into “tegra186-quill-p3310-1000-a00-00-base.dts” and “tegra186-quill-p3310-1000-c03-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_USB3_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(2)>;
		phy-names = "utmi-0", "utmi-1", "usb3-1", "utmi-2","usb3-0", "usb3-2";
		nvidia,boost_cpu_freq = <800>;
	};
gpio@2200000 {
		sdmmc-wake-support-input {
			status = "okay";
		};

		sdmmc-wake-support-output {
			status = "okay";
		};
		pcie0_lane2_mux {
			status = "okay"; //This is for switch usb3.0 on M.2 to PCIe.
		};
	};
pinctrl@3520000 {
 		pinmux {
 			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";
 			};
                       e3325-usb3-std-A-HS {
                                status = "okay"; //This is usb2.0 port on M.2
		        };
 		};
 	};

BUS 04: “USB_SS0” (F43, F44, C43, C44)
Bus 03: usb 2.0
Bus 02: not sure
Bus 01: PCIe-USB
“USB_SS1” (G43, G44, D43, D44) seems not work.

nvidia@tegra-ubuntu:~$ lsusb -t
/:  Bus 04.Port 1: Dev 1, Class=root_hub, Driver=xhci-tegra/3p, 5000M
/:  Bus 03.Port 1: Dev 1, Class=root_hub, Driver=xhci-tegra/4p, 480M
    |__ Port 1: Dev 3, If 0, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 3, If 1, Class=Audio, Driver=snd-usb-audio, 12M
    |__ Port 1: Dev 3, If 2, Class=Human Interface Device, Driver=usbhid, 12M
/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M

If I also add those modification into tegra186-quill-p3310-1000-a00-plugin-manager.dtsi and comment out conflict parts. The USB status are as below.

/:  Bus 02.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 5000M
/:  Bus 01.Port 1: Dev 1, Class=root_hub, Driver=xhci_hcd/4p, 480M

This thread is close what I need but PCIe setting has error and “USB_SS1” (G43, G44, D43, D44) can’t work.
https://devtalk.nvidia.com/default/topic/1007448/jetson-tx2/differences-between-tx2-module-revisions/1

I comment out “fragment-500-pcie-config”, “fragment-500-xusb-config” and “fragment-500-e3325-pcie” in
“tegra186-quill-p3310-1000-a00-plugin-manager.dtsi”.

And add modification in these two dtsi files but still have problems.
“tegra186-quill-p3310-1000-a00-00-base.dts”
“tegra186-quill-p3310-1000-c03-00-base.dts”

If I use the following pcie modifications (ODMDATA=0x7090000)

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

system log shows as following but there is no any pcie device can be detected by lspci

[    0.456138] tegra-pcie 10003000.pcie-controller: 1x1, 1x1, 1x1 configuration

If I change to other settings
for example

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

system log shows as following and it can detect pcie device by lspci

[    0.450066] tegra-pcie 10003000.pcie-controller: wrong configuration updated in DT, switching to default 2x1, 1x1, 1x1 configuration

USB settings as followings (base on pcie 1x1x1)

gpio@2200000 {
		sdmmc-wake-support-input {
			status = "okay";
		};

		sdmmc-wake-support-output {
			status = "okay";
		};
		pcie0_lane2_mux {
			status = "okay"; //This is for switch usb3.0 on M.2 to PCIe.
		};
	};

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 {
		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";
		};
		e3325-usb3-std-A-HS {
                    status = "okay"; //This is usb2.0 port on M.2
		};
	};
      };

If I use “sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1” to update dtb

USB_SS#0(USB_SS0) can’t work but USB_SS#2(USB_SS1) can work.
(default USB_SS#0 can work but USB_SS#2 can’t and pcie is 4x1 1x1).

But after flash whole image with “sudo ./flash.sh jetson-tx2 mmcblk0p1”
there is no any pcie and usb can be detected. Is it also a bug?

Now I am so confused to modify USB Lane Mapping to #4

Hi JasonFan,

Please attach the full dmesg log along with c03 and a00 device tree. I will help you check.

Sorry for inconvenience.

Hi WayneWWW,

Here are three dtsi files
“tegra186-quill-p3310-1000-a00-00-base.dts”
“tegra186-quill-p3310-1000-c03-00-base.dts”
“tegra186-quill-p3310-1000-a00-plugin-manager.dtsi”

and log

After I flash whole image, lspci and lsusb can’t detect anything.

Thanks a lot for your help.
dtsi.7z (3.8 KB)
0126.log (211 KB)

Hi JasonFan,

The USB_SS#0 should work if you have below change.

pcie0_lane2_mux {
			status = "<s>okay</s>disabled";
		};

I am still checking the PCIe issue.

According to your previous comment,

  1. USB hub bridge over PCIe
    “PEX0”(A44, A45, H44, H45, E44, E45)

How about PEX2? Does your carrier board use F40,F41, C40, C41?

Hi WayneWWW,

We will not use PEX2. but only config#4 fit our requirements. (one lane PCIe and two USB3.0 including USB_SS#0)

After I flash whole image, lspci and lsusb can’t detect anything.
So I back to original three dtsi files and flash whole image again.
then

  1. update modified “tegra186-quill-p3310-1000-a00-plugin-manager.dtsi” and flash whole image
    → it’s okay for lspci and lsusb.
nvidia@tegra-ubuntu:~$ lspci
00:01.0 PCI bridge: NVIDIA Corporation Device 10e5 (rev a1)
01:00.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02)
nvidia@tegra-ubuntu:~$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 0572:1494 Conexant Systems (Rockwell), Inc.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
  1. then update modified “tegra186-quill-p3310-1000-a00-00-base.dts” and “tegra186-quill-p3310-1000-c03-00-base.dts” with
pcie0_lane2_mux {
			status = "okaydisabled";
		};

–>2.1 only flash DTB.
by

make O=$TEGRA_KERNEL_OUT dtbs
cp .../kernel_out/arch/arm64/boot/dts/tegra* .../Linux_for_Tegra/kernel/dtb/
sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1

But everything is the same. (Only USB_SS#0 okay, but USB_SS#2 not)

nvidia@tegra-ubuntu:~$ lspci
00:01.0 PCI bridge: NVIDIA Corporation Device 10e5 (rev a1)
01:00.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02)
nvidia@tegra-ubuntu:~$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 0572:1494 Conexant Systems (Rockwell), Inc.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

–>2.2 So I try to flash whole image
everything is the still same. (Only USB_SS#0 okay, but USB_SS#2 not)

nvidia@tegra-ubuntu:~$ lspci
00:01.0 PCI bridge: NVIDIA Corporation Device 10e5 (rev a1)
01:00.0 USB controller: Texas Instruments TUSB73x0 SuperSpeed USB 3.0 xHCI Host Controller (rev 02)
nvidia@tegra-ubuntu:~$ lsusb
Bus 004 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 003 Device 003: ID 0572:1494 Conexant Systems (Rockwell), Inc.
Bus 003 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Depends on above results, it looks like no any rules when modifying dts files.

Is it correct to update DTB only by the following commands after modifying dtsi files?

make O=$TEGRA_KERNEL_OUT dtbs
cp .../kernel_out/arch/arm64/boot/dts/tegra* .../Linux_for_Tegra/kernel/dtb/
sudo ./flash.sh -r -k kernel-dtb jetson-tx2 mmcblk0p1

HI JasonFan,

Yes, there is a rule. The rule is that plugin-manager is the last one that overwrites all your dts file.

That is why I asked you to comment out all plugin-manager stuff related to PCIe and usb so that it would not affect you final dts.

Seems that there are some configuration that can work. Maybe we can begin with that first.

To debug with what is the exact dts during runtime. Please use following command after device is boot up.

nvidia@tegra-ubuntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@1\,0/nvidia\,num-lanes 
nvidia@tegra-ubuntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@1\,0/status 
nvidia@tegra-ubuntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@2\,0/nvidia\,num-lanes 
nvidia@tegra-ubuntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@2\,0/status 
nvidia@tegra-ubuntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@3\,0/nvidia\,num-lanes 
nvidia@tegra-ubuntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@3\,0/status 
nvidia@tegra-ubuntu:~$ xxd /proc/device-tree/xhci@3530000/phy-names

Because configuration #3 and configuration #4 has one differ in one lane. Could you try to use config#3 to see if it is partially up?

https://elinux.org/Jetson/TX2_USB

Hi WayneWWW,

Sorry to make a mistake for previous post. Let me describe again.
After I comment out “fragment-500-pcie-config”, fragment-500-xusb-config, fragment-500-e3325-pcie, fragment-500-e3325-xusb in “tegra186-quill-p3310-1000-a00-plugin-manager.dtsi”. and flash whole image.
lspci and lsusb can’t detect anything.

After I follow “Jetson/TX2 USB - eLinux.org” to use config#3 with ODMDATA= 0x6090000 and flash whole image. USB_SS#1 and USB_SS#2 can work now. (We rework our custom board, change USB connector from USB_SS#0 to USB_SS#1). It means USB configurations work. But lspci is still nothing.

Here are the information for command you post previously

nvidia@tegra-ubuntu:~$
vidia\,num-lanesntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@1\,0/n
00000000: 0000 0001                                ....
tatusa@tegra-ubuntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@1\,0/s
00000000: 6f6b 6179 00                             okay.
vidia\,num-lanes tu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@2\,0/n
00000000: 0000 0001                                ....
tatusa@tegra-ubuntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@2\,0/s
00000000: 6f6b 6179 00                             okay.
vidia\,num-lanes tu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@3\,0/n
00000000: 0000 0001                                ....
tatus @tegra-ubuntu:~$ xxd /proc/device-tree/pcie-controller@10003000/pci@3\,0/s
00000000: 6f6b 6179 00                             okay.
nvidia@tegra-ubuntu:~$ xxd /proc/device-tree/xhci@3530000/phy-names
00000000: 7574 6d69 2d30 0075 746d 692d 3100 7574  utmi-0.utmi-1.ut
00000010: 6d69 2d32 0075 7362 332d 3100 7573 6233  mi-2.usb3-1.usb3
00000020: 2d32 00

If config#3 both pcie and usb can work, I think we can change our hardware design.

Thank you

0129.log (212 KB)

Hi JasonFan,

Config#3 and #4 only differs in PCIe#2_0 and USB_SS#0. As a result, if your pcie is gone after using config #4, which means you are using PCIe#2_0 (PEX1). Could you check from hardware side?

Hi WayneWWW,

Now I use config#3, pcie is still gone.
Config#3 now is only good for USB_SS#1 and USB_SS#2.

And default config#2 works well for PCIe.

Sorry that I didn’t see it… Too much posts to reply this afternoon.

Make a summary here:
config#2 : PCIe is back but you need usb.

config#3: PCIe is gone, but two usb port is working.

config#4: Both PCIe and usb port are gone.

Let’s debug it one by one.

  1. Is your USB_SS#0 also gone when change from #2 to #3?
  2. What did you change between #3 and #4? USB_SS#1 and USB_SS#2 should still work.