Skip to content

DFU initial implementation

Andrzej Pietrasiewicz u-boot 2 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest4 patches 0 repliesNew
  2. v11 patch 0 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/4dfu: protocol initial implementationdrivers/usb/gadget/Makefile drivers/usb/gadget/dfu.c drivers/usb/gadget/dfu.h +2 more+1159 -00 replies
2/4dfu: generic backend partsMakefile drivers/usb/dfu/Makefile drivers/usb/dfu/dfu.c +4 more+464 -01 reply
2/4dfu: generic backend parts+0 -015 replies
3/4dfu: command implementationcommon/Makefile common/cmd_dfu.c+52 -00 replies
4/4dfu: target-specific implementation for Goniboard/samsung/goni/Makefile board/samsung/goni/flash.c board/samsung/goni/flash.h +2 more+392 -00 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v2 yet.

Read the v2 thread

Cover letter [U-Boot] [PATCH v2 0/4] DFU initial implementation

Dear All,

This is a quick-and-dirty proof-of-concept for splitting the dfu into core dfu gadget, generic parts of dfu backend, dfu command and target-specific implementation for Goni.

This patch definitely needs some coding style cleanups.

Also, the place for storing generic parts of dfu was chosen somewhat arbitrary and can be changed if a better alternative is found.

The original idea of the flash_entity was to equip it with a void * to a context structure, which is not interpreted by the dfu gadget but passed to the dfu backend and understood there. I am still hesitating if flash_entity_ctx is generic enough to be generalized, as of now I assumed it is. If it wasn't then less common code could be extracted.

@Stefan: you need the first 3 patches from this series, and then you need to implement your own target-specific parts. In fact, all is expected from the target, is to provide board_dfu_init/cleanup pair and call register_flash_entities.

Andrzej Pietrasiewicz (4):
dfu: protocol initial implementation
dfu: generic backend parts
dfu: command implementation
dfu: target-specific implementation for Goni

 Makefile                    |    1 +
 board/samsung/goni/Makefile |    2 +
 board/samsung/goni/flash.c  |  341 ++++++++++++++++
 board/samsung/goni/flash.h  |   28 ++
 board/samsung/goni/goni.c   |   17 +
 common/Makefile             |    1 +
 common/cmd_dfu.c            |   51 +++
 drivers/usb/dfu/Makefile    |   33 ++
 drivers/usb/dfu/dfu.c       |  109 +++++
 drivers/usb/dfu/fat.c       |   77 ++++
 drivers/usb/dfu/mmc.c       |  124 ++++++
 drivers/usb/gadget/Makefile |    1 +
 drivers/usb/gadget/dfu.c    |  920 +++++++++++++++++++++++++++++++++++++++++++
 drivers/usb/gadget/dfu.h    |  171 ++++++++
 include/configs/s5p_goni.h  |    4 +
 include/dfu.h               |   28 ++
 include/dfu_backend.h       |   71 ++++
 include/flash_entity.h      |   39 ++
 include/mbr.h               |   49 +++
 19 files changed, 2067 insertions(+), 0 deletions(-)
 create mode 100644 board/samsung/goni/flash.c
 create mode 100644 board/samsung/goni/flash.h
 create mode 100644 common/cmd_dfu.c
 create mode 100644 drivers/usb/dfu/Makefile
 create mode 100644 drivers/usb/dfu/dfu.c
 create mode 100644 drivers/usb/dfu/fat.c
 create mode 100644 drivers/usb/dfu/mmc.c
 create mode 100644 drivers/usb/gadget/dfu.c
 create mode 100644 drivers/usb/gadget/dfu.h
 create mode 100644 include/dfu.h
 create mode 100644 include/dfu_backend.h
 create mode 100644 include/flash_entity.h
 create mode 100644 include/mbr.h