public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Rebecca Cran" <quic_rcran@quicinc.com>
To: <devel@edk2.groups.io>, Oliver Steffen <osteffen@redhat.com>,
	"Gerd Hoffmann" <kraxel@redhat.com>,
	Ard Biesheuvel <ardb@kernel.org>,
	Sami Mujawar <sami.mujawar@arm.com>,
	Leif Lindholm <quic_llindhol@quicinc.com>
Cc: Rebecca Cran <rebecca@quicinc.com>
Subject: [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot
Date: Fri, 7 Oct 2022 05:38:05 -0600	[thread overview]
Message-ID: <20221007113805.43823-1-rebecca@quicinc.com> (raw)

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>
---
 ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf  |  3 +++
 ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf |  3 +++
 ArmPlatformPkg/PrePeiCore/PrePeiCore.c          | 14 ++++++++++++++
 3 files changed, 20 insertions(+)

diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
index a5b4722459d1..4a3112b58dcb 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreMPCore.inf
@@ -54,6 +54,9 @@ [Ppis]
   gEfiTemporaryRamSupportPpiGuid
   gArmMpCoreInfoPpiGuid
 
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
+
 [FeaturePcd]
   gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
 
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
index 466a2b01c384..ab5bf1dac2d8 100644
--- a/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
+++ b/ArmPlatformPkg/PrePeiCore/PrePeiCoreUniCore.inf
@@ -52,6 +52,9 @@ [LibraryClasses]
 [Ppis]
   gEfiTemporaryRamSupportPpiGuid
 
+[Pcd]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFirmwareVersionString
+
 [FeaturePcd]
   gArmPlatformTokenSpaceGuid.PcdSendSgiToBringUpSecondaryCores
 
diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c
index 9c4b25df953d..49df21aca92a 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"
 
@@ -58,6 +60,9 @@ CEntryPoint (
   IN  EFI_PEI_CORE_ENTRY_POINT  PeiCoreEntryPoint
   )
 {
+  CHAR8  Buffer[100];
+  UINTN  CharCount;
+
   // Data Cache enabled on Primary core when MMU is enabled.
   ArmDisableDataCache ();
   // Invalidate instruction cache
@@ -93,6 +98,15 @@ CEntryPoint (
     // Invoke "ProcessLibraryConstructorList" to have all library constructors
     // called.
     ProcessLibraryConstructorList ();
+    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);
 
     // Initialize the Debug Agent for Source Level Debugging
     InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, NULL);
-- 
2.30.2


             reply	other threads:[~2022-10-07 11:38 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-10-07 11:38 Rebecca Cran [this message]
2022-10-07 12:34 ` [edk2-devel] [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot Sami Mujawar
2022-10-07 13:12   ` Rebecca Cran
2022-10-07 13:44 ` Oliver Steffen

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-list from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20221007113805.43823-1-rebecca@quicinc.com \
    --to=devel@edk2.groups.io \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox