This is a cache of https://discuss.96boards.org/t/usb2-0-not-working-in-host-mode-in-kernel-v4-14/4814. It is a snapshot of the page at 2024-11-04T09:47:45.099+0000.
USB2.0 not working in host mode in kernel v4.14 - DragonBoard 820c - 96Boards Forum

USB2.0 not working in host mode in kernel v4.14

Hi,

I am using latest OpenEmbedded Release on DragonBoard820c(p4).
Release: http://snapshots.linaro.org/96boards/dragonboard820c/linaro/openembedded/rocko/latest/rpb/1

root@dragonboard-820c:~# uname -a
Linux dragonboard-820c 4.14.15+linaro #1 SMP PREEMPT Wed May 16 13:10:36 UTC 2018 aarch64 aarch64 aarch64 GNU/Linux

Setup:
Mass storage(pendrive) connected on USB2.0 port via micro USB 2.0 OTG cable.

Issue :
USB2.0 port doesn’t work in host mode.By default dr_mode for dwc3@7600000 is set as otg, which means it can be configured as both host and gadget.
I tried modifying dr_mode=“host” in dwc3@7600000, but it didn’t work.

Note: USB2.0 host mode works with kernel v4.11.

root@dragonboard-820c:~# lsusb -t
/: Bus 04.Port 1: Dev 1, Class=root_hub, driver=xhci-hcd/0p, 5000M
/: Bus 03.Port 1: Dev 1, Class=root_hub, driver=xhci-hcd/1p, 480M
/: Bus 02.Port 1: Dev 1, Class=root_hub, driver=xhci-hcd/1p, 5000M
|__ Port 1: Dev 2, If 0, Class=Hub, driver=hub/4p, 5000M
/: Bus 01.Port 1: Dev 1, Class=root_hub, driver=xhci-hcd/1p, 480M
|__ Port 1: Dev 2, If 0, Class=Hub, driver=hub/4p, 480M

Can you please suggest any workaround to enable USB2.0 in host mode in kernel v4.14.?

Regards,
Krupal

Hi @krupal

The Micro-USB port on the 820c is hardwired as a device only port, it is not a USB-OTG port, it is not capable of host mode. The two Type A USB3.0 ports are hardwired as host only ports and you can connect your drive to either one of them, If you run out of USB2.0 Host ports, you can also add an external hub to gain access to many more ports.

Full Disclosure: I am no longer an employee of Qualcomm Canada and any opinions I may have left in this or any other post are my own. Currently looking for new opportunities, you can contact my personal email through the forums at 96Boards.

To resolve this, we have to force dwc3 to serve in single role, not dual role, like below. then it will work. In my case, usb3 ports are in host mode. so, i had to force it.
dwc3@6a00000 {
extcon = <&usb3_id>;
- dr_mode = “otg”;
+ dr_mode = “host”;
};
};

Thanks for the reply,

@pradeep I have already tried this, but it didn’t work for USB2.0. We want to use USB2.0 as host. Any Suggestion for USB2.0.?

Hi @krupal

A Micro USB 2.0 connector has 5 pins (Power, Ground, Data+, Data-, and ID). If you look a the schematics for the 820c board https://developer.qualcomm.com/download/db820c/dragonboard-820c-schematics.pdf on Page 30 you will see that the ID pin (pin 4) is not connected, hence the system has no way of determining if a Host, or Device cable is connected. If you also look at the power connection (pin 1) you will see that it simply goes into a level shifter (Q6) and the level shifted signal is routed into the processor so that the system can detect when a cable is plugged in. The 820c board has no path to provide +5VDC power to your external device, so no matter what you do in software, your external device will never work because it has no power from the 820c board.

There are several ways to work around this, 1) you could solder a wire from the +5VDC supply on the board over to Pin 1 on the on the micro-USB connector, then force the software to operate in host mode, however if you do this then there will be no way to get the board into fastboot so you can load new software images. Option 2) is to use one of the USB3.0 Host ports to operate your USB2.0 device. USB3.0 is a superset of USB2.0 and all USB2.0 devices will work when connected to a USB3.0 port.

Hope this helps.

Full Disclosure: I am currently unemployed and looking for new opportunities.

Hi @ljking,
Using android kernel 3.10/.18 in 820c the OTG is working. But if i use 4.14 kernel, the OTG is not working. Does this means some drivers are missing in 4.14 for OTG? @anon91830841

Best Regards,
Jox

hey @krupal

check usb 2.0 host mode, works in 4.14 kernel now. I have just checked.