On 5/10/23 09:40, Marcin Juszkiewicz wrote:

@@ -26,6 +36,9 @@ InitializeSbsaQemuPlatformDxe (
    EFI_STATUS                     Status;
    UINTN                          Size;
    VOID*                          Base;
+  UINTN                          Major;
+  UINTN                          Minor;
+  UINTN                          Result;
DEBUG ((DEBUG_INFO, "%a: InitializeSbsaQemuPlatformDxe called\n", __FUNCTION__)); @@ -51,5 +64,16 @@ InitializeSbsaQemuPlatformDxe (
      return Status;
    }
+ Result = ArmCallSmc0 (SIP_SVC_VERSION, &Major, &Minor, NULL);
+  if (Result == SMC_ARCH_CALL_SUCCESS)
+  {
+        Result = PcdSet32S (PcdPlatformVersionMajor, Major);
+        ASSERT_EFI_ERROR (Result);
+        Result = PcdSet32S (PcdPlatformVersionMinor, Minor);
+        ASSERT_EFI_ERROR (Result);
+  }
+
+  DEBUG((DEBUG_ERROR, "Platform version: %d.%d\n", Major, Minor));
+
    return EFI_SUCCESS;
  }

That should probably be logged at DEBUG_INFO instead of DEBUG_ERROR.

Also, if the SMC call fails Major and Minor are uninitialized. With a slightly older TF-A I get:


Platform version: -71457408.-8905312


--

Rebecca Cran



-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#104580): https://edk2.groups.io/g/devel/message/104580
Mute This Topic: https://groups.io/mt/98808598/21656
Group Owner: devel+ow...@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com]
-=-=-=-=-=-=-=-=-=-=-=-


Reply via email to