From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from mga09.intel.com (mga09.intel.com [134.134.136.24]) by mx.groups.io with SMTP id smtpd.web11.25.1595024302339615883 for ; Fri, 17 Jul 2020 15:18:22 -0700 Authentication-Results: mx.groups.io; dkim=missing; spf=pass (domain: intel.com, ip: 134.134.136.24, mailfrom: ianx.kuo@intel.com) IronPort-SDR: 6UonGjJrqFh7SjVptkLTmZbHEwX0SezaUjJ8BehyfSJZu3f1q46CnAw1rh3M8U8JYwm9kr0ful 9BZKVgNPLPPw== X-IronPort-AV: E=McAfee;i="6000,8403,9685"; a="151047956" X-IronPort-AV: E=Sophos;i="5.75,364,1589266800"; d="scan'208";a="151047956" X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga004.jf.intel.com ([10.7.209.38]) by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384; 17 Jul 2020 15:18:22 -0700 IronPort-SDR: 7u1YtI+e70+ExMVqAxwpDWzn+VqvhOzg5ffVaR5LeUY6XsZ/OxCs0SHz39Np2wYLKV9pdDAUk9 f2L7dsgmMSPA== X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.75,364,1589266800"; d="scan'208";a="430984039" Received: from yungchua-mobl.ccr.corp.intel.com (HELO ikuox-MOBL1.gar.corp.intel.com) ([10.252.191.171]) by orsmga004.jf.intel.com with ESMTP; 17 Jul 2020 15:18:20 -0700 From: IanX Kuo To: devel@edk2.groups.io Cc: IanX Kuo Subject: [PATCH v2 6/6] Platform/Intel/MinPlatformPkg: Add ReportCpuHobLib. Date: Sat, 18 Jul 2020 06:18:18 +0800 Message-Id: <79c709cab4d1b1aa2571ba24b5404dd369308fd5.1595023968.git.ianx.kuo@intel.com> X-Mailer: git-send-email 2.26.2.windows.1 In-Reply-To: References: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Create an Library instance of ReportCpuHobLib from PlatformInitPei driver. PA bits reported can be overriden using Library instance in Platform. REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3D2674 Change-Id: I1c14aece3b229c194960e91dc9505dd8120bbe30 Signed-off-by: IanX Kuo --- .../Intel/MinPlatformPkg/MinPlatformPkg.dsc | 3 ++- .../PlatformInitPei/PlatformInitPreMem.c | 25 ++----------------- .../PlatformInitPei/PlatformInitPreMem.inf | 3 ++- 3 files changed, 6 insertions(+), 25 deletions(-) diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/In= tel/MinPlatformPkg/MinPlatformPkg.dsc index 13a0fda2..b62351da 100644 --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc @@ -1,7 +1,7 @@ ## @file=0D # Platform description.=0D #=0D -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -92,6 +92,7 @@ #=0D FspWrapperPlatformLib|MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPla= tformLib/PeiFspWrapperPlatformLib.inf=0D ReportFvLib|MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReport= FvLib.inf=0D + ReportCpuHobLib|MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Repo= rtCpuHobLib.inf=0D TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestP= ointCheckLib.inf=0D TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.in= f=0D SetCacheMtrrLib|MinPlatformPkg/Library/SetCacheMtrrLib/SetCacheMtrrLibNu= ll.inf=0D diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/Pla= tformInitPreMem.c b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInit= Pei/PlatformInitPreMem.c index efdeb6a9..48cbe0df 100644 --- a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformIn= itPreMem.c +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformIn= itPreMem.c @@ -1,7 +1,7 @@ /** @file=0D Source code file for Platform Init Pre-Memory PEI module=0D =0D -Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
=0D +Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
=0D SPDX-License-Identifier: BSD-2-Clause-Patent=0D =0D **/=0D @@ -26,6 +26,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent #include =0D #include =0D #include =0D +#include =0D #include =0D #include =0D #include =0D @@ -355,28 +356,6 @@ Done: return EFI_SUCCESS;=0D }=0D =0D -VOID=0D -ReportCpuHob (=0D - VOID=0D - )=0D -{=0D - UINT8 PhysicalAddressBits;=0D - UINT32 RegEax;=0D -=0D - AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);=0D - if (RegEax >=3D 0x80000008) {=0D - AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);=0D - PhysicalAddressBits =3D (UINT8) RegEax;=0D - } else {=0D - PhysicalAddressBits =3D 36;=0D - }=0D -=0D - ///=0D - /// Create a CPU hand-off information=0D - ///=0D - BuildCpuHob (PhysicalAddressBits, 16);=0D -}=0D -=0D /**=0D Install Firmware Volume Hob's once there is main memory=0D =0D diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/Pla= tformInitPreMem.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformIn= itPei/PlatformInitPreMem.inf index 7ee18eb6..8e828ff2 100644 --- a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformIn= itPreMem.inf +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformIn= itPreMem.inf @@ -1,7 +1,7 @@ ### @file=0D # Component information file for the Platform Init Pre-Memory PEI module.= =0D #=0D -# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.
=0D +# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.
=0D #=0D # SPDX-License-Identifier: BSD-2-Clause-Patent=0D #=0D @@ -28,6 +28,7 @@ TestPointCheckLib=0D TimerLib=0D SetCacheMtrrLib=0D + ReportCpuHobLib=0D =0D [Packages]=0D MinPlatformPkg/MinPlatformPkg.dec=0D --=20 2.26.2.windows.1