How to Configure USB2 as usb function on TX2?

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.

The only suggestion I can give you according to this comment is maybe you could upgrade to rel-32.4.3. rel-32.1 is kind of old.

Also, I don’t see any other useful inputs now. Where is your result of xusb_padctl@3520000? I asked in previous comment but you didn’t reply.

Your dmesg does not have any error. It is just like usb2-2 does not exist. Thus I guess you should also check the runtime device tree too.

Hello, where is the runtime device tree?

nvidia@nvidia:/sys/firmware/devicetree/base/pinctrl@3520000/pinmux$ ls -al
total 0
drwxr-xr-x 7 root root 0 6月 18 17:27 .
drwxr-xr-x 3 root root 0 6月 18 17:27 …
drwxr-xr-x 2 root root 0 6月 18 17:27 e3325-usb3-std-A-HS
drwxr-xr-x 2 root root 0 6月 18 17:27 e3325-usb3-std-A-SS
-r–r–r-- 1 root root 4 6月 18 17:27 linux,phandle
-r–r–r-- 1 root root 7 6月 18 17:27 name
-r–r–r-- 1 root root 4 6月 18 17:27 phandle
drwxr-xr-x 2 root root 0 6月 18 17:27 usb2-micro-AB
drwxr-xr-x 2 root root 0 6月 18 17:27 usb2-std-A-port2
drwxr-xr-x 2 root root 0 6月 18 17:27 usb3-std-A-port2

#xxd /proc/device-tree/xhci@3530000/phy-names
00000000: 7573 6232 2d30 0075 7362 322d 3100 7573 usb2-0.usb2-1.us
00000010: 6233 2d30 00 b3-0.

xxd info looks like usb2-2 is not config correctly.

Yes, that is what we call runtime device tree. What under /proc/device-tree is the real device tree running on tegra.

Your change does not appears there and usb2-2 is not there. That is what I keep trying to ask.

Also, as I told before. If you are using rel-32.x which is kernel 4.9, pinctrl@3520000 is just a dummy node. No driver is using this node. You have to check xusb_padctl@3520000.

Could you also dump the serial console log for us? Want to make sure no plugin-manager affects your case. That log is only in cboot.

Hi Wayne,

Sorry for my late update.

dts diff file:dts.txt (2.3 KB)
serial console log:debug-uart.log (83.7 KB)

and what is “nvidia,oc-pin”,I don’t know what the oc-pin value should be for usb2-2.

Thank you so much.

Hi,

I think the cause of this issue is quite obvious. It is same as my previous comment.
Have you ever wondered which dts file is flashed onto your board?

Hi,
Issue is quite obvious for you sir, not for newbie like me.
Dts flash to my board is tegra186-quill-p3310-1000-c03-00-base.dts and all the included dtsi in this dts file.

I changed tegra186-quill-p3310-1000-a00-plugin-manager.dtsi file and got below xdd info:
nvidia@nvidia:~$ xxd /proc/device-tree/xhci@3530000/phy-names
00000000: 7573 6232 2d30 0075 7362 322d 3100 7573 usb2-0.usb2-1.us
00000010: 6232 2d32 0075 7362 332d 3000 b2-2.usb3-0.

Hi,

Yes, that should work. Any error log from the dmesg now?

Hi,

USB2-2 is working now for one of our carrier board,other one is not(we have two different carrier board),maybe it’s HW issue.

On the worked one:dmesg.log (59.9 KB)

I have several questions,

  1. I have tegra18x_xusb_firmware file under /lib/firmware,why dmesg shows:tegra-xusb 3530000.xhci: Direct firmware load for tegra18x_xusb_firmware failed with error -2
    2.what is the correct value that “nvidia,oc-pin” should be for usb2-2.
    3.the Power Tree Changes told me pinctrl@3520000->vbus-2-supply should be <&battery_reg>, and you say “pinctrl@3520000 is not in use on rel-32 anymore”, so what is the correct value for vbus-2-supply.
    4.meybe my modification is not the best way to enable usb2-2, could you please show me how to enbale it on L4T “# R32 (release), REVISION: 1.0, GCID: 14531094, BOARD: t186ref, EABI: aarch64, DATE: Wed Mar 13 07:41:08 UTC 2019”.

Thank you.

Hi,

I have tegra18x_xusb_firmware file under /lib/firmware,why dmesg shows:tegra-xusb 3530000.xhci: Direct firmware load for tegra18x_xusb_firmware failed with error -2

If your xhci gives correct log in the end, then no need to worry about it. It is just failure during the beginning.

2.what is the correct value that “nvidia,oc-pin” should be for usb2-2.

It depends on your hardware design. If your port doesn’t have oc-pin function, then you don’t need to write it.

3.the Power Tree Changes told me pinctrl@3520000->vbus-2-supply should be <&battery_reg>, and you say “pinctrl@3520000 is not in use on rel-32 anymore”, so what is the correct value for vbus-2-supply.

I think the question should be “where” should vbus-supply put. The adaptation guide has provided the example, maybe you could read it again. It is easy to find it by search “vbus-supply” in that document.

4.meybe my modification is not the best way to enable usb2-2, could you please show me how to enbale it on L4T “# R32 (release), REVISION: 1.0, GCID: 14531094, BOARD: t186ref, EABI: aarch64, DATE: Wed Mar 13 07:41:08 UTC 2019”.

Actually you could just delete that part from plugin-manager and what your change in a00-base would take effect.
Plugin-manager is a tool that would overwrite device tree in cboot. Thus what you’ve done in a00-base does not take effect.

Thanks for the suggestions posted here.

The adaptation guide has provided the example, maybe you could read it again. It is easy to find it by search “vbus-supply” in that document.

In the July 2 2019 adaptation and bringup guide this is the mention on page 18 which correctly references the vbus-supply setting in the ports node.

However there’s also a “Power Tree Changes” section in page 10 which still references the pinctrl@3520000 node and presumably needs to be updated. Ignoring the “Power Tree Changes” section example and following the example on page 18 works. Here’s the patch which changes dtb settings from the tegra186 defaults to work using the battery_reg instead of the vdd_usb2_5v regulator used on the TX2 dev board:

diff --git a/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dts b/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dts
index d02fcacaa081..267f7652bf73 100644
--- a/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dts
+++ b/nvidia/platform/t18x/quill/kernel-dts/tegra186-quill-p3310-1000-a00-00-base.dts
@@ -202,7 +202,7 @@
                        usb2-2 {
                                status = "okay";
                                mode = "host";
-                               vbus-supply = <&vdd_usb2_5v>;
+                               vbus-supply = <&battery_reg>;
                        };
                        usb3-0 {
                                nvidia,usb2-companion = <2>;
--

However there’s also a “Power Tree Changes” section in page 10 which still references the pinctrl@3520000 node and presumably needs to be updated. Ignoring the “Power Tree Changes” section example and following the example on page 18 works

That is right. That example is an old one and we already removed this internally. Unfortunately, the new one seems not updated on dlc. I will check this.

Thanks.