public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "IanX Kuo" <ianx.kuo@intel.com>
To: devel@edk2.groups.io
Cc: james.lu@intel.com, chandana.c.kumar@intel.com,
	varalakshmi.a.prabhala@intel.com, liming.gao@intel.com,
	IanX Kuo <ianx.kuo@intel.com>,
	Sai Chaganty <rangasai.v.chaganty@intel.com>,
	Chasel Chiu <chasel.chiu@intel.com>
Subject: [edk2-platforms] [PATCH v8 6/6] Platform/Intel/MinPlatformPkg: Add ReportCpuHobLib
Date: Tue, 21 Jul 2020 15:30:39 +0800	[thread overview]
Message-ID: <c18416ec196e2cbdd1ed828861492f78551a31ce.1595315589.git.ianx.kuo@intel.com> (raw)
In-Reply-To: <cover.1595315589.git.ianx.kuo@intel.com>

Create a Library instance of ReportCpuHobLib from PlatformInitPei driver.
PA bits reported can be overridden by Library instance in Platform.

REF: https://bugzilla.tianocore.org/show_bug.cgi?id=2674

Signed-off-by: IanX Kuo <ianx.kuo@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
---
 .../Intel/MinPlatformPkg/MinPlatformPkg.dsc   |  1 +
 .../PlatformInitPei/PlatformInitPreMem.c      | 25 ++-----------------
 .../PlatformInitPei/PlatformInitPreMem.inf    |  3 ++-
 3 files changed, 5 insertions(+), 24 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index 13a0fda272..112ddff7d9 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -92,6 +92,7 @@
   #
   FspWrapperPlatformLib|MinPlatformPkg/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
   ReportFvLib|MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
+  ReportCpuHobLib|MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf
   TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.inf
   TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.inf
   SetCacheMtrrLib|MinPlatformPkg/Library/SetCacheMtrrLib/SetCacheMtrrLibNull.inf
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c
index efdeb6a91c..48cbe0dfbe 100644
--- a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c
@@ -1,7 +1,7 @@
 /** @file
   Source code file for Platform Init Pre-Memory PEI module
 
-Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
+Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
 SPDX-License-Identifier: BSD-2-Clause-Patent
 
 **/
@@ -26,6 +26,7 @@ SPDX-License-Identifier: BSD-2-Clause-Patent
 #include <Library/BoardInitLib.h>
 #include <Library/TestPointCheckLib.h>
 #include <Library/SetCacheMtrrLib.h>
+#include <Library/ReportCpuHobLib.h>
 #include <Guid/MemoryTypeInformation.h>
 #include <Ppi/PlatformMemorySize.h>
 #include <Ppi/BaseMemoryTest.h>
@@ -355,28 +356,6 @@ Done:
   return EFI_SUCCESS;
 }
 
-VOID
-ReportCpuHob (
-  VOID
-  )
-{
-  UINT8                         PhysicalAddressBits;
-  UINT32                        RegEax;
-
-  AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);
-  if (RegEax >= 0x80000008) {
-    AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);
-    PhysicalAddressBits = (UINT8) RegEax;
-  } else {
-    PhysicalAddressBits = 36;
-  }
-
-  ///
-  /// Create a CPU hand-off information
-  ///
-  BuildCpuHob (PhysicalAddressBits, 16);
-}
-
 /**
   Install Firmware Volume Hob's once there is main memory
 
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf
index 7ee18eb6d5..8e828ff2ac 100644
--- a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf
@@ -1,7 +1,7 @@
 ### @file
 # Component information file for the Platform Init Pre-Memory PEI module.
 #
-# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR>
+# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR>
 #
 # SPDX-License-Identifier: BSD-2-Clause-Patent
 #
@@ -28,6 +28,7 @@
   TestPointCheckLib
   TimerLib
   SetCacheMtrrLib
+  ReportCpuHobLib
 
 [Packages]
   MinPlatformPkg/MinPlatformPkg.dec
-- 
2.27.0.windows.1


  parent reply	other threads:[~2020-07-21  7:30 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-07-21  7:28 [edk2-platforms] [PATCH v8 0/6] Create a Library instance of ReportCpuHobLib IanX Kuo
2020-07-21  7:29 ` [edk2-platforms] [PATCH v8 1/6] Platform/Intel/MinPlatformPkg: Fix build error IanX Kuo
2020-07-21  7:29 ` [edk2-platforms] [PATCH v8 2/6] Platform/Intel/CometlakeOpenBoardPkg: Add ReportCpuHobLib IanX Kuo
2020-07-21  7:29 ` [edk2-platforms] [PATCH v8 3/6] Platform/Intel/KabylakeOpenBoardPkg: " IanX Kuo
2020-07-21  7:30 ` [edk2-platforms] [PATCH v8 4/6] Platform/Intel/SimicsOpenBoardPkg: " IanX Kuo
2020-07-21  7:30 ` [edk2-platforms] [PATCH v8 5/6] Platform/Intel/WhiskeylakeOpenBoardPkg: " IanX Kuo
2020-07-21  7:30 ` IanX Kuo [this message]
2020-07-21  9:11 ` [edk2-platforms] [PATCH v8 0/6] Create a Library instance of ReportCpuHobLib Liming Gao
2020-07-21 12:41 ` Chiu, Chasel

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=c18416ec196e2cbdd1ed828861492f78551a31ce.1595315589.git.ianx.kuo@intel.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