Tx2 usb vbus2 over current protection

I’ve a carrier board that’s breaking out one additional USB (A) connector. Lane mapping works ok, I can see usb devices enumerate ok after a lsusb.

In order to get that far I have to set up the vbus_en pin I’m using, in this case B19 as follows:

		gpio_pq5_pi5 {  // B19
			nvidia,pins = "gpio_pq5_pi5";
			nvidia,function = "rsvd0";
			nvidia,pull = <TEGRA_PIN_PULL_UP>;
			nvidia,tristate = <TEGRA_PIN_DISABLE>;
			nvidia,enable-input = <TEGRA_PIN_ENABLE>;
		};

The pull-up triggers the enable on the regulator I’m using & also serves the looped-back fault pin off same regulator. I know that pin is 1.8V, it’s not a problem for the regulator.

I suspect however that this means the usb driver can’t/won’t react to the fault (over-current pin).

I’ve tried to duplicate the same topology for usb0 & 1 in the device-tree:

xusb_padctl@3520000 {

ifdef _3_PORT_USB_OVER_CURRENT_PROTECTION
pinctrl-0 = <&vbus_en0_default_state>;
pinctrl-1 = <&vbus_en1_default_state>;
pinctrl-2 = <&vbus_en2_default_state>;
pinctrl-3 = <&vbus_en0_sfio_tristate_state>;
pinctrl-4 = <&vbus_en1_sfio_tristate_state>;
pinctrl-5 = <&vbus_en2_sfio_tristate_state>;
pinctrl-6 = <&vbus_en0_sfio_passthrough_state>;
pinctrl-7 = <&vbus_en1_sfio_passthrough_state>;
pinctrl-8 = <&vbus_en2_sfio_passthrough_state>;
pinctrl-names = “vbus_en0_default”, “vbus_en1_default”, “vbus_en2_default”,
“vbus_en0_sfio_tristate”, “vbus_en1_sfio_tristate”, “vbus_en2_sfio_tristate”,
“vbus_en0_sfio_passthrough”, “vbus_en1_sfio_passthrough”, “vbus_en2_sfio_passthrough”;
endif //ifdef _3_PORT_USB_OVER_CURRENT_PROTECTION

and

ifdef _3_PORT_USB_OVER_CURRENT_PROTECTION
pinmux@2430000 {
vbus_en2_sfio_tristate_state: vbus_en2_oc_tristate {
gpio_pq5_pi5 { // B19
nvidia,pins = “gpio_pq5_pi5”;
nvidia,function = “rsvd0”;
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_ENABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
};
vbus_en2_sfio_passthrough_state: vbus_en2_oc_passthrough {
gpio_pq5_pi5 { // B19
nvidia,pins = “gpio_pq5_pi5”;
nvidia,function = “rsvd0”;
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
};
vbus_en2_default_state: vbus_en2_default {
gpio_pq5_pi5 { // B19
nvidia,pins = “gpio_pq5_pi5”;
nvidia,function = “rsvd0”;
nvidia,pull = <TEGRA_PIN_PULL_UP>;
nvidia,tristate = <TEGRA_PIN_DISABLE>;
nvidia,enable-input = <TEGRA_PIN_ENABLE>;
};
};
};
endif //ifdef _3_PORT_USB_OVER_CURRENT_PROTECTION

ifdef _3_PORT_USB_OVER_CURRENT_PROTECTION
regulator@17 { /* vdd_usb2_5v /
regulator-boot-on;
regulator-always-on;
gpio = <&tegra_main_gpio TEGRA_MAIN_GPIO(I, 5) GPIO_ACTIVE_HIGH>;
gpio-open-drain;
enable-active-high;
};
else
/delete-node/ /
vdd_usb2_5v */ regulator@17;
endif //ifdef _3_PORT_USB_OVER_CURRENT_PROTECTION

The above doesn’t work, the enable signal doesn’t go high.

I note for usb0 & 1 their vbus_ens have “nvidia,function = “usb”” in their pinmuxing. I don’t see any other pins that have that option.

So in a roundabout way I guess I’m asking if the usb driver can only support two usb buses with over-current protection?

Hi,
In TX2, there are two oc-pin A17 and A18. Other pins may not have the function. Both pins are used on default board. Suggest you refer to the default board for enabling the function.