* [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot
@ 2022-10-07 11:38 Rebecca Cran
2022-10-07 12:34 ` [edk2-devel] " Sami Mujawar
2022-10-07 13:44 ` Oliver Steffen
0 siblings, 2 replies; 4+ messages in thread
From: Rebecca Cran @ 2022-10-07 11:38 UTC (permalink / raw)
To: devel, Oliver Steffen, Gerd Hoffmann, Ard Biesheuvel,
Sami Mujawar, Leif Lindholm
Cc: Rebecca Cran
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
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot
2022-10-07 11:38 [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot Rebecca Cran
@ 2022-10-07 12:34 ` Sami Mujawar
2022-10-07 13:12 ` Rebecca Cran
2022-10-07 13:44 ` Oliver Steffen
1 sibling, 1 reply; 4+ messages in thread
From: Sami Mujawar @ 2022-10-07 12:34 UTC (permalink / raw)
To: Rebecca Cran, devel
[-- Attachment #1: Type: text/plain, Size: 516 bytes --]
Hi Rebecca,
Thank you for this patch.
On Fri, Oct 7, 2022 at 04:38 AM, Rebecca Cran wrote:
>
> + CharCount = AsciiSPrint (
> + Buffer,
> + sizeof (Buffer),
> + "UEFI firmware (version %s built at %a on %a)\n\r",
> + (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),
> + __TIME__,
> + __DATE__
> + );
Can you check if uncrustify reports any issue with the above, please?
Other than that this patch looks good to me.
Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
Regards,
Sami Mujawar
[-- Attachment #2: Type: text/html, Size: 601 bytes --]
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [edk2-devel] [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot
2022-10-07 12:34 ` [edk2-devel] " Sami Mujawar
@ 2022-10-07 13:12 ` Rebecca Cran
0 siblings, 0 replies; 4+ messages in thread
From: Rebecca Cran @ 2022-10-07 13:12 UTC (permalink / raw)
To: Sami Mujawar, Rebecca Cran, devel
Ah, dangit! I completely forgot to run uncrustify.
I'll send out a v3.
--
Rebecca Cran
On 10/7/22 06:34, Sami Mujawar wrote:
> Hi Rebecca,
>
> Thank you for this patch.
>
> On Fri, Oct 7, 2022 at 04:38 AM, Rebecca Cran wrote:
>
> + CharCount = AsciiSPrint (
> + Buffer,
> + sizeof (Buffer),
> + "UEFI firmware (version %s built at %a on %a)\n\r",
> + (CHAR16 *)PcdGetPtr (PcdFirmwareVersionString),
> + __TIME__,
> + __DATE__
> + );
>
> Can you check if uncrustify reports any issue with the above, please?
> Other than that this patch looks good to me.
>
> Reviewed-by: Sami Mujawar <sami.mujawar@arm.com>
>
> Regards,
>
> Sami Mujawar
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot
2022-10-07 11:38 [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot Rebecca Cran
2022-10-07 12:34 ` [edk2-devel] " Sami Mujawar
@ 2022-10-07 13:44 ` Oliver Steffen
1 sibling, 0 replies; 4+ messages in thread
From: Oliver Steffen @ 2022-10-07 13:44 UTC (permalink / raw)
To: Ard Biesheuvel, Gerd Hoffmann, Leif Lindholm, Rebecca Cran,
Sami Mujawar, devel
Quoting Rebecca Cran (2022-10-07 13:38:05)
> 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
>
Hi Rebecca,
thank you!
Tested-by: Oliver Steffen <osteffen@redhat.com>
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2022-10-07 13:44 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2022-10-07 11:38 [PATCH v2 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot Rebecca Cran
2022-10-07 12:34 ` [edk2-devel] " Sami Mujawar
2022-10-07 13:12 ` Rebecca Cran
2022-10-07 13:44 ` Oliver Steffen
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox