summaryrefslogtreecommitdiffstats
path: root/ArmPlatformPkg/PrePeiCore
diff options
context:
space:
mode:
authorRebecca Cran <rebecca@quicinc.com>2022-10-11 14:59:52 -0600
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2022-10-25 16:26:25 +0000
commit56035d1c8b255b33b34cd4625c26bc7d38504e30 (patch)
tree0cc76d521a370378c98dc4bf1aa37721196d264d /ArmPlatformPkg/PrePeiCore
parentdb2c22633f3c761975d8f469a0e195d8b79e1287 (diff)
downloadedk2-56035d1c8b255b33b34cd4625c26bc7d38504e30.tar.gz
edk2-56035d1c8b255b33b34cd4625c26bc7d38504e30.tar.bz2
edk2-56035d1c8b255b33b34cd4625c26bc7d38504e30.zip
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 <rebecca@quicinc.com> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com> Tested-by: Oliver Steffen <osteffen@redhat.com> Reviewed-by: Leif Lindholm <quic_llindhol@quicinc.com>
Diffstat (limited to 'ArmPlatformPkg/PrePeiCore')
-rw-r--r--ArmPlatformPkg/PrePeiCore/PrePeiCore.c29
-rw-r--r--ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf3
-rw-r--r--ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf3
3 files changed, 35 insertions, 0 deletions
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
index 8b86c6e69a..42a7ccc9c6 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
@@ -11,6 +11,8 @@
#include <Library/CacheMaintenanceLib.h>
#include <Library/DebugAgentLib.h>
#include <Library/ArmLib.h>
+#include <Library/PrintLib.h>
+#include <Library/SerialPortLib.h>
#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 a5b4722459..4a3112b58d 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 466a2b01c3..ab5bf1dac2 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
@@ -52,6 +52,9 @@
[Ppis]
gEfiTemporaryRamSupportPpiGuid
+[Pcd]
+ gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
+
[FeaturePcd]
gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores