From 56035d1c8b255b33b34cd4625c26bc7d38504e30 Mon Sep 17 00:00:00 2001 From: Rebecca Cran Date: Tue, 11 Oct 2022 14:59:52 -0600 Subject: ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot Copy code from PrePi to PrePeiCore that prints the firmware version and build date early in the boot process. Signed-off-by: Rebecca Cran Reviewed-by: Sami Mujawar Tested-by: Oliver Steffen Reviewed-by: Leif Lindholm --- ArmPlatformPkg/PrePeiCore/PrePeiCore.c | 29 +++++++++++++++++++++++++ ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf | 3 +++ ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf | 3 +++ 3 files changed, 35 insertions(+) diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c index 8b86c6e..42a7ccc 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c @@ -11,6 +11,8 @@ #include #include #include +#include +#include #include "PrePeiCore.h" @@ -52,6 +54,31 @@ CreatePpiList ( *PpiListSize = sizeof (gCommonPpiTable) + PlatformPpiListSize; } +/** + + Prints firmware version and build time to serial console. + +**/ +STATIC +VOID +PrintFirmwareVersion ( + VOID + ) +{ + CHAR8 Buffer[100]; + UINTN CharCount; + + CharCount = AsciiSPrint ( + Buffer, + sizeof (Buffer), + "UEFI firmware (version %s built at %a on %a)\n\r", + (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString), + __TIME__, + __DATE__ + ); + SerialPortWrite ((UINT8 *)Buffer, CharCount); +} + VOID CEntryPoint ( IN UINTN MpId, @@ -96,6 +123,8 @@ CEntryPoint ( // called. ProcessLibraryConstructorList (); + PrintFirmwareVersion (); + // Initialize the Debug Agent for Source Level Debugging InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL); SaveAndSetDebugTimerInterrupt (TRUE); diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf index a5b4722..4a3112b 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf @@ -54,6 +54,9 @@ gEfiTemporaryRamSupportPpiGuid gArmMpCoreInfoPpiGuid +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString + [FeaturePcd] gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf index 466a2b0..ab5bf1d 100644 --- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf @@ -52,6 +52,9 @@ [Ppis] gEfiTemporaryRamSupportPpiGuid +[Pcd] + gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString + [FeaturePcd] gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores -- cgit v1.1