public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
From: "Nate DeSimone" <nathaniel.l.desimone@intel.com>
To: "Oram, Isaac W" <isaac.w.oram@intel.com>,
	"devel@edk2.groups.io" <devel@edk2.groups.io>
Cc: "Chiu, Chasel" <chasel.chiu@intel.com>
Subject: Re: [edk2-devel][edk2-platforms][PATCH V1 1/2] WhitleySiliconPkg/MultiPchPei: Open Source PEIM
Date: Fri, 22 Oct 2021 00:22:38 +0000	[thread overview]
Message-ID: <MW4PR11MB58213C3F0932FF118F623FFCCD809@MW4PR11MB5821.namprd11.prod.outlook.com> (raw)
In-Reply-To: <b9ff27353d55fb9d8d541447c20e9ec1050b234f.1634698531.git.isaac.w.oram@intel.com>

Reviewed-by: Nate DeSimone <nathaniel.l.desimone@intel.com>

-----Original Message-----
From: Oram, Isaac W <isaac.w.oram@intel.com> 
Sent: Tuesday, October 19, 2021 8:00 PM
To: devel@edk2.groups.io
Cc: Oram, Isaac W <isaac.w.oram@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>; Chiu, Chasel <chasel.chiu@intel.com>
Subject: [edk2-devel][edk2-platforms][PATCH V1 1/2] WhitleySiliconPkg/MultiPchPei: Open Source PEIM

Eliminate the need for the binary PEIM currenty in use by Whitley.

Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Cc: Chasel Chiu <chasel.chiu@intel.com>
Signed-off-by: Isaac Oram <isaac.w.oram@intel.com>
---
 Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/Library/PchMultiPch.h | 34 ++++++++
 Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/MultiPch/Pei/MultiPchPei.c    | 84 ++++++++++++++++++++
 Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/MultiPch/Pei/MultiPchPei.inf  | 40 ++++++++++
 3 files changed, 158 insertions(+)

diff --git a/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/Library/PchMultiPch.h b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/Library/PchMultiPch.h
new file mode 100644
index 0000000000..1fe502b7a7
--- /dev/null
+++ b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/Include/Librar
+++ y/PchMultiPch.h
@@ -0,0 +1,34 @@
+/** @file
+  Prototype of the MultiPch library.
+
+  @copyright
+  Copyright 2019 - 2021 Intel Corporation. <BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent **/
+
+#ifndef _PCH_MULTI_PCH_LIB_H_
+#define _PCH_MULTI_PCH_LIB_H_
+
+#include <Ppi/PchPolicy.h>
+#include <Library/PchMultiPchBase.h>
+
+#define PCH_IP_INFO_REVISION              1
+
+typedef struct _PCH_IP_INFO {
+  /**
+    Revision 1:   Original version
+  **/
+  UINT8                        Revision;
+
+  BOOLEAN                      Valid[PCH_MAX];
+  UINT8                        SocketId[PCH_MAX];
+  UINT8                        Segment[PCH_MAX];
+  UINT8                        Bus[PCH_MAX];
+  UINT64                       P2sbBar[PCH_MAX];
+  UINT64                       TempBar[PCH_MAX];
+  UINT64                       PmcBar[PCH_MAX];
+  UINT64                       SpiBar[PCH_MAX];
+} PCH_IP_INFO;
+
+#endif // _PCH_MULTI_PCH_LIB_H_
diff --git a/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/MultiPch/Pei/MultiPchPei.c b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/MultiPch/Pei/MultiPchPei.c
new file mode 100644
index 0000000000..65cee5d031
--- /dev/null
+++ b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/MultiPch/Pei/M
+++ ultiPchPei.c
@@ -0,0 +1,84 @@
+/** @file
+  This driver manages the initial phase of Multi PCH
+
+  @copyright
+  Copyright 2019 - 2021 Intel Corporation. <BR>
+
+  SPDX-License-Identifier: BSD-2-Clause-Patent **/
+
+#include <Base.h>
+#include <PiPei.h>
+#include <Uefi.h>
+#include <Library/PeiServicesLib.h>
+#include <Library/PeiServicesTablePointerLib.h>
+
+#include <Library/BaseLib.h>
+#include <Library/UefiLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MemoryAllocationLib.h> #include 
+<Library/PchMultiPch.h>
+
+///
+/// The default PCH PCI segment number
+///
+#define DEFAULT_PCI_SEGMENT_NUMBER_PCH  0
+
+/**
+ @brief
+   Multi PCH entry point.
+
+ @param[in] FileHandle  PEIM file handle @param[in] PeiServices General 
+ purpose services available to every PEIM
+
+ @retval EFI_SUCCESS    The function completed successfully.
+**/
+EFI_STATUS
+MultiPchPeiEntryPoint (
+  IN       EFI_PEI_FILE_HANDLE  FileHandle,
+  IN CONST EFI_PEI_SERVICES     **PeiServices
+  )
+{
+  EFI_STATUS                    Status;
+  PCH_IP_INFO                   *PchInfo;
+  EFI_PEI_PPI_DESCRIPTOR        *PchIpInfoPpiDesc;
+
+  DEBUG ((DEBUG_INFO, "[PCH] MultiPchPeiEntryPoint called.\n"));
+
+  //
+  // Create PchIpInfo
+  //
+  PchInfo = (PCH_IP_INFO *) AllocateZeroPool (sizeof (PCH_IP_INFO));  
+ if (PchInfo == NULL) {
+    ASSERT (FALSE);
+    return EFI_OUT_OF_RESOURCES;
+  }
+  PchInfo->Revision = PCH_IP_INFO_REVISION;  
+ PchInfo->Valid[PCH_LEGACY_ID] = TRUE;  PchInfo->Segment[PCH_LEGACY_ID] 
+ = DEFAULT_PCI_SEGMENT_NUMBER_PCH;  PchInfo->Bus[PCH_LEGACY_ID] = 
+ DEFAULT_PCI_BUS_NUMBER_PCH;  PchInfo->P2sbBar[PCH_LEGACY_ID] = 
+ PCH_PCR_BASE_ADDRESS;  PchInfo->PmcBar[PCH_LEGACY_ID] = 
+ PCH_PWRM_BASE_ADDRESS;  PchInfo->SpiBar[PCH_LEGACY_ID] = 
+ PCH_SPI_BASE_ADDRESS;  PchInfo->TempBar[PCH_LEGACY_ID] = 
+ PCH_TEMP_BASE_ADDRESS;
+
+  //
+  // Install PchIpInfoPpi
+  //
+  PchIpInfoPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool 
+ (sizeof (EFI_PEI_PPI_DESCRIPTOR));  if (PchIpInfoPpiDesc == NULL) {
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  PchIpInfoPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | 
+ EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
+  PchIpInfoPpiDesc->Guid  = &gPchIpInfoPpiGuid;
+  PchIpInfoPpiDesc->Ppi   = PchInfo;
+
+  Status = PeiServicesInstallPpi (PchIpInfoPpiDesc);  if (EFI_ERROR 
+ (Status)) {
+    ASSERT_EFI_ERROR (Status);
+    return EFI_UNSUPPORTED;
+  }
+
+  return EFI_SUCCESS;
+}
diff --git a/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/MultiPch/Pei/MultiPchPei.inf b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/MultiPch/Pei/MultiPchPei.inf
new file mode 100644
index 0000000000..bd15593f2b
--- /dev/null
+++ b/Silicon/Intel/WhitleySiliconPkg/Pch/SouthClusterLbg/MultiPch/Pei/M
+++ ultiPchPei.inf
@@ -0,0 +1,40 @@
+## @file
+# This driver manages the initial phase of Multi PCH # # @copyright # 
+Copyright 2019 - 2021 Intel Corporation. <BR> # # 
+SPDX-License-Identifier: BSD-2-Clause-Patent ##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = MultiPch
+  FILE_GUID                      = 0043A734-CB11-4274-B363-E165F958CB5F
+  MODULE_TYPE                    = PEIM
+  VERSION_STRING                 = 1.0
+  ENTRY_POINT                    = MultiPchPeiEntryPoint
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+#  VALID_ARCHITECTURES           = IA32
+#
+
+[Sources]
+  MultiPchPei.c
+
+[Packages]
+  MdePkg/MdePkg.dec
+  WhitleySiliconPkg/SiliconPkg.dec
+
+[LibraryClasses]
+  BaseLib
+  PeimEntryPoint
+  DebugLib
+
+[Ppis]
+  gPchIpInfoPpiGuid
+
+[Depex]
+  TRUE
--
2.27.0.windows.1


  reply	other threads:[~2021-10-22  0:22 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-10-20  2:59 [edk2-devel][edk2-platforms][PATCH V1 0/2] Eliminate MultiPchPei PEIM binary Oram, Isaac W
2021-10-20  2:59 ` [edk2-devel][edk2-platforms][PATCH V1 1/2] WhitleySiliconPkg/MultiPchPei: Open Source PEIM Oram, Isaac W
2021-10-22  0:22   ` Nate DeSimone [this message]
2021-10-20  2:59 ` [edk2-devel][edk2-platforms][PATCH V1 2/2] WhitleyOpenBoardPkg/Build: Remove MultiPchPei PEIM binary use Oram, Isaac W
2021-10-22  0:22   ` Nate DeSimone

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=MW4PR11MB58213C3F0932FF118F623FFCCD809@MW4PR11MB5821.namprd11.prod.outlook.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