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 v7 6/6] Platform/Intel/MinPlatformPkg: Add ReportCpuHobLib.
Date: Tue, 21 Jul 2020 13:30:43 +0800 [thread overview]
Message-ID: <5eca72d86fb0d2a2f2242ef8d082febda563e4e6.1595309109.git.ianx.kuo@intel.com> (raw)
In-Reply-To: <cover.1595309109.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
Change-Id: I1c14aece3b229c194960e91dc9505dd8120bbe30
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 | 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/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index 13a0fda2..b62351da 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
@@ -1,7 +1,7 @@
## @file
# Platform description.
#
-# 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
#
@@ -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 efdeb6a9..48cbe0df 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 7ee18eb6..8e828ff2 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.26.2.windows.1
prev parent reply other threads:[~2020-07-21 5:30 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-07-21 5:29 [edk2-platforms] [PATCH v7 0/6] Create a Library instance of ReportCpuHobLib IanX Kuo
2020-07-21 5:29 ` [edk2-platforms] [PATCH v7 1/6] Platform/Intel/MinPlatformPkg: Fix build error IanX Kuo
2020-07-21 5:43 ` Liming Gao
2020-07-21 5:29 ` [edk2-platforms] [PATCH v7 2/6] Platform/Intel/CometlakeOpenBoardPkg: Add ReportCpuHobLib IanX Kuo
2020-07-21 5:43 ` Liming Gao
2020-07-21 5:29 ` [edk2-platforms] [PATCH v7 3/6] Platform/Intel/KabylakeOpenBoardPkg: " IanX Kuo
2020-07-21 5:30 ` [edk2-platforms] [PATCH v7 4/6] Platform/Intel/SimicsOpenBoardPkg: " IanX Kuo
2020-07-21 5:30 ` [edk2-platforms] [PATCH v7 5/6] Platform/Intel/WhiskeylakeOpenBoardPkg: " IanX Kuo
2020-07-21 5:30 ` IanX Kuo [this message]
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=5eca72d86fb0d2a2f2242ef8d082febda563e4e6.1595309109.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