AGX Xavier how to modify USB's PD Control binding gpio

Hi
now i want to use the GPIO23(GPIO(Z, 2)) as USB3-0(UPHY6) 's PD Control binding GPIO
how can i modify to make the binding gpio of usb3-0 to be GPIO23 and make it worked?
By the way ,i use the AGX Xavier, version =# R32 (release), REVISION: 5.1, GCID: 26202423, BOARD: t186ref, EABI: aarch64, DATE: Fri Feb 19 16:50:29 UTC 2021
Thank you very much.

Hi,

Please refer to the adaptation guide.

https://docs.nvidia.com/jetson/l4t/index.html#page/Tegra%20Linux%20Driver%20Package%20Development%20Guide/adaptation_and_bringup_xavier.html#wwpID0E0MK0HA

Hi WayneWWW
I have read the guide. But i still have a question.
How can i bind the gpio to be vbus? in where dts?
Thank you

Hi,

Are you talking about the vbus for usb otg mode state table or you are talking about the vbus-supply ?

Hi
vbus-supply

now i use the gpio USB_CH2_PRT_CTL to be the vbus. how can i bind the gpio to be the usb vbus. (the usb link UPHY6)

1- \hardware\nvidia\platform\t19x\galen\kernel-dts\common\tegra194-fixed-regulator-p2822-1000.dtsi

p2822_vdd_5v_sata: regulator@114 {
			compatible = "regulator-fixed";
			reg = <114>;
			regulator-name = "vdd-5v-sata";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Z, 1) 0>;
			enable-active-high;
			vin-supply = <&battery_reg>;
		};
		
		p2822_vdd_5v_sata2: regulator@115 {
			compatible = "regulator-fixed";
			reg = <115>;
			regulator-name = "vdd-5v-sata";
			regulator-min-microvolt = <5000000>;
			regulator-max-microvolt = <5000000>;
			gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Z, 2) 0>;
			enable-active-high;
			vin-supply = <&battery_reg>;
		};

2 - i verify the tegra19x-mb1-pinmux-p2888-0000-a04-p2822-0000-b01.cfg

pinmux.0x02430060 = 0x00000459; # soc_gpio22_pq2: nv, pull-up, tristate-enable, input-enable, lpdr-disable
pinmux.0x02430068 = 0x00000414; # soc_gpio23_pq3: rsvd0, pull-down, tristate-enable, input-disable, lpdr-disable

verify like below
pinmux.0x02430060 = 0x00000459; # soc_gpio22_pq2: nv, pull-up, tristate-enable, input-enable, lpdr-disable
pinmux.0x02430068 = 0x00000459; # soc_gpio23_pq3: rsvd0, pull-down, tristate-enable, input-disable, lpdr-disable

3 - cat the gpio status

mount -t debugfs debugfs /test
cat /test/gpio

And the status is below:

 gpio-489 (                    |vdd-5v-sata         ) out hi    
 gpio-490 (                    |vdd-5v-sata         ) out lo

the gpio-490 is still output low

please help
i don’t find the code where make the relationship about the gpio and vbus

Thank you

HI,

Did you assign this regulator to the “vbus-supply” property under the usb2-x port?

Something like

usb2-0 {
 				vbus-supply = <__you_need_to_assign_the_regulator_here>;
 			};

Hi
it’s my code, i think i am wrong here. how can i verify?

ports {
	usb2-1 {
					mode = "host";
					vbus-supply = <&battery_reg>;	//zp
					status = "okay";
				};

Have any blog or case can be read?

Hi,

Since you already modify “p2822_vdd_5v_sata” regulator to match your hardware (with GPIO Z,1), then you can just tell usb2-0 to use p2822_vdd_5v_sata instead of battery_reg as regulator, if your usb2-0 port is using GPIO Z,1.

battery_reg is a dummy regulator we set by default.

thanks WayneWWW
now it worked.

1 Like

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