This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

Linux/DRA745: USB Role switch functionality is not working

Part Number: DRA745


Tool/software: Linux

Hi,

       I am working on h/w based on DRA74xx  Jancito6 SoC. It has dwc3 DRD from synopsys. We are trying to bring up USB dual role switch functionality in Linux kernel version 4.4.23.

We don't have OTG support on target due to h/w limitations. So we cant use ID PIN for mode selection. We are looking for role switch from software (using  /sys/kernel/debugfs interface) .

Our intention is to have the USB DRD controller in host mode (dr_mode=host) at the startup. And then based on a condition we shall trigger the role switch, preferably by writing "device" to the debugfs file "mode". But when we do this, there is no role switch because the DWC controller will be still registered to XHCI driver and it does not register to the UDC driver. The same holds good for vice versa scenario, device mode to host mode switch.

Is there any way we can achieve this? Or if you already have a patch/solution that would help us achieve our goal? 

  • Hi Dhananjay,

    I have forwarded your question to USB expert.

    Regards,
    Yordan
  • Hi Dhananjay,
    I'm not expert in USB software, I guess you have to reload the driver or something similar. I leave this question to USB expert.
    I just wanted to highlight that you can still toggle the ID GPIO (assuming it is unconnected on PCB) by enabling internal pullup or pulldown resistor using the corresponding PAD CONF register.

    Regards,
    Stan
  • Dhananjay

    The DRD role switch is supported. Are you verifiying on TI-EVM or custom board.

    Make sure, dr_mode is set to "otg" for DRD support for USB1 or USB2. And you have insert the gadget module for DRD port to make work as host or device.

    check the below steps, say USB1 in configured for DRD support.

    # mount -t debugfs debugfs /mnt

    # modprobe g_zero

    role switch to host

    # echo "host' > /mnt/48890000.usb/mode

    role switch to device

    # echo "device' > /mnt/48890000.usb/mode

    refer to SDG for more information.

    Regards

    Ravi