Assign I2C to USB-C Port

Hi, we have a custom carrier board for Orin Nano 8GB (p3768-0000+p3767-0003).

On the Orin Nano Dev Kit, USBSS0 is a USB-A port, and USBSS1 is a USB-C port - with the associated I2C for the USB-C port control using I2C0_ (communicating with the FUSB301TMX)

The Image bellow shows the standard NVIDIA connection of the diff pairs USBSS0 and USBSS1:


On our carrier board we have swapped them and now USBSS0 is a Type-C, and USBSS1 is a Type-A.

We have looked at the document universal-serial-bus
but are still unsure how we re-associate the I2C to operate with USBSS0?

We have converted the tegra234-p3768-0000+p3767-0003-nv.dtb to a dts and found the device tree snippet that defines the FUSB301 Type-C controller with an I2C address of 0x25. The FUSB301 communicates with the system over the I2C bus managed by the I2C controller located at base address 0xc240000:

device tree snippet that defines the FUSB301:

references to the endpoint nodes:

Any Guidance would be much appreciated

I can also see that the fusb301 endpoints go to usb2-0

What is your exact question here? What I saw is you already posted the answer by yourself.

The device tree is a template for NV devkit. If you want to change the mapping, then just change the usb2-companion.

If it is same as NV devkit mapping, then nothing needs to be changed.

Hi @WayneWWW, I’m not to sure on the mapping change I need to make in the ports {} section , and what usb2-companion to change. I can see that usb 2 port 0 is the otg but im not sure what the other ports are

What does that mean you don’t know when the hardware design is made by you?

Could you try to give a more precise question for what you want to ask?

Hi @WayneWWW,

Can you please explain where and how we re-associate the I2C to operate the USBC with USBSS0 instead of USBSS1?

We have looked at the document universal-serial-bus
but are still unsure how we re-associate the I2C to operate with USBSS0?

The remote endpoint is the connection between USB driver and FUSB301 followed within usb2 but not directly with USBSS.

Your post here already gave out the answer.

And in case you don’t know about it

usb2-x is mapping to that USBx in your picture
and usb3-x is mapping to USBSSx.

Hi @WayneWWW,
So with the physical swap I mentioned where should the FUSB301remote endpoint go.
Currently it points to usb2-0. Do I need to change this to usb2-1, usb2-2, usb2-3 or usb3-0 ,usb3-1, etc…

As I already told, you need to tell me where does your hardware connection go. Which usb2 and which usb3 signal combined as this port?

I won’t know the answer unless you tell me how is your board design looks like…

On our carrier board USBSS0 is connected to the USB Type-C, and USBSS1 is connected to the USB Type-A like so:

Just for clarification the Image in my first post is the standard Orin Nano devkit.

So per my understanding, the type C port is now USB0+ USBSS0? Could you confirm that?

It does not really matter whether I know it or not. The real problem here is I feel you cannot even tell this on your side.

Hi @WayneWWW.

yes in our custom carrier design the type C port is now USB0+ USBSS0.

So as my comment here

Are you able to interpret the device tree now…??

Hi @WayneWWW,

Unfortunately your comment does not help me interpret the device tree because your comment was made in reference to the original dev kit design and not our design.

We have not yet implemented our design because of the fact we are unsure on how to map the swapped usbs. The screenshot I posted of the endpoints in the 1st post was something that I thought may help, but was unsure of how to implement. We still need to know how to re-associate the I2C to operate the USBC with USBSS0 instead of USBSS1

We will ask our internal Nvidia contact about this as this topic seems to be too technical for forums.

Hi,

Your internal NVIDIA contact will still ask me and my team this question… so please just stay here. Your other previous requests went to me as well…

I already gave everything in the post and waited for you to combine them by yourself. Your question has been answered too but you didn’t get it.

If you cannot get it, let me directly tell you the answer.

  1. The “remote endpoint” is the connection for your question. The i2c of fusb301 operates with this node to the usb driver.
  2. Remote endpoint is on the USB2 port
  3. USB2 port is connected with USB3 with device tree property “nvidia,usb2-companion”.
  4. usb2-x is mapping to that USBx in your picture and usb3-x is mapping to USBSSx. → This is the key to understand the device tree…

Thus… since you are using USB0+ USBSS0… keep remote endpoint in your usb2-0 node. Check your usb3-0 node and it has to use nvidia,usb2-companion with usb2-0 port…

You don’t need to add fusb setting in any of usb3-x setting… it does not matter.

And you have to check the other USBSSx port are not using duplicated usb2-x port …

Hi @WayneWWW,

Thanks for your response, we have changed:
usb3-1 to usb3-0
usb3-0 to usb3-1
To match our schematic as seen below:

dmesg shows this when plugging in USB2 and 3 device into the USBC port:


Below is the standard pads{} section of the dts that we have not yet changed, do we also need to change anything in this section?

Yes, you need to change something else. The document has the answer so you should read it first…

Hi @WayneWWW,

If you are referring to this document: universal-serial-bus, we have already read it as I mentioned in my earlier post and found it unclear which is why I am reaching out to the forms.

Please could you be more clear when you mean “you need to change something else”. This is what we currently have in our padctl@3520000:

		padctl@3520000 {
			compatible = "nvidia,tegra234-xusb-padctl";
			reg = <0x00 0x3520000 0x00 0x20000 0x00 0x3540000 0x00 0x10000>;
			reg-names = "padctl\0ao";
			interrupts = <0x00 0xa7 0x04>;
			resets = <0x03 0x72>;
			reset-names = "padctl";
			status = "okay";
			vclamp-usb-supply = <0xe7>;
			avdd-usb-supply = <0xe8>;
			phandle = <0xec>;

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

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

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

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

						usb2-3 {
							nvidia,function = "xusb";
							status = "disabled";
							#phy-cells = <0x00>;
						};
					};
				};

				usb3 {
					lanes {
						// USB TYPE C (now swapped to usb3-0)
						usb3-0 {
							nvidia,function = "xusb";
							status = "okay";
							#phy-cells = <0x00>;
							phandle = <0xf1>;
						};

						// USB A HUB (now swapped to usb3-1)
						usb3-1 {
							nvidia,function = "xusb";
							status = "okay";
							#phy-cells = <0x00>;
							phandle = <0xee>;
						};

						usb3-2 {
							nvidia,function = "xusb";
							status = "disabled";
							#phy-cells = <0x00>;
						};

						usb3-3 {
							nvidia,function = "xusb";
							status = "disabled";
							#phy-cells = <0x00>;
						};
					};
				};
			};

			ports {
				// OTG (Debug USB0)
				usb2-0 {
					status = "okay";
					mode = "otg";
					vbus-supply = <0xe9>;
					usb-role-switch;

					port {
						endpoint {
							remote-endpoint = <0xea>;
							phandle = <0xf7>;
						};
					};
				};

				// USB A HUB (no change to USB2, still at usb2-1)
				usb2-1 {
					status = "okay";
					mode = "host";
					vbus-supply = <0xeb>;
				};

				// M.2E WIFI
				usb2-2 {
					status = "okay";
					mode = "host";
					vbus-supply = <0xe9>;
				};

				usb2-3 {
					status = "disabled";
				};

				// USB A HUB now at usb3-1
				usb3-1 {
					status = "okay";
					nvidia,usb2-companion = <0x01>;
				};

				// USB TYPE C now at usb3-0
				usb3-0 {
					status = "okay";
					nvidia,usb2-companion = <0x00>;
				};

				usb3-2 {
					status = "disabled";
				};

				usb3-3 {
					status = "disabled";
				};
			};
		};

Is there something else we need to change outside of the padctl@3520000?

Yes… something else that needs to be changed other than padctl@3520000.

This is also mentioned in the document…
Check xhci node and For an On-The-GO Port section please.

The problem here is you just told me “yes I read the document” but what I saw is you don’t understand it fully.