Skip to content

dfu: update dfu stack and add MTD backend

Patrick Delaunay u-boot 3 versions – New

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest15 patches 0 repliesNew
  2. v216 patches 0 repliesSuperseded
  3. v114 patches 0 repliesSuperseded

Changes in v3 from the cover letter

- Add CONFIG_DFU_SF_PART and solve compilation issue, dependancy with CONFIG_MTDPARTS
- update bad block support in erase loop
- Update loop management for erase
- rebase on v2019.10
- remove previous patch 16/16 pushed by error in v2
http://patchwork.ozlabs.org/patch/1162076/

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/15dfu: cosmetic: cleanup sf to avoid checkpatch errordrivers/dfu/dfu.c drivers/dfu/dfu_sf.c+6 -50 replies
2/15doc: dfu: Add dfu documentationdoc/README.dfu+144 -00 replies
3/15dfu: sf: add partition support for nor backenddoc/README.dfu drivers/dfu/Kconfig drivers/dfu/dfu_sf.c +1 more+67 -00 replies
4/15dfu: prepare the support of multiple interfacedrivers/dfu/dfu.c include/dfu.h+41 -120 replies
5/15dfu: allow to manage DFU on several devicescmd/dfu.c doc/README.dfu drivers/dfu/dfu.c+127 -120 replies
6/15dfu: allow read with no data without error for EOF indicationdrivers/dfu/dfu.c+2 -00 replies
7/15dfu: add backend for MTD devicedoc/README.dfu drivers/dfu/Kconfig drivers/dfu/Makefile +3 more+274 -10 replies
8/15dfu: add partition support for MTD backenddoc/README.dfu drivers/dfu/dfu_mtd.c include/dfu.h+103 -10 replies
9/15dfu: add DFU virtual backenddoc/README.dfu drivers/dfu/Kconfig drivers/dfu/Makefile +3 more+114 -20 replies
10/15dfu: add callback for flush and initiated operationdoc/README.dfu drivers/dfu/dfu.c include/dfu.h+49 -00 replies
11/15stm32mp1: activate DFU support and command MTDconfigs/stm32mp15_basic_defconfig configs/stm32mp15_optee_defconfig configs/stm32mp15_trusted_defconfig+12 -01 reply
11/15stm32mp1: activate DFU support and command MTD+0 -00 replies
12/15stm32mp1: activate SET_DFU_ALT_INFOboard/st/stm32mp1/README board/st/stm32mp1/stm32mp1.c include/configs/stm32mp1.h+194 -01 reply
12/15stm32mp1: activate SET_DFU_ALT_INFO+0 -00 replies
13/15stm32mp1: configs: activate CONFIG_MTD_SPI_NANDconfigs/stm32mp15_basic_defconfig configs/stm32mp15_optee_defconfig configs/stm32mp15_trusted_defconfig+3 -01 reply
13/15stm32mp1: configs: activate CONFIG_MTD_SPI_NAND+0 -00 replies
14/15stm32mp1: board: add spi nand supportboard/st/stm32mp1/stm32mp1.c include/configs/stm32mp1.h+37 -51 reply
14/15stm32mp1: board: add spi nand support+0 -00 replies
15/15stm32mp1: add support for virtual partition readboard/st/stm32mp1/stm32mp1.c configs/stm32mp15_basic_defconfig configs/stm32mp15_optee_defconfig +1 more+86 -01 reply
15/15stm32mp1: add support for virtual partition read+0 -00 replies

Reviews trailers per patch

12 of 20 patches have a Reviewed-by or Acked-by.

PatchLukasz MajewskiPatrice Chotard
1/15A-b
2/15R-b
3/15
4/15
5/15
6/15
7/15
8/15A-b
9/15A-b
10/15
11/15R-b
11/15R-b
12/15R-b
12/15R-b
13/15R-b
13/15R-b
14/15R-b
14/15R-b
15/15
15/15

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v3 thread

Cover letter [U-Boot] [PATCH v3 00/15] dfu: update dfu stack and add MTD backend

This serie based on v2019.10 propose updates on the DFU stack:
- add capability to have several DFU backend running in parallel
- add MTD backend for update of NAND, NOR or SPI-NAND
- add VIRTUAL backend for board/command specific behavior
- add some weak callback

This v2 patchset:
+ solves compilation for dependancy with CONFIG_CMD_MTDPARTS
+ solves bad block management for NAND in the erase loops (copied from MTD command), the previous was functional only on SPI-NAND. But I detect issue for NAND; when bad block is detected fail_addr is not updated.
See the complete analysis on the issue (reproduced in MTD command) in http://patchwork.ozlabs.org/patch/1165056/
"cmd: mtd: solve bad block support in erase command" The better solution is a MTD backport from Linux, but udpate the loop is functional for SPI-NAND and NAND.

To test the new features and as example, I update the stm32mp1 board to use the new features; I test them with the command "dfu 0" (for test I have dependency with patch
http://patchwork.ozlabs.org/patch/1162076/)

The expected target of the dfu part for this serie is v2020.01. I will merge the stm32mp1 part when they will be accepted by dfu maintainers.

This serie prepares the DFU backend for the coming 'stm32prog' command and for STM32CubeProgrammer on stm32mp1 platform.
This STMicroelectronics tool is based on DFU protocol and allows to update all the boot devices and the OTPs on the ST boards (so several DFU target in parallel, including spi nand).

Build result for dfu_v3 branch can be found in
https://travis-ci.org/patrickdelaunay/u-boot/builds/596684593

only one error for sheevaplug, but not reproduced on my side

arm: + sheevaplug
+u-boot.kwb exceeds file size limit:

+  limit:  524288 bytes
+  actual: 524320 bytes
+  excess: 32 bytes

$> tools/buildman/buildman sheevaplug

boards.cfg is up to date. Nothing to do.
Building current source for 1 boards (1 thread, 12 jobs per thread)
arm: w+ sheevaplug
+===================== WARNING ====================== +This board does not use CONFIG_DM_MMC. Please update +the board to use CONFIG_DM_MMC before the v2019.04 release. +Failure to update by the deadline may result in board removal. +See doc/driver-model/MIGRATION.txt for more info.
+====================================================
+This board does not use CONFIG_DM_USB. Please update +the board to use CONFIG_DM_USB before the v2019.07 release. +This board does use CONFIG_MVSATA_IDE which is not +ported to driver-model (DM) yet. Please update the storage +controller driver to use CONFIG_AHCI before the v2019.07 +release.
+This board does not use CONFIG_DM_ETH (Driver Model +for Ethernet drivers). Please update the board to use +CONFIG_DM_ETH before the v2020.07 release. Failure to +update by the deadline may result in board removal. +See doc/driver-model/migration.rst for more info.
0 1 0 /1 sheevaplug

Regards

Patrick

Changes in v3:
- Add CONFIG_DFU_SF_PART and solve compilation issue, dependancy with CONFIG_MTDPARTS
- update bad block support in erase loop
- Update loop management for erase
- rebase on v2019.10
- remove previous patch 16/16 pushed by error in v2
http://patchwork.ozlabs.org/patch/1162076/

Changes in v2:
- Add dfu documentation
- Update dfu documentation for callbacks
- Add dfu documentation for several device
- Update commit message
- Update commit message
- Update dfu documentation for MTD
- Update dfu documentation for MTD
- Update dfu documentation for virtual backend
- Update dfu documentation for callbacks
- Update callbacks comment after Lukasz review
- Update after Lukasz Majewski comments

Patrick Delaunay (15):
dfu: cosmetic: cleanup sf to avoid checkpatch error
doc: dfu: Add dfu documentation
dfu: sf: add partition support for nor backend
dfu: prepare the support of multiple interface
dfu: allow to manage DFU on several devices
dfu: allow read with no data without error for EOF indication
dfu: add backend for MTD device
dfu: add partition support for MTD backend
dfu: add DFU virtual backend
dfu: add callback for flush and initiated operation
stm32mp1: activate DFU support and command MTD
stm32mp1: activate SET_DFU_ALT_INFO
stm32mp1: configs: activate CONFIG_MTD_SPI_NAND
stm32mp1: board: add spi nand support
stm32mp1: add support for virtual partition read

 board/st/stm32mp1/README            | 111 ++++++++++
 board/st/stm32mp1/stm32mp1.c        | 164 ++++++++++++++-
 cmd/dfu.c                           |  21 +-
 configs/stm32mp15_basic_defconfig   |   6 +
 configs/stm32mp15_optee_defconfig   |   6 +
 configs/stm32mp15_trusted_defconfig |   6 +
 doc/README.dfu                      | 270 ++++++++++++++++++++++++
 drivers/dfu/Kconfig                 |  21 ++
 drivers/dfu/Makefile                |   2 +
 drivers/dfu/dfu.c                   | 145 +++++++++++--
 drivers/dfu/dfu_mtd.c               | 311 ++++++++++++++++++++++++++++
 drivers/dfu/dfu_sf.c                |  56 ++++-
 drivers/dfu/dfu_virt.c              |  49 +++++
 include/configs/stm32mp1.h          |  42 +++-
 include/dfu.h                       |  71 +++++++
 15 files changed, 1251 insertions(+), 30 deletions(-)
 create mode 100644 doc/README.dfu
 create mode 100644 drivers/dfu/dfu_mtd.c
 create mode 100644 drivers/dfu/dfu_virt.c
Signature · 1 line
2.17.1