Hello,
we have some problems with getting the same behavior for USB_VBUS_EN0 and USB_VBUS_EN1. When we set the NVIDIA Jetson AGX Xavier into sleep mode, we see different behavior for the USB_VBUS_EN0 and USB_VBUS_EN1 pins. The USB_VBUS_EN0 stays high and keeps the USB 5V available, and USB_VBUS_EN1 goes to low. Is there a configuration to control this behavior? Or is there a way to set both USB_VBUS_EN0/1 to low when the system goes to sleep
I guess your question is based on a custom carrier board?
Yes, it is on a custom carrier board. But the USB power is controlled by the USB_VBUS_EN0/1 pin.
I didn’t see settings for the device tree that can configure the behavior of the USB_VBUS_EN0/1 pin, also we didn’t change this for the device tree files (kept it original from the NVIDIA image). We only removed the OTG functionalities of the USB port.
This is our device tree configuration for xusb_padctl.
xusb_padctl@3520000 {
reg-names = "padctl\0ao";
resets = <0x04 0x72>;
interrupts = <0x00 0xa7 0x04>;
avdd-usb-supply = <0x2ac>;
compatible = "nvidia,tegra194-xusb-padctl";
status = "okay";
vclamp-usb-supply = <0x15>;
reg = <0x00 0x3520000 0x00 0x1000 0x00 0x3540000 0x00 0x1000>;
phandle = <0x2ae>;
reset-names = "padctl";
ports {
usb3-2 {
nvidia,usb2-companion = <0x00>;
status = "okay";
};
usb3-0 {
nvidia,usb2-companion = <0x01>;
status = "okay";
};
usb2-2 {
mode = "host";
vbus-supply = <0x21>;
status = "okay";
};
usb2-0 {
mode = "host";
vbus-supply = <0x21>;
status = "okay";
};
usb3-3 {
nvidia,usb2-companion = <0x03>;
status = "okay";
nvidia,usb3-gen1-only = <0x01>;
};
usb3-1 {
status = "disabled";
};
usb2-3 {
mode = "host";
vbus-supply = <0x2ad>;
status = "okay";
};
usb2-1 {
mode = "host";
vbus-supply = <0x21>;
status = "okay";
};
};
prod-settings {
#prod-cells = <0x04>;
prod {
prod = <0x00 0x24 0xfff 0x00>;
};
prod_c_bias {
prod = <0x00 0x284 0x38 0x38>;
};
};
pads {
usb3 {
lanes {
usb3-2 {
nvidia,function = "xusb";
#phy-cells = <0x00>;
status = "okay";
phandle = <0x2b3>;
};
usb3-0 {
nvidia,function = "xusb";
#phy-cells = <0x00>;
status = "okay";
phandle = <0x2b4>;
};
usb3-3 {
nvidia,function = "xusb";
#phy-cells = <0x00>;
status = "okay";
phandle = <0x2b5>;
};
usb3-1 {
#phy-cells = <0x00>;
status = "disabled";
};
};
};
usb2 {
clock-names = "trk";
clocks = <0x04 0xa5>;
lanes {
usb2-2 {
nvidia,function = "xusb";
#phy-cells = <0x00>;
status = "okay";
phandle = <0x2b2>;
nvidia,xcvr-hsslew = 7;
};
usb2-0 {
nvidia,function = "xusb";
#phy-cells = <0x00>;
status = "okay";
phandle = <0x2af>;
nvidia,xcvr-hsslew = 7;
};
usb2-3 {
nvidia,function = "xusb";
#phy-cells = <0x00>;
status = "okay";
phandle = <0x2b1>;
};
usb2-1 {
nvidia,function = "xusb";
#phy-cells = <0x00>;
status = "okay";
phandle = <0x2b0>;
nvidia,xcvr-hsslew = 7;
};
};
};
};
};
I am not sure about what does that mean you didn’t change it. The AGX Xavier devkit is using Cypress PD controller. If you didn’t change that part in device tree, then usb functionality may have problem.
Back to your original question, vbus-supply is for USB_VBUS_ENx.
Okay, I see that the vbus-supply part is still incorrect as it still uses the Cypress PD controller settings (vbus-supply “battery_reg”). How to change this to VBUS_EN0 (or VBUS_EN1)?
And this is our setting for the oc-pin, the syntax for selecting the correct NVIDIA pin is correct, right?
xusb_padctl: xusb_padctl@3520000 {
ports {
usb2-0 {
nvidia,oc-pin = <TEGRA194_MAIN_GPIO(G, 2)>;
};
};
In this document there is no reference to the VBUS_EN pins. Also in the examples only the vbus-supply = “battery_reg” is used. This value for “vbus-supply” is not correct when using an external 5V and the VBUS_EN pins, right?
You need to write a regulator and assign the regulator to vbus-supply.
Because regulator framework is standard linux kernel thing, we won’t write it in our document again.
I’ve created the regulator and did some tests to disable the power when the Jetson is in suspend. The Z.02 pin enables the 5V USB voltage when high. I’ve created this vbus supply for the USB power:
reg_5v_usb: regulator@11 {
compatible = "regulator-fixed";
reg = <11>;
regulator-name = "5V USB";
regulator-min-microvolt = <5000000>;
regulator-max-microvolt = <5000000>;
gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Z, 2) GPIO_ACTIVE_HIGH>;
regulator-boot-on;
enable-active-high;
regulator-state-mem {
regulator-off-in-suspend;
};
};
The 5V supply goes on when the Jetson is on, but the 5V supply stays on during a suspend. Do you know what could cause this, as I thought the “regulator-off-in-suspend” should turn the supply off during suspend.