Changing rear USB C to 'device' mode

Hi all! I am currently trying to change the USB mode of the rear USB C port (J513) on the AGX Xavier devkit from ‘host’ to ‘device’. I have looked up which port in the device tree to change by referring to the design files (for J513 the USB2.0 is wired to port 1 and USB3.1 to port 0 via UPHY6)

I have amended the kernel/dtb/tegra194-p2888-0001-p2822-0000.dts file so it looks like this:

xusb_padctl@3520000 {
...
    pads {
        ...
    }
    ports {
        ...
        usb2-1{
            status = "okay";
            vbus-supply = <0x1c>;
            mode = "device";   // Changed from "host"
        };
        ...
        usb3-0 {
            status = "okay";
            nvidia,usb2-companion = <0x1>;
        };
    }
...
}

And recompiled by running dtc -I dts -O dtb kernel/dtb/tegra194-p2888-0001-p2822-0000.dts -o kernel/dtb/tegra194-p2888-0001-p2822-0000.dtb.

Afterwards, I updated the device tree via this method. However, the rear USB still works as before. I am a bit stuck here, my main goal is two use one port to send camera information (J513) and the other port (J512) to serve as an OTG cable connecting to a PC.

I appreciate any help that can be offered, thank you very much!

Hi,
This looks invalid. For changing J513 to device mode, J512 has to be changed to host mode only. Only one port can be configured to device mode.

I see, so there is no way for the Jetson to be configured to have two device mode ports?

Also, if this is the case, would it make sense to change J512 from ‘otg’ to ‘device’ and leave J513 as ‘host’. The reason why I am trying to use two cables is because I can’t seem to get USB 3.0 speeds using the OTG port.

Hi,
Here is a patch to set J512 to device mode:
RNDIS failed with USB 2.0 - #10 by DaneLLL

Please apply it and give it a try.

1 Like

Sorry, but my default device tree for the Xavier AGX Devkit running Jetpack 4.4 does not look like the one in that thread, mine looks this:

external-connection {
        compatible = "simple-bus";
        device_type = "external-connection";
        #address-cells = <0x1>;
        #size-cells = <0x0>;

        disp-state {
                compatible = "extcon-disp-state";
                #extcon-cells = <0x1>;
        };
};

Is the default one you showed from the tegra194-p2888-0001-p2822-0000.dts file?

Okay, so i ended up following a similar thread that was linked on the thread you posted thread and it ended up work for me.

This was the summary:

  • Under xusb_padctl@3520000/ports/usb2-0, change the mode to “host”
    • Note the phandle under usb_padctl@3520000/pads/usb2-0 and usb3-2
      • <0xd8> and <0xd9>
  • Under xusb_padctl@3520000/ports/usb2-1, change the mode to “device”
    • Note the phandle under usb_padctl@3520000/pads/usb2-1 and usb3-0
      • <0xda> and <0xdd>
  • Under xudc@3550000, change phys to <0xda 0xdd>, which are the handles corresponding to usb2-1 and usb3-0, respectively
  • Under xudc@3550000, change phy-names to “usb2-1”, “usb3-0”
  • Under usb_cd, change phys to <0xda> (i.e. usb2-1)
  • Under …/ucsi_ccg@8/typec-extcon note the phandle for port-1 and change the extcon-cables under xhci and xudc to match that phandle
    • <0x75>

This ended up working for me; thanks a lot, I really appreciate the help you gave!

2 Likes

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