How to Configure USB2 as usb function on TX2?

Hello,forums

TX2 USB2_D+/D- usage on Carrier board is M.2 Key E,could I re-configure it as usb?

Hi,

USB2_D+/D- on M.2 key E is for USB in the beginning. Nothing needs to be changed.

Thank you,WayneWWW

But I connect a usb device to USB2_D+/D- and GND VCC_5V, TX2 can not dectect the usb device.

Hi,

Please check the dmesg when you connect the usb device to see if any error log.

Hi Wayne,

There is no dmesg info when usb device hotplug.
Do I have a way to debug this problem?

Then could you paste the dmesg?

dmesg.log (59.8 KB)

Hi,

Are you using a pure dtb file from jetpack and doesn’t modify it?

I have modify the dtb file for our carrier board.
Bellow dtb file is disabled:
<t18x-common-plugin-manager/tegra186-quill-camera-plugin-manager.dtsi>
<t18x-common-platforms/tegra186-quill-camera-modules.dtsi>

Hi,

Please check if usb2-2 exist under xhci@3530000.

If it does not, then you need to modify the device tree.

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”;

hello Wayne

My modification as bellow:

`— a/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dts
+++ b/hardware/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dts
@@ -121,8 +121,10 @@
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", "usb3-1";
    
  •           phy-names = "usb2-0", "usb2-1", "usb2-2", "usb3-0", "usb3-1";
      };
    

#else
xhci@3530000 {

USB2 still not work.

Please always share the dmesg when something does not work.

You could also read the TX2 adaptation guide for USB. That is a very clear document.

addusb.log (59.2 KB)

Thanks Wayne,

I have read TX2 adaptation guide, I want to know do I need to change xhci@3530000 configure in file tegra186-quill-p3310-1000-a00-plugin-manager.dtsi?

Hi,

Plugin-manager is a tool for NV internal use only. It will take effect during runtime.
Generally, you don’t need to modify it. I was trying to explain how plugin-manager works on forum but only few users could understand. So I give up. Please just ignore this file. We will only remove something from it but will not add anything.

You could check the node /proc/device-tree on your device to confirm the runtime dts. Why I said “runtime” is because device tree is a structure that could be keeping overwritten. Just make it simple to understand, why do you think you have to modify xhci@3530000 in plugin-manager? I guess that is because you see xhci in that device tree too, right? But you also see xhci in a00-00-base.dts, right? Then the next question is modifying which dts file could make your change take effect?
There is no standard answer for this question. If you are using c03-base.dtb, you will notice it includes a00-00-base.dts and a00-00-base.dts includes other files too.

In such case, modifying in c03-base.dts would make those change take effect because it is the final one.
However, if you modify something in a00-00-base but c03-base.dts also modify similar thing again, then your change in a00-00-base will not work.

1 Like

Thanks for the details.
usb2-2 still not work in my case ,I am still work on this.

Hi Wayne,

I think I realy need your help about enable usb2-2(USB2_D+/-).

This is what I want to use the USB:
[USB3.0]
USB_SS0
USB1

[USB0 MircoUSB]
USB0

[USB2.0]
USB2

After read other usb topic and USB Lane Mapping guide I still can not make usb2-2 work.
My dts file changed as below:

#if TEGRA_XUSB_PADCONTROL_VERSION >= DT_VERSION_2
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”;
};
#else

xusb_padctl@3520000 {

ports {
usb2-0 {
status = “okay”;
mode = “otg”;
vbus-supply = <&vdd_usb0_5v>;
nvidia,oc-pin = <0>;
};
usb2-1 {
status = “okay”;
mode = “host”;
vbus-supply = <&vdd_usb1_5v>;
nvidia,oc-pin = <1>;
};
usb2-2 {
status = “okay”;
mode = “host”;
vbus-supply = <&battery_reg>;
nvidia,oc-pin = <1>;
};
usb3-1 {
nvidia,usb2-companion = <1>;
status = “okay”;
};
};

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

dmesg log:dmesg-usb.log (58.5 KB)

I test usb2-2 use USB2_D+/- and GND VCC_5V(from our carrier board) connect to a keyboard or a usb storage device, Nothing show up when usb devices hotplug.

Thanks.

AFAIK, any M.2 card plug on the m.2 slot on devkit would be listed in lsusb. That proves the usb2-2 could work fine on devkit.
Could you try devkit to verify my comment and compare your dts with devkit dts?

Also, lane mapping only affects usb3 lanes so usb2-2 does not need to care the lane mapping.

Have you ever enabled the lanes under xusb_padctl@3520000? Please note pinctrl@3520000 is not in use on rel-32 anymore. That is for rel-28 based driver.

Hi
I have no usb debug experience on nvidia platform,this is my first time to do usb work on tx2.
The L4T version I used is R32 (release), REVISION: 1.0.