
On Tue, 17 Mar 2020 at 07:42, AKASHI Takahiro takahiro.akashi@linaro.org wrote:
Summary
'UpdateCapsule' is one of runtime services defined in UEFI specification and its aim is to allow a caller to pass information to the firmware. This is mostly used to update firmware binary on devices by instructions from OS.
In this patch series, all the related definitions and structures are given as UEFI specification describes and basic framework for capsule support is implemented. Currently supported types of capsule are
- firmware update (Firmware Management Protocol or simply FMP)
- variable update
UpdateCapsule is a runtime services function, but is, at least initially, provided only before exiting boot services alike other runtime functions. This is because modifying storage which may be shared with OS must be carefully designed and there is no general assumption to do that as in the case of [Get/]SetVariable. Instead, any capsule can be handed over to the firmware as a file on a specific file system. In other words, we only support "capsules on disk" for now.
Regarding firmware update, most of functionality is provided by FMP driver and it will be by nature system/platform-specific. So you can and should implement FMP drivers based on your system requirements. In this patch series, only a simple FMP driver based on FIT image for a single region is supported. (So it is "for reference only") See more details in "efi_loader: capsule: add simple firmware management protocol."
Regarding variable update, the implementation here is based on a draft proposal[1] by Peter in Boot-arch ML. The specification should be discussed and finalized first. So the code doesn't fully implement Peter's idea.
[1] https://lists.linaro.org/pipermail/boot-architecture/2018-October/000883.htm...
Patch structure
Patch#1-#4: preparatory patches Patch#5-#11: main part of implementation Patch#12-#14: utilities and tests
With the changes that I suggested in a couple of patches, I am able to test the capsule-on-disk update of the u-boot firmware image on the qemu arm64 platform. I have also tested the capsule update functionality via the 'efidebug capsule update -v <capsule address>' command. Thanks!
-sughosh