<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=us-ascii">
<style type="text/css" style="display:none;"> P {margin-top:0;margin-bottom:0;} </style>
</head>
<body dir="ltr">
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<br>
</div>
<div style="font-family: Calibri, Arial, Helvetica, sans-serif; font-size: 12pt; color: rgb(0, 0, 0);">
<p style="margin:0in; font-size:10.5pt" lang="en-US">Reviewed-by: Chasel Chiu <<a href="mailto:chasel.chiu@intel.com">chasel.chiu@intel.com</a><span style="color:#1F497D">></span></p>
<br>
</div>
<div id="appendonsend"></div>
<hr style="display:inline-block;width:98%" tabindex="-1">
<div id="divRplyFwdMsg" dir="ltr"><font face="Calibri, sans-serif" style="font-size:11pt" color="#000000"><b>From:</b> Kumar, Chandana C <chandana.c.kumar@intel.com><br>
<b>Sent:</b> Friday, April 24, 2020 1:19 PM<br>
<b>To:</b> devel@edk2.groups.io <devel@edk2.groups.io><br>
<b>Cc:</b> Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com><br>
<b>Subject:</b> [edk2-platforms: PATCH V1] MinPlatformPkg/PlatformInitPei: Create Library Instance of ReportCpuHobLib.</font>
<div> </div>
</div>
<div class="BodyFragment"><font size="2"><span style="font-size:11pt;">
<div class="PlainText">Create an Library instance of ReportCpuHobLib from PlatformInitPei driver.<br>
PA bits reported can be overriden using Library instance in Platform.<br>
<br>
Initial Patch to create ReportCpuHobLib.<br>
<br>
REF: <a href="https://bugzilla.tianocore.org/show_bug.cgi?id=2674">https://bugzilla.tianocore.org/show_bug.cgi?id=2674</a><br>
<br>
Signed-off-by: Chandana Kumar <chandana.c.kumar@intel.com><br>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com><br>
Cc: Chasel Chiu <chasel.chiu@intel.com><br>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com><br>
---<br>
Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h | 23 +++++++++++++++++++++++<br>
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec | 6 ++++--<br>
Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c | 32 ++++++++++++++++++++++++++++++++<br>
Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf | 27 +++++++++++++++++++++++++++<br>
4 files changed, 86 insertions(+), 2 deletions(-)<br>
<br>
diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h<br>
new file mode 100644<br>
index 0000000000..337e17f154<br>
--- /dev/null<br>
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h<br>
@@ -0,0 +1,23 @@<br>
+/** @file<br>
+<br>
+ Report CPU HOB library<br>
+<br>
+ This library report the CPU HOB with Physical Address bits.<br>
+<br>
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR><br>
+SPDX-License-Identifier: BSD-2-Clause-Patent<br>
+<br>
+**/<br>
+<br>
+#ifndef _REPORT_CPU_HOB_LIB_H_<br>
+#define _REPORT_CPU_HOB_LIB_H_<br>
+<br>
+#include <PiPei.h><br>
+#include <Uefi.h><br>
+<br>
+VOID<br>
+ReportCpuHob (<br>
+ VOID<br>
+ );<br>
+<br>
+#endif<br>
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec<br>
index 5bec4eee3a..7ef189dac8 100644<br>
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec<br>
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec<br>
@@ -6,7 +6,7 @@<br>
# INF files to generate AutoGen.c and AutoGen.h files<br>
# for the build infrastructure.<br>
#<br>
-# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved.<BR><br>
+# Copyright (c) 2017 - 2020, Intel Corporation. All rights reserved.<BR><br>
#<br>
# SPDX-License-Identifier: BSD-2-Clause-Patent<br>
#<br>
@@ -73,7 +73,9 @@<br>
TestPointLib|Include/Library/TestPointLib.h<br>
TestPointCheckLib|Include/Library/TestPointCheckLib.h<br>
<br>
-SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h<br>
+ SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h<br>
+<br>
+ ReportCpuHobLib|Include/Library/ReportCpuHobLib.h<br>
<br>
[PcdsFixedAtBuild, PcdsPatchableInModule]<br>
<br>
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c<br>
new file mode 100644<br>
index 0000000000..aa2565343c<br>
--- /dev/null<br>
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c<br>
@@ -0,0 +1,32 @@<br>
+/** @file<br>
+ Source code file for Report CPU HOB library.<br>
+<br>
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR><br>
+SPDX-License-Identifier: BSD-2-Clause-Patent<br>
+<br>
+**/<br>
+<br>
+#include <Base.h><br>
+#include <Library/HobLib.h><br>
+<br>
+VOID<br>
+ReportCpuHob (<br>
+ VOID<br>
+ )<br>
+{<br>
+ UINT8 PhysicalAddressBits;<br>
+ UINT32 RegEax;<br>
+<br>
+ AsmCpuid (0x80000000, &RegEax, NULL, NULL, NULL);<br>
+ if (RegEax >= 0x80000008) {<br>
+ AsmCpuid (0x80000008, &RegEax, NULL, NULL, NULL);<br>
+ PhysicalAddressBits = (UINT8) RegEax;<br>
+ } else {<br>
+ PhysicalAddressBits = 36;<br>
+ }<br>
+<br>
+ ///<br>
+ /// Create a CPU hand-off information<br>
+ ///<br>
+ BuildCpuHob (PhysicalAddressBits, 16);<br>
+}<br>
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf<br>
new file mode 100644<br>
index 0000000000..ae6ec901a1<br>
--- /dev/null<br>
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf<br>
@@ -0,0 +1,27 @@<br>
+### @file<br>
+# Component information file for the Report CPU HOB library.<br>
+#<br>
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR><br>
+#<br>
+# SPDX-License-Identifier: BSD-2-Clause-Patent<br>
+#<br>
+###<br>
+<br>
+[Defines]<br>
+ INF_VERSION = 0x00010005<br>
+ BASE_NAME = ReportCpuHobLib<br>
+ FILE_GUID = F19AA754-CE24-448D-B755-1F939B00C25D<br>
+ VERSION_STRING = 1.0<br>
+ MODULE_TYPE = BASE<br>
+ LIBRARY_CLASS = ReportCpuHobLib<br>
+<br>
+[LibraryClasses]<br>
+ BaseLib<br>
+ HobLib<br>
+<br>
+[Packages]<br>
+ MdePkg/MdePkg.dec<br>
+ MinPlatformPkg/MinPlatformPkg.dec<br>
+<br>
+[Sources]<br>
+ PeiReportFvLib.c<br>
-- <br>
2.16.2.windows.1<br>
<br>
</div>
</span></font></div>
</body>
</html>
<div width="1" style="color:white;clear:both">_._,_._,_</div>
<hr>
Groups.io Links:<p>
You receive all messages sent to this group.
<p>
<a target="_blank" href="https://edk2.groups.io/g/devel/message/58025">View/Reply Online (#58025)</a> |
|
<a target="_blank" href="https://groups.io/mt/73235446/1813853">Mute This Topic</a>
| <a href="https://edk2.groups.io/g/devel/post">New Topic</a><br>
<br>
<a href="https://edk2.groups.io/g/devel/editsub/1813853">Your Subscription</a> |
<a href="mailto:devel+owner@edk2.groups.io">Contact Group Owner</a> |
<a href="https://edk2.groups.io/g/devel/unsub">Unsubscribe</a>
[edk2-devel-archive@redhat.com]<br>
<div width="1" style="color:white;clear:both">_._,_._,_</div>