USB doesn't work on custom board

I’m working in a custom board with 2 USB 2.0 and 2 USB 3.0.

I’m following the “Platform Adaptation and Bring-UP Guide” and on page 18 it says: “For the detailed information about xusb_padctl, refer to the documentation at:
kernel/kernel4.9/Documentation/devicetree/bindings/pinctrl/nvidia,tegra186-
padctl.txt”

But on latest source code download from https://developer.download.nvidia.com/embedded/L4T/r32-2-1_Release_v1.0/TX2-AGX/Sources/public_sources.tbz2?C5desH2W1q5ZA0zvPN0d8J_Iu35nex-TMh8B_63QczhpjYfOd6Mi06rIjyAbXwe2BpKTxCfTeQ8RFh-dapVE1ihW0wxb17I3sLHjTYEO5GQ8Cl-tYFyIOJMnecop305B3sKjpV1hrL1lAOdHg1DlN7tKfM3xwEBnLfeFr9qC_LmdzSo7
this file doesn’t exist.

Can you send it to me?
Can you guide me to turn theses interfaces UP?

I’m sending the design USB schematics.

Obs. I’m using L4T R32.2.1
USB2_0.png
usb2&3.png

Hi,
Please check documents first.

In Figure 21 of product design guide, you can see A19 pin is not connected. Looks not right if you can measure hardware signals on it.

Hi DaneLLL

I’v checked the documents and made a DT, but with no success, I’m sending it to you, can you help-me on this?
I’m sending the dmesg log and the serial debug log on boot.

Because of the pull-up on pin A19 we always have power on USB3 ports, but we’ll change this on next hardware revision, do you have any suggestion to design a board with 2 USB2.0 and 2 USB3.0?

Thanks!
tegra186-quill-p3310-1000-c03-00-base.dts.txt (7.11 KB)
dmesg_usb.txt (55.5 KB)
usb_boot.txt (21.1 KB)

Hi,
There is an example for your reference:
[url]https://devtalk.nvidia.com/default/topic/1057885/jetson-tx2/usb-not-working-in-jetson-tx2-r32-2/post/5364464/#5364464[/url]

Also for debugging, you can use xxd to check xhci@3530000 and xusb_padctl@3520000. If no power is measured, probably ‘vbus-supply’ is not configured correctly in usb2-* ports.

Hi DaneLLL
Can you explain better what I need to read on xhci and xusb_padctl?

I’ve modified the DT (I’m sending it to you) and now I get theses errors:

[    1.184080] OF: /xhci@3530000: could not get #phy-cells for /xusb_padctl@3520000/pads/usb2/lanes/usb2-0
[    1.193709] OF: /xhci@3530000: could not get #phy-cells for /xusb_padctl@3520000/pads/usb2/lanes/usb2-0
[    1.203287] OF: /xhci@3530000: could not get #phy-cells for /xusb_padctl@3520000/pads/usb2/lanes/usb2-0
[    1.212799] OF: /xhci@3530000: could not get #phy-cells for /xusb_padctl@3520000/pads/usb2/lanes/usb2-0
[    1.227892] OF: /usb_cd: could not get #phy-cells for /xusb_padctl@3520000/pads/usb2/lanes/usb2-0
[    1.236835] tegra-usb-cd usb_cd: failed to get otg port phy -19
[    1.244456] OF: /xudc@3550000: could not get #phy-cells for /xusb_padctl@3520000/pads/usb2/lanes/usb2-0

And if I type lsusb I get:

nvidia@nvidia-desktop:~$ lsusb
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

Finally I cant change the ODMDATA, I’v changed all values 0x1090000 to 0x3090000 in p2771-0000.conf.common and write it to TX2 typing:

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

But, after reboot, if a list the files in /sys/firmware/devicetree/base/chosen/plugin-manager/odm-data I get:

nvidia@nvidia-desktop:~$ ls /sys/firmware/devicetree/base/chosen/plugin-manager/odm-data
android-build       disable-tegra-wdt     enable-pcie-on-uphy-lane1  enable-sata-on-uphy-lane5  no-battery
disable-pmic-wdt    enable-debug-console  enable-pcie-on-uphy-lane2  enable-xusb-on-uphy-lane0  normal-flashed
disable-sdmmc-hwcq  enable-denver-wdt     enable-pcie-on-uphy-lane4  name

What is wrong?

tegra186-quill-p3310-1000-c03-00-base.dts.txt (7.11 KB)

Hi,
For updating ODMDATA, you need to do re-flash:

sudo ./flash.sh -r jetson-tx2 mmcblk0p1

G42/G43/D42/D43 is on lane 1(PEX_RFU) so you should see enable-xusb-on-uphy-lane1

Hi DanelLL

Now I was able to modify the OMDDATA, thanks.
But Nothings change!

Could you, PLEASE, analyse my dmesg log?, I’m sending it to you
I running out of options here, can you give any information to help me?

Thanks
dmesg_usb1710.txt (58.2 KB)

Why do you remove pads here?

xusb_padctl@3520000 {
	 /delete-node/ pads;

It’s because I want to be sure that the new configuration will be used.
But it was when I tried to use USB 3.0 (F43, F44, C43, C44, B42 and B43) on #5, for the results in #7 I was trying to turn up (at least) the USB 2.0 (B40, B39, A17, B37, A36), please look at #1 to schematics, and on this trying I’m nothing deleting the pads node anymore (USB 2.0 has pretty much the same schematic as the test board). The USB 2.0 port is working for flash the TX2.
Also we did a modification on board and let the A36 (USB0_OTG_ID) floating.
I’m sending the actual DT.
tegra186-quill-p3310-1000-c03-00-base.dts.txt (5.86 KB)

Hi,
The PCIe setting is wrong. It should be set to one lane.

pcie-controller@10003000 {
    pci@1,0 {
        nvidia,num-lanes = <4>;
        nvidia,disable-clock-request;
    };

xusb_padctl@3520000 shows usb2-1 and usb3-1 is a type A port. usb2-2 and usb3-0 is a type A port. usb2-1usb2-0 looks to be a microAB port.

vbus of usb2-2 and usb3-0 is <&battery_reg>, which can be an issue if it is turned on before booting to kernel.
https://devtalk.nvidia.com/default/topic/1043644/jetson-tx2/usb1-and-installing-kernel-modules-for-lte-modem/post/5294983/#5294983

You can use xxd to inspect the device tree:

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 3000            mi-2.usb3-0.

Please inspect xhci@3530000 and xusb_padctl@3520000.

Hi DaneLLL, thanks for the reply.

In our design we have 2 USB3.0 and 2 PCI 1x1 + 1x2, So we are running on option 6 from “Platform Adaptation and Bring-Up Guide” table 1. The line 6 from this table, says that my ODMDATA must be 0x3090000, and it’s ok. But I don’t know which one has 1 lane and which one has 2 lanes, from table 1 we have PCIe#1_0 → Lane 3, PCIe#0_1 → Lane 2, PCIe#0_0 → Lane4. So the "pcie-controller@10003000 from tegra186-quill-p3310-1000-a00-00-base.dts is the correct for my case?

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

usb2-1 must be a microAB (you mean OTG?) because it’s in companion of usb3-1?

usb3-1 {
	nvidia,usb2-companion = <1>;
	status = "okay";
};

I use this property, because on page 18 of “Apaptaion and Bring-Up” we have: “nvidia,usb2-companion:Specifies the USB2 port (0,1,2, or 3) to which the port is mapped. A port for USB3 must have this property.”, but, if you look on our schematic on #1, the USB3.0 port 1 (J17) has no companion. What is the correct property on this case (usb3.0 without companion).

Vbus of usb2-2, and both usb3 is always on because the circuit is connected to USB2_EN_OC and this pin from TX2 seems to have a pull-up.

I’ll inspect xhci and xusb_padctl and post the results asap.

Corrected a typo. It should be ‘usb2-0 looks to be a microAB port’

Do you mean, on board we must have this kind of conector with USB0_OTG_ID connected to TX2.
Is there no possibility of this working with a type A connector?

Hello DaneLLL,

I got the xhci@3530000 and xusb_padctl@3520000 logs, and I’m sending it to you.
I also got the complete DT from /proc/device-tree with the command:

dtc -I fs -O dts /proc/device-tree > device-tree.dts

vbus: I checked the topic you shared, but we don’t have anything connected in theses ports. Whatever, I connected a mouse on each port and try to disable (with a wire) the vbus of that port and enable after the boot and nothing happen.

One last thing: I’m having this error on boot:

/xudc@3550000: could not get #phy-cells for /xusb_padctl@3520000/pads/usb2/lanes/usb2-0

I can’t find a topic with this same issue on this forum, I even try to use another board and another TX2 and same happen…
xhci@3530000.txt (2.72 KB)
xusb_padctl@3520000.txt (11 KB)
device-tree.dts.txt (461 KB)

Hi,
If usb2-0 is in host mode, you need to disable xudc@3550000 and external-connection. And remove [extcon-cable-names = “id”;] [extcon-cables = <0xa6 0x1>;] in xhci@3530000. And set [mode=“host”;] in usb2-0.

usb3-1 is invald. It has to be paired with one usb2 port.

Hi DaneLLL

I did these modification, but no success, things seem to be the same…

I’m sending the extracted device tree from /proc/device-tree and dmesg log.

This line still remains…

OF: /xhci@3530000: could not get #phy-cells for /xusb_padctl@3520000/pads/usb2/lanes/usb2-0

And always I see these:

[    1.681759] vdd-usb0-5v: disabling
[    1.681762] vdd-usb1-5v: disabling

I think because of this, there’s no power at USB2-0 and USB2-1

dmesg_usb2110.txt (57.5 KB)
device-tree.dts.txt (461 KB)

Good news, with theses news modification and removing the line “/delete-node/ pads” from xusb_padctl@3520000 on DT all USB2.0 is wonking, but I didn’t tested the USB 3.0 yet.

Now I’m trying to put PCIe to work on this topic: [url]https://devtalk.nvidia.com/default/topic/1065229/jetson-tx2/pcie-1x1-2x1-on-custom-board/post/5394144/#5394144[/url]

Yes, please do not delete pads arbitrarily. There are some hidden properties in other device trees which define the necessary function of pads. “delete-node” would just remove all of them and cause some missing.