]> git.proxmox.com Git - mirror_edk2.git/commitdiff
ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot
authorRebecca Cran <rebecca@quicinc.com>
Tue, 11 Oct 2022 20:59:52 +0000 (14:59 -0600)
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
Tue, 25 Oct 2022 16:26:25 +0000 (16:26 +0000)
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>
ArmPlatformPkg/PrePeiCore/PrePeiCore.c
ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf

index 8b86c6e69abdde98a0f58de07dd8812abad5f250..42a7ccc9c6a0887b2db4bd1469812f6e3916cb60 100644 (file)
@@ -11,6 +11,8 @@
 #include <Library/CacheMaintenanceLib.h>\r
 #include <Library/DebugAgentLib.h>\r
 #include <Library/ArmLib.h>\r
+#include <Library/PrintLib.h>\r
+#include <Library/SerialPortLib.h>\r
 \r
 #include "PrePeiCore.h"\r
 \r
@@ -52,6 +54,31 @@ CreatePpiList (
   *PpiListSize = sizeof (gCommonPpiTable) + PlatformPpiListSize;\r
 }\r
 \r
+/**\r
+\r
+ Prints firmware version and build time to serial console.\r
+\r
+**/\r
+STATIC\r
+VOID\r
+PrintFirmwareVersion (\r
+  VOID\r
+  )\r
+{\r
+  CHAR8  Buffer[100];\r
+  UINTN  CharCount;\r
+\r
+  CharCount = AsciiSPrint (\r
+                Buffer,\r
+                sizeof (Buffer),\r
+                "UEFI firmware (version %s built at %a on %a)\n\r",\r
+                (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),\r
+                __TIME__,\r
+                __DATE__\r
+                );\r
+  SerialPortWrite ((UINT8 *)Buffer, CharCount);\r
+}\r
+\r
 VOID\r
 CEntryPoint (\r
   IN  UINTN                     MpId,\r
@@ -96,6 +123,8 @@ CEntryPoint (
     // called.\r
     ProcessLibraryConstructorList ();\r
 \r
+    PrintFirmwareVersion ();\r
+\r
     // Initialize the Debug Agent for Source Level Debugging\r
     InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);\r
     SaveAndSetDebugTimerInterrupt (TRUE);\r
index a5b4722459d1be589afc4305464bbf2811798cf8..4a3112b58dcbba7c363ff27c8697e18f0be94f4a 100644 (file)
@@ -54,6 +54,9 @@
   gEfiTemporaryRamSupportPpiGuid\r
   gArmMpCoreInfoPpiGuid\r
 \r
+[Pcd]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString\r
+\r
 [FeaturePcd]\r
   gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores\r
 \r
index 466a2b01c384d12eede93e99349f8d6cace644f4..ab5bf1dac2d8cb5ab512154cb1b3dbe1b85b5513 100644 (file)
@@ -52,6 +52,9 @@
 [Ppis]\r
   gEfiTemporaryRamSupportPpiGuid\r
 \r
+[Pcd]\r
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString\r
+\r
 [FeaturePcd]\r
   gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores\r
 \r