Usb1-1 not support hotplug as host on Orin NX

Hi team, I am using Orin NX 16GB with a custom carrier board, R35.3.1, I modify the dts to config the usb otg port as a host. like this

   xusb_padctl: xusb_padctl@3520000 {
       status = "okay";
       pads {
           usb2 {
               lanes {
                   usb2-0 {
                       nvidia,function = "xusb";
                       status = "okay";
                   };
                   usb2-1 {
                       nvidia,function = "xusb";
                       status = "okay";
                   };
                   usb2-2 {
                       nvidia,function = "xusb";
                       status = "okay";
                   };
               };
           };
           usb3 {
               lanes {
                   usb3-0 {
                       nvidia,function = "xusb";
                       status = "okay";
                   };
               };
           };
       };
         ports {
             usb2-0 {
-                mode = "otg";
+               mode = "host";
                 status = "okay";
                                 vbus-supply = <&p3509_vdd_5v_sys>;
 #if TEGRA_XUSB_DT_VERSION >= DT_VERSION_3
                 usb-role-switch;
                 connector {
                     compatible = "usb-b-connector", "gpio-usb-b-connector";
                     label = "micro-USB";
                     type = "micro";
                     vbus-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Z, 1) GPIO_ACTIVE_LOW>;
                 };
 #endif
             };
             usb2-1 {
                 mode = "host";
                                 vbus-supply = <&p3509_vdd_av10_hub>;
                 status = "okay";
             };
             usb2-2 {/* Goes to M2.E */
                 mode = "host";
                                 vbus-supply = <&p3509_vdd_5v_sys>;
                 status = "okay";
             };
             usb3-0 {
                 nvidia,usb2-companion = <1>;
                 status = "okay";
             };
         };
     };

and I plug a usb device to the port, and reboot the system, and it works well

root@w:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 002: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

but when I unplug the Logitech usb device, and replug again , the system can not detect the device any more.
when I change one usb port to test, it works well. the test like this

root@w:~# #now we unplug the usb device
root@w:~# 
root@w:~# [   50.395925] usb 1-1: USB disconnect, device number 2
[   50.726394] tegra-xusb 3610000.xhci: entering ELPG done

root@w:~# 
root@w:~# 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
root@w:~# 
root@w:~# 
root@w:~# 
root@w:~# #now we plug the usb device again, cannot detect it again
root@w:~# 
root@w:~# 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
root@w:~# 
root@w:~# 
root@w:~# 
root@w:~# #now we unplug it and plug it on another usb port
root@w:~# 
root@w:~# [  130.089926] tegra-xusb 3610000.xhci: Firmware timestamp: 2021-12-01 05:27:10 UTC, Version: 80.03 release
[  130.325921] usb 1-2: new full-speed USB device number 3 using tegra-xusb
[  130.480358] usb 1-2: New USB device found, idVendor=046d, idProduct=c534, bcdDevice=29.01
[  130.480622] usb 1-2: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[  130.480847] usb 1-2: Product: USB Receiver
[  130.480984] usb 1-2: Manufacturer: Logitech
[  130.485682] logitech-djreceiver 0003:046D:C534.0005: hidraw0: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-3610000.xhci-2/input0
[  130.549808] logitech-djreceiver 0003:046D:C534.0006: hiddev96,hidraw1: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-3610000.xhci-2/input1
[  130.612164] logitech-djreceiver 0003:046D:C534.0006: device of type eQUAD nano Lite (0x0a) connected on slot 1
[  130.614171] logitech-djreceiver 0003:046D:C534.0006: device of type eQUAD nano Lite (0x0a) connected on slot 2
[  130.622489] input: Logitech Wireless Keyboard PID:4023 as /devices/platform/3610000.xhci/usb1/1-2/1-2:1.1/0003:046D:C534.0006/0003:046D:4023.0007/input/input24
[  130.623342] logitech-hidpp-device 0003:046D:4023.0007: input,hidraw2: USB HID v1.11 Keyboard [Logitech Wireless Keyboard PID:4023] on usb-3610000.xhci-2/input1:1
[  130.630348] input: Logitech Wireless Mouse as /devices/platform/3610000.xhci/usb1/1-2/1-2:1.1/0003:046D:C534.0006/0003:046D:4058.0008/input/input25
[  130.631005] logitech-hidpp-device 0003:046D:4058.0008: input,hidraw3: USB HID v1.11 Mouse [Logitech Wireless Mouse] on usb-3610000.xhci-2/input1:2

root@w:~# 
root@w:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 003: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@w:~# 

and here is the boot log
boot_with_usbdevice_pluged.txt (253.0 KB)

please help me to solve this , thanks!

Hi,
Is it a micro-B port on the carrier board? Please make sue the port is designed properly. The Xaiver NX and Jetson Nano carrier boards have micro-B port and it is designed to work in host mode only. For OTG port, you would need to have proper design for VBUS_DETECT and ID pins.

It is not a micro-B port, the usb port of carrier board works well on Xavier NX, but failed on Orin Nx, so we should have the proper design.

Hi,
Is it a type-A port?

Yes, type-A port

Hi,
This setting is for OTG port and not required for host-only port:

                 usb-role-switch;
                 connector {
                     compatible = "usb-b-connector", "gpio-usb-b-connector";
                     label = "micro-USB";
                     type = "micro";
                     vbus-gpio = <&tegra_main_gpio TEGRA234_MAIN_GPIO(Z, 1) GPIO_ACTIVE_LOW>;
                 };

Please remove it and try again. If the issue still persists, please do compliance test to ensure D+/D- signals are good:
https://developer.nvidia.com/downloads/jetson-orin-nx-series-orin-nano-series-tuning-complinace-guide

Hi @DaneLL , the issue seems be related to “auto suspend” function of usb.

when I disable the function, it works well.

root@w:~# cat /sys/bus/usb/devices/usb1/power/control
auto
root@w:~# 
root@w:~# 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
root@w:~# 
root@w:~# 
root@w:~# echo on >  /sys/bus/usb/devices/usb1/power/control
[ 2113.268609] tegra-xusb 3610000.xhci: Firmware timestamp: 2021-12-01 05:27:10 UTC, Version: 80.03 release
root@w:~# [ 2113.632018] usb 1-1: new full-speed USB device number 4 using tegra-xusb
[ 2113.789991] usb 1-1: New USB device found, idVendor=046d, idProduct=c534, bcdDevice=29.01
[ 2113.790254] usb 1-1: New USB device strings: Mfr=1, Product=2, SerialNumber=0
[ 2113.790468] usb 1-1: Product: USB Receiver
[ 2113.790587] usb 1-1: Manufacturer: Logitech
[ 2113.796679] logitech-djreceiver 0003:046D:C534.0009: hidraw0: USB HID v1.11 Keyboard [Logitech USB Receiver] on usb-3610000.xhci-1/input0
[ 2113.860161] logitech-djreceiver 0003:046D:C534.000A: hiddev96,hidraw1: USB HID v1.11 Mouse [Logitech USB Receiver] on usb-3610000.xhci-1/input1
[ 2113.922525] logitech-djreceiver 0003:046D:C534.000A: device of type eQUAD nano Lite (0x0a) connected on slot 1
[ 2113.924550] logitech-djreceiver 0003:046D:C534.000A: device of type eQUAD nano Lite (0x0a) connected on slot 2
[ 2113.933022] input: Logitech Wireless Keyboard PID:4023 as /devices/platform/3610000.xhci/usb1/1-1/1-1:1.1/0003:046D:C534.000A/0003:046D:4023.000B/input/input26
[ 2113.933854] logitech-hidpp-device 0003:046D:4023.000B: input,hidraw2: USB HID v1.11 Keyboard [Logitech Wireless Keyboard PID:4023] on usb-3610000.xhci-1/input1:1
[ 2113.940495] input: Logitech Wireless Mouse as /devices/platform/3610000.xhci/usb1/1-1/1-1:1.1/0003:046D:C534.000A/0003:046D:4058.000C/input/input27
[ 2113.941054] logitech-hidpp-device 0003:046D:4058.000C: input,hidraw3: USB HID v1.11 Mouse [Logitech Wireless Mouse] on usb-3610000.xhci-1/input1:2

root@w:~# 
root@w:~# 
root@w:~# 
root@w:~# lsusb
Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub
Bus 001 Device 004: ID 046d:c534 Logitech, Inc. Unifying Receiver
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub
root@w:~# 

could you please help me to solve this ?

Sorry for the late response, is this still an issue to support? Thanks

If it works by disabling auto suspend, it looks to be a fine solution.