Does Toradex software automatically bypass USB hub in favor of WiFi/Bluetooth module?

alt text

Using Toradex Linux kernel from linux-toradex.git - Linux kernel for Apalis, Colibri and Verdin modules with “toradex_imx_4.14.78_1.0.0_ga-bring_up” branch, does the software automatically use the GPIO expander to bypass the HSIC USB Hub “USB3803” to route USB OTG2 to the Wi-Fi/Bluetooth module as in the attached image?

If so can you point me to the code/configuration that automatically bypasses this so that we can forward the USB OTG2 directly to the edge connector.

Note: We are using fsl-imx8qxp-colibri-dsihdmi-eval-v3.dts Linux device tree.

Hi

Note that Figure 6. above is how a 'Colibri iMX8QXP 2GB WB IT v1.0 ’ is assembled. Figure 7 does give the wiring for a (not yet available) module without a on module Wi-Fi chip.

I think you misinterpret the bypass function of the USB3803.

The “USB3803” USB Hub allows to connect the upstream port with the USB_H port through the bypass HW signal without providing any Hub functionality. The Linux kernel with our device tree does take the Hub out of Reset and out of that bypass mode so that it works as a USB Hub providing its USB services to the USB_H port AND the Wi-Fi module.

The question is what is it exactly that you want to achieve, respectively what does not work for you in the current configuration?

If you do not care about the USB connection to the Wi-Fi module and you do want to not go through an additional USB Hub you could disable the USB3803 driver in the device tree and take the USB3803 out of reset but keep it in bypass mode by configuring the FXL6408 drivers initial state accordingly.

Max

Hi Max,

Thanks for the clarification. I was indeed referring to Figure 6. I was misinterpreting the bypass function of the USB3803.

So by default the Toradex kernel and device tree will enable use of the USB3803 as a Hub and USB_H will work externally.

I have configured USB OTG2 as a USB Device and after the configuration script I see no activity on either Windows or Ubuntu USB Host PC. This same script works on iMX8 MEK NXP hardware to configure the port as USB Device. I have attached the script for reference.

Any suggestion for changes to Toradex Linux kernel configuration and/or device tree configuration are welcome.

Thanks for the support!

Brandon

link text

Hi Brandon

USB Hub here means: The i.MX8X plays the USB Host role, on USB_H is a host port and you connect a USB device there.

Whether or not the USB3803 allows to reverse the USB roles if in bypass mode I do not know. The datasheet clearly still marks the port as upstream on the i.MX8X side and downstream on the USB_H connector side. However, as the datasheet also talks about an analog switch it may be that your configuration works if setting the USB3803 into bypass mode.

While we did not yet bring-up the USB client functionality and the automatic role switching on USB_C that would be the port meant to be used for that. Do you have any particular reason for trying this on USB_H?

Regards,
Max

Hi Max,
I am using this port as a USB Device because that is what our hardware team has laid it out for. The OTG1 port should act as a USB Host, but that is also not working. The OTG1 hardware is fine because when I use an NXP MEK based u-boot (with subtle modifications for this hardware) I can see a connected USB stick as a mass storage device from u-boot prompt. When booting Toradex kernel and connecting the same USB stick to this port I see no activity in the kernel dmesg. This was going to be my next conversation with you so I am jumping ahead of myself.

Back to the OTG2 issue. I disabled the “usb3803@08” by adding a label:

/* USB3503A */
usb3803: usb3803@08 {
    compatible = "smsc,usb3803";
    pinctrl-names = "default";

And in my custom board DTS file:

&usb3803 {
    status = "disabled";
};

I also set the “inital_output” to 0x15 for the gpio expander to keep the bypass gpio active (expander GPIO 5 LOW) and the reset gpio inactive (expander GPIO 4 HIGH) to keep the part out of reset and in bypass mode with the following:

/* GPIO expander */
gpio_expander_43: gpio-expander@43 {
	compatible = "fcs,fxl6408";
	gpio-controller;
	#gpio-cells = <2>;
	reg = <0x43>;
	inital_io_dir = <0xff>;
	inital_output = <0x15>;
};

The USB Device still does not show up on my PC host. I read the FXL6408 datasheet and I assumed that the GPIO pins 5 (bypass) and 4 (reset) were the correct pins because of the following:

	bypass-gpios = <&gpio_expander_43 5 GPIO_ACTIVE_LOW>;
	intn-gpios = <&gpio3 4 GPIO_ACTIVE_LOW>;
	reset-gpios = <&gpio_expander_43 4 GPIO_ACTIVE_LOW>;

Please let me know if I missed something.

Thanks,
Brandon

UPDATE: I got the USB OTG1 to work as USB Host with the following change to comment out “extcon” from the device tree.

&usbotg1 {
    #extcon = <&extcon_usbc_det &extcon_usbc_det>;
    vbus-supply = <&reg_usbh_vbus>;
    srp-disable;
    hnp-disable;
    adp-disable;
    power-polarity-active-high;
    disable-over-current;
    status = "okay";
};

I am using this port as a USB Device because that is what our hardware team has laid it out for.

I really doubt this will work. And even if it would it is still a very very bad idea as the USBH port on any other module is always just a host port only.

The OTG1 port should act as a USB Host,

That port is a switchable device/host port on any of our Colibri modules since the dawn of time. So both configurations should be possible.

but that is also not working. The OTG1 hardware is fine because when I use an NXP MEK based u-boot (with subtle modifications for this hardware) I can see a connected USB stick as a mass storage device from u-boot prompt.

Given the existence of a regular USB host port USBH such configuration really does not make much sense for us especially in the boot loader where USBC is just that a client port to be used e.g. as USB mass storage (UMS).

When booting Toradex kernel and connecting the same USB stick to this port I see no activity in the kernel dmesg. This was going to be my next conversation with you so I am jumping ahead of myself.

I guess that was just never really implemented/supported.

Please note that the Colibri iMX8QXP 2GB WB IT V1.0A was an early access sample and as such is no longer supported.

Hi Max, Marcel,

Sorry I mis-typed the module we are using, it is the Colibri iMX8QXP 2GB WB IT v1.0 B .

I was able to get the OTG2 (USB_H) to be identified and work as a USB Device. I simply had to force the device tree mode to be “peripheral”:

&usbotg3 {
    dr_mode = "peripheral";
    status = "okay";
};

Thanks very much for all of the support!

Perfect that it works. Thanks for the feedback.