diff mbox series

[1/2] arm-bsp/u-boot:corstone1000: add unique guid for fvp and mps3

Message ID 20240410150744.53421-2-anusmita.duttamazumder@arm.com
State New
Headers show
Series arm-bsp/corstone1000: add unique guid for fvp and | expand

Commit Message

anusmita.duttamazumder@arm.com April 10, 2024, 3:07 p.m. UTC
From: Anusmita Dutta Mazumder <anusmita.duttamazumder@arm.com>

This patch in U-boot sets unique GUID for Corstone1000 FVP and MPS3

Signed-off-by: Anusmita Dutta Mazumder <anusmita.duttamazumder@arm.com>
---
 .../documentation/corstone1000/user-guide.rst |  4 +-
 .../u-boot/u-boot-corstone1000.inc            |  1 +
 ...000-set-unique-GUID-for-fvp-and-mps3.patch | 57 +++++++++++++++++++
 3 files changed, 60 insertions(+), 2 deletions(-)
 create mode 100644 meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0044-corstone1000-set-unique-GUID-for-fvp-and-mps3.patch
diff mbox series

Patch

diff --git a/meta-arm-bsp/documentation/corstone1000/user-guide.rst b/meta-arm-bsp/documentation/corstone1000/user-guide.rst
index dc1d1023..06353b5d 100644
--- a/meta-arm-bsp/documentation/corstone1000/user-guide.rst
+++ b/meta-arm-bsp/documentation/corstone1000/user-guide.rst
@@ -735,11 +735,11 @@  generate a UEFI capsule.
    cd <_workspace>
 
    ./u-boot/tools/mkeficapsule --monotonic-count 1 --private-key build/tmp/deploy/images/corstone1000-mps3/corstone1000_capsule_key.key \
-   --certificate build/tmp/deploy/images/corstone1000-mps3/corstone1000_capsule_cert.crt --index 1 --guid 989f3a4e-46e0-4cd0-9877-a25c70c01329 \
+   --certificate build/tmp/deploy/images/corstone1000-mps3/corstone1000_capsule_cert.crt --index 1 --guid df1865d1-90fb-4d59-9c38-c9f2c1bba8cc \
    --fw-version 6 build/tmp/deploy/images/corstone1000-mps3/corstone1000_image.nopt cs1k_cap_mps3_v6
 
    ./u-boot/tools/mkeficapsule --monotonic-count 1 --private-key build/tmp/deploy/images/corstone1000-mps3/corstone1000_capsule_key.key \
-   --certificate build/tmp/deploy/images/corstone1000-mps3/corstone1000_capsule_cert.crt --index 1 --guid 989f3a4e-46e0-4cd0-9877-a25c70c01329 \
+   --certificate build/tmp/deploy/images/corstone1000-mps3/corstone1000_capsule_cert.crt --index 1 --guid df1865d1-90fb-4d59-9c38-c9f2c1bba8cc \
    --fw-version 5 build/tmp/deploy/images/corstone1000-mps3/corstone1000_image.nopt cs1k_cap_mps3_v5
 
 Generating FVP Capsules
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-corstone1000.inc b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-corstone1000.inc
index c7172d6f..c0a029e9 100644
--- a/meta-arm-bsp/recipes-bsp/u-boot/u-boot-corstone1000.inc
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot-corstone1000.inc
@@ -59,6 +59,7 @@  SRC_URI:append = " \
     file://0041-scatter-gather-flag-workaround.patch			  \
     file://0042-corstone1000-enable-virtio-net-support.patch		  \
     file://0043-firmware-psci-Fix-bind_smccc_features-psci-check.patch		  \
+    file://0044-corstone1000-set-unique-GUID-for-fvp-and-mps3.patch		  \
     "
 
 do_configure:append() {
diff --git a/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0044-corstone1000-set-unique-GUID-for-fvp-and-mps3.patch b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0044-corstone1000-set-unique-GUID-for-fvp-and-mps3.patch
new file mode 100644
index 00000000..86b1071c
--- /dev/null
+++ b/meta-arm-bsp/recipes-bsp/u-boot/u-boot/corstone1000/0044-corstone1000-set-unique-GUID-for-fvp-and-mps3.patch
@@ -0,0 +1,57 @@ 
+From 6dc17c01df592f685636e34ad8bb0a6ecb994e15 Mon Sep 17 00:00:00 2001
+From: Anusmita Dutta Mazumder <anusmita.duttamazumder@arm.com>
+Date: Thu, 21 Mar 2024 20:34:46 +0000
+Subject: [PATCH] corstone1000: set unique GUID for fvp and mps3
+
+This patch sets unique GUID for Corstone1000 FVP and MPS3
+
+Upstream-Status: Inappropriate [Redesign of Capsule update interface is required]
+Signed-off-by: Anusmita Dutta Mazumder <anusmita.duttamazumder@arm.com>
+---
+ lib/efi_loader/efi_firmware.c | 15 +++++++++++++--
+ 1 file changed, 13 insertions(+), 2 deletions(-)
+
+diff --git a/lib/efi_loader/efi_firmware.c b/lib/efi_loader/efi_firmware.c
+index 7792a6aa83..1e49f79864 100644
+--- a/lib/efi_loader/efi_firmware.c
++++ b/lib/efi_loader/efi_firmware.c
+@@ -16,16 +16,19 @@
+ 
+ #include <linux/list.h>
+ #include <efi_variable.h>
++#include <generated/dt.h>
+ 
+ #define FMP_PAYLOAD_HDR_SIGNATURE	SIGNATURE_32('M', 'S', 'S', '1')
+ 
+ #if CONFIG_IS_ENABLED(TARGET_CORSTONE1000)
+ /* Firmware GUID */
+-#define EFI_CORSTONE1000_FIRMWARE_GUID \
++#define EFI_CORSTONE1000_FIRMWARE_GUID_FVP \
+ 	EFI_GUID(0x989f3a4e, 0x46e0, 0x4cd0, 0x98, 0x77, \
+ 		 0xa2, 0x5c, 0x70, 0xc0, 0x13, 0x29)
+ 
+-efi_guid_t corstone1000_firmware_guid = EFI_CORSTONE1000_FIRMWARE_GUID;
++#define EFI_CORSTONE1000_FIRMWARE_GUID_MPS3 \
++	EFI_GUID(0xdf1865d1, 0x90fb, 0x4d59, 0x9c, 0x38, \
++		 0xc9, 0xf2, 0xc1, 0xbb, 0xa8, 0xcc)
+ 
+ static efi_status_t efi_corstone1000_img_info_get (
+ 	efi_uintn_t *image_info_size,
+@@ -334,6 +337,14 @@ efi_status_t EFIAPI efi_firmware_get_image_info(
+ 	u16 **package_version_name)
+ {
+ 	efi_status_t ret;
++	efi_guid_t corstone1000_firmware_guid;
++	const char *cmp_dtb = DEVICE_TREE;
++	
++	if (!strcmp(cmp_dtb, "corstone1000-fvp")) {
++		corstone1000_firmware_guid = (efi_guid_t)EFI_CORSTONE1000_FIRMWARE_GUID_FVP;
++	} else {
++		corstone1000_firmware_guid = (efi_guid_t)EFI_CORSTONE1000_FIRMWARE_GUID_MPS3;
++	}
+ 
+ 	EFI_ENTRY("%p %p %p %p %p %p %p %p\n", this,
+ 		  image_info_size, image_info,
+-- 
+2.38.1
+