I run 3 Radxa Zero and I need to have them networked to synchronize them. I’d like to use ethernet over USB, as it means less needed hardware than adding ethernet dongles.
Is it feasible ?
I’m trying to build and use the g_ether.ko
and dwc2.ko
kernel modules because I’m used to doing this, for example on Manjaro for the same platform.
I built CE 20.5 (pulled latest commits 2 days ago), with some additions to the kernel config - mostly, set CONFIG_USB_OTG, and add CONFIG_USB_ETH and CONFIG_USB_DWC2 :
diff --git a/projects/Amlogic-ce/devices/Amlogic-ng/linux/linux.aarch64.conf b/projects/Amlogic-ce/devices/Amlogic-ng/linux/linux.aarch64.conf
index d3488b0ec9..5e22f8449b 100644
--- a/projects/Amlogic-ce/devices/Amlogic-ng/linux/linux.aarch64.conf
+++ b/projects/Amlogic-ce/devices/Amlogic-ng/linux/linux.aarch64.conf
@@ -4560,9 +4560,10 @@ CONFIG_USB_ANNOUNCE_NEW_DEVICES=y
#
CONFIG_USB_DEFAULT_PERSIST=y
# CONFIG_USB_DYNAMIC_MINORS is not set
-# CONFIG_USB_OTG is not set
+CONFIG_USB_OTG=y
# CONFIG_USB_OTG_WHITELIST is not set
# CONFIG_USB_OTG_BLACKLIST_HUB is not set
+# CONFIG_USB_OTG_FSM is not set
# CONFIG_USB_LEDS_TRIGGER_USBPORT is not set
# CONFIG_USB_MON is not set
# CONFIG_USB_WUSB_CBAF is not set
@@ -4575,7 +4576,7 @@ CONFIG_USB_XHCI_HCD=y
CONFIG_USB_XHCI_PCI=y
CONFIG_USB_XHCI_PLATFORM=y
CONFIG_USB_EHCI_HCD=y
-# CONFIG_USB_EHCI_ROOT_HUB_TT is not set
+CONFIG_USB_EHCI_ROOT_HUB_TT=y
CONFIG_USB_EHCI_TT_NEWSCHED=y
CONFIG_USB_EHCI_PCI=y
# CONFIG_USB_EHCI_HCD_PLATFORM is not set
@@ -4641,8 +4642,18 @@ CONFIG_USB_DWC3_HOST=y
#
CONFIG_USB_DWC3_PCI=y
CONFIG_USB_DWC3_OF_SIMPLE=y
-# CONFIG_USB_DWC2 is not set
# CONFIG_USB_CHIPIDEA is not set
+CONFIG_USB_DWC2=m
+# CONFIG_USB_DWC2_HOST is not set
+
+#
+# Gadget/Dual-role mode requires USB Gadget support to be enabled
+#
+# CONFIG_USB_DWC2_PERIPHERAL is not set
+CONFIG_USB_DWC2_DUAL_ROLE=y
+# CONFIG_USB_DWC2_PCI is not set
+# CONFIG_USB_DWC2_DEBUG is not set
+# CONFIG_USB_DWC2_TRACK_MISSED_SOFS is not set
# CONFIG_USB_ISP1760 is not set
#
@@ -4779,8 +4790,15 @@ CONFIG_USB_GADGET_STORAGE_NUM_BUFFERS=2
# CONFIG_USB_GADGET_XILINX is not set
# CONFIG_USB_DUMMY_HCD is not set
CONFIG_USB_LIBCOMPOSITE=y
+CONFIG_USB_F_ACM=m
+CONFIG_USB_U_SERIAL=m
CONFIG_USB_U_ETHER=y
+CONFIG_USB_F_NCM=m
+CONFIG_USB_F_ECM=m
+CONFIG_USB_F_EEM=y
+CONFIG_USB_F_SUBSET=m
CONFIG_USB_F_RNDIS=y
+CONFIG_USB_F_MASS_STORAGE=m
CONFIG_USB_F_FS=y
CONFIG_USB_F_MIDI=y
CONFIG_USB_F_MTP=y
@@ -4795,7 +4813,7 @@ CONFIG_USB_CONFIGFS=y
# CONFIG_USB_CONFIGFS_ECM is not set
# CONFIG_USB_CONFIGFS_ECM_SUBSET is not set
CONFIG_USB_CONFIGFS_RNDIS=y
-# CONFIG_USB_CONFIGFS_EEM is not set
+CONFIG_USB_CONFIGFS_EEM=y
# CONFIG_USB_CONFIGFS_MASS_STORAGE is not set
# CONFIG_USB_CONFIGFS_F_LB_SS is not set
CONFIG_USB_CONFIGFS_F_FS=y
@@ -4810,6 +4828,27 @@ CONFIG_USB_CONFIGFS_F_MIDI=y
# CONFIG_USB_CONFIGFS_F_HID is not set
# CONFIG_USB_CONFIGFS_F_UVC is not set
# CONFIG_USB_CONFIGFS_F_PRINTER is not set
+# CONFIG_USB_ZERO is not set
+# CONFIG_USB_AUDIO is not set
+CONFIG_USB_ETH=m
+CONFIG_USB_ETH_RNDIS=y
+CONFIG_USB_ETH_EEM=y
+CONFIG_USB_G_NCM=m
+# CONFIG_USB_GADGETFS is not set
+CONFIG_USB_FUNCTIONFS=m
+CONFIG_USB_FUNCTIONFS_ETH=y
+CONFIG_USB_FUNCTIONFS_RNDIS=y
+CONFIG_USB_FUNCTIONFS_GENERIC=y
+# CONFIG_USB_MASS_STORAGE is not set
+# CONFIG_USB_G_SERIAL is not set
+# CONFIG_USB_MIDI_GADGET is not set
+# CONFIG_USB_G_PRINTER is not set
+# CONFIG_USB_CDC_COMPOSITE is not set
+# CONFIG_USB_G_ACM_MS is not set
+# CONFIG_USB_G_MULTI is not set
+# CONFIG_USB_G_HID is not set
+# CONFIG_USB_G_DBGP is not set
+# CONFIG_USB_G_WEBCAM is not set
# CONFIG_USB_LED_TRIG is not set
# CONFIG_USB_ULPI_BUS is not set
# CONFIG_UWB is not set
The build succeeded and I was able to boot the system and login via ssh and modprobe dwc2 g_ether
. But then I don’t get any usb0
interface when I ip a
. dmesg has :
udc-core: couldn't find an available UDC - added [g_ether] to list of pending drivers
I then tried adding CONFIG_DUMMY_HCD, rebuilding, and modprobe dummy_hcd
before g_ether
. The latter fails with an obscure message that I can find back if it helps.
Any comment welcome !