Custom Carrier Board, wrong usb wiring, try to change device tree for fixing the issue

Hi,

We currently have a custom board where the USB pins are not connected as intended. According to the design reference, USB0 should be used for the micro USB for recovery mode, while USB1 should be used for the USB 3.2 hub. Unfortunately, these two ports are swapped in our design.

in the device tree there is a section that can change the usb ports:
“tegra234-p3509-a02.dtsi”

ports {
                  usb2-0 {
                        mode = "otg";
                        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 based on design reference :

Only USB0_D_N/P supports USB Recovery Mode

I wonder swapping USB0 and USB1 ports in the file will be flashed to bootloader in jetson or just in os kernel?
do I lose recovery mode completely if I swap USB0 and USB1 even on dev board with another ssd installed?
my purpose is testing usb host and making sure it is working before changing the design and making the next revision of the board.

thanks in advance

Recovery mode is pure hardware event. None of device tree can save that thing if the hardware is wrong.

You can try to think about it… the device tree is just a binary for kernel to read. You just enter the recovery mode by pressing some button or jumper, there is totally no linux kernel running at that moment.

1 Like

Thanks Wayne for answering.

I’m not talking about entering the recovery mode. I’m talking about usb recovery connection.

lets say if I change the device tree to this:

ports {
                  usb2-1 { // this changed to 1
                        mode = "otg";
                        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-0 { // this changed to 0
                        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 = <0>;
                        status = "okay";
                  };
            };

is these changes enough for testing the usb hub? and do I lose microusb for good on dev kit?

this is usb hub schematic:

What does that mean “I’m talking about usb recovery connection” but “I’m not talking about entering the recovery mode”?

This question totally does not make sense.

Are you talking about the “usb device mode” and the usb hub behavior after you boot into kernel?

based on design ref :

Only USB0_D_N/P supports USB Recovery Mode

USB0 is connected to micousb on dev board, right?

so in the device tree the mode for usb2-0 is “otg”.
if i change the mode for usb2-0 to “host”, does it affect the functionality of the microusb port for recovery mode? or as you said this is implemented in hardware level and can’t be changed by device tree?

Yes, that is what I mean in previous comment.

If you are talking about “recovery mode”, which is for entering a mode for flashing. Then “device tree” has no effect to it as I already said in previous comment.

Device tree did not even exist when you try to enter the recovery mode.

1 Like

thanks. just want to make sure about this.

what about the other problem?
in the carrier board design, USB0 is connected to usb hub, instead of USB1.
can this be fix in device tree by changing

                        nvidia,usb2-companion = <1>;

to

                        nvidia,usb2-companion = <0>;

?

It depends on the overall schematic. From what you shared, I only saw you use USB0 and USBSS0 for that hub.

I can only say your swapping for nvidia,usb2-companion is correct. But for the rest of parameters, that depends on your schematic, which I cannot tell.

1 Like

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