All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v5 00/23] FWU: Add FWU Multi Bank Update feature support
@ 2022-06-09 12:29 Sughosh Ganu
  2022-06-09 12:29 ` [PATCH v5 01/23] dt/bindings: Add bindings for FWU Metadata storage device Sughosh Ganu
                   ` (23 more replies)
  0 siblings, 24 replies; 104+ messages in thread
From: Sughosh Ganu @ 2022-06-09 12:29 UTC (permalink / raw)
  To: u-boot
  Cc: Heinrich Schuchardt, Ilias Apalodimas, Takahiro Akashi,
	Patrick Delaunay, Patrice Chotard, Simon Glass, Bin Meng,
	Tom Rini, Etienne Carriere, Michal Simek, Jassi Brar


The patchset adds support for the FWU Multi Bank Update[1]
feature. Certain aspects of the Dependable Boot[2] specification have
also been implemented.

The FWU multi bank update feature is used for supporting multiple
sets(also called banks) of firmware image(s), allowing the platform to
boot from a different bank, in case it fails to boot from the active
bank. This functionality is supported by keeping the relevant
information in a structure called metadata, which provides information
on the images. Among other parameters, the metadata structure contains
information on the currect active bank that is being used to boot
image(s).

Functionality is being added to work with the UEFI capsule driver in
u-boot. The metadata is read to gather information on the update bank,
which is the bank to which the firmware images would be flashed to. On
a successful completion of the update of all components, the active
bank field in the metadata is updated, to reflect the bank from which
the platform will boot on the subsequent boots.

Currently, the feature is being enabled on the STM32MP157C-DK2 and
Synquacer boards. The DK2 board boots a FIP image from a uSD card
partitioned with the GPT partioning scheme, while the Synquacer board
boots a FIP image from a MTD partitioned SPI NOR flash device.

This feature also requires changes in a previous stage of
bootloader, which parses the metadata and selects the bank to boot the
image(s) from. Support has being added in tf-a(BL2 stage) for the
STM32MP157C-DK2 board to boot the active bank images. These changes 
have been merged to the upstream tf-a repository.

Earlier, two separate patchsets were being sent. The patchset sent by
me was adding support for the feature, and enabling the feature on the
ST board. The other set of patches were being sent by Masami
Hiramatsu, which were enabling the feature on the Synquacer
platform. This patchset contains both set of patches, along with the
associated documentation and the python test script for testing the
feature.

The upstreaming effort for this feature had been put on a temporary
hold to address the fixing of some issues in the capsule update code,
primarily using a per platform image GUID for the updatable
images. Now that the series has been merged, upstreaming effort for
the FWU update feature is being resumed. Hence, this version does not
have any review comments being addressed.


[1] - https://developer.arm.com/documentation/den0118/a
[2] - https://git.codelinaro.org/linaro/dependable-boot/mbfw/uploads/6f7ddfe3be24e18d4319e108a758d02e/mbfw.pdf

Jassi Brar (1):
  developerbox: synquacer: Use FIP as the updatable image

Masami Hiramatsu (9):
  FWU: Add FWU metadata access driver for non-GPT MTD devices
  dt/bindings: firmware: Add FWU metadata on MTD devices binding
  tools: Add mkfwumdata tool for FWU metadata image
  FWU: doc: Update documentation for the FWU non-GPT MTD
  synquacer: Update for TBBR (BL2) based new FIP layout
  FWU: synquacer: Add FWU Multi bank update support for DeveloperBox
  FWU: synquacer: Generate dfu_alt_info from devicetree partition
  doc: synquacer: Add how to enable FWU Multi Bank Update
  [TEMP]configs: synquacer: Add FWU support for DeveloperBox

Sughosh Ganu (13):
  dt/bindings: Add bindings for FWU Metadata storage device
  FWU: Add FWU metadata structure and driver for accessing metadata
  FWU: Add FWU metadata access driver for GPT partitioned block devices
  stm32mp1: dk2: Add a node for the FWU metadata device
  stm32mp1: dk2: Add image information for capsule updates
  FWU: stm32mp1: Add helper functions for accessing FWU metadata
  FWU: STM32MP1: Add support to read boot index from backup register
  FWU: Add boot time checks as highlighted by the FWU specification
  FWU: Add support for the FWU Multi Bank Update feature
  FWU: cmd: Add a command to read FWU metadata
  mkeficapsule: Add support for generating empty capsules
  FWU: doc: Add documentation for the FWU feature
  sandbox: fwu: Add support for testing FWU feature on sandbox

 arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi      |   7 +
 .../synquacer-sc2a11-developerbox-u-boot.dtsi |  40 +-
 arch/arm/mach-stm32mp/include/mach/stm32.h    |   4 +
 arch/sandbox/Kconfig                          |   6 +
 arch/sandbox/dts/test.dts                     |  45 +-
 board/sandbox/sandbox.c                       |  49 ++
 board/socionext/developerbox/Kconfig          |  14 +
 board/socionext/developerbox/Makefile         |   1 +
 board/socionext/developerbox/developerbox.c   |  17 +-
 board/socionext/developerbox/fwu_plat.c       | 200 ++++++++
 board/st/stm32mp1/stm32mp1.c                  | 141 ++++++
 cmd/Kconfig                                   |   7 +
 cmd/Makefile                                  |   1 +
 cmd/fwu_mdata.c                               |  74 +++
 common/board_r.c                              |   5 +
 configs/sandbox64_defconfig                   |  12 +-
 configs/synquacer_developerbox_defconfig      |  10 +-
 doc/board/socionext/developerbox.rst          | 110 +++++
 doc/develop/uefi/fwu_updates.rst              | 200 ++++++++
 doc/develop/uefi/index.rst                    |   1 +
 doc/develop/uefi/uefi.rst                     |   2 +
 .../firmware/fwu-mdata.txt                    |  18 +
 .../firmware/uboot,fwu-mdata-mtd.yaml         |  38 ++
 doc/mkeficapsule.1                            |  29 +-
 drivers/Kconfig                               |   2 +
 drivers/Makefile                              |   1 +
 drivers/fwu-mdata/Kconfig                     |  24 +
 drivers/fwu-mdata/Makefile                    |   8 +
 drivers/fwu-mdata/fwu-mdata-uclass.c          | 459 ++++++++++++++++++
 drivers/fwu-mdata/fwu_mdata_gpt_blk.c         | 404 +++++++++++++++
 drivers/fwu-mdata/fwu_mdata_mtd.c             | 308 ++++++++++++
 include/configs/stm32mp15_common.h            |   4 +
 include/configs/synquacer.h                   |  21 +-
 include/dm/uclass-id.h                        |   1 +
 include/fwu.h                                 |  74 +++
 include/fwu_mdata.h                           |  67 +++
 lib/Kconfig                                   |   6 +
 lib/Makefile                                  |   1 +
 lib/efi_loader/efi_capsule.c                  | 231 ++++++++-
 lib/efi_loader/efi_setup.c                    |   3 +-
 lib/fwu_updates/Kconfig                       |  31 ++
 lib/fwu_updates/Makefile                      |   7 +
 lib/fwu_updates/fwu.c                         | 206 ++++++++
 lib/fwu_updates/fwu_mtd.c                     | 173 +++++++
 .../test_capsule_firmware_fit.py              |   1 -
 .../py/tests/test_fwu_updates/capsule_defs.py |  10 +
 test/py/tests/test_fwu_updates/conftest.py    |  78 +++
 .../test_fwu_updates/test_fwu_updates.py      | 367 ++++++++++++++
 tools/Kconfig                                 |   9 +
 tools/Makefile                                |   4 +
 tools/eficapsule.h                            |   8 +
 tools/mkeficapsule.c                          | 139 +++++-
 tools/mkfwumdata.c                            | 298 ++++++++++++
 53 files changed, 3903 insertions(+), 73 deletions(-)
 create mode 100644 board/socionext/developerbox/fwu_plat.c
 create mode 100644 cmd/fwu_mdata.c
 create mode 100644 doc/develop/uefi/fwu_updates.rst
 create mode 100644 doc/device-tree-bindings/firmware/fwu-mdata.txt
 create mode 100644 doc/device-tree-bindings/firmware/uboot,fwu-mdata-mtd.yaml
 create mode 100644 drivers/fwu-mdata/Kconfig
 create mode 100644 drivers/fwu-mdata/Makefile
 create mode 100644 drivers/fwu-mdata/fwu-mdata-uclass.c
 create mode 100644 drivers/fwu-mdata/fwu_mdata_gpt_blk.c
 create mode 100644 drivers/fwu-mdata/fwu_mdata_mtd.c
 create mode 100644 include/fwu.h
 create mode 100644 include/fwu_mdata.h
 create mode 100644 lib/fwu_updates/Kconfig
 create mode 100644 lib/fwu_updates/Makefile
 create mode 100644 lib/fwu_updates/fwu.c
 create mode 100644 lib/fwu_updates/fwu_mtd.c
 create mode 100644 test/py/tests/test_fwu_updates/capsule_defs.py
 create mode 100644 test/py/tests/test_fwu_updates/conftest.py
 create mode 100644 test/py/tests/test_fwu_updates/test_fwu_updates.py
 create mode 100644 tools/mkfwumdata.c

-- 
2.25.1



^ permalink raw reply	[flat|nested] 104+ messages in thread

end of thread, other threads:[~2022-07-22 17:01 UTC | newest]

Thread overview: 104+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 12:29 [PATCH v5 00/23] FWU: Add FWU Multi Bank Update feature support Sughosh Ganu
2022-06-09 12:29 ` [PATCH v5 01/23] dt/bindings: Add bindings for FWU Metadata storage device Sughosh Ganu
2022-06-16 13:34   ` Michal Simek
2022-06-17  6:21     ` Sughosh Ganu
2022-06-09 12:29 ` [PATCH v5 02/23] FWU: Add FWU metadata structure and driver for accessing metadata Sughosh Ganu
2022-06-21 10:54   ` Etienne Carriere
2022-06-23  6:24     ` Sughosh Ganu
2022-06-23 11:55       ` Etienne Carriere
2022-06-09 12:29 ` [PATCH v5 03/23] FWU: Add FWU metadata access driver for GPT partitioned block devices Sughosh Ganu
2022-06-21  9:34   ` Patrick DELAUNAY
2022-06-22 12:39     ` Patrick DELAUNAY
2022-06-28 10:01     ` Sughosh Ganu
2022-06-21 10:55   ` Etienne Carriere
2022-06-28 10:11     ` Sughosh Ganu
2022-06-09 12:29 ` [PATCH v5 04/23] stm32mp1: dk2: Add a node for the FWU metadata device Sughosh Ganu
2022-06-21  9:36   ` Patrick DELAUNAY
2022-06-09 12:29 ` [PATCH v5 05/23] stm32mp1: dk2: Add image information for capsule updates Sughosh Ganu
2022-06-09 12:29 ` [PATCH v5 06/23] FWU: stm32mp1: Add helper functions for accessing FWU metadata Sughosh Ganu
2022-06-10 11:53   ` Ilias Apalodimas
2022-06-13 12:37     ` Sughosh Ganu
2022-06-21  9:49   ` Patrick DELAUNAY
2022-06-23  6:04     ` Sughosh Ganu
2022-06-09 12:29 ` [PATCH v5 07/23] FWU: STM32MP1: Add support to read boot index from backup register Sughosh Ganu
2022-06-10 12:02   ` Ilias Apalodimas
2022-06-21 11:27   ` Patrick DELAUNAY
2022-06-23  6:30     ` Sughosh Ganu
2022-06-09 12:29 ` [PATCH v5 08/23] FWU: Add boot time checks as highlighted by the FWU specification Sughosh Ganu
2022-06-15  6:34   ` Heinrich Schuchardt
2022-06-15  6:39     ` Takahiro Akashi
2022-06-21 10:56   ` Etienne Carriere
2022-06-23  9:45     ` Sughosh Ganu
2022-06-23 12:32       ` Etienne Carriere
2022-06-28 10:42         ` Sughosh Ganu
2022-06-21 11:46   ` Patrick DELAUNAY
2022-06-23  9:49     ` Sughosh Ganu
2022-06-09 12:29 ` [PATCH v5 09/23] FWU: Add support for the FWU Multi Bank Update feature Sughosh Ganu
2022-06-21 10:56   ` Etienne Carriere
2022-06-21 11:55   ` Patrick DELAUNAY
2022-06-09 12:29 ` [PATCH v5 10/23] FWU: cmd: Add a command to read FWU metadata Sughosh Ganu
2022-06-10 12:07   ` Ilias Apalodimas
2022-06-13 12:38     ` Sughosh Ganu
2022-06-20 12:53   ` Michal Simek
2022-06-21 12:07   ` Patrick DELAUNAY
2022-06-09 12:29 ` [PATCH v5 11/23] mkeficapsule: Add support for generating empty capsules Sughosh Ganu
2022-06-09 16:27   ` Heinrich Schuchardt
2022-06-13 12:33     ` Sughosh Ganu
2022-06-15  5:11   ` Takahiro Akashi
2022-06-15 10:49     ` Sughosh Ganu
2022-06-16  1:01       ` Takahiro Akashi
2022-06-16  7:12         ` Sughosh Ganu
2022-06-17  0:46           ` Takahiro Akashi
2022-06-17  8:01             ` Sughosh Ganu
2022-06-21 10:58   ` Etienne Carriere
2022-06-09 12:29 ` [PATCH v5 12/23] FWU: doc: Add documentation for the FWU feature Sughosh Ganu
2022-06-21 12:12   ` Patrick DELAUNAY
2022-06-09 12:30 ` [PATCH v5 13/23] FWU: Add FWU metadata access driver for non-GPT MTD devices Sughosh Ganu
2022-06-21 10:56   ` Etienne Carriere
2022-06-21 12:39   ` Patrick DELAUNAY
2022-06-09 12:30 ` [PATCH v5 14/23] dt/bindings: firmware: Add FWU metadata on MTD devices binding Sughosh Ganu
2022-06-21 10:56   ` Etienne Carriere
2022-06-21 12:26   ` Patrick DELAUNAY
2022-06-09 12:30 ` [PATCH v5 15/23] tools: Add mkfwumdata tool for FWU metadata image Sughosh Ganu
2022-06-21 10:57   ` Etienne Carriere
2022-06-21 12:59     ` Michal Simek
2022-06-21 12:55   ` Patrick DELAUNAY
2022-06-09 12:30 ` [PATCH v5 16/23] FWU: doc: Update documentation for the FWU non-GPT MTD Sughosh Ganu
2022-06-09 12:30 ` [PATCH v5 17/23] synquacer: Update for TBBR (BL2) based new FIP layout Sughosh Ganu
2022-06-09 12:30 ` [PATCH v5 18/23] developerbox: synquacer: Use FIP as the updatable image Sughosh Ganu
2022-06-09 12:30 ` [PATCH v5 19/23] FWU: synquacer: Add FWU Multi bank update support for DeveloperBox Sughosh Ganu
2022-06-17 14:00   ` Michal Simek
2022-06-20  8:23   ` Michal Simek
2022-07-18 14:43     ` Jassi Brar
2022-07-18 14:46       ` Ilias Apalodimas
2022-07-18 15:08         ` Jassi Brar
2022-07-18 15:16           ` Ilias Apalodimas
2022-07-18 15:31             ` Jassi Brar
2022-07-18 15:34               ` Ilias Apalodimas
2022-07-18 15:34               ` Jassi Brar
2022-07-18 15:37                 ` Ilias Apalodimas
2022-07-18 21:00               ` Tom Rini
2022-07-19 15:23                 ` Jassi Brar
2022-07-20  1:17                   ` Tom Rini
2022-07-19 15:27                 ` Jassi Brar
2022-07-20  7:53                   ` Ilias Apalodimas
2022-07-20 14:30                     ` Jassi Brar
2022-07-22  8:37                       ` Ilias Apalodimas
2022-07-22 17:01                         ` Jassi Brar
2022-06-09 12:30 ` [PATCH v5 20/23] FWU: synquacer: Generate dfu_alt_info from devicetree partition Sughosh Ganu
2022-06-17 14:02   ` Michal Simek
2022-07-18 14:49     ` Jassi Brar
2022-07-20  1:13       ` Takahiro Akashi
2022-07-20  3:16         ` Jassi Brar
2022-06-09 12:30 ` [PATCH v5 21/23] doc: synquacer: Add how to enable FWU Multi Bank Update Sughosh Ganu
2022-06-17 13:59   ` Michal Simek
2022-06-09 12:30 ` [PATCH v5 22/23] [TEMP]configs: synquacer: Add FWU support for DeveloperBox Sughosh Ganu
2022-06-09 12:30 ` [PATCH v5 23/23] sandbox: fwu: Add support for testing FWU feature on sandbox Sughosh Ganu
2022-06-15  5:37   ` Takahiro Akashi
2022-06-15 12:10     ` Sughosh Ganu
2022-06-17  1:08       ` Takahiro Akashi
2022-06-17  7:57         ` Sughosh Ganu
2022-06-15  6:30   ` Takahiro Akashi
2022-06-15 12:13     ` Sughosh Ganu
2022-06-20 18:12 ` [PATCH v5 00/23] FWU: Add FWU Multi Bank Update feature support Patrick DELAUNAY
2022-06-21  9:23   ` Sughosh Ganu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.