Can't recognize the USB at OTG mode

Hi,

I met a problem about usb port. In a custom board, the usb2-0 works as expected in OTG when flashing. I also want to use it as an connector to communicate with PC. But when it connected to PC, nothing happen and no dmesg. And my usb2-0 is type-C. My dtb setting is as following:

                pads {

                        usb2 {
                                clocks = <0x02 0xa5>;
                                clock-names = "trk";

                                lanes {

                                        usb2-0 {
                                                status = "okay";
                                                #phy-cells = <0x00>;
                                                nvidia,function = "xusb";
                                                phandle = <0x2b8>;
                                        };

and

                ports {

                        usb2-0 {
                                status = "okay";
                                mode = "otg";
                                vbus-supply = <0x2b5>;   /*"vdd-5v-sys"*/
                                usb-role-switch;

                                connector {
                                        compatible = "usb-b-connector\0gpio-usb-b-connector";
                                        label = "micro-USB";
                                        type = "micro";
                                        vbus-gpio = <0x50 0x99 0x01>;
                                };
                        };

and

        xudc@3550000 {
                compatible = "nvidia,tegra234-xudc";
                reg = <0x00 0x3550000 0x00 0x8000 0x00 0x3558000 0x00 0x8000>;
                reg-names = "base\0fpci";
                interrupts = <0x00 0xa6 0x04>;
                clocks = <0x02 0x109 0x02 0x115 0x02 0x113 0x02 0x110>;
                clock-names = "dev\0ss\0ss_src\0fs_src";
                power-domains = <0x02 0x0b 0x02 0x0a 0x02 0x0c>;
                power-domain-names = "dev\0ss\0host";
                nvidia,xusb-padctl = <0x2b7>;
                iommus = <0x56 0x0f>;
                dma-coherent;
                status = "okay";
                charger-detector = <0x2b9>;
                avdd-usb-supply = <0x2b4>;
                phys = <0x2b8>;
                phy-names = "usb2-0";
                phandle = <0x468>;
        };

        xhci@3610000 {
                compatible = "nvidia,tegra234-xhci\0nvidia,tegra234-xusb";
                reg = <0x00 0x3610000 0x00 0x40000 0x00 0x3600000 0x00 0x10000 0x00 0x3650000 0x00 0x10000>;
                reg-names = "base\0fpci\0bar2";
                interrupts-extended = <0x01 0x00 0xa3 0x04 0x01 0x00 0xa4 0x04 0x01 0x00 0xa7 0x04 0x0a 0x4c 0x04 0x0a 0x4d 0x04 0x0a 0x4e 0x04 0x0a 0x4f 0x04 0x0a 0x50 0x04 0x0a 0x51 0x04 0x0a 0x52 0x04>;
                interrupt-names = "xhci\0mbox\0padctl\0wake0\0wake1\0wake2\0wake3\0wake4\0wake5\0wake6";
                clocks = <0x02 0x10a 0x02 0x10b 0x02 0x10c 0x02 0x10d 0x02 0x10e 0x02 0x10f 0x02 0x110 0x02 0x111 0x02 0x113 0x02 0x115 0x02 0x67 0x02 0x0e 0x02 0x64>;
                clock-names = "xusb_hs_src\0xusb_host\0xusb_core_superspeed_clk\0xusb_falcon_src\0xusb_falcon_host_clk\0xusb_falcon_superspeed_clk\0xusb_fs_src\0xusb_fs_host_clk\0xusb_ss_src\0xusb_ss\0pll_u_480m\0clk_m\0pll_e";
                power-domains = <0x02 0x0c 0x02 0x0a>;
                power-domain-names = "xusb_host\0xusb_ss";
                nvidia,xusb-padctl = <0x2b7>;
                interconnects = <0x03 0x4a 0x03 0x4b>;
                interconnect-names = "dma-mem\0dma-mem";
                iommus = <0x56 0x0e>;
                dma-coherent;
                status = "okay";
                phys = <0x2ba 0x2bb 0x2bc 0x2bd 0x2be>;
                phy-names = "usb2-1\0usb2-2\0usb3-0\0usb3-1\0usb3-2";
                phandle = <0x469>;
        };

BR
Salutonn

Is it device mode only or you want it as OTG? or you don’t know what I am talking about?

I want connect orin nx to PC, and orin nx are a device part. I try to set it OTG mode. But, when I plug it to PC, there is no dmesg in PC and orin.

Also, I try to set it device mode, and same.

Your answer seems not making much sense…

OTG mode means it can switch between “host” and “device”.

device mode means it can only in device…

Thus, please answer the question again. What thing do you want to achieve here…

Actually, I want it be the device.

But, similarity, when I use the xavier nx, I set the usb2-0 OTG mode, basing on the similar usb cable equipment with orin nx. Xavier nx can be the device, and communicate with PC.

And the only difference is the dtb configuration. So I wonder whether it is the dtb problem or not.

Please change the mode = “otg”; directly to peripheral if you don’t need it as host mode.

And rest of configuration depends on your hardware design.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.