Modifying DT for custom carrier board USB setup

Hi,
Its my first time working with USB related schematics, dt and drivers.
We have a custom carrier board hosting an Orin NX with JP 5.1.3.
We need to make modifications to the default configuration. We have two USB ports and need the following functionalities:

  1. USB0 - otg for recovery
  2. USB1 - need to work with both 2.1/3.2 devices
  3. Both USB ports needs to be powered by GPIO regulators
  4. We don’t have a type C connections
  5. We don’t have fusb3.1
  6. We need a retry mechanism on which if the usb is powered down it will try to re powered.

Following is our exact circuit of the USB port (including the switch and the GPIO power source)

So my questions are:

  1. Is there an example for a dt that I can use and learn how to correctly configure our dt?
  2. What I need to do in order to disable all type c and fusb 3.1 related components?
  3. Which regulators I need to use for our USB ports? Do I need to create them by myself or can I use existing ones? (I need them to be gpio)
  4. How do I use the retry mechanism? is it already implemented?
  5. Any additional help will be much appreciated!

Hi bsp_dev,

Please refer to Porting Universal Serial Bus to port USB on the custom carrier board.

You may also share the current state and the difference with the devkit board.

I read the guide.
I didn’t find the following topics:

  1. What I need to do in order to disable all type c related components? we don’t have it on our board.
  2. I need to use a GPIO regulator. Is there an example of how to do it?
  3. Is there an example of how to use a retry mechanism for this regulator?

Thanks

Is this still an issue to support? Any result can be shared?

Yes,
Is there any dt example for cutom board to use gpio as a regulator for usb + without usb type c in the system?

please share the full device tree and dmesg for further check.

Is this still an issue to support? Any result can be shared?

It is not a difficult work to remove the type C part in the device tree. Writing a regulator or adding it to usb part are all included in the original DT too. Please open your eye and check the DT first.

Hi,
sorry for the late response.
I was ill and out of work.

These are the files:
dmesg.log (65.6 KB)
dt.txt (334.9 KB)

I’m not familiar with this material hence I wanted a reference for:

  1. Removing all USB C related stuff from my DT and system (we don’t have it on our custom carrier board)
  2. Use a gpio based regulator for the usb. How to bind between gpio number that will act as the regulator and the USB port.
    Thanks

You still have type C here. The remote endpoint thing is linked to the type C controller…

			usb2-0 {
				status = "okay";
				mode = "otg";
				vbus-supply = <0xf7>;
				usb-role-switch;

				port {

					endpoint {
						remote-endpoint = <0xf8>;
						phandle = <0x106>;
					};
				};
			};

How to bind between gpio number

What do you mean “gpio number”?

My goal is to use USB ports powered by specific gpios.
I saw there is a think called “gpio regulator” but I’m not sure how to use it (my first time)

So I need:

  1. Remove all USB type C stuff (we don’t have this port in our system)
  2. Indicate that the USB port are powered by specific GPIOs
  3. In case there is a power down, tell the system to try in re-power it

Is it possible?

Thanks

For the (3) here, it is controlled by the driver if your DT is correct. You don’t need to made it by yourself.

For (2), it is also related to what kind of port you are making… type A/micro-B/ type C… Your question is too general one to be answered here…

Hi,
Our two USB ports use Type-A connectors. Both work fine with USB devices and also function as recovery ports.
The only issue is voltage management. We have other GPIOs that control USB voltage switches and sense overloads (see the attached sketch).
The question is: Is it possible to connect these control GPIOs to the existing driver?

You could just write a regulator that uses that GPIO inside of it… Then assign that regulator to the vbus-supply of the usb node in device tree.

This is basic Linux kernel regulator framework that you could find example even by using Google Search. This is not NVIDIA specific software or syntax…

Thank you for your help. As we said its our first time encountering these subject so thank you for your guidance.

Just one last thing - what about the remote endpoint property in our usb2-0 node that points to USB C controller even tough we don’t have a USB type C in our system. Is that OK?

I am not sure if I need to directly say such obvious answer …

As I already mentioned here.

What I was trying to say is you need to remove that. If you don’t have type C there, then you have to remove it.

Excuse me if I’m asking questions with obvious answers. I don’t have the familiarity and knowledge that you have.

What I actually meant is: when removing this reference, should I replace it with something else or just remove and that’s it?

Thanks again for your patience and help. Its much appreciated.

You should read this document to understand how to write usb related device tree.

https://docs.nvidia.com/jetson/archives/r36.4/DeveloperGuide/HR/JetsonModuleAdaptationAndBringUp/JetsonAgxOrinSeries.html?highlight=universal%20serial#porting-the-universal-serial-bus
For each kind of connector, the DT will be different. Type A is the simplest one.

Thank you

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