All of lore.kernel.org
 help / color / mirror / Atom feed
* [RFC PATCH 00/14] FWU: Add FWU Multi Bank Update for DeveloerBox
@ 2022-01-20 15:29 Masami Hiramatsu
  2022-01-20 15:29 ` [RFC PATCH 01/14] DFU: Do not copy the entity name over the buffer size Masami Hiramatsu
                   ` (13 more replies)
  0 siblings, 14 replies; 23+ messages in thread
From: Masami Hiramatsu @ 2022-01-20 15:29 UTC (permalink / raw)
  To: u-boot
  Cc: Masami Hiramatsu, Patrick Delaunay, Patrice Chotard,
	Heinrich Schuchardt, Alexander Graf, AKASHI Takahiro,
	Simon Glass, Bin Meng, Ilias Apalodimas, Jose Marinho,
	Grant Likely, Tom Rini, Etienne Carriere, Sughosh Ganu, Paul Liu

Hi,

Here is an RFC series of patches for the FWU Multi Bank Update
support for the DeveloperBox platform. This series depends on
Sughosh's Multi Bank Update v3 [1]. Thus if that is updated,
this must be rebased and updated too.

[1] https://patchwork.ozlabs.org/project/uboot/list/?series=281875

This series includes my previous DFU updates[2] as [01/14]-[05/14],
which is still under review in the U-Boot ML. For "nicely" indent
the dfu_alt_info lines, I need that series. :-)

[2] https://patchwork.ozlabs.org/project/uboot/list/?series=275293

I also added some patches which updates Sughosh's series as [06/14]
- [08/14]. Thus the [09/14] - [14/14] are the changes for DeveloperBox.

Unlike the STM32MP board, DeveloperBox (SynQuacer) loads the firmware
from SPI NOR flash. Thus it doesn't use GPT partitions to store the
firmware banks and the FWU metadata. Instead, it stores those data
at fixed address areas on SPI NOR flash. I carefully chose the areas
which doesn't overlap the previous firmware and EDK2.

I introduced fwu_metadata_sf.c driver for this FWU multi bank support
on SPI flash, which does not use GPT too.

Since there is no GPT, the location GUID for images and the image
GUID for banks are Null GUID. Anyway, for managing firmware image
banks, we only need the ImageType GUID.

And the SynQuacer also does not have any non-volatile register.
Thus this allocates the platform defined boot index on the SPI flash
too.

So, in summary, on the DeveloperBox, this FWU Multi Bank update is
only for avoidance of unexpected bricking by firmware update. If there
are multiple banks, when the user (or firmware developer) update it
with a wrong image, they can revert the wrong one. Even if it does
not boot, SCP firmware can detect it and roll back to the previous
bank. But please note that this is not "security" enhancement at all
at least on the DeveloperBox because all images are still on normal
SPI NOR flash. This is rather like a "safety" feature like a fool proof.

NOTE: To use this series, you also need to update SCP firmware[3] and
TF-A[4] on the DeveloperBox. Those are under cleaning up.

[3] https://git.linaro.org/people/masami.hiramatsu/SCP-firmware.git/
[4] https://git.linaro.org/people/masami.hiramatsu/arm-trusted-firmware.git/

Thank you,

---

Masami Hiramatsu (14):
      DFU: Do not copy the entity name over the buffer size
      DFU: Accept redundant spaces and tabs in dfu_alt_info
      DFU: Check the number of arguments and argument string strictly
      doc: usage: DFU: Fix dfu_alt_info document
      cmd/dfu: Enable 'dfu list' command without DFU_OVER_USB
      FWU: Calculate CRC32 in gpt_update_mdata()
      FWU: Free metadata copy if gpt_get_mdata() failed
      FWU: Move FWU metadata operation code in fwu_mdata.c
      synquacer: Update for TBBR based new FIP layout
      FWU: Reboot soon after successfully install the new firmware
      FWU: Add FWU Multi Bank Update on SPI Flash
      FWU: synquacer: Add FWU Multi bank update support for DeveloperBox
      FWU: synquacer: Initialize broken metadata
      configs: synquacer: Add FWU support for DeveloperBox


 .../dts/synquacer-sc2a11-developerbox-u-boot.dtsi  |   26 +-
 board/socionext/developerbox/Kconfig               |   31 +++
 board/socionext/developerbox/Makefile              |    1 
 board/socionext/developerbox/fwu_plat.c            |  217 ++++++++++++++++++
 cmd/dfu.c                                          |    6 
 configs/synquacer_developerbox_defconfig           |   12 +
 doc/usage/dfu.rst                                  |   45 +++-
 drivers/dfu/dfu.c                                  |   37 ++-
 drivers/dfu/dfu_mmc.c                              |   55 +++--
 drivers/dfu/dfu_mtd.c                              |   34 ++-
 drivers/dfu/dfu_nand.c                             |   34 ++-
 drivers/dfu/dfu_ram.c                              |   24 +-
 drivers/dfu/dfu_sf.c                               |   34 ++-
 drivers/dfu/dfu_virt.c                             |    5 
 include/configs/synquacer.h                        |   14 +
 include/dfu.h                                      |   33 ++-
 include/efi_loader.h                               |    3 
 include/fwu.h                                      |   22 +-
 lib/efi_loader/efi_capsule.c                       |   10 +
 lib/efi_loader/efi_firmware.c                      |   14 +
 lib/fwu_updates/Kconfig                            |   43 ++++
 lib/fwu_updates/Makefile                           |    5 
 lib/fwu_updates/fwu_mdata.c                        |  123 ++++++----
 lib/fwu_updates/fwu_mdata_gpt_blk.c                |  109 +--------
 lib/fwu_updates/fwu_mdata_sf.c                     |  241 ++++++++++++++++++++
 25 files changed, 888 insertions(+), 290 deletions(-)
 create mode 100644 board/socionext/developerbox/fwu_plat.c
 create mode 100644 lib/fwu_updates/fwu_mdata_sf.c

--
Masami Hiramatsu <masami.hiramatsu@linaro.org>

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

end of thread, other threads:[~2022-01-21  7:09 UTC | newest]

Thread overview: 23+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-01-20 15:29 [RFC PATCH 00/14] FWU: Add FWU Multi Bank Update for DeveloerBox Masami Hiramatsu
2022-01-20 15:29 ` [RFC PATCH 01/14] DFU: Do not copy the entity name over the buffer size Masami Hiramatsu
2022-01-20 15:29 ` [RFC PATCH 02/14] DFU: Accept redundant spaces and tabs in dfu_alt_info Masami Hiramatsu
2022-01-20 15:29 ` [RFC PATCH 03/14] DFU: Check the number of arguments and argument string strictly Masami Hiramatsu
2022-01-20 15:30 ` [RFC PATCH 04/14] doc: usage: DFU: Fix dfu_alt_info document Masami Hiramatsu
2022-01-20 15:30 ` [RFC PATCH 05/14] cmd/dfu: Enable 'dfu list' command without DFU_OVER_USB Masami Hiramatsu
2022-01-20 15:30 ` [RFC PATCH 06/14] FWU: Calculate CRC32 in gpt_update_mdata() Masami Hiramatsu
2022-01-20 15:30 ` [RFC PATCH 07/14] FWU: Free metadata copy if gpt_get_mdata() failed Masami Hiramatsu
2022-01-20 15:30 ` [RFC PATCH 08/14] FWU: Move FWU metadata operation code in fwu_mdata.c Masami Hiramatsu
2022-01-20 15:30 ` [RFC PATCH 09/14] synquacer: Update for TBBR based new FIP layout Masami Hiramatsu
2022-01-20 15:31 ` [RFC PATCH 10/14] FWU: Reboot soon after successfully install the new firmware Masami Hiramatsu
2022-01-21  1:46   ` AKASHI Takahiro
2022-01-21  4:35     ` Masami Hiramatsu
2022-01-21  6:54       ` Masami Hiramatsu
2022-01-21  7:08         ` AKASHI Takahiro
2022-01-20 15:31 ` [RFC PATCH 11/14] FWU: Add FWU Multi Bank Update on SPI Flash Masami Hiramatsu
2022-01-21  2:20   ` AKASHI Takahiro
2022-01-21  4:41     ` Masami Hiramatsu
2022-01-20 15:31 ` [RFC PATCH 12/14] FWU: synquacer: Add FWU Multi bank update support for DeveloperBox Masami Hiramatsu
2022-01-21  2:22   ` AKASHI Takahiro
2022-01-21  4:40     ` Masami Hiramatsu
2022-01-20 15:31 ` [RFC PATCH 13/14] FWU: synquacer: Initialize broken metadata Masami Hiramatsu
2022-01-20 15:31 ` [RFC PATCH 14/14] configs: synquacer: Add FWU support for DeveloperBox Masami Hiramatsu

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.