aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrew Penner <Andrew.Penner@domino-uk.com>2021-09-17 13:58:27 +0100
committerAndrei Gherzan <andrei@gherzan.com>2021-09-24 17:34:23 +0100
commit9eb4879cf4a289607ec7493577adb0ba97367821 (patch)
tree3a6570ce50e066df20bcaec9dd46aee35afbd187
parent5f72ec0aa4afc142996cf43701a97a56847d2d1a (diff)
downloadmeta-raspberrypi-9eb4879cf4a289607ec7493577adb0ba97367821.zip
meta-raspberrypi-9eb4879cf4a289607ec7493577adb0ba97367821.tar.gz
meta-raspberrypi-9eb4879cf4a289607ec7493577adb0ba97367821.tar.bz2
rpi-cmdline: Support ethernet over USB
Support ethernet over USB via config.txt and cmdline.txt Signed-off-by: Andrew Penner <andrew.penner@protonmail.com>
-rw-r--r--recipes-bsp/bootfiles/rpi-cmdline.bb8
-rw-r--r--recipes-bsp/bootfiles/rpi-config_git.bb8
2 files changed, 15 insertions, 1 deletions
diff --git a/recipes-bsp/bootfiles/rpi-cmdline.bb b/recipes-bsp/bootfiles/rpi-cmdline.bb
index 74550ef..50c2b53 100644
--- a/recipes-bsp/bootfiles/rpi-cmdline.bb
+++ b/recipes-bsp/bootfiles/rpi-cmdline.bb
@@ -29,6 +29,13 @@ CMDLINE_LOGO ?= '${@oe.utils.conditional("DISABLE_RPI_BOOT_LOGO", "1", "logo.nol
# to enable kernel debugging.
CMDLINE_DEBUG ?= ""
+# Add RNDIS capabilities (must be after rootwait)
+# example:
+# CMDLINE_RNDIS = "modules-load=dwc2,g_ether g_ether.host_addr=<some MAC
+# address> g_ether.dev_addr=<some MAC address>"
+# if the MAC addresses are omitted, random values will be used
+CMDLINE_RNDIS ?= ""
+
CMDLINE = " \
${CMDLINE_DWC_OTG} \
${CMDLINE_SERIAL} \
@@ -38,6 +45,7 @@ CMDLINE = " \
${CMDLINE_LOGO} \
${CMDLINE_PITFT} \
${CMDLINE_DEBUG} \
+ ${CMDLINE_RNDIS} \
"
do_compile() {
diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb
index 583144d..657123f 100644
--- a/recipes-bsp/bootfiles/rpi-config_git.bb
+++ b/recipes-bsp/bootfiles/rpi-config_git.bb
@@ -215,7 +215,7 @@ do_deploy() {
fi
# DWC2 USB peripheral support
- if [ "${ENABLE_DWC2_PERIPHERAL}" = "1" ]; then
+ if ([ "${ENABLE_DWC2_PERIPHERAL}" = "1" ] && [ "${ENABLE_DWC2_OTG}" != "1" ]); then
echo "# Enable USB peripheral mode" >> $CONFIG
echo "dtoverlay=dwc2,dr_mode=peripheral" >> $CONFIG
fi
@@ -225,6 +225,12 @@ do_deploy() {
echo "# Enable USB host mode" >> $CONFIG
echo "dtoverlay=dwc2,dr_mode=host" >> $CONFIG
fi
+
+ # DWC2 USB OTG support
+ if ([ "${ENABLE_DWC2_OTG}" = "1" ] && [ "${ENABLE_DWC2_PERIPHERAL}" != "1" ]); then
+ echo "# Enable USB OTG mode" >> $CONFIG
+ echo "dtoverlay=dwc2,dr_mode=otg" >> $CONFIG
+ fi
# AT86RF23X support
if [ "${ENABLE_AT86RF}" = "1" ]; then