From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mx0a-0031df01.pphosted.com (mx0a-0031df01.pphosted.com [205.220.168.131]) by mx.groups.io with SMTP id smtpd.web09.59.1666715509112663652 for ; Tue, 25 Oct 2022 09:31:49 -0700 Authentication-Results: mx.groups.io; dkim=pass header.i=@quicinc.com header.s=qcppdkim1 header.b=BYuBGNUj; spf=permerror, err=parse error for token &{10 18 %{ir}.%{v}.%{d}.spf.has.pphosted.com}: invalid domain name (domain: quicinc.com, ip: 205.220.168.131, mailfrom: quic_llindhol@quicinc.com) Received: from pps.filterd (m0279867.ppops.net [127.0.0.1]) by mx0a-0031df01.pphosted.com (8.17.1.5/8.17.1.5) with ESMTP id 29PCF5vm015118; Tue, 25 Oct 2022 16:31:46 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=quicinc.com; h=date : from : to : cc : subject : message-id : references : mime-version : content-type : in-reply-to; s=qcppdkim1; bh=iLu/ynJQpjTg33mJv6ngGLy4+qf3xIUsFoxR+B/1fok=; b=BYuBGNUjA83RPPcIQdwzsdOoAys9Hzpv2qvbdOjIiidW9U6I3s1p+ZI9aAdWrZwb/WVs kTp28H4gZk2mvne7VjynUNUNNC6R7dMf4N3/3Ha5NmW+cxFTTSTQB8fv3CaEIoBkqkH7 1rTIiKXU3A19U6AJ3IMrjY7+uj9QmGqC4orz5XNcU3xAzh0Tq35OPWnFRLixErJretZO peHDjrKHn/Ha052kOCrCJDWsQ6NN6JX1Wc9eNNDonWkRD9Ra6GM+l+SZsHjfKOb5TMpj 6CJ8e1qcmyT+uMHIcuoJIU3Ov4MKqXLBVu33GbSKskHgNCamYKDz6o66x5EBkf/f6Hc4 iA== Received: from nasanppmta03.qualcomm.com (i-global254.qualcomm.com [199.106.103.254]) by mx0a-0031df01.pphosted.com (PPS) with ESMTPS id 3kea55a0kp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Oct 2022 16:31:45 +0000 Received: from pps.filterd (NASANPPMTA03.qualcomm.com [127.0.0.1]) by NASANPPMTA03.qualcomm.com (8.17.1.5/8.17.1.5) with ESMTP id 29PGSYjK013289; Tue, 25 Oct 2022 16:31:45 GMT Received: from pps.reinject (localhost [127.0.0.1]) by NASANPPMTA03.qualcomm.com (PPS) with ESMTPS id 3keb6jbaev-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Oct 2022 16:31:45 +0000 Received: from NASANPPMTA03.qualcomm.com (NASANPPMTA03.qualcomm.com [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 29PGVjgu019848; Tue, 25 Oct 2022 16:31:45 GMT Received: from nasanex01c.na.qualcomm.com (nasanex01c.na.qualcomm.com [10.45.79.139]) by NASANPPMTA03.qualcomm.com (PPS) with ESMTPS id 29PGVjPx019847 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Tue, 25 Oct 2022 16:31:45 +0000 Received: from qc-i7.hemma.eciton.net (10.80.80.8) by nasanex01c.na.qualcomm.com (10.45.79.139) 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 09:31:43 -0700 Date: Tue, 25 Oct 2022 17:31:40 +0100 From: "Leif Lindholm" To: Rebecca Cran CC: , Oliver Steffen , "Gerd Hoffmann" , Ard Biesheuvel , Sami Mujawar Subject: Re: [PATCH v3 1/1] ArmPlatformPkg/PrePeiCore: Print the firmware version early in boot Message-ID: References: <20221011205952.357499-1-rebecca@quicinc.com> <20221011205952.357499-2-rebecca@quicinc.com> <8991ae9b-0089-b389-4554-2833f36543ae@quicinc.com> MIME-Version: 1.0 In-Reply-To: <8991ae9b-0089-b389-4554-2833f36543ae@quicinc.com> X-Originating-IP: [10.80.80.8] X-ClientProxiedBy: nasanex01b.na.qualcomm.com (10.46.141.250) To nasanex01c.na.qualcomm.com (10.45.79.139) X-QCInternal: smtphost X-QCInternal: smtphost X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-Virus-Version: vendor=nai engine=6200 definitions=5800 signatures=585085 X-Proofpoint-ORIG-GUID: muwAfkuXoFOgj0gl17ug6Dq_LAa2Vuwx X-Proofpoint-GUID: muwAfkuXoFOgj0gl17ug6Dq_LAa2Vuwx X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.205,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-10-25_10,2022-10-25_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 impostorscore=0 clxscore=1015 lowpriorityscore=0 adultscore=0 spamscore=0 mlxscore=0 phishscore=0 malwarescore=0 bulkscore=0 suspectscore=0 mlxlogscore=999 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2209130000 definitions=main-2210250093 Content-Type: text/plain; charset="us-ascii" Content-Disposition: inline On Tue, Oct 25, 2022 at 07:46:13 -0600, Rebecca Cran wrote: > Thanks, that's a good change. > > Reviewed-by: Rebecca Cran (I won't add an R-b from you on your own patch.) Reviewed-by: Leif Lindholm After fixing a couple of style issues in my diff below: Pushed as 56035d1c8b25. Thanks! / Leif > 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 > > > >