All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v4 00/11] FWU: Add support for FWU Multi Bank Update feature
@ 2022-02-07 18:19 Sughosh Ganu
  2022-02-07 18:19 ` [PATCH v4 01/11] FWU: Add FWU metadata structure and driver for accessing metadata Sughosh Ganu
                   ` (11 more replies)
  0 siblings, 12 replies; 64+ messages in thread
From: Sughosh Ganu @ 2022-02-07 18:19 UTC (permalink / raw)
  To: u-boot
  Cc: Heinrich Schuchardt, Masami Hiramatsu, Patrick Delaunay,
	Patrice Chotard, Alexander Graf, AKASHI Takahiro, Simon Glass,
	Bin Meng, Ilias Apalodimas, Jose Marinho, Grant Likely, Tom Rini,
	Etienne Carriere



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
board which boots a FIP image from a uSD card partitioned with the GPT
partioning scheme. This also requires changes in the previous stage of
bootloader, which parses the metadata and selects the bank to boot the
image(s) from. Support is 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's integration branch[3].

These patches are based on top of the series from Takahiro to add
Authentication support to mkeficapsule utility[4] and a couple of
other patches[5][6]

TODO's
------
* Add a unit test case for the newly added FWU_MDATA uclass. Some
  involved effort is needed on this since the host device interface on
  sandbox cannot be used with the UT framework.
* Add test case for the feature with the python test suite, along the
  lines of capsule update testing.

[1] - https://developer.arm.com/documentation/den0118/a
[2] - https://git.codelinaro.org/linaro/dependable-boot/mbfw/uploads/6f7ddfe3be24e18d4319e108a758d02e/mbfw.pdf
[3] - https://git.trustedfirmware.org/TF-A/trusted-firmware-a.git/log/?h=integration
[4] - https://patchwork.ozlabs.org/project/uboot/list/?series=281549
[5] - https://patchwork.ozlabs.org/project/uboot/patch/164388019634.446835.18271480521485569016.stgit@localhost/
[6] - https://patchwork.ozlabs.org/project/uboot/patch/20220129192108.6618-1-sughosh.ganu@linaro.org/


Changes since V3:
* Move the FWU metadata access to driver model
* Get the storage device containing the metadata from a device tree
  property instead of a platform helper function
* Move the metadata access driver for GPT partitioned block devices
  under drivers/fwu-mdata/ directory, complying with driver model.
* Move functionality to get the active index under the common function
  instead of the GPT block device specific driver.
* Remove function for getting the storage device containing the
  metadata as the information is now obtained from the device tree.
* Define a weak function fill_image_type_guid_array for populating the
  image descriptor array with u-boot's raw and fit image GUIDs
* Define the function fill_image_type_guid_array for the ST DK2 board
  for GPT partitioned devices.
* Change the TrialStateCtr efi variable attribute to remove the
  runtime attribute
* Rebase the change on top of the patch from Masami to call
  efi_capsule_update_firmware directly.
* Put the FWU related checks which were earlier in efi_update_capsule
  function to separate functions fwu_empty_capsule and
  fwu_empty_capsule_process.
* Use the device model api uclass_get_device to probe and get the FWU
  Metadata device.
* Add related documentation for empty capsules in the mkeficapsule man
  page.
* Add separate usage for empty capsules, with corresponding valid
  options.
* Use ternary operators where possible.
* Put a exclusivity check for the empty capsule options.


Sughosh Ganu (11):
  FWU: Add FWU metadata structure and driver for accessing metadata
  FWU: Add FWU metadata access driver for GPT partitioned block devices
  FWU: stm32mp1: Add helper functions for accessing FWU metadata
  FWU: STM32MP1: Add support to read boot index from backup register
  EFI: FMP: Add provision to update image's ImageTypeId in image
    descriptor
  stm32mp1: Populate ImageTypeId values in EFI_FIRMWARE_IMAGE_DESCRIPTOR
    array
  FWU: Add boot time checks as highlighted by the FWU specification
  FWU: Add support for 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

 arch/arm/dts/stm32mp157c-dk2-u-boot.dtsi      |   7 +
 board/st/stm32mp1/stm32mp1.c                  | 178 +++++++
 cmd/Kconfig                                   |   7 +
 cmd/Makefile                                  |   1 +
 cmd/fwu_mdata.c                               |  74 +++
 common/board_r.c                              |   6 +
 doc/develop/uefi/fwu_updates.rst              | 142 +++++
 doc/develop/uefi/index.rst                    |   1 +
 doc/develop/uefi/uefi.rst                     |   2 +
 .../firmware/fwu-mdata.txt                    |  18 +
 doc/mkeficapsule.1                            |  23 +-
 drivers/Kconfig                               |   2 +
 drivers/Makefile                              |   1 +
 drivers/fwu-mdata/Kconfig                     |  16 +
 drivers/fwu-mdata/Makefile                    |   7 +
 drivers/fwu-mdata/fwu-mdata-uclass.c          | 434 +++++++++++++++
 drivers/fwu-mdata/fwu_mdata_gpt_blk.c         | 501 ++++++++++++++++++
 include/dm/uclass-id.h                        |   1 +
 include/efi_loader.h                          |   2 +
 include/fwu.h                                 |  70 +++
 include/fwu_mdata.h                           |  67 +++
 lib/Kconfig                                   |   6 +
 lib/Makefile                                  |   1 +
 lib/efi_loader/efi_capsule.c                  | 221 +++++++-
 lib/efi_loader/efi_firmware.c                 |  71 ++-
 lib/efi_loader/efi_setup.c                    |   3 +-
 lib/fwu_updates/Kconfig                       |  31 ++
 lib/fwu_updates/Makefile                      |   6 +
 lib/fwu_updates/fwu.c                         | 204 +++++++
 tools/eficapsule.h                            |   8 +
 tools/mkeficapsule.c                          | 131 ++++-
 31 files changed, 2208 insertions(+), 34 deletions(-)
 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 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 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

-- 
2.17.1



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

end of thread, other threads:[~2022-03-09  8:32 UTC | newest]

Thread overview: 64+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-02-07 18:19 [PATCH v4 00/11] FWU: Add support for FWU Multi Bank Update feature Sughosh Ganu
2022-02-07 18:19 ` [PATCH v4 01/11] FWU: Add FWU metadata structure and driver for accessing metadata Sughosh Ganu
2022-02-08  9:33   ` Masami Hiramatsu
2022-02-08 10:24     ` Sughosh Ganu
2022-02-08 11:23       ` Masami Hiramatsu
2022-02-08 10:56   ` Michal Simek
2022-02-08 11:35     ` Sughosh Ganu
2022-02-08 11:39       ` Michal Simek
2022-02-08 13:36       ` Masami Hiramatsu
2022-02-08 13:45         ` Michal Simek
2022-02-08 14:14           ` Masami Hiramatsu
2022-02-08 14:27             ` Michal Simek
2022-02-08 23:39               ` Masami Hiramatsu
2022-02-09  7:21                 ` Michal Simek
2022-02-08 11:31   ` Michal Simek
2022-02-08 11:38     ` Sughosh Ganu
2022-02-08 11:44       ` Michal Simek
2022-02-08 11:54         ` Sughosh Ganu
2022-02-08 11:59           ` Michal Simek
2022-02-08 12:07             ` Sughosh Ganu
2022-02-08 12:14               ` Michal Simek
2022-02-08 12:49                 ` Sughosh Ganu
2022-02-07 18:19 ` [PATCH v4 02/11] FWU: Add FWU metadata access driver for GPT partitioned block devices Sughosh Ganu
2022-02-09  4:56   ` Masami Hiramatsu
2022-02-09  9:03     ` Sughosh Ganu
2022-02-09 11:47       ` Masami Hiramatsu
2022-02-09 18:40         ` Sughosh Ganu
2022-02-10  1:43           ` Masami Hiramatsu
2022-02-10  3:14             ` Masami Hiramatsu
2022-02-10 12:25               ` Sughosh Ganu
2022-02-11  1:58                 ` Masami Hiramatsu
2022-02-07 18:19 ` [PATCH v4 03/11] FWU: stm32mp1: Add helper functions for accessing FWU metadata Sughosh Ganu
2022-02-07 18:19 ` [PATCH v4 04/11] FWU: STM32MP1: Add support to read boot index from backup register Sughosh Ganu
2022-02-07 18:19 ` [PATCH v4 05/11] EFI: FMP: Add provision to update image's ImageTypeId in image descriptor Sughosh Ganu
2022-02-10  2:48   ` AKASHI Takahiro
2022-02-10  7:18     ` Sughosh Ganu
2022-02-10  7:58       ` AKASHI Takahiro
2022-02-10 10:10         ` Sughosh Ganu
2022-02-14  3:24           ` AKASHI Takahiro
2022-02-14  5:42             ` Sughosh Ganu
2022-02-15  1:51               ` AKASHI Takahiro
2022-02-15  6:38                 ` Sughosh Ganu
2022-02-15 14:40                   ` Ilias Apalodimas
2022-02-15 17:19                     ` Sughosh Ganu
2022-02-17  8:22                       ` Ilias Apalodimas
2022-02-17 10:10                         ` Sughosh Ganu
2022-02-26  6:54                           ` Heinrich Schuchardt
2022-02-26  9:54                             ` Sughosh Ganu
2022-03-08 13:13                               ` AKASHI Takahiro
2022-03-09  8:31                                 ` Ilias Apalodimas
2022-02-07 18:19 ` [PATCH v4 06/11] stm32mp1: Populate ImageTypeId values in EFI_FIRMWARE_IMAGE_DESCRIPTOR array Sughosh Ganu
2022-02-07 18:19 ` [PATCH v4 07/11] FWU: Add boot time checks as highlighted by the FWU specification Sughosh Ganu
2022-02-08 10:53   ` Michal Simek
2022-02-11 10:46     ` Sughosh Ganu
2022-02-07 18:19 ` [PATCH v4 08/11] FWU: Add support for FWU Multi Bank Update feature Sughosh Ganu
2022-02-07 18:19 ` [PATCH v4 09/11] FWU: cmd: Add a command to read FWU metadata Sughosh Ganu
2022-02-07 18:20 ` [PATCH v4 10/11] mkeficapsule: Add support for generating empty capsules Sughosh Ganu
2022-02-09  3:05   ` AKASHI Takahiro
2022-02-10  1:27     ` AKASHI Takahiro
2022-02-11 13:27       ` Sughosh Ganu
2022-02-11 13:25     ` Sughosh Ganu
2022-02-07 18:20 ` [PATCH v4 11/11] FWU: doc: Add documentation for the FWU feature Sughosh Ganu
2022-02-08 11:05 ` [PATCH v4 00/11] FWU: Add support for FWU Multi Bank Update feature Michal Simek
2022-02-08 12:09   ` 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.