Provide guidance for testing capsule updates on arm64, matching the
equivalent sections for qemu-x86 and qemu-riscv.

Signed-off-by: Elliot Berman <[email protected]>
---
 doc/board/emulation/qemu-arm.rst | 32 ++++++++++++++++++++++++++++++++
 1 file changed, 32 insertions(+)

diff --git a/doc/board/emulation/qemu-arm.rst b/doc/board/emulation/qemu-arm.rst
index 9e993ca9783..f2ecb98ebbc 100644
--- a/doc/board/emulation/qemu-arm.rst
+++ b/doc/board/emulation/qemu-arm.rst
@@ -178,6 +178,38 @@ can be enabled with the following command line parameters:
 
 These have been tested in QEMU 2.9.0 but should work in at least 2.5.0 as well.
 
+Running as flash binary
+-----------------------
+
+Running U-Boot from emulated flash lets QEMU write a new image back to the ROM.
+This allows EFI capsule updates to be tested. To create a U-Boot binary that 
can
+accept capsule updates, build qemu-arm64_defconfig with::
+
+    CONFIG_EFI_CAPSULE_ON_DISK=y
+    CONFIG_EFI_CAPSULE_FIRMWARE_RAW=y
+
+See :ref:`uefi_capsule_update_ref` for the full set of capsule options and the
+general update procedure.
+
+The QEMU virt machine has a 64 MiB flash bank, so pad u-boot.bin to that size::
+
+    truncate -s 64M u-boot.bin
+
+Instead of the '-bios' option, attach u-boot.bin as writable pflash::
+
+    qemu-system-aarch64 -machine virt -nographic -cpu cortex-a57 \
+    -drive if=pflash,format=raw,index=0,file=u-boot.bin,readonly=off
+
+Generate a capsule with mkeficapsule, using the image GUID for the target (see
+'board/emulation/qemu-arm/qemu-arm.c')::
+
+    mkeficapsule --index 1 --guid 058b7d83-50d5-4c47-a195-60d86ad341c4 \
+        u-boot.bin uboot.capsule
+
+Place the capsule under '\EFI\UpdateCapsule' on the EFI system partition and
+reboot to apply it; see :ref:`uefi_capsule_update_ref` for the OsIndications 
and
+authentication details.
+
 Booting distros
 ---------------
 

-- 
2.54.0

Reply via email to