Ethernet gadget error with 18.01

I am getting an error trying to enable the ethernet gadget with the 18.01 release:

root@linaro-developer:~# uname -a
Linux linaro-developer 4.14.0-qcomlt-arm64 #1 SMP PREEMPT Fri Feb 2 21:19:01 UTC 2018 aarch64 GNU/Linux
root@linaro-developer:~# modprobe g_ether
[ 55.167498] udc-core: couldn’t find an available UDC - added [g_ether] to list of pending drivers
root@linaro-developer:~# lsusb
Bus 001 Device 003: ID 0b95:7720 ASIX Electronics Corp. AX88772
Bus 001 Device 002: ID 0424:2513 Standard Microsystems Corp. 2.0 Hub
Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

Any help would be appreciated.

Device mode is not supported on 4.14 due to refactoring of the upstream USB driver, AFAIK some patches are pending… This is however supported by previous release (with kernel 4.9), and hope it will be as well in next release.

I realize this is a fairly old thread but I just ran into this issue myself and am very disappointed gadget mode is not supported.
Especially considering the release notes on this page: http://releases.linaro.org/96boards/dragonboard410c/linaro/debian/latest/
Specifically indicate “ethernet” is supported functionality on USB 2.0.
I wasted a whole day messing with this trying to get it to work like I had it with a previous release, had I known this wasn’t doable I could’ve saved the time downloading the zip, burning it to my micro-SD, loading it into the board (several times) and then researching why it didn’t work.

Anyway, I guess I’ll move back to the prior version as I’m not going to rely on WiFi being stable in my local environment.

Wheelman

gadget mode is actually supported but host/gadget switch is not supported at runtime. So if you want to support gadget, you need to apply the following modification in your device tree:

in apq8016-sbc.dtsi, usb@78d9000 node:

-  dr_mode = "otg";
+  dr_mode = "gadget";

in apq8016-sbc-pmic-pins.dtsi, usb_sw_sel_pm node:

- output-high;
+ output-low;

Note: I’m currenty working on a solution for re-introducing OTG support : loic.poulain/linux.git - [no description].

@Loic
Thanks for the pointer, now I have other question(s).

I installed the device-tree-compiler package and used fdtdump to list out the nodes in /usr/lib/linux-image-4.14.0-qcomlt-arm64/qcom/apq8016-sbc.dtb.
Once I had the contents of the .dtb file in a form I could look at I searched for the nodes you mentioned.
The usb@78d9000 node contents don’t match what you indicate, instead of dr_mode = “otg” it shows dr_mode = “host”.
The usb_sw_sel_pm node seems to match your data.

My first question: Am I working with the correct .dtb file?
Second question: Do you believe changing the value of the usb@78d9000 node dr_mode variable to “gadget” from “host” will accomplish my goal, which is to enable gadget mode?

My plan is to use fdtput to change the values in the nodes you mention but I don’t want to try it until I hear back from you about the contents of the node that specifies “otg”, “host” or “gadget” mode first.

Wheelman

Well, being the impatient type person I am I went ahead and tried to update the .dtb file from my previous post.
The tools showed I was able to change dr_mode from “host” to “gadget” and the pin mux property to output_low but it made no difference.

I power cycled the board after updating the dtb file and checked to make sure my changes were still in place, which they were.

I connected a USB cable between the board and my PC, I issued “sudo modprobe g_ether” and did an lsusb to see which devices were present, only the 2 base entries were shown.
Then, out of curiosity I plugged a keyboard into one of the USB type A connectors and did lsusb again, this time the keyboard was also displayed.
So, I can either conclude I edited the wrong .dtb file, I missed step(s) in activating the settings, the settings given by @Loic are wrong or incomplete or the Debian 18.01 distribution doesn’t actually support gadget mode after all.

Any thoughts on this from anyone??

Wheelman

The physical hardware on the 410c will not be able to operate the Type A ports, and the micro USB port at the same time. It’s one or the other, never both!

If your Type A ports are working, then the MUX is in the wrong state. Check your cable, a standard micro USB cable from your PC to the micro USB port on the 410c will force the MUX to the micro USB port on the 410c.

After the cable is connected, then gadget mode should work.

-Lawrence-

The cable is good, I used it with no problems at all (for more than a year) until i upgraded the Debian installation to 18.01.

Can you tell me whether I updated the correct .dtb file?
I suspect I didn’t but there are a number of .dtb files on the system and figuring out which one to update and how is not something I have the time to do right now.

I’m thinking I should reinstall the older distribution just to verify everything still works, but i have no reason to believe the hardware failed just because i installed the updated version.

This wouldn’t really be an issue if the WiFi didn’t disconnect itself and force me to power cycle the board.
I’m running it headless so a power cycle is the only way to get it back once the WiFi disconnects.

Wheelman