Configure oc-pin for USB in device tree

How to configure the nvidia,oc-pin in the device tree?
I checked the documentation and added the pin oc-pin as follows:

ports {
	usb2-0 {
		vbus-supply = <&reg_5v_rp>;
		 nvidia,oc-pin = <TEGRA194_MAIN_GPIO(Q, 0)>;
	};

This causes a crash during the boot sequence of the Jetson. I saw others setting it to “1” as well, but how do you link the overcurrent pin to the usb port in that case?
What should the “nvidia,oc-pin” parameter be?

Something like this

nvidia,oc-pin = <1>; /* VBUS_EN1 /
nvidia,oc-pin = <0>; /
VBUS_EN0 */

Hi user148820,

Are you using the devkit or custom board for AGX Xavier?
What’s your Jetpack version in use?

Which document are you referring to?

What is your use case to configure nvidia,oc-pin?

I am using a custom board. I have pin Q.00 and G02 (Hardware pin B55 and L9) connected to an overcurrent detection circuit for the USB 5V supply. Is it possible to configure the Q00 and G02 pins in the device tree as overcurrent pins so the VBUS_EN pin can disable the 5V supply to the USB device?

I checked the documentation on page: NVIDIA documentation and the section of “nvidia,oc-pin”.
and I am using Jetson Linux release: R35.4.1 and JetPack release: 5.1.2

OC pin is not necessary design. What is your purpose to use that?

What do you mean with this?

OC pin is not necessary design

I want the VBUS_EN_0 pin to be off (and thus disabling the 5V supply) when the GPIO3_PQ.00 pin is pulled low (by an external chip on the PCB detecting an overcurrent on the 5V supply). Can this be done using the OC-pin or some other setting in the DTC or does the VBUS_EN_0 pin need to be manually toggled to get this behavior?

Hi,

OC pin will only give out an interrupt and enable the usb port again when it detects OC . Is this what you need?

Kernel driver code:tegra186_phy_xusb_handle_overcurrent.

The 0/1 in the oc-pin field is mapping to something like below.

When you give it “0”, it will check vbus_en0_default_state, vbus_en0_sfio_tristate_state and vbus_en0_sfio_passthrough_state. Thus, you need to go to pinmux to make these nodes mapping to the pin you want to use.

pinctrl-0 = <&vbus_en0_default_state>;
		pinctrl-1 = <&vbus_en1_default_state>;
		pinctrl-2 = <&vbus_en0_sfio_tristate_state>;
		pinctrl-3 = <&vbus_en1_sfio_tristate_state>;
		pinctrl-4 = <&vbus_en0_sfio_passthrough_state>;
		pinctrl-5 = <&vbus_en1_sfio_passthrough_state>;
1 Like