From d3709fa6887d6d35046df6376fe39e9a7a59038e Mon Sep 17 00:00:00 2001 From: "Peter A. Bigot" Date: Tue, 1 May 2018 10:09:27 -0500 Subject: rpi-config: add helper to enable dwc2 peripheral support Document and add support to easily enable USB gadget mode. Also fix a spelling error. Signed-off-by: Peter A. Bigot --- docs/extra-build-config.md | 10 +++++++++- recipes-bsp/bootfiles/rpi-config_git.bb | 6 ++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/docs/extra-build-config.md b/docs/extra-build-config.md index 35abbdf..806c238 100644 --- a/docs/extra-build-config.md +++ b/docs/extra-build-config.md @@ -221,7 +221,7 @@ needs a fixed core frequency and enable_uart wil set it to the minimum. Certain operations - 60fps h264 decode, high quality deinterlace - which aren't performed on the ARM may be affected, and we wouldn't want to do that to users who don't want to use the serial port. Users who want serial console support on -RaspberryPi3 will have to explicitely set in local.conf: +RaspberryPi3 will have to explicitly set in local.conf: ENABLE_UART = "1" @@ -229,6 +229,14 @@ Ref.: * * +## Enable USB Peripheral (Gadget) support + +The standard USB driver only supports host mode operations. Users who +want to use gadget modules like g_ether should set the following in +local.conf: + + ENABLE_DWC2_PERIPHERAL = "1" + ## Manual additions to config.txt The `RPI_EXTRA_CONFIG` variable can be used to manually add additional lines to diff --git a/recipes-bsp/bootfiles/rpi-config_git.bb b/recipes-bsp/bootfiles/rpi-config_git.bb index e21872e..9440897 100644 --- a/recipes-bsp/bootfiles/rpi-config_git.bb +++ b/recipes-bsp/bootfiles/rpi-config_git.bb @@ -172,6 +172,12 @@ do_deploy() { echo "hdmi_drive=1" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt fi + # DWC2 USB peripheral support + if [ "${ENABLE_DWC2_PERIPHERAL}" = "1" ]; then + echo "# Enable USB peripheral mode" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + echo "dtoverlay=dwc2,dr_mode=peripheral" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt + fi + # Append extra config if the user has provided any echo "${RPI_EXTRA_CONFIG}" >> ${DEPLOYDIR}/bcm2835-bootfiles/config.txt } -- cgit v1.2.3-54-g00ecf