Hi ALL,
In our custom board, the type C port which is combination of usb2-2 and usb3-2. We want to change usb2-2 to peripheral mode(device mode) instead of host mode which is currently deafult mode in dtsi. Currently recovery port usb2-0 with micro usb connector is tied with xudc. Now we have mapped xudc to usb2-2 instead of usb2-0
Done the following DTSI changes to make the usb2-2 has peripheral mode.
- usb2-0 is changed to host instead of otg.
- Now we have mapped xudc to usb2-2 instead of usb2-0.
{
usb2-0 {
mode = “host”;
status = “okay”;
#if TEGRA_XUSB_DT_VERSION >= DT_VERSION_3
/* usb-role-switch; */
connector {
compatible = “usb-b-connector”, “gpio-usb-b-connector”;
label = “micro-USB”;
type = “micro”;
vbus-gpio = <&tegra_main_gpio TEGRA194_MAIN_GPIO(Z, 1) GPIO_ACTIVE_LOW>;
};
endif
};
usb2-2 {
mode = “peripheral”;
/vbus-supply = <&usb2_2>;/
vbus-supply = <&battery_reg>;
status = “okay”;
usb-role-switch;
};
usb3-2 {
nvidia,usb2-companion = <2>;
status = “okay”;
};
};
}
With the following changes usb2-2, I don’t see any error in dmesg during bootup, so ports are properly hooked up. But if I connect the custom board to laptop don’t see that jeston xavier is not going into device mode.
We have 3.0 PD module which controls the type C port for device mode. Below is the schematic. This module can be controlled via I2C.
Linux has FUSB302 driver, enabled this driver in the configuration file and added below DTSI changes in tegra194-p3668-common.dtsi.
/*Added FUSB entry */
i2c8: i2c@31e0000 {
fusb302@22{
compatible = “fcs,fusb302”; // String must match driver’s .compatible string exactly
reg = <0x22>; // I2C Slave address
status = “okay”; // The device is enabled, comment out or delete to disable
vbus-supply = <&usb2_2>;
fcs,int_n = <&tegra_aon_gpio TEGRA194_AON_GPIO(CC, 0) GPIO_ACTIVE_LOW>; // INT_N GPIO pin - <&gpio_bus pin# 0>.
};
};
Now fusb driver probe is successful and IRQ 264 is registered with GPIO. cat /sys/kernel/debug/gpio shows gpio-317 (PCC.00 |fcs,int_n ) in hi IRQ ACTIVE LOW
Even with this driver no interrupt is generated to jetson xavier nx when it is connected to windows/Linux PC.
I know there is service which runs at bootup and configures the mass storage, serial port and RNDIS. Later need to modify this if required to consider usb2-2 instead of usb2-0.
Is there changes I am missing at DTSI side or anything else need to be taken care for usb port to work in peripheral mode?