Jetson xavier NX doesn't get detected in device mode after bootup unless unplug and plug it back

Hi,

I just checked your device tree and schematic. There are 4 points that we cannot understand.

  1. We are not sure why you put a connector in usb2-0 and also a vbus-supply with GPIO Z,1. Doesn’t your usb device port run on usb2-2?

  2. Your fusb302 and usb2-2 is not correct becuase there is no remote-endpoint. Our driver totally does not know the relationship between usb2-2 and fusb302. Please refer to Orin NX device tree tegra234-p3768-0000-a0.dtsi. There is a fusb301 example of what to do.

  3. Please set usb2-2 mode into otg instead of peripheral.

  4. If your type C device mode wants to support USB3 speed, then you need to put usb3 lanes into the xudc phy list in the device tree.

Please refer the schematic of usb2-0(Micro-usb port). The ID pin(IO in schematic) pin4 of J9 is open (not connected).

If the ID pin not connected(open). Only VBUS pin1 of J9 is available to control. Refer the The USB Connector Class which has following table

Since ID Pin is not connected, only mode can be achieved is device mode by making GPIO Z,1 active low. I have set GPIO Z,1 to active high in DTSI so that USB2-0 is in not connected state. Now I can USB2-2(Type-c port) for device mode.
Hope explanation clears your doubt.

I’ll look into this and try any necessary changes for Jetson xavier nx and get back to you if have any queries.

I am not able to recall exactly, if I keep the usb2-2 mode into otg, I was facing problem with fusb302. Eventually our plan is to have otg combination in near future. I’ll give it a try again and update you on this.

Ok, got it. I’ll take care of this change.

How many device mode do you expect there?

Jetson can only support to one device mode at a time. If your usb2-0 is in device mode, then other ports cannot work in device mode at same time.

Only one device mode USB2-2 port is configured in DTSI and USB2-0 is not device mode DSTI configured for host mode. As explained earlier, if you refer the table provided in the previous comment USB2-0 is in not connected data role.

ports {
usb2-0 {
mode = “host”;
status = “okay”;
#if TEGRA_XUSB_DT_VERSION >= DT_VERSION_3
connector {
compatible = “usb-b-connector”, “gpio-usb-b-connector”;
label = “micro-USB”;
type = “micro”;
/*ONSEMI : Changed Active low to Active high so that vbus is not active, doesn’t go into device mode */
vbus-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Z, 1) GPIO_ACTIVE_HIGH>;
};
endif
};

ok. Then I just don’t care about the usb2-0 from now on.

But your usb2-0 design looks like a device mode only thing… if it does not have ID pin…

Not just, it doesn’t have ID pin. Apart from this I have changed the GPIO Z,1 from active low to active high( w.r.t original DTSI) which controls the VBUS.
Since no ID pin connected makes it active high and VBUS is also active high.
From below table it matches with data role “Not Connected”. Hence USB2-0 is not in use.

I’ll try rest of the things as suggested in earlier reply and update you on this regard.

So your usb2-0 is just a port that for flash? You won’t use it after kernel boot up?

Exactly :)

1 Like

Ok. No further question on usb2-0. Let’s just focus on usb2-2 problem.

Hi WayneWWW

I looked into the tegra234-p3768-0000-a0.dtsi. It uses the fusb301, but fusb302 is different. I have attached the
fcs,fusb302.txt (917 Bytes)
only those things present in the documentation can be added in device tree and usb_con: connector is declared. It mentions Documentation/devicetree/bindings/connector/usb-connector.yaml for connector details. Addition of remote-endpoint doesn’t making any difference.

Added the usb3 lanes into the xudc phy list in the device tree. After this changes after every reboot host system detects the device and lsusb lists “NVIDIA (Linux for tegra)”. No need of hot plug.

Thanks

Hallo ashwath.narasimhamurthy

Can you share the change you made in the device tree?
I have the same problem. The board has to be unplugged at each boot for it to be recognized by the host computer.
The difference is that I use usb2 port 1 for device mode.
A hint from your deviceTree would be very helpful.

Best regards

It sounds like it is just another “coincidence” because it does not make much sense that this issue just bypassed by adding usb3 to xudc while remote-endpoint is not added.

Please add remote-endpoint back to your DT and share what is the exact dtb file it looks like after you added it.
You can tell you added it 100 times on your side but if that 100 times all added in wrong place, it won’t take effect either… thus, always attach what you modify instead of just telling…

Also, dump the data role and register dump as our previous check.
We have to see data role is device when plugged and “none” when it got removed…

Hi WayneWWW.

I’ve got a pretty similar issue with the same custom Jetson Xavier NX board.
I tried out the USB3 lane/phandle addition in xudc, and that actually fixed the hassle of unplugging it every time I boot up.

The custom board is recognized in device mode. I can use it as a USB gadget with ACM - that means I can hook up to the board through /dev/ttyACM0. The USB gadget for mass storage also works like a charm.

However, the USB Gadget-ethernet choice doesn’t show up. Checked it with the 'ifconfig' command and all I see is eth0, lo, rndis0, and usb0 - no sign of l4tbr0.

You can take a look at the Device Tree below for more info.
kernel_tegra194-p3668-0001-p3509-0000_edit.dts (393.6 KB)
the original for your reference:
kernel_tegra194-p3668-0001-p3509-0000_ori.dts (393.6 KB)

Hi @ahlicpp

Please file a new topic. USB case are all different from each one’s carrier board.
This post has been 75 comments. I don’t think it is a good idea to start a new check on a unknown board here on this topic anymore.

ah Ja, sorry for that. I will file a new topic.

thank you WayneWWW.

Hi WayneWWW,

Sorry for delay in response. I was busy with other work. I have provided the required details, please look into it.

Please find the attached DTSI and diff file w.r.t original file
tegra194-p3668-common.dtsi (18.0 KB)
device_mode_PatchFile (7.3 KB)

Register dumps after above changes.

nx@dhcp-10-164-9-112:~$ sudo busybox devmem 0x3520360
0x00215049
nx@dhcp-10-164-9-112:~$ sudo busybox devmem 0x3520364
0x00211040
nx@dhcp-10-164-9-112:~$ sudo busybox devmem 0x3520368
0x00211040
nx@dhcp-10-164-9-112:~$ sudo busybox devmem 0x352036C
0x00211040
nx@dhcp-10-164-9-112:~$ sudo busybox devmem 0x355003c
0x00001003
nx@dhcp-10-164-9-112:~$

Thanks

Also, dump the data role and register dump as our previous check.
We have to see data role is device when plugged and “none” when it got removed…

Data role.

After boot-up (without hotplug)

nx@dhcp-10-164-9-112:~$ cat /sys/class/usb_role/usb2-2-role-switch/role
device

After unplugging.

nx@dhcp-10-164-9-112:~$ cat /sys/class/usb_role/usb2-2-role-switch/role
none

Earlier also device role was properly toggling between “device” and “none”. Even during bootup or reboot device was in “device” role, but it was not detected at host system, unless you remove the cable and hotplug it again.

Thanks

Hi,

Just to clarify, so what is the exact diff in device tree for your “working” and “non working” case?

You said you added usb3 ( I assumed you are talking about usb3-2?) to the xudc and it can work properly.
But I saw the device tree you shared to us also has that added. But register dump looks like it is still dead.

Are you saying that after you add remote-endpoint then it goes to dead?