[edk2-devel] [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create Library Instance of ReportCpuHobLib.

Kumar, Chandana C posted 1 patch 4 years ago
Failed in applying to current master (apply log)
There is a newer version of this series
Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h                        | 23 +++++++++++++++++++++++
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec                                       |  4 +++-
Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                       |  3 ++-
Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c   | 32 ++++++++++++++++++++++++++++++++
Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf | 27 +++++++++++++++++++++++++++
Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c        | 25 ++-----------------------
6 files changed, 89 insertions(+), 25 deletions(-)
[edk2-devel] [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create Library Instance of ReportCpuHobLib.
Posted by Kumar, Chandana C 4 years ago
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=2674

Signed-off-by: Chandana Kumar <chandana.c.kumar@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h                        | 23 +++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec                                       |  4 +++-
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                       |  3 ++-
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c   | 32 ++++++++++++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf | 27 +++++++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c        | 25 ++-----------------------
 6 files changed, 89 insertions(+), 25 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
new file mode 100644
index 0000000000..79e5d4efb2
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
@@ -0,0 +1,23 @@
+/** @file
+
+  Report CPU HOB library
+
+  This library report the CPU HOB with Physical Address bits.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _REPORT_CPU_HOB_LIB_H_
+#define _REPORT_CPU_HOB_LIB_H_
+
+#include <PiPei.h>
+#include <Uefi.h>
+
+VOID
+ReportCpuHob (
+  VOID
+  )
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
index 7f74ac9380..71776dfe80 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
@@ -68,7 +68,9 @@
   TestPointLib|Include/Library/TestPointLib.h
   TestPointCheckLib|Include/Library/TestPointCheckLib.h
 
-SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h
+  SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h
+
+  ReportCpuHobLib|Include/Library/ReportCpuHobLib.h
 
 [PcdsFixedAtBuild, PcdsPatchableInModule]
 
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index 13a0fda272..b62351dac6 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/Library/ReportCpuHobLib/ReportCpuHobLib.c b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c
new file mode 100644
index 0000000000..aa2565343c
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c
@@ -0,0 +1,32 @@
+/** @file
+  Source code file for Report CPU HOB library.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Base.h>
+#include <Library/HobLib.h>
+
+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);
+}
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf
new file mode 100644
index 0000000000..ae6ec901a1
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf
@@ -0,0 +1,27 @@
+### @file
+# Component information file for the Report CPU HOB library.
+#
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+###
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = ReportCpuHobLib
+  FILE_GUID                      = F19AA754-CE24-448D-B755-1F939B00C25D
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = BASE
+  LIBRARY_CLASS                  = ReportCpuHobLib
+
+[LibraryClasses]
+  BaseLib
+  HobLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[Sources]
+  PeiReportFvLib.c
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
 
-- 
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#57404): https://edk2.groups.io/g/devel/message/57404
Mute This Topic: https://groups.io/mt/73028512/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create Library Instance of ReportCpuHobLib.
Posted by Chiu, Chasel 4 years ago
Reviewed-by: Chasel Chiu <chasel.chiu@intel.com>

> -----Original Message-----
> From: Kumar, Chandana C <chandana.c.kumar@intel.com>
> Sent: Wednesday, April 15, 2020 4:31 PM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create
> Library Instance of ReportCpuHobLib.
> 
> 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=2674
> 
> Signed-off-by: Chandana Kumar <chandana.c.kumar@intel.com>
> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> ---
>  Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
> | 23 +++++++++++++++++++++++
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> |  4 +++-
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> |  3 ++-
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Repo
> rtCpuHobLib.c   | 32 ++++++++++++++++++++++++++++++++
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Repo
> rtCpuHobLib.inf | 27 +++++++++++++++++++++++++++
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPre
> Mem.c        | 25 ++-----------------------
>  6 files changed, 89 insertions(+), 25 deletions(-)
> 
> diff --git
> a/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
> b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
> new file mode 100644
> index 0000000000..79e5d4efb2
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
> @@ -0,0 +1,23 @@
> +/** @file
> +
> +  Report CPU HOB library
> +
> +  This library report the CPU HOB with Physical Address bits.
> +
> +Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef _REPORT_CPU_HOB_LIB_H_
> +#define _REPORT_CPU_HOB_LIB_H_
> +
> +#include <PiPei.h>
> +#include <Uefi.h>
> +
> +VOID
> +ReportCpuHob (
> +  VOID
> +  )
> +
> +#endif
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> index 7f74ac9380..71776dfe80 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> @@ -68,7 +68,9 @@
>    TestPointLib|Include/Library/TestPointLib.h
>    TestPointCheckLib|Include/Library/TestPointCheckLib.h
> 
> -SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h
> +  SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h
> +
> +  ReportCpuHobLib|Include/Library/ReportCpuHobLib.h
> 
>  [PcdsFixedAtBuild, PcdsPatchableInModule]
> 
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> index 13a0fda272..b62351dac6 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/PeiFspWrappe
> rPlatformLib/PeiFspWrapperPlatformLib.inf
> 
> ReportFvLib|MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReport
> FvLib.inf
> +
> +
> ReportCpuHobLib|MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/R
> e
> + portCpuHobLib.inf
> 
> TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPo
> intCheckLib.inf
> 
> TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.inf
> 
> SetCacheMtrrLib|MinPlatformPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib
> Null.inf
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Re
> portCpuHobLib.c
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Re
> portCpuHobLib.c
> new file mode 100644
> index 0000000000..aa2565343c
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib
> +++ /ReportCpuHobLib.c
> @@ -0,0 +1,32 @@
> +/** @file
> +  Source code file for Report CPU HOB library.
> +
> +Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <Base.h>
> +#include <Library/HobLib.h>
> +
> +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); }
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Re
> portCpuHobLib.inf
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Re
> portCpuHobLib.inf
> new file mode 100644
> index 0000000000..ae6ec901a1
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib
> +++ /ReportCpuHobLib.inf
> @@ -0,0 +1,27 @@
> +### @file
> +# Component information file for the Report CPU HOB library.
> +#
> +# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR> # #
> +SPDX-License-Identifier: BSD-2-Clause-Patent # ###
> +
> +[Defines]
> +  INF_VERSION                    = 0x00010005
> +  BASE_NAME                      = ReportCpuHobLib
> +  FILE_GUID                      =
> F19AA754-CE24-448D-B755-1F939B00C25D
> +  VERSION_STRING                 = 1.0
> +  MODULE_TYPE                    = BASE
> +  LIBRARY_CLASS                  = ReportCpuHobLib
> +
> +[LibraryClasses]
> +  BaseLib
> +  HobLib
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MinPlatformPkg/MinPlatformPkg.dec
> +
> +[Sources]
> +  PeiReportFvLib.c
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPr
> eMem.c
> b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPr
> eMem.c
> index efdeb6a91c..48cbe0dfbe 100644
> ---
> a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPr
> eMem.c
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/Platfor
> +++ mInitPreMem.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
> 
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#57405): https://edk2.groups.io/g/devel/message/57405
Mute This Topic: https://groups.io/mt/73028512/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create Library Instance of ReportCpuHobLib.
Posted by Chaganty, Rangasai V 4 years ago
Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: Kumar, Chandana C <chandana.c.kumar@intel.com> 
Sent: Wednesday, April 15, 2020 1:31 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create Library Instance of ReportCpuHobLib.

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=2674

Signed-off-by: Chandana Kumar <chandana.c.kumar@intel.com>
Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
---
 Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h                        | 23 +++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec                                       |  4 +++-
 Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc                                       |  3 ++-
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c   | 32 ++++++++++++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf | 27 +++++++++++++++++++++++++++
 Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPreMem.c        | 25 ++-----------------------
 6 files changed, 89 insertions(+), 25 deletions(-)

diff --git a/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
new file mode 100644
index 0000000000..79e5d4efb2
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
@@ -0,0 +1,23 @@
+/** @file
+
+  Report CPU HOB library
+
+  This library report the CPU HOB with Physical Address bits.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#ifndef _REPORT_CPU_HOB_LIB_H_
+#define _REPORT_CPU_HOB_LIB_H_
+
+#include <PiPei.h>
+#include <Uefi.h>
+
+VOID
+ReportCpuHob (
+  VOID
+  )
+
+#endif
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
index 7f74ac9380..71776dfe80 100644
--- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
+++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
@@ -68,7 +68,9 @@
   TestPointLib|Include/Library/TestPointLib.h
   TestPointCheckLib|Include/Library/TestPointCheckLib.h
 
-SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h
+  SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h
+
+  ReportCpuHobLib|Include/Library/ReportCpuHobLib.h
 
 [PcdsFixedAtBuild, PcdsPatchableInModule]
 
diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
index 13a0fda272..b62351dac6 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/Re
+ portCpuHobLib.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/Library/ReportCpuHobLib/ReportCpuHobLib.c b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.c
new file mode 100644
index 0000000000..aa2565343c
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib
+++ /ReportCpuHobLib.c
@@ -0,0 +1,32 @@
+/** @file
+  Source code file for Report CPU HOB library.
+
+Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
+SPDX-License-Identifier: BSD-2-Clause-Patent
+
+**/
+
+#include <Base.h>
+#include <Library/HobLib.h>
+
+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); }
diff --git a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf
new file mode 100644
index 0000000000..ae6ec901a1
--- /dev/null
+++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib
+++ /ReportCpuHobLib.inf
@@ -0,0 +1,27 @@
+### @file
+# Component information file for the Report CPU HOB library.
+#
+# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR> # # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ###
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = ReportCpuHobLib
+  FILE_GUID                      = F19AA754-CE24-448D-B755-1F939B00C25D
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = BASE
+  LIBRARY_CLASS                  = ReportCpuHobLib
+
+[LibraryClasses]
+  BaseLib
+  HobLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[Sources]
+  PeiReportFvLib.c
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/Platfor
+++ mInitPreMem.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
 
--
2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#57500): https://edk2.groups.io/g/devel/message/57500
Mute This Topic: https://groups.io/mt/73028512/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-

Re: [edk2-devel] [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create Library Instance of ReportCpuHobLib.
Posted by Chiu, Chasel 4 years ago
Pushed: 944af47a8c83115dcd5dae581e5c3770a12a2ed2

Thanks,
Chasel


> -----Original Message-----
> From: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>
> Sent: Friday, April 17, 2020 4:11 PM
> To: Kumar, Chandana C <chandana.c.kumar@intel.com>;
> devel@edk2.groups.io
> Cc: Chiu, Chasel <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: RE: [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create
> Library Instance of ReportCpuHobLib.
> 
> Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>
> 
> -----Original Message-----
> From: Kumar, Chandana C <chandana.c.kumar@intel.com>
> Sent: Wednesday, April 15, 2020 1:31 AM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Chiu, Chasel
> <chasel.chiu@intel.com>; Desimone, Nathaniel L
> <nathaniel.l.desimone@intel.com>
> Subject: [edk2-platforms: PATCH] MinPlatformPkg/PlatformInitPei: Create
> Library Instance of ReportCpuHobLib.
> 
> 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=2674
> 
> Signed-off-by: Chandana Kumar <chandana.c.kumar@intel.com>
> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Chasel Chiu <chasel.chiu@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> ---
>  Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
> | 23 +++++++++++++++++++++++
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> |  4 +++-
>  Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> |  3 ++-
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Repo
> rtCpuHobLib.c   | 32 ++++++++++++++++++++++++++++++++
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Repo
> rtCpuHobLib.inf | 27 +++++++++++++++++++++++++++
> 
> Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPre
> Mem.c        | 25 ++-----------------------
>  6 files changed, 89 insertions(+), 25 deletions(-)
> 
> diff --git
> a/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
> b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
> new file mode 100644
> index 0000000000..79e5d4efb2
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/Include/Library/ReportCpuHobLib.h
> @@ -0,0 +1,23 @@
> +/** @file
> +
> +  Report CPU HOB library
> +
> +  This library report the CPU HOB with Physical Address bits.
> +
> +Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#ifndef _REPORT_CPU_HOB_LIB_H_
> +#define _REPORT_CPU_HOB_LIB_H_
> +
> +#include <PiPei.h>
> +#include <Uefi.h>
> +
> +VOID
> +ReportCpuHob (
> +  VOID
> +  )
> +
> +#endif
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> index 7f74ac9380..71776dfe80 100644
> --- a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> +++ b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dec
> @@ -68,7 +68,9 @@
>    TestPointLib|Include/Library/TestPointLib.h
>    TestPointCheckLib|Include/Library/TestPointCheckLib.h
> 
> -SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h
> +  SetCacheMtrrLib|Include/Library/SetCacheMtrrLib.h
> +
> +  ReportCpuHobLib|Include/Library/ReportCpuHobLib.h
> 
>  [PcdsFixedAtBuild, PcdsPatchableInModule]
> 
> diff --git a/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> b/Platform/Intel/MinPlatformPkg/MinPlatformPkg.dsc
> index 13a0fda272..b62351dac6 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/PeiFspWrappe
> rPlatformLib/PeiFspWrapperPlatformLib.inf
> 
> ReportFvLib|MinPlatformPkg/PlatformInit/Library/PeiReportFvLib/PeiReport
> FvLib.inf
> +
> +
> ReportCpuHobLib|MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/R
> e
> + portCpuHobLib.inf
> 
> TestPointCheckLib|MinPlatformPkg/Test/Library/TestPointCheckLib/PeiTestPo
> intCheckLib.inf
> 
> TestPointLib|MinPlatformPkg/Test/Library/TestPointLib/PeiTestPointLib.inf
> 
> SetCacheMtrrLib|MinPlatformPkg/Library/SetCacheMtrrLib/SetCacheMtrrLib
> Null.inf
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Re
> portCpuHobLib.c
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Re
> portCpuHobLib.c
> new file mode 100644
> index 0000000000..aa2565343c
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib
> +++ /ReportCpuHobLib.c
> @@ -0,0 +1,32 @@
> +/** @file
> +  Source code file for Report CPU HOB library.
> +
> +Copyright (c) 2020, Intel Corporation. All rights reserved.<BR>
> +SPDX-License-Identifier: BSD-2-Clause-Patent
> +
> +**/
> +
> +#include <Base.h>
> +#include <Library/HobLib.h>
> +
> +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); }
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Re
> portCpuHobLib.inf
> b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib/Re
> portCpuHobLib.inf
> new file mode 100644
> index 0000000000..ae6ec901a1
> --- /dev/null
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/Library/ReportCpuHobLib
> +++ /ReportCpuHobLib.inf
> @@ -0,0 +1,27 @@
> +### @file
> +# Component information file for the Report CPU HOB library.
> +#
> +# Copyright (c) 2020, Intel Corporation. All rights reserved.<BR> # #
> +SPDX-License-Identifier: BSD-2-Clause-Patent # ###
> +
> +[Defines]
> +  INF_VERSION                    = 0x00010005
> +  BASE_NAME                      = ReportCpuHobLib
> +  FILE_GUID                      =
> F19AA754-CE24-448D-B755-1F939B00C25D
> +  VERSION_STRING                 = 1.0
> +  MODULE_TYPE                    = BASE
> +  LIBRARY_CLASS                  = ReportCpuHobLib
> +
> +[LibraryClasses]
> +  BaseLib
> +  HobLib
> +
> +[Packages]
> +  MdePkg/MdePkg.dec
> +  MinPlatformPkg/MinPlatformPkg.dec
> +
> +[Sources]
> +  PeiReportFvLib.c
> diff --git
> a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPr
> eMem.c
> b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPr
> eMem.c
> index efdeb6a91c..48cbe0dfbe 100644
> ---
> a/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/PlatformInitPr
> eMem.c
> +++ b/Platform/Intel/MinPlatformPkg/PlatformInit/PlatformInitPei/Platfor
> +++ mInitPreMem.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
> 
> --
> 2.16.2.windows.1


-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.

View/Reply Online (#57506): https://edk2.groups.io/g/devel/message/57506
Mute This Topic: https://groups.io/mt/73028512/1787277
Group Owner: devel+owner@edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub  [importer@patchew.org]
-=-=-=-=-=-=-=-=-=-=-=-