Raspberry Pi4: add support for DFU over USB
Get series with b4
b4 am 20200127233637.6b388194@jawaVersions newest first · linked by author and title
- v4 Latest1 of 6 patches 0 repliesNew
- v13 patches 0 repliesSuperseded
1 of 6 patches is in this archive. The cover letter announces 6.
Patches in v4 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/6 | fat: write: fix broken write to fragmented files | +0 | 2 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v4 yet.
Cover letter [PATCH v4 0/6] Raspberry Pi4: add support for DFU over USB
Hi Matthias,
Do you plan to pull this patch series to RPI repository?
I'm asking as it contains some DFU related patches (Acked already by me), which I would like to see pulled in this merge window.
Thanks in advance for your help :-)
Quoted 80 lines
Hi All!
This patchset enables support for DFU over USB protocol on Raspberry Pi4 board. The board has DWC2 UDC controller connected to the USB-C power connector. Enabling DFU on it, make the u-boot development much more convenient, as one no longer needs to swap SD-card between RPi4 board and host machine to update the u-boot binary.
Patches are based on current 'master' u-boot branch. They were tested on the 2019-07-10-raspbian-buster-lite.img sd-card image with the following lines added to config.txt:
dtoverlay=dwc2,dr_mode=peripheral
dtparam=i2c_arm=on
dtparam=spi=on
enable_uart=1
uart_2ndstage=1
kernel=u-boot.binTo enable DFU, one has to enter follwing command:
# dfu 0 mmc 0During the development of this feature I've encountered a serious bugs in FAT write code. Over-writing discontiguous files always caused serious filesystem corruption. This was especially anoying, because the system environment is kept on FAT volume in uboot.env file, so 'saveenv' basically corrupted the boot partiting on the second call. Another bunch of the issues in the FAT write code has been revealed while removing predefined file size limit in DFU MMC code and then running sandbox tests.
I hope that my fixes for FAT code will be helpful for non-RPi users too.
Best regards
Marek Szyprowski
Samsung R&D Institute PolandChangelog:
v4:
- rechecked the FAT related fixes, it turned out that much simpler patch fixes both issues discovered while working on DFU support; added simple sandbox based tests reveleaing the issue and showing correctness of the fix
- rebased patches onto current u-boot's master branch:4b19b89ca4a8("Merge tag 'rpi-next-2020.01' of https://github.com/mbgg/u-boot")v3: https://patchwork.ozlabs.org/cover/1200793/
- fixed one more FAT issue revealed by sandbox testsv3: (patch 6/6 posted separately):
https://patchwork.ozlabs.org/patch/1195645/
- fixed non-RPi4 builds (missing #elseENV_DFU_SETTINGSdef)
- removed config.txt entity (not needed in uboot-based boot)
- switched arm64 kernel filename to 'Image'v2: https://patchwork.ozlabs.org/cover/1166589/
- added changes torpi_4_defconfigtoo (arm64 version)
- extended DFU entity list by confix.txt, cmdline.txt and Image.gz
- fixed missing '\0' at the end ofdfu_alt_infoenv
- added reviewed-by tags
- added patches for DFU MMC to remove file size limit
- added patch for fat write to fix issues on non-zero file offset (revealed by previous patch)v1: https://patchwork.ozlabs.org/cover/1162770/
- initial versionPatch summary:
Marek Szyprowski (6):
fat: write: fix broken write to fragmented files
fat: write: adjust data written in each partial write
dfu: mmc: rearrange the code
dfu: mmc: remove file size limit for io operations
usb:dwc2_udc_otg: add bcm2835 SoC (Raspberry Pi4) support
config: enable DFU over USB on Raspberry Pi4 boards
Quoted 9 lines
configs/rpi_4_32b_defconfig | 11 +++ configs/rpi_4_defconfig | 11 +++ drivers/dfu/dfu_mmc.c | 93 +++++++++++++--------- drivers/usb/gadget/dwc2_udc_otg.c | 2 + drivers/usb/gadget/dwc2_udc_otg_xfer_dma.c | 12 +-- fs/fat/fat_write.c | 8 +- include/configs/rpi.h | 20 +++++ 7 files changed, 112 insertions(+), 45 deletions(-)
Best regards,
Lukasz Majewski
--
DENX Software Engineering GmbH, Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-59 Fax: (+49)-8142-66989-80 Email: lukma at denx.de -------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 488 bytes
Desc: OpenPGP digital signature
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20200127/5d63a466/attachment.sig>