On 2024/11/19 08:12, Jonas Karlman wrote:
After the commit 788cf33315c7 ("efi: add a helper to generate dynamic
UUIDs") update_info.num_images must match number of valid update images.

On Rock Pi 4 following Synchronous Abort can be observed due to fw_name
being NULL:

   Scanning global bootmeth 'efi_mgr':
   "Synchronous Abort" handler, esr 0x96000010, far 0x0
   elr: 0000000000200e28 lr : 000000000028adb8 (reloc)
   elr: 00000000f3efbe28 lr : 00000000f3f85db8
   x0 : 0000000000000000 x1 : ffffffffffffffff
   x2 : 0000000000000000 x3 : 000000000000000e
   x4 : 0000000000000000 x5 : 00000000f1ef0d78
   x6 : 00000000f3fb3b90 x7 : 0000000000000044
   x8 : 0000000000000010 x9 : 0000000000000031
   x10: 00000000f0ea3fff x11: 00000000f1f29e00
   x12: 0000000000000002 x13: fffffffffffff000
   x14: 00000000f1f29e00 x15: 0000000000000018
   x16: 00000000f3f44f7c x17: 0000000000000000
   x18: 00000000f1ef2de0 x19: 00000000f0ea3040
   x20: 00000000f3ff53d8 x21: 00000000f3fd0498
   x22: 0000000000000000 x23: 00000000f1edb960
   x24: 00000000f1edb95f x25: 00000000f1edb990
   x26: 00000000f1edb964 x27: 00000000f1edb998
   x28: 00000000f1edc1ec x29: 00000000f1edb820

   Code: aa0003e2 d2800000 eb01001f 54000060 (78607843)
   Resetting CPU ...

   resetting ...

Fix this by setting update_info.num_images to 0 when no valid update
images is added to update_info.

Signed-off-by: Jonas Karlman <jo...@kwiboo.se>
Reviewed-by: Kever Yang <kever.y...@rock-chips.com>

Thanks,
- Kever
---
  board/radxa/rockpi4-rk3399/rockpi4-rk3399.c | 2 ++
  1 file changed, 2 insertions(+)

diff --git a/board/radxa/rockpi4-rk3399/rockpi4-rk3399.c 
b/board/radxa/rockpi4-rk3399/rockpi4-rk3399.c
index fd827467b30a..856b434df36d 100644
--- a/board/radxa/rockpi4-rk3399/rockpi4-rk3399.c
+++ b/board/radxa/rockpi4-rk3399/rockpi4-rk3399.c
@@ -52,6 +52,8 @@ void rockchip_capsule_update_board_setup(void)
fw_images[0].fw_name = u"ROCKPI4C-IDBLOADER";
                fw_images[1].fw_name = u"ROCKPI4C-UBOOT";
+       } else {
+               update_info.num_images = 0;
        }
  }
  #endif /* CONFIG_EFI_HAVE_CAPSULE_SUPPORT && CONFIG_EFI_PARTITION */

Reply via email to