From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from alexa-out-sd-01.qualcomm.com (alexa-out-sd-01.qualcomm.com [199.106.114.38]) by mx.groups.io with SMTP id smtpd.web08.7164.1666705574905030986 for ; Tue, 25 Oct 2022 06:46:14 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcdkim header.b=KmBeeO9L; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 199.106.114.38, mailfrom: quic_rcran@quicinc.com) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; i=@quicinc.com; q=dns/txt; s=qcdkim; t=1666705574; x=1698241574; h=from:message-id:date:mime-version:subject:to:cc: references:in-reply-to:content-transfer-encoding; bh=2ZPgL6iW+1fq066IAbRgqyAFzBktjLESvuL94YwKEfQ=; b=KmBeeO9LN/SJEY8+CTj7cfPQD8s4F/jN/QMnrrJJysFeNsXLlQwlNui3 diIpacSdP//eeR91RmDD/9NYyB06ky8Kv7hueKM+m9iZsAd57cruBNX3o b3GSeXnWpHezMwUE97H1K9hfDwb8KQDvm0Swl0/wKkz4lnSsDA5qcyRkE M=; Received: from unknown (HELO ironmsg04-sd.qualcomm.com) ([10.53.140.144]) by alexa-out-sd-01.qualcomm.com with ESMTP; 25 Oct 2022 06:46:14 -0700 From: "Rebecca Cran" X-QCInternal: smtphost Received: from nasanex01b.na.qualcomm.com ([10.46.141.250]) by ironmsg04-sd.qualcomm.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 25 Oct 2022 06:46:14 -0700 Received: from [10.110.89.30] (10.80.80.8) by nasanex01b.na.qualcomm.com (10.46.141.250) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.986.29; Tue, 25 Oct 2022 06:46:13 -0700 Message-ID: <8991ae9b-0089-b389-4554-2833f36543ae@quicinc.com> Date: Tue, 25 Oct 2022 07:46:13 -0600 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.3.3 Subject: Re: [PATCH v3 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot To: Leif Lindholm CC: , Oliver Steffen , "Gerd Hoffmann" , Ard Biesheuvel , Sami Mujawar References: <20221011205952.357499-1-rebecca@quicinc.com> <20221011205952.357499-2-rebecca@quicinc.com> In-Reply-To: Return-Path: rebecca@quicinc.com X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01a.na.qualcomm.com (10.52.223.231) To nasanex01b.na.qualcomm.com (10.46.141.250) Content-Language: en-US Content-Type: text/plain; charset="UTF-8"; format=flowed Content-Transfer-Encoding: 7bit Thanks, that's a good change. Reviewed-by: Rebecca Cran On 10/25/22 05:41, Leif Lindholm wrote: > On Tue, Oct 11, 2022 at 14:59:52 -0600, Rebecca Cran wrote: >> Copy code from PrePi to PrePeiCore that prints the firmware version >> and build date early in the boot process. > I'm good with this, but I'd prefer to break the printout into a helper > function in order to reduce clutter in CEntryPoint. > > i.e. fold in > > --- > diff --git a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c > b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c > index 674f4f7df498..225e22f75c23 100644 > --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c > +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c > @@ -54,15 +54,32 @@ CreatePpiList ( > *PpiListSize = sizeof (gCommonPpiTable) + PlatformPpiListSize; > } > > +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, > IN EFI_PEI_CORE_ENTRY_POINT PeiCoreEntryPoint > ) > { > - CHAR8 Buffer[100]; > - UINTN CharCount; > - > if (!ArmMmuEnabled ()) { > // Data Cache enabled on Primary core when MMU is enabled. > ArmDisableDataCache (); > @@ -100,15 +117,8 @@ 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); > + > + PrintFirmwareVersion(); > > // Initialize the Debug Agent for Source Level Debugging > InitializeDebugAgent (DEBUG_AGENT_INIT_POSTMEM_SEC, NULL, > NULL); > --- > > If you're happy with that, I can apply and push. > > / > Leif > >> Signed-off-by: Rebecca Cran >> Reviewed-by: Sami Mujawar >> Tested-by: Oliver Steffen >> --- >> 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..1d4f6969b660 100644 >> --- a/ArmPlatformPkg/PrePeiCore/PrePeiCore.c >> +++ b/ArmPlatformPkg/PrePeiCore/PrePeiCore.c >> @@ -11,6 +11,8 @@ >> #include >> #include >> #include >> +#include >> +#include >> >> #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 >>