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!