From: Jonathan Gray Date: Tue, 17 Sep 2019 02:18:40 +1000 Subject: [U-Boot] [PATCH 3/3] config: enable DFU over USB on Raspberry Pi4 boards In-Reply-To: References: <20190916122417.27520-1-m.szyprowski@samsung.com> <20190916122417.27520-4-m.szyprowski@samsung.com> <6072210e-24fa-3699-7e41-7a02cc7ea7e8@suse.com> Message-ID: <20190916161840.GA48454@largo.jsg.id.au> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Mon, Sep 16, 2019 at 02:53:30PM +0200, Marek Szyprowski wrote: > Hi Matthias, > > On 16.09.2019 14:45, Matthias Brugger wrote: > > On 16/09/2019 14:24, Marek Szyprowski wrote: > >> Enable support for DFU over USB. This requires to enable USB gadget, > >> DWC2 UDC OTG driver and DFU command. DFU entities are defined for the > >> following firmware objects: u-boot.bin, uboot.env and zImage. > >> > >> Signed-off-by: Marek Szyprowski > >> --- > >> configs/rpi_4_32b_defconfig | 11 +++++++++++ > >> include/configs/rpi.h | 10 ++++++++++ > >> 2 files changed, 21 insertions(+) > >> > >> diff --git a/configs/rpi_4_32b_defconfig b/configs/rpi_4_32b_defconfig > >> index a31a617a5fb..0a375b97369 100644 > >> --- a/configs/rpi_4_32b_defconfig > >> +++ b/configs/rpi_4_32b_defconfig > >> @@ -12,6 +12,7 @@ CONFIG_MISC_INIT_R=y > >> # CONFIG_DISPLAY_CPUINFO is not set > >> # CONFIG_DISPLAY_BOARDINFO is not set > >> CONFIG_SYS_PROMPT="U-Boot> " > >> +CONFIG_CMD_DFU=y > >> # CONFIG_CMD_FLASH is not set > >> CONFIG_CMD_GPIO=y > >> CONFIG_CMD_MMC=y > >> @@ -19,6 +20,7 @@ CONFIG_CMD_FS_UUID=y > >> CONFIG_ENV_FAT_INTERFACE="mmc" > >> CONFIG_ENV_FAT_DEVICE_AND_PART="0:1" > >> CONFIG_ENV_VARS_UBOOT_RUNTIME_CONFIG=y > >> +CONFIG_DFU_MMC=y > >> CONFIG_DM_KEYBOARD=y > >> CONFIG_DM_MMC=y > >> CONFIG_MMC_SDHCI=y > >> @@ -26,6 +28,15 @@ CONFIG_MMC_SDHCI_BCM2835=y > >> CONFIG_PINCTRL=y > >> # CONFIG_PINCTRL_GENERIC is not set > >> # CONFIG_REQUIRE_SERIAL_CONSOLE is not set > >> +CONFIG_USB=y > >> +CONFIG_DM_USB=y > >> +CONFIG_DM_USB_GADGET=y > >> +CONFIG_USB_GADGET=y > >> +CONFIG_USB_GADGET_MANUFACTURER="FSL" > >> +CONFIG_USB_GADGET_VENDOR_NUM=0x0525 > >> +CONFIG_USB_GADGET_PRODUCT_NUM=0xa4a5 > >> +CONFIG_USB_GADGET_DWC2_OTG=y > >> +CONFIG_USB_GADGET_DOWNLOAD=y > > Does this only work on RPi4? It seems to me that this should also be working on > > the other RPi's. Do you have such HW to test? > > It should work on any RPi with USB device controller available on the > micro-usb/c-usb connector. AFAIK, besides RPi4, only some RPi0 has USB > device mode available. Other RPi's have USB hub connected to DWC2 > controller, so switching DWC2 to device mode is not enough to make it > working. > > However I have access only to RPi3 and RPi4. https://www.raspberrypi.org/documentation/hardware/raspberrypi/bootmodes/device.md The following devices can boot using USB device boot mode: Pi Compute Module Pi Compute Module 3 Pi Zero Pi Zero W Pi A Pi A+ Pi 3A+