public inbox for devel@edk2.groups.io
 help / color / mirror / Atom feed
* [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers
@ 2021-02-09  8:45 Heng Luo
  2021-02-09  8:45 ` [Patch V2 2/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add fdf and header file Heng Luo
                   ` (7 more replies)
  0 siblings, 8 replies; 18+ messages in thread
From: Heng Luo @ 2021-02-09  8:45 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Nate DeSimone

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

Create the TigerlakeOpenBoardPkg to provide board support code. The
package may support Tigerlake boards. The package serves as a board
support package in the EDK II Minimum Platform design. Silicon support
for this package is provided in TigerLakeFspBinPkg in the FSP repository
and TigerlakeSiliconPkg in the edk2-platforms repository.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardConfig.h |  61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardId.h     |  17 +++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Include/PolicyUpdateMacro.h   |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/OpenBoardPkg.dec              | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 280 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardConfig.h b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardConfig.h
new file mode 100644
index 0000000000..148abcce74
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardConfig.h
@@ -0,0 +1,61 @@
+/** @file
+  Header file for Platform Boards Configurations.
+
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _PLATFORM_BOARD_CONFIG_H
+#define _PLATFORM_BOARD_CONFIG_H
+
+#include <ConfigBlock.h>
+#include <PchPolicyCommon.h>
+
+
+#pragma pack(1)
+
+typedef struct {
+  UINT8 ClkReqNumber : 4;
+  UINT8 ClkReqSupported : 1;
+  UINT8 DeviceResetPadActiveHigh : 1;
+  UINT32 DeviceResetPad;
+} ROOT_PORT_CLK_INFO;
+
+typedef struct {
+  UINT8 Section;
+  UINT8 Pin;
+} EXPANDER_GPIO_CONFIG;
+
+typedef struct {
+  UINT8 Type;
+  UINT8 Reserved[3];  // alignment for COMMON_GPIO_CONFIG
+  union {
+    UINT32 Pin;
+    EXPANDER_GPIO_CONFIG Expander;
+  } u;
+} BOARD_GPIO_CONFIG;
+
+// Do not change the encoding. It must correspond with PCH_PCIE_CLOCK_USAGE from PCH RC.
+#define NOT_USED     0xFF
+#define FREE_RUNNING 0x80
+#define LAN_CLOCK    0x70
+#define PCIE_PEG     0x40
+#define PCIE_PCH     0x00
+
+typedef struct {
+  UINT32 ClockUsage;
+  UINT32 ClkReqSupported;
+} PCIE_CLOCK_CONFIG;
+
+typedef union {
+  UINT64 Blob;
+  BOARD_GPIO_CONFIG  BoardGpioConfig;
+  ROOT_PORT_CLK_INFO Info;
+  PCIE_CLOCK_CONFIG  PcieClock;
+} PCD64_BLOB;
+
+#pragma pack()
+
+#endif // _PLATFORM_BOARD_CONFIG_H
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardId.h b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardId.h
new file mode 100644
index 0000000000..2e1ee9eca4
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardId.h
@@ -0,0 +1,17 @@
+/** @file
+  Defines Platform BoardIds
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _PLATFORM_BOARD_ID_H_
+#define _PLATFORM_BOARD_ID_H_
+
+// TigerLake Sku IDs
+#define SkuIdTglU                         0x1
+
+// TigerLake Board Id 0x01
+#define BoardIdTglUDdr4                   0x01
+
+#endif // _PLATFORM_BOARD_ID_H_
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Include/PolicyUpdateMacro.h b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PolicyUpdateMacro.h
new file mode 100644
index 0000000000..0848efe5b6
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PolicyUpdateMacro.h
@@ -0,0 +1,49 @@
+
+/** @file
+  Macros for platform to update different types of policy.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _POLICY_UPDATE_MACRO_H_
+#define _POLICY_UPDATE_MACRO_H_
+
+#ifdef UPDATE_POLICY
+#undef UPDATE_POLICY
+#endif
+
+#ifdef COPY_POLICY
+#undef COPY_POLICY
+#endif
+
+#ifdef GET_POLICY
+#undef GET_POLICY
+#endif
+
+#ifdef AND_POLICY
+#undef AND_POLICY
+#endif
+
+#ifdef OR_POLICY
+#undef OR_POLICY
+#endif
+
+#if FixedPcdGetBool(PcdFspModeSelection) == 1
+//
+// MACROS for platform code use
+//
+#define UPDATE_POLICY(UpdField, ConfigField, Value)  UpdField = Value;
+#define COPY_POLICY(UpdField, ConfigField, Value, Size)  CopyMem (UpdField, Value, Size);
+#define GET_POLICY(UpdField, ConfigField, Value)  Value = UpdField;
+#define AND_POLICY(UpdField, ConfigField, Value)  UpdField &= Value;
+#define OR_POLICY(UpdField, ConfigField, Value)  UpdField |= Value;
+#else
+#define UPDATE_POLICY(UpdField, ConfigField, Value)  ConfigField = Value;
+#define COPY_POLICY(UpdField, ConfigField, Value, Size)  CopyMem (ConfigField, Value, Size);
+#define GET_POLICY(UpdField, ConfigField, Value)  Value = ConfigField;
+#define AND_POLICY(UpdField, ConfigField, Value)  ConfigField &= Value;
+#define OR_POLICY(UpdField, ConfigField, Value)  ConfigField |= Value;
+#endif
+
+#endif //_POLICY_UPDATE_MACRO_H_
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/OpenBoardPkg.dec b/Platform/Intel/TigerlakeOpenBoardPkg/OpenBoardPkg.dec
new file mode 100644
index 0000000000..91f0a88470
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/OpenBoardPkg.dec
@@ -0,0 +1,153 @@
+## @file
+#
+# The DEC files are used by the utilities that parse DSC and
+# INF files to generate AutoGen.c and AutoGen.h files
+# for the build infrastructure.
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+[Defines]
+DEC_SPECIFICATION = 0x00010017
+PACKAGE_NAME = OpenBoardPkg
+PACKAGE_VERSION = 0.1
+PACKAGE_GUID = 734F5E12-4C70-4EC9-908B-D7421B4B128C
+
+[Includes]
+Include
+TigerlakeURvp/Include
+
+[Guids]
+  gBoardModuleTokenSpaceGuid            =  {0x72d1fff7, 0xa42a, 0x4219, {0xb9, 0x95, 0x5a, 0x67, 0x53, 0x6e, 0xa4, 0x2a}}
+  # gUefiShellFileGuid is FILE GUID for MinUefiShell.inf/UefiShell.inf/Shell.inf.
+  gUefiShellFileGuid                    =  {0x7c04a583, 0x9e3e, 0x4f1c, {0xad, 0x65, 0xe0, 0x52, 0x68, 0xd0, 0xb4, 0xd1}}
+  gPlatformInitFvLocationGuid           =  {0xa564010a, 0x1d90, 0x4b1c, {0x8d, 0x10, 0xcb, 0xba, 0xff, 0xb2, 0x55, 0x42}}
+  gTianoLogoGuid                        =  {0x7BB28B99, 0x61BB, 0x11D5, {0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}}
+
+[Protocols]
+  gPlatformNvsAreaProtocolGuid          =  {0xc77ae556, 0x40a3, 0x41c0, {0xac, 0xe6, 0x71, 0x43, 0x8c, 0x60, 0xf8, 0x71}}
+
+[Ppis]
+
+[LibraryClasses]
+
+[PcdsFixedAtBuild, PcdsPatchableInModule]
+
+[PcdsFixedAtBuild]
+  gBoardModuleTokenSpaceGuid.PcdLpcIoDecodeRange|0x0010|UINT16|0x10001004
+  gBoardModuleTokenSpaceGuid.PchLpcIoEnableDecoding|0x3c03|UINT16|0x10001005
+
+  gBoardModuleTokenSpaceGuid.PcdLpcSioIndexPort|0x4e|UINT16|0x90000018
+  gBoardModuleTokenSpaceGuid.PcdLpcSioDataPort|0x4f|UINT16|0x9000001F
+
+  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort|0x164E|UINT16|0x9000001C
+  gBoardModuleTokenSpaceGuid.PcdSioBaseAddress|0x0680|UINT16|0x9000001D
+
+  gBoardModuleTokenSpaceGuid.PcdDmiBaseAddress|0xFED18000|UINT64|0x90000003
+  gBoardModuleTokenSpaceGuid.PcdDmiMmioSize|0x1000|UINT32|0x90000004
+
+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesBase|0x00000000|UINT32|0x20000040
+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize|0x00000000|UINT32|0x20000041
+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesOffset|0x00000000|UINT32|0x20000042
+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalBase|0x00000000|UINT32|0x2000004C
+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize|0x00000000|UINT32|0x2000004D
+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalOffset|0x00000000|UINT32|0x2000004E
+  gBoardModuleTokenSpaceGuid.PcdEpBaseAddress|0xFED19000|UINT64|0x90000005
+  gBoardModuleTokenSpaceGuid.PcdEpMmioSize|0x1000|UINT32|0x90000006
+
+[PcdsDynamic]
+  # Board GPIO Table
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTable|0|UINT32|0x00000040
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTableSize|0|UINT16|0x00000041
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMem|0|UINT32|0x00000042
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMemSize|0|UINT16|0x00000043
+
+  # SA Misc Configuration
+  gBoardModuleTokenSpaceGuid.PcdSaMiscUserBd|0|UINT8|0x00000066
+  gBoardModuleTokenSpaceGuid.PcdSaMiscMmioSizeAdjustment|0|UINT16|0x00000067
+
+  # DRAM Configuration
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdData|0|UINT32|0x00000174
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdDataSize|0|UINT16|0x00000175
+
+  # SPD Address Table
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable0|0|UINT8|0x00000099
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable1|0|UINT8|0x0000009A
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable2|0|UINT8|0x0000009B
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable3|0|UINT8|0x0001009C
+
+  # Root Port Clock Info
+  gBoardModuleTokenSpaceGuid.PcdPcieClock0|0|UINT64|0x0000009E
+  gBoardModuleTokenSpaceGuid.PcdPcieClock1|0|UINT64|0x0000009F
+  gBoardModuleTokenSpaceGuid.PcdPcieClock2|0|UINT64|0x000000A0
+  gBoardModuleTokenSpaceGuid.PcdPcieClock3|0|UINT64|0x000000A1
+  gBoardModuleTokenSpaceGuid.PcdPcieClock4|0|UINT64|0x000000A2
+  gBoardModuleTokenSpaceGuid.PcdPcieClock5|0|UINT64|0x000000A3
+  gBoardModuleTokenSpaceGuid.PcdPcieClock6|0|UINT64|0x000000A4
+  gBoardModuleTokenSpaceGuid.PcdPcieClock7|0|UINT64|0x000000A5
+  gBoardModuleTokenSpaceGuid.PcdPcieClock8|0|UINT64|0x000000A6
+  gBoardModuleTokenSpaceGuid.PcdPcieClock9|0|UINT64|0x000000A7
+  gBoardModuleTokenSpaceGuid.PcdPcieClock10|0|UINT64|0x000000A8
+  gBoardModuleTokenSpaceGuid.PcdPcieClock11|0|UINT64|0x000000A9
+  gBoardModuleTokenSpaceGuid.PcdPcieClock12|0|UINT64|0x000000AA
+  gBoardModuleTokenSpaceGuid.PcdPcieClock13|0|UINT64|0x000000AB
+  gBoardModuleTokenSpaceGuid.PcdPcieClock14|0|UINT64|0x000000AC
+  gBoardModuleTokenSpaceGuid.PcdPcieClock15|0|UINT64|0x000000AD
+
+  # USB 2.0 Port Over Current Pin
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort0|0xFF|UINT8|0x000000CF
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort1|0xFF|UINT8|0x000000D0
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort2|0xFF|UINT8|0x000000D1
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort3|0xFF|UINT8|0x000000D2
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort4|0xFF|UINT8|0x000000D3
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort5|0xFF|UINT8|0x000000D4
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort6|0xFF|UINT8|0x000000D5
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort7|0xFF|UINT8|0x000000D6
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort8|0xFF|UINT8|0x000000D7
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort9|0xFF|UINT8|0x000000D8
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort10|0xFF|UINT8|0x000000D9
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort11|0xFF|UINT8|0x000000DA
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort12|0xFF|UINT8|0x000000DB
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort13|0xFF|UINT8|0x000000DC
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort14|0xFF|UINT8|0x000000DD
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort15|0xFF|UINT8|0x000000DE
+
+  # USB 3.0 Port Over Current Pin
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort0|0xFF|UINT8|0x000000DF
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort1|0xFF|UINT8|0x000000E0
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort2|0xFF|UINT8|0x000000E1
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort3|0xFF|UINT8|0x000000E2
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort4|0xFF|UINT8|0x000000E3
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort5|0xFF|UINT8|0x000000E4
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort6|0xFF|UINT8|0x000000E5
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort7|0xFF|UINT8|0x000000E6
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort8|0xFF|UINT8|0x000000E7
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort9|0xFF|UINT8|0x000000E8
+  gBoardModuleTokenSpaceGuid.PcdCpuUsb30PortEnable|0|UINT8|0x00100032
+
+  # CPU
+  gBoardModuleTokenSpaceGuid.PcdCpuRatio|0x0|UINT8|0x00000200
+  gBoardModuleTokenSpaceGuid.PcdBiosGuard|0x0|UINT8|0x00000201
+
+  # ACPI
+  gBoardModuleTokenSpaceGuid.PcdAcpiSleepState|1|UINT8|0x40000002
+  gBoardModuleTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x40000003
+  gBoardModuleTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0x40000004
+  gBoardModuleTokenSpaceGuid.PcdDisableActiveTripPoints|1|UINT8|0x4000000A
+  gBoardModuleTokenSpaceGuid.PcdDisablePassiveTripPoints|0|UINT8|0x4000000B
+  gBoardModuleTokenSpaceGuid.PcdDisableCriticalTripPoints|1|UINT8|0x4000000C
+  gBoardModuleTokenSpaceGuid.PcdAcpiGnvsAddress|0|UINT64|0x40000013
+
+  gBoardModuleTokenSpaceGuid.PcdGraphicsVbtGuid|{0x22, 0x61, 0xd4, 0x4a, 0xeb, 0xff, 0x52, 0x4a, 0xbf, 0xb0, 0x51, 0x8c, 0xfc, 0xa0, 0x2d, 0xb0}|VOID*|0x40000014
+
+[PcdsDynamicEx]
+
+[PcdsDynamic, PcdsDynamicEx]
+
+[PcdsPatchableInModule]
+
+[PcdsFeatureFlag]
+  gBoardModuleTokenSpaceGuid.PcdIntelGopEnable      |TRUE|BOOLEAN|0xF0000062
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Patch V2 2/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add fdf and header file
  2021-02-09  8:45 [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Heng Luo
@ 2021-02-09  8:45 ` Heng Luo
  2021-02-09 23:42   ` Chaganty, Rangasai V
  2021-02-09  8:45 ` [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances Heng Luo
                   ` (6 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Heng Luo @ 2021-02-09  8:45 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Nate DeSimone

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

Adds the following files:
  * TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf
  * TigerlakeURvp/Include/PeiPlatformHookLib.h

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf |  54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/PeiPlatformHookLib.h    | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf
new file mode 100644
index 0000000000..b21ae6401f
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf
@@ -0,0 +1,54 @@
+## @file
+#  FDF file of Platform.
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+#=================================================================================#
+# 12 M BIOS - for FSP wrapper
+#=================================================================================#
+DEFINE FLASH_BASE                                                   = 0xFF400000  #
+DEFINE FLASH_SIZE                                                   = 0x00C00000  #
+DEFINE FLASH_BLOCK_SIZE                                             = 0x00010000  #
+DEFINE FLASH_NUM_BLOCKS                                             = 0x000000C0  #
+#=================================================================================#
+
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageOffset             = 0x00000000  # Flash addr (0xFF400000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageSize               = 0x00060000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageVariableOffset     = 0x00000000  # Flash addr (0xFF400000)
+SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize      = 0x0002E000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingOffset   = 0x0002E000  # Flash addr (0xFF42E000)
+SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize    = 0x00002000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareOffset     = 0x00030000  # Flash addr (0xFF430000)
+SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize      = 0x00030000  #
+
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedOffset            = 0x000E0000  # Flash addr (0xFF4E0000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize              = 0x001A0000  #
+SET gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalOffset               = 0x00280000  # Flash addr (0xFF680000)
+SET gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize                 = 0x00300000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset              = 0x00580000  # Flash addr (0xFF980000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize                = 0x000A0000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset            = 0x00620000  # Flash addr (0xFFA20000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize              = 0x001D0000  #
+
+## Firmware binaries FV absolute address requires 256kB alignment
+## Build script checks the requirement.
+SET gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesOffset       = 0x00800000  # Flash addr (0xFFC00000)
+SET gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize         = 0x00080000  # Keep 0x80000 or larger
+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset                    = 0x00880000  # Flash addr (0xFFC80000)
+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize                      = 0x00070000  # Keep 0x70000 or larger, change MicrocodeFv.fdf in case that this value change
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset          = 0x008F0000  # Flash addr (0xFFC00000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize            = 0x00080000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset                = 0x00970000  # Flash addr (0xFFD70000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize                  = 0x000A0000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset                = 0x00A10000  # Flash addr (0xFFE10000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize                  = 0x00110000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset                = 0x00B20000  # Flash addr (0xFFF20000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                  = 0x00010000  #
+
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset            = 0x00B30000  # Flash addr (0xFFF30000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize              = 0x00020000  #
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset           = 0x00B50000  # Flash addr (0xFFF50000)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize             = 0x000B0000  #
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/PeiPlatformHookLib.h b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/PeiPlatformHookLib.h
new file mode 100644
index 0000000000..f8611764f5
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/PeiPlatformHookLib.h
@@ -0,0 +1,130 @@
+/** @file
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _PEI_PLATFORM_HOOK_LIB_H_
+#define _PEI_PLATFORM_HOOK_LIB_H_
+
+#include <Library/PeiServicesLib.h>
+#include <Library/GpioLib.h>
+
+
+//EC Command to provide one byte of debug indication
+#define BSSB_DEBUG_INDICATION 0xAE
+/**
+  Configure EC for specific devices
+
+  @param[in] PchLan       - The PchLan of PCH_SETUP variable.
+  @param[in] BootMode     - The current boot mode.
+**/
+VOID
+EcInit (
+  IN UINT8                PchLan,
+  IN EFI_BOOT_MODE        BootMode
+  );
+
+/**
+  Checks if Premium PMIC present
+
+  @retval  TRUE  if present
+  @retval  FALSE it discrete/other PMIC
+**/
+BOOLEAN
+IsPremiumPmicPresent (
+  VOID
+  );
+
+/**
+  Pmic Programming to supprort LPAL Feature
+
+  @retval     NONE
+**/
+VOID
+PremiumPmicDisableSlpS0Voltage (
+  VOID
+  );
+
+/**
+Pmic Programming to supprort LPAL Feature
+  @retval     NONE
+**/
+VOID
+PremiumPmicEnableSlpS0Voltage(
+  VOID
+  );
+
+/**
+  Do platform specific programming pre-memory. For example, EC init, Chipset programming
+
+  @retval  Status
+**/
+EFI_STATUS
+PlatformSpecificInitPreMem (
+  VOID
+  );
+
+/**
+  Do platform specific programming post-memory.
+
+  @retval  Status
+**/
+EFI_STATUS
+PlatformSpecificInit (
+  VOID
+  );
+
+/**
+  Configure GPIO and SIO Before Memory is ready.
+
+  @retval  EFI_SUCCESS   Operation success.
+**/
+EFI_STATUS
+BoardInitPreMem (
+  VOID
+  );
+
+/**
+  Configure GPIO and SIO
+
+  @retval  EFI_SUCCESS   Operation success.
+**/
+EFI_STATUS
+BoardInit (
+  VOID
+  );
+
+/**
+Voltage Margining Routine
+
+@retval  EFI_SUCCESS   Operation success
+**/
+EFI_STATUS
+VoltageMarginingRoutine(
+  VOID
+  );
+
+/**
+  Detect recovery mode
+
+  @retval  EFI_SUCCESS       System in Recovery Mode
+  @retval  EFI_UNSUPPORTED   System doesn't support Recovery Mode
+  @retval  EFI_NOT_FOUND     System is not in Recovery Mode
+**/
+EFI_STATUS
+IsRecoveryMode (
+  VOID
+  );
+
+/**
+  Early board Configuration before Memory is ready.
+
+  @retval  EFI_SUCCESS  Operation success.
+**/
+EFI_STATUS
+BoardInitEarlyPreMem (
+  VOID
+  );
+#endif
+
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances
  2021-02-09  8:45 [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Heng Luo
  2021-02-09  8:45 ` [Patch V2 2/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add fdf and header file Heng Luo
@ 2021-02-09  8:45 ` Heng Luo
  2021-02-09 23:45   ` Chaganty, Rangasai V
  2021-02-09  8:45 ` [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: " Heng Luo
                   ` (5 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Heng Luo @ 2021-02-09  8:45 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Nate DeSimone

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

Adds the following library instances:
  * FspWrapper/Library/PeiFspPolicyInitLib
  * FspWrapper/Library/PeiSiDefaultPolicyInitLib
  * FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib
  * Library/BasePlatformHookLib
  * Library/SmmSpiFlashCommonLib
  * Policy/Library/DxeSiliconPolicyUpdateLib

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c                        |  79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c                         |  51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c                          |  27 +++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c                        | 372 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c                           | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h                           | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf                         | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c                         | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c                   |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c               |  39 +++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf             |  38 ++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c   |  40 ++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf |  38 ++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c                                      | 391 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.inf                                    |  51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf                                  |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommon.c                                          | 210 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c                                    |  58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c                            | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxePchPolicyInit.c                            |  61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.c                             |  61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLate.c                  |  97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf                 |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 23 files changed, 2846 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c
new file mode 100644
index 0000000000..1358d6a19b
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c
@@ -0,0 +1,79 @@
+/** @file
+  Implementation of Fsp CPU Policy Initialization.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PeiFspPolicyInitLib.h>
+
+#include <Ppi/SiPolicy.h>
+#include <Ppi/SecPlatformInformation2.h>
+
+#include <CpuAccess.h>
+#include <Library/HobLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/ConfigBlockLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/PeiServicesLib.h>
+#include <Library/PeiServicesTablePointerLib.h>
+#include <Library/PcdLib.h>
+#include <FspEas.h>
+#include <PolicyUpdateMacro.h>
+
+/**
+  Performs FSP CPU PEI Policy initialization.
+
+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspCpuPolicyInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  )
+{
+  CPU_CONFIG_LIB_PREMEM_CONFIG    *CpuConfigLibPreMemConfig;
+  CPU_SECURITY_PREMEM_CONFIG      *CpuSecurityPreMemConfig;
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  EFI_STATUS                      Status;
+  SI_PREMEM_POLICY_PPI            *SiPreMemPolicyPpi;
+  SiPreMemPolicyPpi = NULL;
+#endif
+
+  CpuConfigLibPreMemConfig = NULL;
+  CpuSecurityPreMemConfig = NULL;
+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Update SiCpuPolicy Pre-Mem Start\n"));
+
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  //
+  // Locate SiPreMemPolicyPpi
+  //
+  Status = PeiServicesLocatePpi (
+             &gSiPreMemPolicyPpiGuid,
+             0,
+             NULL,
+             (VOID **) &SiPreMemPolicyPpi
+             );
+  if (EFI_ERROR (Status)) {
+    return EFI_NOT_FOUND;
+  }
+  Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gCpuConfigLibPreMemConfigGuid, (VOID *) &CpuConfigLibPreMemConfig);
+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Update SiCpuPolicy Pre-Mem End\n"));
+  Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gCpuSecurityPreMemConfigGuid, (VOID *) &CpuSecurityPreMemConfig);
+  ASSERT_EFI_ERROR(Status);
+#endif
+  //
+  //  Cpu Config Lib policies
+  //
+  UPDATE_POLICY (FspmUpd->FspmConfig.CpuRatio, CpuConfigLibPreMemConfig->CpuRatio, 0);
+  DEBUG ((DEBUG_INFO, "BIOS Guard PCD and Policy are disabled\n"));
+  UPDATE_POLICY (FspmUpd->FspmConfig.BiosGuard, CpuSecurityPreMemConfig->BiosGuard, 0);
+  UPDATE_POLICY (FspmUpd->FspmConfig.PrmrrSize, CpuSecurityPreMemConfig->PrmrrSize, SIZE_1MB);
+  UPDATE_POLICY (FspmUpd->FspmConfig.EnableC6Dram, CpuSecurityPreMemConfig->EnableC6Dram, 1);
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c
new file mode 100644
index 0000000000..53b5ef43cd
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c
@@ -0,0 +1,51 @@
+/** @file
+  Implementation of Fsp Me Policy Initialization.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PeiFspPolicyInitLib.h>
+#include <Ppi/SiPolicy.h>
+#include <Library/ConfigBlockLib.h>
+
+/**
+  Performs FSP ME PEI Policy pre mem initialization.
+
+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspMePolicyInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  )
+{
+  DEBUG ((DEBUG_INFO, "PeiFspMePolicyInitPreMem\n"));
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Performs FSP ME PEI Policy initialization.
+
+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspMePolicyInit (
+  IN OUT FSPS_UPD    *FspsUpd
+  )
+{
+  DEBUG ((DEBUG_INFO, "PeiFspMePolicyInit \n"));
+
+  return EFI_SUCCESS;
+}
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c
new file mode 100644
index 0000000000..5a12e569d9
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c
@@ -0,0 +1,27 @@
+/** @file
+  Implementation of Fsp Misc UPD Initialization.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PeiFspPolicyInitLib.h>
+
+#include <Library/MemoryAllocationLib.h>
+#include <Library/HobLib.h>
+/**
+  Performs FSP Misc UPD initialization.
+
+  @param[in][out]  FspmUpd             Pointer to FSPM_UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspMiscUpdInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  )
+{
+  return EFI_SUCCESS;
+}
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c
new file mode 100644
index 0000000000..67b75d6faf
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c
@@ -0,0 +1,372 @@
+/** @file
+  Implementation of Fsp PCH Policy Initialization.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PeiFspPolicyInitLib.h>
+
+#include <Ppi/SiPolicy.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/PeiServicesLib.h>
+#include <Library/PchInfoLib.h>
+#include <Library/ConfigBlockLib.h>
+#include <Pins/GpioPinsVer2Lp.h>
+#include <TcssInfo.h>
+#include <TcssPeiConfig.h>
+#include <PolicyUpdateMacro.h>
+#include <PlatformBoardConfig.h>
+
+//
+// USB limits
+//
+#define PCH_MAX_USB2_PORTS                  16
+#define PCH_MAX_USB3_PORTS                  10
+
+//
+// TypeC port map GPIO pin
+//
+IOM_AUX_ORI_PAD_CONFIG mIomAuxNullTable[MAX_IOM_AUX_BIAS_COUNT] = {
+  // Pull UP GPIO Pin, Pull Down GPIO pin
+  {0,                  0}, // Port 0
+  {0,                  0}, // Port 1
+  {0,                  0}, // Port 2
+  {0,                  0}, // Port 3
+};
+
+
+VOID
+UpdatePcieClockInfo (
+  PCH_PCIE_RP_PREMEM_CONFIG  *PcieRpPreMemConfig,
+  IN FSPM_UPD                 *FspmUpd,
+  UINTN                      Index,
+  UINT64                     Data
+  )
+{
+  PCD64_BLOB Pcd64;
+
+  Pcd64.Blob = Data;
+  DEBUG ((DEBUG_INFO, "UpdatePcieClockInfo ClkIndex %x ClkUsage %x, Supported %x\n", Index, Pcd64.PcieClock.ClockUsage, Pcd64.PcieClock.ClkReqSupported));
+
+  UPDATE_POLICY (FspmUpd->FspmConfig.PcieClkSrcUsage[Index], PcieRpPreMemConfig->PcieClock[Index].Usage, (UINT8)Pcd64.PcieClock.ClockUsage);
+  UPDATE_POLICY (FspmUpd->FspmConfig.PcieClkSrcClkReq[Index], PcieRpPreMemConfig->PcieClock[Index].ClkReq, Pcd64.PcieClock.ClkReqSupported ? (UINT8)Index : 0xFF);
+}
+/**
+  Performs FSP PCH PEI Policy pre mem initialization.
+
+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspPchPolicyInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  )
+{
+  UINTN                        Index;
+  PCH_PCIE_RP_PREMEM_CONFIG    *PcieRpPreMemConfig;
+  HDAUDIO_PREMEM_CONFIG        *HdaPreMemConfig;
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  SI_PREMEM_POLICY_PPI         *SiPreMemPolicy;
+  EFI_STATUS                   Status;
+
+  //
+  // Locate PchPreMemPolicyPpi
+  //
+  SiPreMemPolicy = NULL;
+  PcieRpPreMemConfig = NULL;
+  HdaPreMemConfig = NULL;
+  Status = PeiServicesLocatePpi (
+             &gSiPreMemPolicyPpiGuid,
+             0,
+             NULL,
+             (VOID **) &SiPreMemPolicy
+             );
+  if (EFI_ERROR (Status)) {
+    return EFI_NOT_FOUND;
+  }
+
+  Status = GetConfigBlock ((VOID *) SiPreMemPolicy, &gPcieRpPreMemConfigGuid, (VOID *) &PcieRpPreMemConfig);
+  ASSERT_EFI_ERROR (Status);
+  Status = GetConfigBlock ((VOID *) SiPreMemPolicy, &gHdAudioPreMemConfigGuid, (VOID *) &HdaPreMemConfig);
+  ASSERT_EFI_ERROR (Status);
+#else
+  PcieRpPreMemConfig = NULL;
+  HdaPreMemConfig = NULL;
+#endif
+
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 0, PcdGet64  (PcdPcieClock0));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 1, PcdGet64  (PcdPcieClock1));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 2, PcdGet64  (PcdPcieClock2));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 3, PcdGet64  (PcdPcieClock3));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 4, PcdGet64  (PcdPcieClock4));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 5, PcdGet64  (PcdPcieClock5));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 6, PcdGet64  (PcdPcieClock6));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 7, PcdGet64  (PcdPcieClock7));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 8, PcdGet64  (PcdPcieClock8));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 9, PcdGet64  (PcdPcieClock9));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 10, PcdGet64 (PcdPcieClock10));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 11, PcdGet64 (PcdPcieClock11));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 12, PcdGet64 (PcdPcieClock12));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 13, PcdGet64 (PcdPcieClock13));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 14, PcdGet64 (PcdPcieClock14));
+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 15, PcdGet64 (PcdPcieClock15));
+
+  //
+  // Update HDA policies
+  //
+  UPDATE_POLICY (FspmUpd->FspmConfig.PchHdaIDispLinkTmode, HdaPreMemConfig->IDispLinkTmode, 0);
+  UPDATE_POLICY (FspmUpd->FspmConfig.PchHdaSdiEnable[0], HdaPreMemConfig->AudioLinkHda.SdiEnable[0], FALSE);
+
+  for (Index = 0; Index < GetPchHdaMaxDmicLinkNum (); Index++) {
+    UPDATE_POLICY (FspmUpd->FspmConfig.PchHdaAudioLinkDmicClockSelect[Index], HdaPreMemConfig->AudioLinkDmic[Index].DmicClockSelect, 0);
+  }
+  DEBUG((DEBUG_INFO | DEBUG_INIT, "UpdatePeiPchPolicyPreMem\n"));
+  return EFI_SUCCESS;
+}
+
+/**
+  This function updates USB Policy per port OC Pin number
+
+  @param[in]  PchUsbConfig     Pointer to USB_CONFIG data buffer
+  @param[in]  PortIndex        USB Port index
+  @param[in]  Pin              OverCurrent pin number
+**/
+VOID
+UpdateUsb20OverCurrentPolicy (
+  IN OUT FSPS_UPD               *FspsUpd,
+  IN USB_CONFIG                 *UsbConfig,
+  IN UINT8                      PortIndex,
+  UINT8                         Pin
+)
+{
+  if (PortIndex < MAX_USB2_PORTS && ((Pin < USB_OC_MAX_PINS) || (Pin == USB_OC_SKIP))) {
+      UPDATE_POLICY (
+        FspsUpd->FspsConfig.Usb2OverCurrentPin[PortIndex],
+        UsbConfig->PortUsb20[PortIndex].OverCurrentPin,
+        Pin
+        );
+  } else {
+    if (PortIndex >= MAX_USB2_PORTS) {
+      DEBUG ((DEBUG_ERROR, "UpdateUsb20OverCurrentPolicy: USB2 port number %d is not a valid USB2 port number\n", PortIndex));
+    } else {
+      DEBUG ((DEBUG_ERROR, "UpdateUsb20OverCurrentPolicy: Invalid OverCurrent pin specified USB2 port %d\n", PortIndex));
+    }
+  }
+}
+
+/**
+  This function updates USB Policy per port OC Pin number
+
+  @param[in]  PchUsbConfig     Pointer to USB_CONFIG data buffer
+  @param[in]  PortIndex        USB Port index
+  @param[in]  Pin              OverCurrent pin number
+**/
+VOID
+UpdateUsb30OverCurrentPolicy (
+  IN OUT FSPS_UPD               *FspsUpd,
+  IN USB_CONFIG                 *UsbConfig,
+  IN UINT8                      PortIndex,
+  UINT8                         Pin
+)
+{
+  if (PortIndex < MAX_USB3_PORTS && ((Pin < USB_OC_MAX_PINS) || (Pin == USB_OC_SKIP))) {
+    UPDATE_POLICY (
+        FspsUpd->FspsConfig.Usb3OverCurrentPin[PortIndex],
+        UsbConfig->PortUsb30[PortIndex].OverCurrentPin,
+        Pin
+        );
+  } else {
+    if (PortIndex >= MAX_USB2_PORTS) {
+      DEBUG ((DEBUG_ERROR, "UpdateUsb30OverCurrentPolicy: USB3 port number %d is not a valid USB3 port number\n", PortIndex));
+    } else {
+      DEBUG ((DEBUG_ERROR, "UpdateUsb30OverCurrentPolicy: Invalid OverCurrent pin specified USB3 port %d\n", PortIndex));
+    }
+  }
+}
+
+/**
+  This function performs PCH USB Platform Policy initialization
+
+  @param[in] PchUsbConfig         Pointer to USB_CONFIG data buffer
+  @param[in] PchSetup             Pointer to PCH_SETUP data buffer
+**/
+VOID
+UpdatePchUsbConfig (
+  IN OUT FSPS_UPD    *FspsUpd,
+  IN OUT USB_CONFIG  *UsbConfig
+  )
+{
+  UINTN              PortIndex;
+
+  UPDATE_POLICY (FspsUpd->FspsConfig.PchUsbOverCurrentEnable, UsbConfig->OverCurrentEnable, TRUE);
+
+  for (PortIndex = 0; PortIndex < GetPchUsb2MaxPhysicalPortNum (); PortIndex++) {
+    UPDATE_POLICY (FspsUpd->FspsConfig.PortUsb20Enable[PortIndex], UsbConfig->PortUsb20[PortIndex].Enable, TRUE);
+  }
+  for (PortIndex = 0; PortIndex < GetPchXhciMaxUsb3PortNum (); PortIndex++) {
+    UPDATE_POLICY (FspsUpd->FspsConfig.PortUsb30Enable[PortIndex], UsbConfig->PortUsb30[PortIndex].Enable, TRUE);
+  }
+
+  UPDATE_POLICY (FspsUpd->FspsConfig.XdciEnable, UsbConfig->XdciConfig.Enable, FALSE);
+
+  //
+  // Platform Board programming per the layout of each port.
+  //
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 0, PcdGet8 (PcdUsb20OverCurrentPinPort0));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 1, PcdGet8 (PcdUsb20OverCurrentPinPort1));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 2, PcdGet8 (PcdUsb20OverCurrentPinPort2));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 3, PcdGet8 (PcdUsb20OverCurrentPinPort3));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 4, PcdGet8 (PcdUsb20OverCurrentPinPort4));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 5, PcdGet8 (PcdUsb20OverCurrentPinPort5));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 6, PcdGet8 (PcdUsb20OverCurrentPinPort6));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 7, PcdGet8 (PcdUsb20OverCurrentPinPort7));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 8, PcdGet8 (PcdUsb20OverCurrentPinPort8));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 9, PcdGet8 (PcdUsb20OverCurrentPinPort9));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,10, PcdGet8 (PcdUsb20OverCurrentPinPort10));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,11, PcdGet8 (PcdUsb20OverCurrentPinPort11));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,12, PcdGet8 (PcdUsb20OverCurrentPinPort12));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,13, PcdGet8 (PcdUsb20OverCurrentPinPort13));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,14, PcdGet8 (PcdUsb20OverCurrentPinPort14));
+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,15, PcdGet8 (PcdUsb20OverCurrentPinPort15));
+
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 0, PcdGet8 (PcdUsb30OverCurrentPinPort0));
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 1, PcdGet8 (PcdUsb30OverCurrentPinPort1));
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 2, PcdGet8 (PcdUsb30OverCurrentPinPort2));
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 3, PcdGet8 (PcdUsb30OverCurrentPinPort3));
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 4, PcdGet8 (PcdUsb30OverCurrentPinPort4));
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 5, PcdGet8 (PcdUsb30OverCurrentPinPort5));
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 6, PcdGet8 (PcdUsb30OverCurrentPinPort6));
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 7, PcdGet8 (PcdUsb30OverCurrentPinPort7));
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 8, PcdGet8 (PcdUsb30OverCurrentPinPort8));
+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 9, PcdGet8 (PcdUsb30OverCurrentPinPort9));
+
+}
+
+/**
+  Update CNVi config
+
+  @param[in] SiPolicy             Pointer to SI_POLICY_PPI
+  @param[in] FspsUpd              Pointer to FspsUpd structure
+  @param[in] PchSetup             Pointer to PCH_SETUP buffer
+**/
+STATIC
+VOID
+UpdateCnviConfig (
+  IN OUT FSPS_UPD              *FspsUpd,
+  IN OUT CNVI_CONFIG           *CnviConfig
+  )
+{
+
+  UPDATE_POLICY (FspsUpd->FspsConfig.CnviMode,           CnviConfig->Mode,           CnviModeDisabled);
+  UPDATE_POLICY (FspsUpd->FspsConfig.CnviBtCore,         CnviConfig->BtCore,         FALSE);
+  UPDATE_POLICY (FspsUpd->FspsConfig.CnviBtAudioOffload, CnviConfig->BtAudioOffload, 0);
+}
+
+/**
+  Performs FSP PCH PEI Policy initialization.
+
+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspPchPolicyInit (
+  IN OUT FSPS_UPD    *FspsUpd
+  )
+{
+  UINTN                        Index;
+  SATA_CONFIG                  *SataConfig;
+  USB_CONFIG                   *UsbConfig;
+  TCSS_PEI_CONFIG              *TcssConfig;
+  SERIAL_IO_CONFIG             *SerialIoConfig;
+  CNVI_CONFIG                  *CnviConfig;
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  SI_POLICY_PPI                *SiPolicy;
+  EFI_STATUS                   Status;
+#endif
+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP UpdatePeiPchPolicy\n"));
+
+  SataConfig = NULL;
+  UsbConfig = NULL;
+  TcssConfig = NULL;
+  SerialIoConfig = NULL;
+  CnviConfig = NULL;
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  //
+  // Locate SiPolicyPpi
+  //
+  SiPolicy = NULL;
+  Status = PeiServicesLocatePpi (
+             &gSiPolicyPpiGuid,
+             0,
+             NULL,
+             (VOID **) &SiPolicy
+             );
+  if (EFI_ERROR (Status)) {
+    return EFI_NOT_FOUND;
+  }
+
+  Status = GetConfigBlock ((VOID *) SiPolicy, &gSataConfigGuid, (VOID *) &SataConfig);
+  ASSERT_EFI_ERROR (Status);
+  Status = GetConfigBlock ((VOID *) SiPolicy, &gUsbConfigGuid, (VOID *) &UsbConfig);
+  ASSERT_EFI_ERROR (Status);
+  Status = GetConfigBlock ((VOID *) SiPolicy, &gTcssPeiConfigGuid, (VOID *) &TcssConfig);
+  ASSERT_EFI_ERROR (Status);
+  Status = GetConfigBlock ((VOID *) SiPolicy, &gSerialIoConfigGuid, (VOID *) &SerialIoConfig);
+  ASSERT_EFI_ERROR (Status);
+  Status = GetConfigBlock ((VOID *) SiPolicy, &gCnviConfigGuid, (VOID *) &CnviConfig);
+  ASSERT_EFI_ERROR (Status);
+  if (EFI_ERROR (Status)) {
+    return Status;
+  }
+#endif
+
+  //
+  // Update Sata Policies
+  //
+  UPDATE_POLICY (FspsUpd->FspsConfig.SataEnable, SataConfig->Enable, TRUE);
+  UPDATE_POLICY (FspsUpd->FspsConfig.SataMode, SataConfig->SataMode, SataModeAhci);
+
+  for (Index = 0; Index < PCH_MAX_SATA_PORTS; Index++) {
+    UPDATE_POLICY (FspsUpd->FspsConfig.SataPortsEnable[Index], SataConfig->PortSettings[Index].Enable, TRUE);
+  }
+
+  //
+  // Update Pch Usb Config
+  //
+  UpdatePchUsbConfig (FspsUpd, UsbConfig);
+
+  //
+  // I2C
+  //
+  for (Index = 0; Index < 8; Index++) {
+    UPDATE_POLICY (FspsUpd->FspsConfig.SerialIoI2cMode[Index], SerialIoConfig->I2cDeviceConfig[Index].Mode, 0);
+    UPDATE_POLICY (FspsUpd->FspsConfig.PchSerialIoI2cPadsTermination[Index], SerialIoConfig->I2cDeviceConfig[Index].PadTermination, 0);
+  }
+
+  UPDATE_POLICY (FspsUpd->FspsConfig.PchSerialIoI2cSdaPinMux[4],  SerialIoConfig->I2cDeviceConfig[4].PinMux.Sda,  GPIO_VER2_LP_MUXING_SERIALIO_I2C4_SDA_GPP_H8);
+  UPDATE_POLICY (FspsUpd->FspsConfig.PchSerialIoI2cSclPinMux[4],  SerialIoConfig->I2cDeviceConfig[4].PinMux.Scl,  GPIO_VER2_LP_MUXING_SERIALIO_I2C4_SCL_GPP_H9);
+
+  //
+  // Type C
+  //
+  for (Index = 0; Index < MAX_IOM_AUX_BIAS_COUNT; Index++) {
+    UPDATE_POLICY (FspsUpd->FspsConfig.IomTypeCPortPadCfg[(Index * 2)],     TcssConfig->IomConfig.IomAuxPortPad[Index].GpioPullN, mIomAuxNullTable[Index].GpioPullN);
+    UPDATE_POLICY (FspsUpd->FspsConfig.IomTypeCPortPadCfg[(Index * 2) + 1], TcssConfig->IomConfig.IomAuxPortPad[Index].GpioPullP, mIomAuxNullTable[Index].GpioPullP);
+  }
+
+  //
+  // Cnvi
+  //
+  UpdateCnviConfig (FspsUpd, CnviConfig);
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c
new file mode 100644
index 0000000000..fc523e93d1
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c
@@ -0,0 +1,308 @@
+/** @file
+  Instance of Fsp Policy Initialization Library.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PeiFspPolicyInitLib.h>
+#include <Library/FspWrapperApiLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Ppi/FspmArchConfigPpi.h>
+
+VOID
+EFIAPI
+FspPolicyInitPreMem(
+  IN FSPM_UPD           *FspmUpdDataPtr
+);
+
+VOID *
+EFIAPI
+SiliconPolicyInitPreMem(
+  IN OUT VOID    *FspmUpd
+)
+{
+  DEBUG ((DEBUG_INFO, "FspmUpd - 0x%x\n", FspmUpd));
+  FspPolicyInitPreMem ((FSPM_UPD *) FspmUpd);
+  return FspmUpd;
+}
+
+/**
+  SiPreMemInstallPolicyReadyPpi installs SiPreMemPolicyReadyPpi.
+  While installed, RC assumes the Policy is ready and finalized. So please update and override
+  any setting before calling this function.
+
+  @retval EFI_SUCCESS            The policy is installed.
+  @retval EFI_OUT_OF_RESOURCES   Insufficient resources to create buffer
+**/
+EFI_STATUS
+EFIAPI
+SiPreMemInstallPolicyReadyPpi (
+  VOID
+  )
+{
+  EFI_STATUS             Status;
+  EFI_PEI_PPI_DESCRIPTOR *SiPolicyReadyPreMemPpiDesc;
+
+  SiPolicyReadyPreMemPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR));
+  if (SiPolicyReadyPreMemPpiDesc == NULL) {
+    ASSERT (FALSE);
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  SiPolicyReadyPreMemPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
+  SiPolicyReadyPreMemPpiDesc->Guid  = &gSiPreMemPolicyReadyPpiGuid;
+  SiPolicyReadyPreMemPpiDesc->Ppi   = NULL;
+
+  //
+  // Install PreMem Silicon Policy Ready PPI
+  //
+  Status = PeiServicesInstallPpi (SiPolicyReadyPreMemPpiDesc);
+  ASSERT_EFI_ERROR (Status);
+  return Status;
+}
+
+RETURN_STATUS
+EFIAPI
+SiliconPolicyDonePreMem(
+  IN VOID *FspmUpd
+)
+{
+  EFI_STATUS                   Status;
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  FSPM_ARCH_CONFIG_PPI                  *FspmArchConfigPpi;
+  EFI_PEI_PPI_DESCRIPTOR                *FspmArchConfigPpiDesc;
+
+  FspmArchConfigPpi = (FSPM_ARCH_CONFIG_PPI *) AllocateZeroPool (sizeof (FSPM_ARCH_CONFIG_PPI));
+  if (FspmArchConfigPpi == NULL) {
+    ASSERT (FALSE);
+    return EFI_OUT_OF_RESOURCES;
+  }
+  FspmArchConfigPpi->Revision            = 1;
+  FspmArchConfigPpi->NvsBufferPtr        = NULL;
+  FspmArchConfigPpi->BootLoaderTolumSize = 0;
+
+  FspmArchConfigPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR));
+  if (FspmArchConfigPpiDesc == NULL) {
+    ASSERT (FALSE);
+    return EFI_OUT_OF_RESOURCES;
+  }
+  FspmArchConfigPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
+  FspmArchConfigPpiDesc->Guid  = &gFspmArchConfigPpiGuid;
+  FspmArchConfigPpiDesc->Ppi   = FspmArchConfigPpi;
+  //
+  // Install FSP-M Arch Config PPI
+  //
+  Status = PeiServicesInstallPpi (FspmArchConfigPpiDesc);
+  ASSERT_EFI_ERROR (Status);
+#endif
+
+  //
+  // Install Policy Ready PPI
+  // While installed, RC assumes the Policy is ready and finalized. So please
+  // update and override any setting before calling this function.
+  //
+  Status = SiPreMemInstallPolicyReadyPpi ();
+  ASSERT_EFI_ERROR (Status);
+
+  DEBUG ((DEBUG_INFO, "Silicon PEI Policy Initialization Done in Pre-Memory\n"));
+
+  return Status;
+}
+
+/**
+  Performs FSP PEI Policy Pre-memory initialization.
+
+  @param[in] FspmUpdDataPtr       Pointer to FSPM UPD data.
+**/
+VOID
+EFIAPI
+FspPolicyInitPreMem (
+  IN FSPM_UPD           *FspmUpdDataPtr
+  )
+{
+  EFI_STATUS            Status;
+
+  //
+  // PCH Pei Fsp Policy Initialization
+  //
+  Status = PeiFspPchPolicyInitPreMem (FspmUpdDataPtr);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_ERROR, "ERROR - PCH Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));
+  }
+
+  //
+  // Cpu Pei Fsp Policy Initialization
+  //
+  Status = PeiFspCpuPolicyInitPreMem (FspmUpdDataPtr);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_ERROR, "ERROR - CPU Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));
+  }
+
+  //
+  // Security Pei Fsp Policy Initialization
+  //
+  Status = PeiFspSecurityPolicyInitPreMem (FspmUpdDataPtr);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_ERROR, "ERROR - Security Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));
+  }
+
+  //
+  // ME Pei Fsp Policy Initialization
+  //
+  Status = PeiFspMePolicyInitPreMem (FspmUpdDataPtr);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_ERROR, "ERROR - ME Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));
+  }
+
+  //
+  // SystemAgent Pei Fsp Policy Initialization
+  //
+  Status = PeiFspSaPolicyInitPreMem (FspmUpdDataPtr);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_ERROR, "ERROR - SystemAgent Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));
+  }
+
+  //
+  // Other Upd Initialization
+  //
+  Status = PeiFspMiscUpdInitPreMem (FspmUpdDataPtr);
+
+}
+
+/**
+  Performs FSP PEI Policy initialization.
+
+  @param[in][out] FspsUpd  Pointer UPD data region
+
+**/
+VOID
+EFIAPI
+FspPolicyInit (
+  IN OUT FSPS_UPD    *FspsUpd
+  )
+{
+  EFI_STATUS            Status;
+
+  //
+  // PCH Pei Fsp Policy Initialization
+  //
+  Status = PeiFspPchPolicyInit (FspsUpd);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_ERROR, "ERROR - PCH Pei Fsp Policy iInitialization fail, Status = %r\n", Status));
+  }
+
+  //
+  // ME Pei Fsp Policy Initialization
+  //
+  Status = PeiFspMePolicyInit (FspsUpd);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_ERROR, "ERROR - ME Pei Fsp Policy Initialization fail, Status = %r\n", Status));
+  }
+
+  //
+  // SystemAgent Pei Fsp Policy Initialization
+  //
+  Status = PeiFspSaPolicyInit (FspsUpd);
+  if (EFI_ERROR (Status)) {
+    DEBUG ((DEBUG_ERROR, "ERROR - SystemAgent Pei Fsp Policy Initialization fail, Status = %r\n", Status));
+  }
+
+  //
+  // Security Pei Fsp Policy Initialization
+  //
+  Status = PeiFspSecurityPolicyInit(FspsUpd);
+  if (EFI_ERROR(Status)) {
+    DEBUG((DEBUG_ERROR, "ERROR - Security Pei Fsp Policy Initialization fail, Status = %r\n", Status));
+  }
+
+}
+
+/**
+Performs silicon post-mem policy initialization.
+
+The meaning of Policy is defined by silicon code.
+It could be the raw data, a handle, a PPI, etc.
+
+The returned data must be used as input data for SiliconPolicyDonePostMem(),
+and SiliconPolicyUpdateLib.SiliconPolicyUpdatePostMem().
+
+1) In FSP path, the input Policy should be FspsUpd.
+Value of FspsUpd has been initialized by FSP binary default value.
+Only a subset of FspsUpd needs to be updated for different silicon sku.
+The return data is same FspsUpd.
+
+2) In non-FSP path, the input policy could be NULL.
+The return data is the initialized policy.
+
+@param[in, out] Policy       Pointer to policy.
+
+@return the initialized policy.
+**/
+VOID *
+EFIAPI
+SiliconPolicyInitPostMem(
+  IN OUT VOID    *FspsUpd
+)
+{
+  DEBUG ((DEBUG_INFO, "FspsUpd - 0x%x\n", FspsUpd));
+  FspPolicyInit ((FSPS_UPD *) FspsUpd);
+  return FspsUpd;
+}
+
+/**
+  SiInstallPolicyReadyPpi installs SiPolicyReadyPpi.
+  While installed, RC assumes the Policy is ready and finalized. So please update and override
+  any setting before calling this function.
+
+  @retval EFI_SUCCESS            The policy is installed.
+  @retval EFI_OUT_OF_RESOURCES   Insufficient resources to create buffer
+**/
+EFI_STATUS
+EFIAPI
+SiInstallPolicyReadyPpi (
+  VOID
+  )
+{
+  EFI_STATUS             Status;
+  EFI_PEI_PPI_DESCRIPTOR *SiPolicyReadyPpiDesc;
+
+  SiPolicyReadyPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR));
+  if (SiPolicyReadyPpiDesc == NULL) {
+    ASSERT (FALSE);
+    return EFI_OUT_OF_RESOURCES;
+  }
+
+  SiPolicyReadyPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;
+  SiPolicyReadyPpiDesc->Guid  = &gSiPolicyReadyPpiGuid;
+  SiPolicyReadyPpiDesc->Ppi   = NULL;
+
+  //
+  // Install Silicon Policy Ready PPI
+  //
+  Status = PeiServicesInstallPpi (SiPolicyReadyPpiDesc);
+  ASSERT_EFI_ERROR (Status);
+  return Status;
+}
+
+/*
+The silicon post-mem policy is finalized.
+Silicon code can do initialization based upon the policy data.
+
+The input Policy must be returned by SiliconPolicyInitPostMem().
+
+@param[in] Policy       Pointer to policy.
+
+@retval EFI_SUCCESS The policy is handled consumed by silicon code.
+*/
+EFI_STATUS
+EFIAPI
+SiliconPolicyDonePostMem(
+  IN OUT VOID    *FspsUpd
+)
+{
+  SiInstallPolicyReadyPpi();
+  return EFI_SUCCESS;
+}
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h
new file mode 100644
index 0000000000..cce0de0089
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h
@@ -0,0 +1,187 @@
+/** @file
+  Internal header file for Fsp Policy Initialization Library.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _PEI_FSP_POLICY_INIT_LIB_H_
+#define _PEI_FSP_POLICY_INIT_LIB_H_
+
+#include <PiPei.h>
+
+#include <Library/DebugLib.h>
+#include <Library/PeiServicesLib.h>
+
+#include <FspEas.h>
+#include <FspmUpd.h>
+#include <FspsUpd.h>
+
+/**
+  Performs FSP PCH PEI Policy pre mem initialization.
+
+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspPchPolicyInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  );
+
+/**
+  Performs FSP PCH PEI Policy initialization.
+
+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspPchPolicyInit (
+  IN OUT FSPS_UPD     *FspsUpd
+  );
+
+/**
+  Performs FSP CPU PEI Policy initialization.
+
+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspCpuPolicyInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  );
+
+/**
+Performs FSP Security PEI Policy initialization.
+
+@param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+@retval          EFI_SUCCESS         FSP UPD Data is updated.
+@retval          EFI_NOT_FOUND       Fail to locate required PPI.
+@retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspSecurityPolicyInitPreMem(
+IN OUT FSPM_UPD    *FspmUpd
+);
+
+/**
+  Performs FSP ME PEI Policy pre mem initialization.
+
+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspMePolicyInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  );
+
+/**
+  Performs FSP ME PEI Policy initialization.
+
+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspMePolicyInit (
+  IN OUT FSPS_UPD     *FspsUpd
+  );
+
+/**
+  Performs FSP SA PEI Policy initialization in pre-memory.
+
+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspSaPolicyInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  );
+
+/**
+  Performs FSP SA PEI Policy initialization.
+
+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspSaPolicyInit (
+  IN OUT FSPS_UPD    *FspsUpd
+  );
+
+
+/**
+Performs FSP Security PEI Policy post memory initialization.
+
+@param[in][out]  FspsUpd             Pointer to FSP UPD Data.
+
+@retval          EFI_SUCCESS         FSP UPD Data is updated.
+@retval          EFI_NOT_FOUND       Fail to locate required PPI.
+@retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspSecurityPolicyInit(
+IN OUT FSPS_UPD    *FspsUpd
+);
+
+/**
+  PeiGetSectionFromFv finds the file in FV and gets file Address and Size
+
+  @param[in] NameGuid              - File GUID
+  @param[out] Address              - Pointer to the File Address
+  @param[out] Size                 - Pointer to File Size
+
+  @retval EFI_SUCCESS                Successfull in reading the section from FV
+**/
+EFI_STATUS
+EFIAPI
+PeiGetSectionFromFv (
+  IN CONST  EFI_GUID        NameGuid,
+  OUT VOID                  **Address,
+  OUT UINT32               *Size
+  );
+
+/**
+  Performs FSP Misc UPD initialization.
+
+  @param[in][out]  FspmUpd             Pointer to FSPM_UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspMiscUpdInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  );
+
+#endif // _PEI_FSP_POLICY_INIT_LIB_H_
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
new file mode 100644
index 0000000000..9d85d855f5
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
@@ -0,0 +1,183 @@
+## @file
+# Library functions for Fsp Policy Initialization Library.
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+################################################################################
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+################################################################################
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = PeiFspPolicyInitLib
+  FILE_GUID                      = 2CB87D67-D1A4-4CD3-8CD7-91A1FA1DF6E0
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = SiliconPolicyInitLib
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+#  VALID_ARCHITECTURES           = IA32
+#
+
+################################################################################
+#
+# Sources Section - list of files that are required for the build to succeed.
+#
+################################################################################
+
+[Sources]
+  PeiFspPolicyInitLib.c
+  PeiFspPchPolicyInitLib.c
+  PeiFspCpuPolicyInitLib.c
+  PeiFspMePolicyInitLib.c
+  PeiFspSaPolicyInitLib.c
+  PeiFspSecurityPolicyInitLib.c
+  PeiFspMiscUpdInitLib.c
+
+################################################################################
+#
+# Package Dependency Section - list of Package files that are required for
+#                              this module.
+#
+################################################################################
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  IntelFsp2Pkg/IntelFsp2Pkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+  TigerLakeFspBinPkg/TigerLakeFspBinPkg.dec
+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
+  UefiCpuPkg/UefiCpuPkg.dec
+  IntelSiliconPkg/IntelSiliconPkg.dec
+  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IoLib
+  PeiServicesLib
+  ConfigBlockLib
+  PcdLib
+  MemoryAllocationLib
+  PchInfoLib
+  FspWrapperApiLib
+  PeiLib
+  BmpSupportLib
+
+[Pcd]
+  gSiPkgTokenSpaceGuid.PcdTsegSize                                  ## CONSUMES
+
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase                   ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize                   ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize                ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize              ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress             ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress                ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress             ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress                ## CONSUMES
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection               ## CONSUMES
+  # SA Misc Config
+  gBoardModuleTokenSpaceGuid.PcdSaMiscUserBd                        ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdSaMiscMmioSizeAdjustment            ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdData                          ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdDataSize                      ## CONSUMES
+
+  # SPD Address Table
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable0            ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable1            ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable2            ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable3            ## CONSUMES
+
+  # PCIe Clock Info
+  gBoardModuleTokenSpaceGuid.PcdPcieClock0                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock1                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock2                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock3                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock4                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock5                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock6                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock7                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock8                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock9                     ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock10                    ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock11                    ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock12                    ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock13                    ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock14                    ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdPcieClock15                    ## CONSUMES
+
+  # USB 2.0 Port Over Current Pin
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort0       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort1       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort2       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort3       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort4       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort5       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort6       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort7       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort8       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort9       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort10      ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort11      ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort12      ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort13      ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort14      ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort15      ## CONSUMES
+
+  # USB 3.0 Port Over Current Pin
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort0       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort1       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort2       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort3       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort4       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort5       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort6       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort7       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort8       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort9       ## CONSUMES
+
+  gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid   ## CONSUMES
+
+  gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr    ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateSmmDataPtr ## CONSUMES
+
+[Ppis]
+  gSiPolicyPpiGuid                        ## CONSUMES
+  gSiPreMemPolicyPpiGuid                  ## CONSUMES
+  gSiPreMemPolicyReadyPpiGuid             ## CONSUMES
+  gSiPolicyReadyPpiGuid                   ## CONSUMES
+  gFspmArchConfigPpiGuid                  ## SOMETIMES_PRODUCES
+
+[Guids]
+  gPcieRpPreMemConfigGuid                 ## CONSUMES
+  gPchGeneralPreMemConfigGuid             ## CONSUMES
+  gPcieRpPreMemConfigGuid                 ## CONSUMES
+  gSataConfigGuid                         ## CONSUMES
+  gHdAudioConfigGuid                      ## CONSUMES
+  gSataConfigGuid                         ## CONSUMES
+  gUsbConfigGuid                          ## CONSUMES
+  gSaMiscPeiPreMemConfigGuid              ## PRODUCES
+  gHostBridgePeiPreMemConfigGuid          ## CONSUMES
+  gSaMiscPeiConfigGuid                    ## PRODUCES
+  gMemoryConfigNoCrcGuid                  ## CONSUMES
+  gSaMiscPeiConfigGuid                    ## CONSUMES
+  gGraphicsPeiConfigGuid                  ## CONSUMES
+  gMePeiPreMemConfigGuid                  ## CONSUMES
+  gMePeiConfigGuid                        ## CONSUMES
+  gPchGeneralConfigGuid                   ## CONSUMES
+  gCpuConfigGuid                          ## CONSUMES
+  gCpuConfigLibPreMemConfigGuid           ## CONSUMES
+  gTcssPeiConfigGuid                      ## CONSUMES
+  gSerialIoConfigGuid                     ## CONSUMES
+  gCpuSecurityPreMemConfigGuid            ## CONSUMES
+  gTianoLogoGuid                          ## CONSUMES
+  gCnviConfigGuid                         ## CONSUMES
+  gHdAudioPreMemConfigGuid                ## CONSUMES
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c
new file mode 100644
index 0000000000..8f426ddb8d
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c
@@ -0,0 +1,240 @@
+/** @file
+  Implementation of Fsp SA Policy Initialization.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PeiFspPolicyInitLib.h>
+
+#include <Ppi/SiPolicy.h>
+#include <MemoryConfig.h>
+#include <Library/IoLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/ConfigBlockLib.h>
+#include <Library/PcdLib.h>
+#include <Library/PeiLib.h>
+#include <IndustryStandard/Pci.h>
+#include <IndustryStandard/Bmp.h>
+#include <Ppi/FirmwareVolume.h>
+#include <Pi/PiFirmwareFile.h>
+#include <Pi/PiPeiCis.h>
+#include <Core/Pei/PeiMain.h>
+#include <Library/ConfigBlockLib.h>
+#include <PolicyUpdateMacro.h>
+#include <Pi/PiFirmwareFile.h>
+#include <Protocol/GraphicsOutput.h>
+#include <Library/BmpSupportLib.h>
+
+/**
+  Performs FSP SA PEI Policy initialization in pre-memory.
+
+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspSaPolicyInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  )
+{
+  SA_MISC_PEI_PREMEM_CONFIG   *MiscPeiPreMemConfig;
+  HOST_BRIDGE_PREMEM_CONFIG   *HostBridgePreMemConfig;
+  MEMORY_CONFIG_NO_CRC        *MemConfigNoCrc;
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  EFI_STATUS                  Status;
+  SI_PREMEM_POLICY_PPI        *SiPreMemPolicyPpi;
+#endif
+
+  DEBUG((DEBUG_INFO, "\nUpdating SA Policy in Pre Mem\n"));
+  MiscPeiPreMemConfig = NULL;
+  HostBridgePreMemConfig = NULL;
+  MemConfigNoCrc      = NULL;
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  //
+  // Locate SiPreMemPolicyPpi
+  //
+  SiPreMemPolicyPpi   = NULL;
+  Status = PeiServicesLocatePpi(
+             &gSiPreMemPolicyPpiGuid,
+             0,
+             NULL,
+             (VOID **) &SiPreMemPolicyPpi
+             );
+  ASSERT_EFI_ERROR (Status);
+  if ((Status == EFI_SUCCESS) && (SiPreMemPolicyPpi != NULL)) {
+    Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gSaMiscPeiPreMemConfigGuid, (VOID *) &MiscPeiPreMemConfig);
+    ASSERT_EFI_ERROR (Status);
+    Status = GetConfigBlock((VOID *) SiPreMemPolicyPpi, &gHostBridgePeiPreMemConfigGuid, (VOID *) &HostBridgePreMemConfig);
+    ASSERT_EFI_ERROR(Status);
+    Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gMemoryConfigNoCrcGuid, (VOID *) &MemConfigNoCrc);
+    ASSERT_EFI_ERROR (Status);
+    ZeroMem ((VOID *) MemConfigNoCrc->SpdData->SpdData, sizeof (SPD_DATA_BUFFER));
+  }
+#endif
+
+  UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[0], MiscPeiPreMemConfig->SpdAddressTable[0], PcdGet8 (PcdMrcSpdAddressTable0));
+  UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[1], MiscPeiPreMemConfig->SpdAddressTable[1], PcdGet8 (PcdMrcSpdAddressTable1));
+  UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[2], MiscPeiPreMemConfig->SpdAddressTable[2], PcdGet8 (PcdMrcSpdAddressTable2));
+  UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[3], MiscPeiPreMemConfig->SpdAddressTable[3], PcdGet8 (PcdMrcSpdAddressTable3));
+
+  if (PcdGet32 (PcdMrcSpdData)) {
+    DEBUG((DEBUG_INFO, "PcdMrcSpdData != NULL, MemConfigNoCrc->SpdData\n"));
+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr000, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][0][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));
+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr010, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][1][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));
+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr020, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][2][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));
+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr030, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][3][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));
+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr100, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][0][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));
+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr110, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][1][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));
+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr120, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][2][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));
+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr130, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][3][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));
+  }
+  UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmConfig.TsegSize,           MiscPeiPreMemConfig->TsegSize,           PcdGet32 (PcdTsegSize));
+  UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmConfig.UserBd,             MiscPeiPreMemConfig->UserBd,             PcdGet8 (PcdSaMiscUserBd));
+  UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmConfig.MmioSizeAdjustment, HostBridgePreMemConfig->MmioSizeAdjustment, PcdGet16 (PcdSaMiscMmioSizeAdjustment));
+
+  return EFI_SUCCESS;
+}
+
+
+/**
+  Performs FSP SA PEI Policy initialization.
+
+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+UpdateGraphics(
+    IN OUT FSPS_UPD *FspsUpd,
+    GRAPHICS_PEI_CONFIG *GtConfig
+  )
+{
+  EFI_STATUS                      Status;
+  VOID                            *Buffer;
+  UINT32                          Size;
+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL   *Blt;
+  UINTN                           BltSize;
+  UINTN                           Height;
+  UINTN                           Width;
+
+  DEBUG((DEBUG_INFO, "\nUpdating SA Policy in Post Mem\n"));
+  UPDATE_POLICY (FspsUpd->FspsConfig.PeiGraphicsPeimInit, GtConfig->PeiGraphicsPeimInit, 1);
+
+  Size = 0;
+  Buffer = NULL;
+  PeiGetSectionFromAnyFv(PcdGetPtr(PcdIntelGraphicsVbtFileGuid), EFI_SECTION_RAW, 0, &Buffer, &Size);
+  DEBUG((DEBUG_INFO, "Vbt Pointer from PeiGetSectionFromAnyFv is 0x%x\n", Buffer));
+  DEBUG((DEBUG_INFO, "Vbt Size from PeiGetSectionFromAnyFv is 0x%x\n", Size));
+#if FixedPcdGet8(PcdFspModeSelection) == 1
+  FspsUpd->FspsConfig.GraphicsConfigPtr = (UINT32)(UINTN)Buffer;
+#else
+  GtConfig->GraphicsConfigPtr = Buffer;
+#endif
+
+  Size = 0;
+  Buffer = NULL;
+  PeiGetSectionFromAnyFv(&gTianoLogoGuid, EFI_SECTION_RAW, 0, &Buffer, &Size);
+  DEBUG((DEBUG_INFO, "LogoPtr from PeiGetSectionFromAnyFv is 0x%x\n", Buffer));
+  DEBUG((DEBUG_INFO, "LogoSize from PeiGetSectionFromAnyFv is 0x%x\n", Size));
+#if FixedPcdGet8(PcdFspModeSelection) == 1
+  FspsUpd->FspsConfig.LogoPtr = (UINT32)Buffer;
+  FspsUpd->FspsConfig.LogoSize = Size;
+#else
+  GtConfig->LogoPtr = Buffer;
+  GtConfig->LogoSize = Size;
+#endif
+
+  if (Buffer != NULL) {
+    Blt = NULL;
+    Status = TranslateBmpToGopBlt (
+              Buffer,
+              Size,
+              &Blt,
+              &BltSize,
+              &Height,
+              &Width
+              );
+    if (EFI_ERROR (Status)) {
+        DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt, Status = %r\n", Status));
+        ASSERT_EFI_ERROR (Status);
+        return Status;
+    }
+
+    UPDATE_POLICY(FspsUpd->FspsConfig.BltBufferSize,  GtConfig->BltBufferSize, BltSize);
+    UPDATE_POLICY(FspsUpd->FspsConfig.LogoPixelWidth,  GtConfig->LogoPixelWidth, Width);
+    UPDATE_POLICY(FspsUpd->FspsConfig.LogoPixelHeight,  GtConfig->LogoPixelHeight, Height);
+#if FixedPcdGet8(PcdFspModeSelection) == 1
+    FspsUpd->FspsConfig.BltBufferAddress  = (UINT32) Blt;
+#else
+    GtConfig->BltBufferAddress = (VOID *) Blt;
+#endif
+  }
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Performs FSP SA PEI Policy initialization.
+
+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspSaPolicyInit (
+  IN OUT FSPS_UPD    *FspsUpd
+  )
+{
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  EFI_STATUS                Status;
+  SI_POLICY_PPI             *SiPolicyPpi;
+#endif
+  SA_MISC_PEI_CONFIG        *MiscPeiConfig;
+  GRAPHICS_PEI_CONFIG       *GtConfig;
+
+  MiscPeiConfig = NULL;
+  GtConfig      = NULL;
+
+#if FixedPcdGet8(PcdFspModeSelection) == 0
+  //
+  // Locate SiPolicyPpi
+  //
+  SiPolicyPpi = NULL;
+  Status = PeiServicesLocatePpi(
+             &gSiPolicyPpiGuid,
+             0,
+             NULL,
+             (VOID **)&SiPolicyPpi
+             );
+  if ((Status == EFI_SUCCESS) && (SiPolicyPpi != NULL)) {
+    MiscPeiConfig = NULL;
+    Status = GetConfigBlock ((VOID *) SiPolicyPpi, &gSaMiscPeiConfigGuid, (VOID *) &MiscPeiConfig);
+    ASSERT_EFI_ERROR (Status);
+
+    GtConfig = NULL;
+    Status = GetConfigBlock ((VOID *) SiPolicyPpi, &gGraphicsPeiConfigGuid, (VOID *) &GtConfig);
+    ASSERT_EFI_ERROR (Status);
+
+  }
+#endif
+
+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Wrapper UpdatePeiSaPolicy\n"));
+
+  //
+  // Update UPD: VBT & LogoPtr
+  //
+  UpdateGraphics(FspsUpd, GtConfig);
+
+  return EFI_SUCCESS;
+}
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c
new file mode 100644
index 0000000000..91a60a6bd3
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c
@@ -0,0 +1,49 @@
+/** @file
+  Implementation of Fsp Security Policy Initialization.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PeiFspPolicyInitLib.h>
+#include <Library/PeiServicesLib.h>
+#include <Ppi/SiPolicy.h>
+
+/**
+  Performs FSP Security PEI Policy initialization.
+
+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspSecurityPolicyInitPreMem (
+  IN OUT FSPM_UPD    *FspmUpd
+  )
+{
+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Update SecurityPolicy Pre-Mem End\n"));
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Performs FSP Security PEI Policy post memory initialization.
+
+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.
+
+  @retval          EFI_SUCCESS         FSP UPD Data is updated.
+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.
+  @retval          Other               FSP UPD Data update process fail.
+**/
+EFI_STATUS
+EFIAPI
+PeiFspSecurityPolicyInit (
+  IN OUT FSPS_UPD    *FspsUpd
+  )
+{
+  return EFI_SUCCESS;
+}
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c
new file mode 100644
index 0000000000..b864753258
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c
@@ -0,0 +1,39 @@
+/** @file
+  Instance of Fsp Policy Initialization Library.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiPei.h>
+#include <Library/DebugLib.h>
+#include <Library/PeiServicesLib.h>
+#include <Ppi/PeiSiDefaultPolicy.h>
+
+EFI_STATUS
+EFIAPI
+PeiSiDefaultPolicyInitLibConstructor (
+  VOID
+  )
+{
+  EFI_STATUS Status;
+  PEI_SI_DEFAULT_POLICY_INIT_PPI *PeiSiDefaultPolicyInitPpi;
+
+  //
+  // Locate Policy init PPI to install default silicon policy
+  //
+  Status = PeiServicesLocatePpi (
+              &gSiDefaultPolicyInitPpiGuid,
+              0,
+              NULL,
+              (VOID **) &PeiSiDefaultPolicyInitPpi
+              );
+  ASSERT_EFI_ERROR (Status);
+  if (PeiSiDefaultPolicyInitPpi == NULL) {
+    return Status;
+  }
+  Status = PeiSiDefaultPolicyInitPpi->PeiPolicyInit ();
+  ASSERT_EFI_ERROR (Status);
+
+  return Status;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf
new file mode 100644
index 0000000000..bcad97c267
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf
@@ -0,0 +1,38 @@
+## @file
+# Library functions for Fsp Policy Initialization Library.
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+################################################################################
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+################################################################################
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = PeiSiDefaultPolicyInitLib
+  FILE_GUID                      = ADA1D87B-6891-453C-A0DB-92D4CFD46693
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = NULL
+  CONSTRUCTOR                    = PeiSiDefaultPolicyInitLibConstructor
+
+[Packages]
+  MdePkg/MdePkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+
+[Sources]
+  PeiSiDefaultPolicyInitLib.c
+
+[LibraryClasses]
+  PeiServicesLib
+  DebugLib
+
+[Ppis]
+  gSiDefaultPolicyInitPpiGuid             ## CONSUMES
+
+[Depex]
+  gSiDefaultPolicyInitPpiGuid
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c
new file mode 100644
index 0000000000..f0eb3f3f14
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c
@@ -0,0 +1,40 @@
+/** @file
+  Instance of Fsp Policy Initialization Library.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiPei.h>
+#include <Library/DebugLib.h>
+#include <Library/PeiServicesLib.h>
+#include <Ppi/PeiPreMemSiDefaultPolicy.h>
+
+EFI_STATUS
+EFIAPI
+PeiSiPreMemDefaultPolicyInitLibConstructor (
+  VOID
+  )
+{
+  EFI_STATUS Status;
+  PEI_PREMEM_SI_DEFAULT_POLICY_INIT_PPI *PeiPreMemSiDefaultPolicyInitPpi;
+
+  //
+  // Locate Policy init PPI to install default silicon policy
+  //
+  Status = PeiServicesLocatePpi (
+              &gSiPreMemDefaultPolicyInitPpiGuid,
+              0,
+              NULL,
+              (VOID **) &PeiPreMemSiDefaultPolicyInitPpi
+              );
+  ASSERT_EFI_ERROR (Status);
+  if (PeiPreMemSiDefaultPolicyInitPpi == NULL) {
+    return Status;
+  }
+  DEBUG ((DEBUG_INFO, "PeiPreMemSiDefaultPolicyInitPpi->PeiPreMemPolicyInit ()\n", Status));
+  Status = PeiPreMemSiDefaultPolicyInitPpi->PeiPreMemPolicyInit ();
+  ASSERT_EFI_ERROR (Status);
+
+  return Status;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf
new file mode 100644
index 0000000000..c118d7fe2c
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf
@@ -0,0 +1,38 @@
+## @file
+# Library functions for Fsp Policy Initialization Library.
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+################################################################################
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+################################################################################
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = PeiSiPreMemDefaultPolicyInitLib
+  FILE_GUID                      = F13311AD-9C5C-4212-AB02-9D0435B3FCF1
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = NULL
+  CONSTRUCTOR                    = PeiSiPreMemDefaultPolicyInitLibConstructor
+
+[Packages]
+  MdePkg/MdePkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+
+[Sources]
+  PeiSiPreMemDefaultPolicyInitLib.c
+
+[LibraryClasses]
+  PeiServicesLib
+  DebugLib
+
+[Ppis]
+  gSiPreMemDefaultPolicyInitPpiGuid       ## CONSUMES
+
+[Depex]
+  gSiPreMemDefaultPolicyInitPpiGuid
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c
new file mode 100644
index 0000000000..6209e50450
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c
@@ -0,0 +1,391 @@
+/** @file
+  Platform Hook Library instances
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Base.h>
+#include <Uefi/UefiBaseType.h>
+#include <Library/PlatformHookLib.h>
+#include <Library/BaseLib.h>
+#include <Library/IoLib.h>
+#include <Library/PciSegmentLib.h>
+#include <Library/PcdLib.h>
+#include <Library/MmPciLib.h>
+#include <Library/PchCycleDecodingLib.h>
+#include <Register/PchRegs.h>
+#include <Register/PchRegsLpc.h>
+#include <Library/SaPlatformLib.h>
+#include <Library/PchPciBdfLib.h>
+
+#define COM1_BASE                                 0x3f8
+#define COM2_BASE                                 0x2f8
+
+#define SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS   0x0690
+
+#define LPC_SIO_INDEX_DEFAULT_PORT_2              0x2E
+#define LPC_SIO_DATA_DEFAULT_PORT_2               0x2F
+#define LPC_SIO_GPIO_REGISTER_ADDRESS_2           0x0A20
+
+#define LEGACY_DAUGHTER_CARD_SIO_INDEX_PORT       0x2E
+#define LEGACY_DAUGHTER_CARD_SIO_DATA_PORT        0x2F
+#define LEGACY_DAUGHTER_CARD_2_SIO_INDEX_PORT     0x4E
+#define LEGACY_DAUGHTER_CARD_2_SIO_DATA_PORT      0x4F
+
+#define IT8628_ENTER_CONFIG_WRITE_SEQ_0           0x87
+#define IT8628_ENTER_CONFIG_WRITE_SEQ_1           0x01
+#define IT8628_ENTER_CONFIG_WRITE_SEQ_2           0x55
+#define IT8628_ENTER_CONFIG_WRITE_SEQ_3           0x55
+#define IT8628_EXIT_CONFIG                        0x2
+#define IT8628_CHIPID_BYTE1                       0x86
+#define IT8628_CHIPID_BYTE2                       0x28
+
+typedef struct {
+  UINT8 Register;
+  UINT8 Value;
+} EFI_SIO_TABLE;
+
+
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_SIO_TABLE mSioTableWpcn381u[] = {
+  {0x29, 0x0A0},                  // Enable super I/O clock and set to 48MHz
+  {0x22, 0x003},                  //
+  {0x07, 0x003},                  // Select UART0 device
+  {0x60, (COM1_BASE >> 8)},       // Set Base Address MSB
+  {0x61, (COM1_BASE & 0x00FF)},   // Set Base Address LSB
+  {0x70, 0x004},                  // Set to IRQ4
+  {0x30, 0x001},                  // Enable it with Activation bit
+  {0x07, 0x002},                  // Select UART1 device
+  {0x60, (COM2_BASE >> 8)},       // Set Base Address MSB
+  {0x61, (COM2_BASE & 0x00FF)},   // Set Base Address LSB
+  {0x70, 0x003},                  // Set to IRQ3
+  {0x30, 0x001},                  // Enable it with Activation bit
+  {0x07, 0x007},                  // Select GPIO device
+  {0x60, (LPC_SIO_GPIO_REGISTER_ADDRESS_2 >> 8)},      // Set Base Address MSB
+  {0x61, (LPC_SIO_GPIO_REGISTER_ADDRESS_2 & 0x00FF)},  // Set Base Address LSB
+  {0x30, 0x001},                  // Enable it with Activation bit
+  {0x21, 0x001},                  // Global Device Enable
+  {0x26, 0x000}                   // Fast Enable UART 0 & 1 as their enable & activation bit
+};
+
+//
+// IT8628
+//
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_SIO_TABLE mSioIt8628TableSerialPort[] = {
+  {0x023, 0x09}, // Clock Selection register
+  {0x007, 0x01}, // Com1 Logical Device Number select
+  {0x061, 0xF8}, // Serial Port 1 Base Address MSB Register
+  {0x060, 0x03}, // Serial Port 1 Base Address LSB Register
+  {0x070, 0x04}, // Serial Port 1 Interrupt Level Select
+  {0x030, 0x01}, // Serial Port 1 Activate
+  {0x007, 0x02}, // Com1 Logical Device Number select
+  {0x061, 0xF8}, // Serial Port 2 Base Address MSB Register
+  {0x060, 0x02}, // Serial Port 2 Base Address MSB Register
+  {0x070, 0x03}, // Serial Port 2 Interrupt Level Select
+  {0x030, 0x01}  // Serial Port 2 Activate
+
+};
+
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_SIO_TABLE mSioTableWinbond_x374[] = {
+  {0x07, 0x03},                   // Select UART0 device
+  {0x60, (COM1_BASE >> 8)},       // Set Base Address MSB
+  {0x61, (COM1_BASE & 0x00FF)},   // Set Base Address LSB
+  {0x70, 0x04},                   // Set to IRQ4
+  {0x30, 0x01}                    // Enable it with Activation bit
+};
+
+/**
+  Detect if a National 393 SIO is docked. If yes, enable the docked SIO
+  and its serial port, and disable the onboard serial port.
+
+  @retval EFI_SUCCESS     Operations performed successfully.
+**/
+STATIC
+VOID
+CheckNationalSio (
+  VOID
+  )
+{
+  UINT8           Data8;
+
+  //
+  // Pc87393 access is through either (0x2e, 0x2f) or (0x4e, 0x4f).
+  // We use (0x2e, 0x2f) which is determined by BADD default strapping
+  //
+
+  //
+  // Read the Pc87393 signature
+  //
+  IoWrite8 (0x2e, 0x20);
+  Data8 = IoRead8 (0x2f);
+
+  if (Data8 == 0xea) {
+    //
+    // Signature matches - National PC87393 SIO is docked
+    //
+
+    //
+    // Enlarge the LPC decode scope to accommodate the Docking LPC Switch
+    // Register (SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS is allocated at
+    // SIO_BASE_ADDRESS + 0x10)
+    //
+    PchLpcGenIoRangeSet ((FixedPcdGet16 (PcdSioBaseAddress) & (UINT16)~0x7F), 0x20);
+
+    //
+    // Enable port switch
+    //
+    IoWrite8 (SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS, 0x06);
+
+    //
+    // Turn on docking power
+    //
+    IoWrite8 (FixedPcdGet16 (PcdSioBaseAddress) + 0x0E, 0x8c);
+
+    IoWrite8 (FixedPcdGet16 (PcdSioBaseAddress) + 0x0E, 0x9c);
+
+    IoWrite8 (FixedPcdGet16 (PcdSioBaseAddress) + 0x0E, 0xBc);
+
+    //
+    // Enable port switch
+    //
+    IoWrite8 (SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS, 0x7);
+
+    //
+    // GPIO setting
+    //
+    IoWrite8 (0x2e, 0x24);
+    IoWrite8 (0x2f, 0x29);
+
+    //
+    // Enable chip clock
+    //
+    IoWrite8 (0x2e, 0x29);
+    IoWrite8 (0x2f, 0x1e);
+
+
+    //
+    // Enable serial port
+    //
+
+    //
+    // Select com1
+    //
+    IoWrite8 (0x2e, 0x7);
+    IoWrite8 (0x2f, 0x3);
+
+    //
+    // Base address: 0x3f8
+    //
+    IoWrite8 (0x2e, 0x60);
+    IoWrite8 (0x2f, 0x03);
+    IoWrite8 (0x2e, 0x61);
+    IoWrite8 (0x2f, 0xf8);
+
+    //
+    // Interrupt: 4
+    //
+    IoWrite8 (0x2e, 0x70);
+    IoWrite8 (0x2f, 0x04);
+
+    //
+    // Enable bank selection
+    //
+    IoWrite8 (0x2e, 0xf0);
+    IoWrite8 (0x2f, 0x82);
+
+    //
+    // Activate
+    //
+    IoWrite8 (0x2e, 0x30);
+    IoWrite8 (0x2f, 0x01);
+
+    //
+    // Disable onboard serial port
+    //
+    IoWrite8 (FixedPcdGet16 (PcdLpcSioConfigDefaultPort), 0x55);
+
+    //
+    // Power Down UARTs
+    //
+    IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x2);
+    IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0x00);
+
+    //
+    // Dissable COM1 decode
+    //
+    IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x24);
+    IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0);
+
+    //
+    // Disable COM2 decode
+    //
+    IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x25);
+    IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0);
+
+    //
+    // Disable interrupt
+    //
+    IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x28);
+    IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0x0);
+
+    IoWrite8 (FixedPcdGet16 (PcdLpcSioConfigDefaultPort), 0xAA);
+
+    //
+    // Enable floppy
+    //
+
+    //
+    // Select floppy
+    //
+    IoWrite8 (0x2e, 0x7);
+    IoWrite8 (0x2f, 0x0);
+
+    //
+    // Base address: 0x3f0
+    //
+    IoWrite8 (0x2e, 0x60);
+    IoWrite8 (0x2f, 0x03);
+    IoWrite8 (0x2e, 0x61);
+    IoWrite8 (0x2f, 0xf0);
+
+    //
+    // Interrupt: 6
+    //
+    IoWrite8 (0x2e, 0x70);
+    IoWrite8 (0x2f, 0x06);
+
+    //
+    // DMA 2
+    //
+    IoWrite8 (0x2e, 0x74);
+    IoWrite8 (0x2f, 0x02);
+
+    //
+    // Activate
+    //
+    IoWrite8 (0x2e, 0x30);
+    IoWrite8 (0x2f, 0x01);
+
+  } else {
+
+    //
+    // No National pc87393 SIO is docked, turn off dock power and
+    // disable port switch
+    //
+    // IoWrite8 (SIO_BASE_ADDRESS + 0x0E, 0xbf);
+    // IoWrite8 (0x690, 0);
+
+    //
+    // If no National pc87393, just return
+    //
+    return ;
+  }
+}
+
+/**
+Check whether the IT8628 SIO present on LPC. If yes, enable its serial ports
+
+@retval EFI_SUCCESS     Operations performed successfully.
+**/
+STATIC
+VOID
+It8628SioSerialPortInit (
+  VOID
+  )
+{
+  UINT8   ChipId0              = 0;
+  UINT8   ChipId1              = 0;
+  UINT16  LpcIoDecondeRangeSet = 0;
+  UINT16  LpcIoDecoodeSet      = 0;
+  UINT8   Index;
+  UINTN   LpcBaseAddr;
+
+
+
+  //
+  // Enable I/O decoding for COM1 (3F8h-3FFh), COM2(2F8h-2FFh), I/O port 2Eh/2Fh.
+  //
+  LpcBaseAddr = MmPciBase (
+                  DEFAULT_PCI_BUS_NUMBER_PCH,
+                  LpcDevNumber (),
+                  LpcFuncNumber ()
+                  );
+
+  LpcIoDecondeRangeSet = (UINT16) MmioRead16 (LpcBaseAddr + R_LPC_CFG_IOD);
+  LpcIoDecoodeSet = (UINT16) MmioRead16 (LpcBaseAddr + R_LPC_CFG_IOE);
+  MmioWrite16 ((LpcBaseAddr + R_LPC_CFG_IOD), (LpcIoDecondeRangeSet | ((V_LPC_CFG_IOD_COMB_2F8 << 4) | V_LPC_CFG_IOD_COMA_3F8)));
+  MmioWrite16 ((LpcBaseAddr + R_LPC_CFG_IOE), (LpcIoDecoodeSet | (B_LPC_CFG_IOE_SE | B_LPC_CFG_IOE_CBE | B_LPC_CFG_IOE_CAE|B_LPC_CFG_IOE_KE)));
+
+
+  //
+  // Enter MB PnP Mode
+  //
+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_0);
+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_1);
+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_2);
+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_3);
+
+  //
+  // Read Chip Id of SIO IT8628 (registers 0x20 and 0x21)
+  //
+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, 0x20);
+  ChipId0 = IoRead8 (LPC_SIO_DATA_DEFAULT_PORT_2);
+
+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, 0x21);
+  ChipId1 = IoRead8 (LPC_SIO_DATA_DEFAULT_PORT_2);
+
+  //
+  // Enable Serial Port 1, Port 2
+  //
+  if ((ChipId0 == IT8628_CHIPID_BYTE1) && (ChipId1 == IT8628_CHIPID_BYTE2)) {
+    for (Index = 0; Index < sizeof (mSioIt8628TableSerialPort) / sizeof (EFI_SIO_TABLE); Index++) {
+      IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, mSioIt8628TableSerialPort[Index].Register);
+      IoWrite8 (LPC_SIO_DATA_DEFAULT_PORT_2, mSioIt8628TableSerialPort[Index].Value);
+    }
+  }
+
+  //
+  // Exit MB PnP Mode
+  //
+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_EXIT_CONFIG);
+  IoWrite8 (LPC_SIO_DATA_DEFAULT_PORT_2, IT8628_EXIT_CONFIG);
+
+  return;
+}
+
+/**
+  Performs platform specific initialization required for the CPU to access
+  the hardware associated with a SerialPortLib instance.  This function does
+  not initialize the serial port hardware itself.  Instead, it initializes
+  hardware devices that are required for the CPU to access the serial port
+  hardware.  This function may be called more than once.
+
+  @retval RETURN_SUCCESS       The platform specific initialization succeeded.
+  @retval RETURN_DEVICE_ERROR  The platform specific initialization could not be completed.
+
+**/
+RETURN_STATUS
+EFIAPI
+PlatformHookSerialPortInitialize (
+  VOID
+  )
+{
+  UINT16  IndexPort;
+  UINT16  DataPort;
+  UINT8   Index;
+
+  IndexPort = 0;
+  DataPort = 0;
+  Index = 0;
+
+  //
+  // Enable I/O decoding for COM1(3F8h-3FFh), COM2(2F8h-2FFh), I/O port 2Eh/2Fh, 4Eh/4Fh, 60h/64Fh and 62h/66h.
+  //
+  PchLpcIoDecodeRangesSet (PcdGet16 (PcdLpcIoDecodeRange));
+  PchLpcIoEnableDecodingSet (PcdGet16 (PchLpcIoEnableDecoding));
+
+  // Configure Sio IT8628
+  It8628SioSerialPortInit ();
+
+  return RETURN_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.inf
new file mode 100644
index 0000000000..cf01780101
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.inf
@@ -0,0 +1,51 @@
+## @file
+# Platform Hook Library instance for Tigerlake Mobile/Desktop CRB.
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010017
+  BASE_NAME                      = BasePlatformHookLib
+  FILE_GUID                      = E22ADCC6-ED90-4A90-9837-C8E7FF9E963D
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = BASE
+  LIBRARY_CLASS                  = PlatformHookLib
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[LibraryClasses]
+  BaseLib
+  IoLib
+  PciSegmentLib
+  MmPciLib
+  PciLib
+  PchCycleDecodingLib
+  SaPlatformLib
+  PchPciBdfLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress            ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdLpcSioIndexPort                ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdLpcSioDataPort                 ## CONSUMES
+
+[FixedPcd]
+  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort        ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdSioBaseAddress                 ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdLpcIoDecodeRange               ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PchLpcIoEnableDecoding            ## CONSUMES
+
+[Sources]
+  BasePlatformHookLib.c
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf
new file mode 100644
index 0000000000..374f5ea52b
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf
@@ -0,0 +1,49 @@
+## @file
+# SMM Library instance of Spi Flash Common Library Class
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010017
+  BASE_NAME                      = SmmSpiFlashCommonLib
+  FILE_GUID                      = 9632D96E-E849-4217-9217-DC500B8AAE47
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = DXE_SMM_DRIVER
+  LIBRARY_CLASS                  = SpiFlashCommonLib|DXE_SMM_DRIVER
+  CONSTRUCTOR                    = SmmSpiFlashCommonLibConstructor
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64
+#
+
+[LibraryClasses]
+  IoLib
+  MemoryAllocationLib
+  BaseLib
+  UefiLib
+  SmmServicesTableLib
+  BaseMemoryLib
+  DebugLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+
+[Pcd]
+  gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress   ## CONSUMES
+  gSiPkgTokenSpaceGuid.PcdBiosSize              ## CONSUMES
+
+[Sources]
+  SpiFlashCommonSmmLib.c
+  SpiFlashCommon.c
+
+[Protocols]
+  gPchSmmSpiProtocolGuid                        ## CONSUMES
+
+[Depex.X64.DXE_SMM_DRIVER]
+  gPchSmmSpiProtocolGuid
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommon.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommon.c
new file mode 100644
index 0000000000..f86896dd1f
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommon.c
@@ -0,0 +1,210 @@
+/** @file
+  Wrap EFI_SPI_PROTOCOL to provide some library level interfaces
+  for module use.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Library/SpiFlashCommonLib.h>
+#include <Library/IoLib.h>
+#include <Protocol/Spi.h>
+
+PCH_SPI_PROTOCOL       *mSpiProtocol;
+
+//
+// Variables for boottime and runtime usage.
+//
+UINTN mBiosAreaBaseAddress = 0;
+UINTN mBiosSize            = 0;
+UINTN mBiosOffset          = 0;
+
+/**
+  Enable block protection on the Serial Flash device.
+
+  @retval     EFI_SUCCESS       Opertion is successful.
+  @retval     EFI_DEVICE_ERROR  If there is any device errors.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFlashLock (
+  VOID
+  )
+{
+  return EFI_SUCCESS;
+}
+
+/**
+  Read NumBytes bytes of data from the address specified by
+  PAddress into Buffer.
+
+  @param[in]      Address       The starting physical address of the read.
+  @param[in,out]  NumBytes      On input, the number of bytes to read. On output, the number
+                                of bytes actually read.
+  @param[out]     Buffer        The destination data buffer for the read.
+
+  @retval         EFI_SUCCESS       Operation is successful.
+  @retval         EFI_DEVICE_ERROR  If there is any device errors.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFlashRead (
+  IN     UINTN                        Address,
+  IN OUT UINT32                       *NumBytes,
+     OUT UINT8                        *Buffer
+  )
+{
+  ASSERT ((NumBytes != NULL) && (Buffer != NULL));
+  if ((NumBytes == NULL) || (Buffer == NULL)) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  //
+  // This function is implemented specifically for those platforms
+  // at which the SPI device is memory mapped for read. So this
+  // function just do a memory copy for Spi Flash Read.
+  //
+  CopyMem (Buffer, (VOID *) Address, *NumBytes);
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Write NumBytes bytes of data from Buffer to the address specified by
+  PAddresss.
+
+  @param[in]      Address         The starting physical address of the write.
+  @param[in,out]  NumBytes        On input, the number of bytes to write. On output,
+                                  the actual number of bytes written.
+  @param[in]      Buffer          The source data buffer for the write.
+
+  @retval         EFI_SUCCESS            Operation is successful.
+  @retval         EFI_DEVICE_ERROR       If there is any device errors.
+  @retval         EFI_INVALID_PARAMETER  Invalid parameter.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFlashWrite (
+  IN     UINTN                      Address,
+  IN OUT UINT32                     *NumBytes,
+  IN     UINT8                      *Buffer
+  )
+{
+  EFI_STATUS                Status;
+  UINTN                     Offset;
+  UINT32                    Length;
+  UINT32                    RemainingBytes;
+
+  ASSERT ((NumBytes != NULL) && (Buffer != NULL));
+  if ((NumBytes == NULL) || (Buffer == NULL)) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  ASSERT (Address >= mBiosAreaBaseAddress);
+  if (Address < mBiosAreaBaseAddress) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Offset = Address - mBiosAreaBaseAddress;
+
+  ASSERT ((*NumBytes + Offset) <= mBiosSize);
+  if ((*NumBytes + Offset) > mBiosSize) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Status = EFI_SUCCESS;
+  RemainingBytes = *NumBytes;
+
+
+  while (RemainingBytes > 0) {
+    if (RemainingBytes > SECTOR_SIZE_4KB) {
+      Length = SECTOR_SIZE_4KB;
+    } else {
+      Length = RemainingBytes;
+    }
+    Status = mSpiProtocol->FlashWrite (
+                             mSpiProtocol,
+                             FlashRegionBios,
+                             (UINT32) Offset,
+                             Length,
+                             Buffer
+                             );
+    if (EFI_ERROR (Status)) {
+      break;
+    }
+    RemainingBytes -= Length;
+    Offset += Length;
+    Buffer += Length;
+  }
+
+  //
+  // Actual number of bytes written
+  //
+  *NumBytes -= RemainingBytes;
+
+  return Status;
+}
+
+/**
+  Erase the block starting at Address.
+
+  @param[in]  Address         The starting physical address of the block to be erased.
+                              This library assume that caller garantee that the PAddress
+                              is at the starting address of this block.
+  @param[in]  NumBytes        On input, the number of bytes of the logical block to be erased.
+                              On output, the actual number of bytes erased.
+
+  @retval     EFI_SUCCESS.           Operation is successful.
+  @retval     EFI_DEVICE_ERROR       If there is any device errors.
+  @retval     EFI_INVALID_PARAMETER  Invalid parameter.
+
+**/
+EFI_STATUS
+EFIAPI
+SpiFlashBlockErase (
+  IN    UINTN                     Address,
+  IN    UINTN                     *NumBytes
+  )
+{
+  EFI_STATUS          Status;
+  UINTN               Offset;
+  UINTN               RemainingBytes;
+
+  ASSERT (NumBytes != NULL);
+  if (NumBytes == NULL) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  ASSERT (Address >= mBiosAreaBaseAddress);
+  if (Address < mBiosAreaBaseAddress) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Offset = Address - mBiosAreaBaseAddress;
+
+  ASSERT ((*NumBytes % SECTOR_SIZE_4KB) == 0);
+  if ((*NumBytes % SECTOR_SIZE_4KB) != 0) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  ASSERT ((*NumBytes + Offset) <= mBiosSize);
+  if ((*NumBytes + Offset) > mBiosSize) {
+    return EFI_INVALID_PARAMETER;
+  }
+
+  Status = EFI_SUCCESS;
+  RemainingBytes = *NumBytes;
+
+
+  Status = mSpiProtocol->FlashErase (
+                           mSpiProtocol,
+                           FlashRegionBios,
+                           (UINT32) Offset,
+                           (UINT32) RemainingBytes
+                           );
+  return Status;
+}
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c
new file mode 100644
index 0000000000..7941b8f872
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c
@@ -0,0 +1,58 @@
+/** @file
+  SMM Library instance of SPI Flash Common Library Class
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Library/SmmServicesTableLib.h>
+#include <Protocol/Spi.h>
+#include <Library/DebugLib.h>
+
+extern PCH_SPI_PROTOCOL   *mSpiProtocol;
+
+extern UINTN mBiosAreaBaseAddress;
+extern UINTN mBiosSize;
+extern UINTN mBiosOffset;
+
+/**
+  The library constructuor.
+
+  The function does the necessary initialization work for this library
+  instance.
+
+  @param[in]  ImageHandle       The firmware allocated handle for the UEFI image.
+  @param[in]  SystemTable       A pointer to the EFI system table.
+
+  @retval     EFI_SUCCESS       The function always return EFI_SUCCESS for now.
+                                It will ASSERT on error for debug version.
+  @retval     EFI_ERROR         Please reference LocateProtocol for error code details.
+**/
+EFI_STATUS
+EFIAPI
+SmmSpiFlashCommonLibConstructor (
+  IN EFI_HANDLE        ImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  EFI_STATUS Status;
+  UINT32     BaseAddr;
+  UINT32     RegionSize;
+
+  mBiosAreaBaseAddress = (UINTN)PcdGet32 (PcdBiosAreaBaseAddress);
+  mBiosSize            = (UINTN)PcdGet32 (PcdBiosSize);
+
+  //
+  // Locate the SMM SPI protocol.
+  //
+  Status = gSmst->SmmLocateProtocol (
+                    &gPchSmmSpiProtocolGuid,
+                    NULL,
+                    (VOID **) &mSpiProtocol
+                    );
+  ASSERT_EFI_ERROR (Status);
+
+  mSpiProtocol->GetRegionAddress (mSpiProtocol, FlashRegionBios, &BaseAddr, &RegionSize);
+  mBiosOffset = BaseAddr;
+  return Status;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c
new file mode 100644
index 0000000000..a2367047cd
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c
@@ -0,0 +1,168 @@
+/** @file
+  This file initialises and Installs GopPolicy Protocol.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiDxe.h>
+#include <Library/UefiBootServicesTableLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Protocol/FirmwareVolume2.h>
+#include <Protocol/GopPolicy.h>
+
+GLOBAL_REMOVE_IF_UNREFERENCED GOP_POLICY_PROTOCOL        mGOPPolicy;
+GLOBAL_REMOVE_IF_UNREFERENCED UINT32                     mVbtSize = 0;
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_PHYSICAL_ADDRESS       mVbtAddress = 0;
+
+/**
+  @param[out] CurrentLidStatus
+
+  @retval     EFI_SUCCESS
+  @retval     EFI_UNSUPPORTED
+**/
+EFI_STATUS
+EFIAPI
+GetPlatformLidStatus (
+  OUT LID_STATUS *CurrentLidStatus
+  )
+{
+  return EFI_UNSUPPORTED;
+}
+
+/**
+  @param[out] CurrentDockStatus
+
+  @retval     EFI_SUCCESS
+  @retval     EFI_UNSUPPORTED
+**/
+EFI_STATUS
+EFIAPI
+GetPlatformDockStatus (
+  OUT DOCK_STATUS  CurrentDockStatus
+  )
+{
+    return EFI_UNSUPPORTED;
+}
+
+/**
+  @param[out] VbtAddress
+  @param[out] VbtSize
+
+  @retval     EFI_SUCCESS
+  @retval     EFI_NOT_FOUND
+**/
+EFI_STATUS
+EFIAPI
+GetVbtData (
+  OUT EFI_PHYSICAL_ADDRESS *VbtAddress,
+  OUT UINT32               *VbtSize
+  )
+{
+  EFI_STATUS                    Status;
+  UINTN                         FvProtocolCount;
+  EFI_HANDLE                    *FvHandles;
+  EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;
+  UINTN                         Index;
+  UINT32                        AuthenticationStatus;
+  UINT8                         *Buffer;
+  UINTN                         VbtBufferSize;
+
+
+  Status = EFI_NOT_FOUND;
+  if ( mVbtAddress == 0) {
+    Fv           = NULL;
+
+    Buffer = 0;
+    FvHandles = NULL;
+    Status = gBS->LocateHandleBuffer (
+                    ByProtocol,
+                    &gEfiFirmwareVolume2ProtocolGuid,
+                    NULL,
+                    &FvProtocolCount,
+                    &FvHandles
+                    );
+    if (!EFI_ERROR (Status)) {
+      for (Index = 0; Index < FvProtocolCount; Index++) {
+        Status = gBS->HandleProtocol (
+                        FvHandles[Index],
+                        &gEfiFirmwareVolume2ProtocolGuid,
+                        (VOID **) &Fv
+                        );
+        VbtBufferSize = 0;
+        Status = Fv->ReadSection (
+                       Fv,
+                       PcdGetPtr (PcdIntelGraphicsVbtFileGuid),
+                       EFI_SECTION_RAW,
+                       0,
+                       (VOID **) &Buffer,
+                       &VbtBufferSize,
+                       &AuthenticationStatus
+                       );
+        if (!EFI_ERROR (Status)) {
+          *VbtAddress = (EFI_PHYSICAL_ADDRESS)Buffer;
+          *VbtSize = (UINT32)VbtBufferSize;
+          mVbtAddress = *VbtAddress;
+          mVbtSize = *VbtSize;
+          Status = EFI_SUCCESS;
+          break;
+        }
+      }
+    } else {
+      Status = EFI_NOT_FOUND;
+    }
+
+    if (FvHandles != NULL) {
+      FreePool (FvHandles);
+      FvHandles = NULL;
+    }
+  } else {
+    *VbtAddress = mVbtAddress;
+    *VbtSize = mVbtSize;
+    Status = EFI_SUCCESS;
+  }
+
+  return Status;
+}
+
+/**
+Initialize GOP DXE Policy
+
+@param[in] ImageHandle          Image handle of this driver.
+
+@retval EFI_SUCCESS             Initialization complete.
+@retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.
+@retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.
+@retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.
+**/
+EFI_STATUS
+EFIAPI
+GopPolicyInitDxe (
+  IN EFI_HANDLE       ImageHandle
+  )
+{
+  EFI_STATUS         Status;
+
+  //
+  // Initialize the EFI Driver Library
+  //
+  SetMem (&mGOPPolicy, sizeof (GOP_POLICY_PROTOCOL), 0);
+
+  mGOPPolicy.Revision                = GOP_POLICY_PROTOCOL_REVISION_03;
+  mGOPPolicy.GetPlatformLidStatus    = GetPlatformLidStatus;
+  mGOPPolicy.GetVbtData              = GetVbtData;
+  mGOPPolicy.GetPlatformDockStatus   = GetPlatformDockStatus;
+
+  //
+  // Install protocol to allow access to this Policy.
+  //
+  Status = gBS->InstallMultipleProtocolInterfaces (
+                  &ImageHandle,
+                  &gGopPolicyProtocolGuid,
+                  &mGOPPolicy,
+                  NULL
+                  );
+
+  return Status;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxePchPolicyInit.c b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxePchPolicyInit.c
new file mode 100644
index 0000000000..e75abcb42a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxePchPolicyInit.c
@@ -0,0 +1,61 @@
+/** @file
+  This file initialises and Installs GopPolicy Protocol.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Uefi.h>
+#include <Library/DebugLib.h>
+
+EFI_STATUS
+EFIAPI
+CreatePchDxeConfigBlocks (
+  IN OUT  VOID      **SaPolicy
+  );
+
+EFI_STATUS
+EFIAPI
+PchInstallPolicyProtocol (
+  IN  EFI_HANDLE                  ImageHandle,
+  IN  VOID                        *PchPolicy
+  );
+
+/**
+  Initialize PCH DXE Policy
+
+  @param[in] ImageHandle          Image handle of this driver.
+
+  @retval EFI_SUCCESS             Initialization complete.
+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.
+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.
+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.
+**/
+EFI_STATUS
+EFIAPI
+PchPolicyInitDxe (
+  IN EFI_HANDLE           ImageHandle
+  )
+{
+  EFI_STATUS    Status;
+  EFI_HANDLE    PchHandle;
+  VOID          *PchPolicy;
+
+  //
+  // Call CreatePchDxeConfigBlocks to create & initialize platform policy structure
+  // and get all Intel default policy settings.
+  //
+  Status = CreatePchDxeConfigBlocks (&PchPolicy);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Install PchInstallPolicyProtocol.
+  // While installed, RC assumes the Policy is ready and finalized. So please
+  // update and override any setting before calling this function.
+  //
+  PchHandle = NULL;
+  Status = PchInstallPolicyProtocol (PchHandle, PchPolicy);
+  ASSERT_EFI_ERROR (Status);
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.c b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.c
new file mode 100644
index 0000000000..5a9def9d13
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.c
@@ -0,0 +1,61 @@
+/** @file
+  This file initialises and Installs GopPolicy Protocol.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Uefi.h>
+#include <Library/DebugLib.h>
+
+EFI_STATUS
+EFIAPI
+CreateSaDxeConfigBlocks (
+  IN OUT  VOID      **SaPolicy
+  );
+
+EFI_STATUS
+EFIAPI
+SaInstallPolicyProtocol (
+  IN  EFI_HANDLE                  ImageHandle,
+  IN  VOID                        *SaPolicy
+  );
+
+/**
+  Initialize SA DXE Policy
+
+  @param[in] ImageHandle          Image handle of this driver.
+
+  @retval EFI_SUCCESS             Initialization complete.
+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.
+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.
+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.
+**/
+EFI_STATUS
+EFIAPI
+SaPolicyInitDxe (
+  IN EFI_HANDLE           ImageHandle
+  )
+{
+  EFI_STATUS    Status;
+  EFI_HANDLE    SaHandle;
+  VOID          *SaPolicy;
+
+  //
+  // Call CreateSaDxeConfigBlocks to create & initialize platform policy structure
+  // and get all Intel default policy settings.
+  //
+  Status = CreateSaDxeConfigBlocks (&SaPolicy);
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Install SaInstallPolicyProtocol.
+  // While installed, RC assumes the Policy is ready and finalized. So please
+  // update and override any setting before calling this function.
+  //
+  SaHandle = NULL;
+  Status = SaInstallPolicyProtocol (SaHandle, SaPolicy);
+  ASSERT_EFI_ERROR (Status);
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLate.c b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLate.c
new file mode 100644
index 0000000000..2eee9958be
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLate.c
@@ -0,0 +1,97 @@
+/** @file
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiDxe.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+#include <Library/UefiBootServicesTableLib.h>
+
+/**
+  Initialize SA DXE Policy
+
+  @param[in] ImageHandle          Image handle of this driver.
+
+  @retval EFI_SUCCESS             Initialization complete.
+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.
+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.
+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.
+**/
+EFI_STATUS
+EFIAPI
+SaPolicyInitDxe (
+  IN EFI_HANDLE           ImageHandle
+  );
+
+/**
+  Initialize PCH DXE Policy
+
+  @param[in] ImageHandle          Image handle of this driver.
+
+  @retval EFI_SUCCESS             Initialization complete.
+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.
+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.
+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.
+**/
+EFI_STATUS
+EFIAPI
+PchPolicyInitDxe (
+  IN EFI_HANDLE           ImageHandle
+  );
+
+/**
+  Initialize GOP DXE Policy
+
+  @param[in] ImageHandle          Image handle of this driver.
+
+  @retval EFI_SUCCESS             Initialization complete.
+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.
+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.
+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.
+**/
+EFI_STATUS
+EFIAPI
+GopPolicyInitDxe (
+  IN EFI_HANDLE           ImageHandle
+  );
+
+/**
+  Performs silicon late policy update.
+
+  The meaning of Policy is defined by silicon code.
+  It could be the raw data, a handle, a Protocol, etc.
+
+  The input Policy must be returned by SiliconPolicyDoneLate().
+
+  In FSP or non-FSP path, the board may use additional way to get
+  the silicon policy data field based upon the input Policy.
+
+  @param[in, out] Policy       Pointer to policy.
+
+  @return the updated policy.
+**/
+VOID *
+EFIAPI
+SiliconPolicyUpdateLate (
+  IN OUT VOID *Policy
+  )
+{
+  EFI_STATUS               Status;
+
+  SaPolicyInitDxe (gImageHandle);
+  PchPolicyInitDxe (gImageHandle);
+
+  if (PcdGetBool (PcdIntelGopEnable)) {
+    //
+    // GOP Dxe Policy Initialization
+    //
+    Status = GopPolicyInitDxe (gImageHandle);
+    RETURN_ERROR (Status);
+    DEBUG ((DEBUG_INFO, "GOP Dxe Policy Initialization done\n"));
+  }
+
+  return Policy;
+}
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf
new file mode 100644
index 0000000000..573dbfa04a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf
@@ -0,0 +1,49 @@
+## @file
+#  Component information file for Silicon Policy Update Library
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = DxeSiliconUpdateLib
+  FILE_GUID                      = C523609D-E354-416B-B24F-33468D4BD21D
+  MODULE_TYPE                    = DXE_DRIVER
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = SiliconPolicyUpdateLib
+
+[LibraryClasses]
+  BaseLib
+  PcdLib
+  DebugLib
+  UefiBootServicesTableLib
+  DxeSaPolicyLib
+  DxePchPolicyLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
+  IntelSiliconPkg/IntelSiliconPkg.dec
+
+[Sources]
+  DxeSiliconPolicyUpdateLate.c
+  DxeSaPolicyInit.c
+  DxePchPolicyInit.c
+  DxeGopPolicyInit.c
+
+[Pcd]
+  gBoardModuleTokenSpaceGuid.PcdIntelGopEnable
+  gBoardModuleTokenSpaceGuid.PcdGraphicsVbtGuid
+  gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid
+
+[Protocols]
+  gEfiFirmwareVolume2ProtocolGuid               ## CONSUMES
+  gGopPolicyProtocolGuid                        ## PRODUCES
+
+[Depex]
+  gEfiVariableArchProtocolGuid
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add library instances
  2021-02-09  8:45 [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Heng Luo
  2021-02-09  8:45 ` [Patch V2 2/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add fdf and header file Heng Luo
  2021-02-09  8:45 ` [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances Heng Luo
@ 2021-02-09  8:45 ` Heng Luo
  2021-02-10  0:38   ` Chaganty, Rangasai V
  2021-02-09  8:45 ` [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules Heng Luo
                   ` (4 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Heng Luo @ 2021-02-09  8:45 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Nate DeSimone

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

Adds the following library instances:
  * TigerlakeURvp/Library/BoardAcpiLib
  * TigerlakeURvp/Library/BoardInitLib
  * TigerlakeURvp/Library/PeiPlatformHookLib

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c      |  88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf    |  43 +++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c          | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmTigerlakeURvpAcpiEnableLib.c    |  51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardPchInitPreMemLib.c            | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardSaInitPreMemLib.c             |  96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4Rvp.h       |  93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4RvpPreMem.h |  33 +++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c      |  41 +++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf    |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c       |  88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf     | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpDetect.c           |  39 +++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPostMemLib.c   | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c    | 445 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/TigerlakeURvpInit.h                |  23 +++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.c         | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf       |  58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 18 files changed, 1947 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c
new file mode 100644
index 0000000000..1436d9b79a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c
@@ -0,0 +1,88 @@
+/** @file
+  Tiger Lake U RVP SMM Multi-Board ACPI Support library
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Base.h>
+#include <Uefi.h>
+#include <PiDxe.h>
+#include <Library/BaseLib.h>
+#include <Library/IoLib.h>
+#include <Library/BoardAcpiEnableLib.h>
+#include <Library/MultiBoardAcpiSupportLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+
+#include <PlatformBoardId.h>
+
+EFI_STATUS
+EFIAPI
+TglBoardEnableAcpi (
+  IN BOOLEAN  EnableSci
+  );
+
+EFI_STATUS
+EFIAPI
+TglBoardDisableAcpi (
+  IN BOOLEAN  DisableSci
+  );
+
+EFI_STATUS
+EFIAPI
+SiliconEnableAcpi (
+  IN BOOLEAN  EnableSci
+  );
+
+EFI_STATUS
+EFIAPI
+SiliconDisableAcpi (
+  IN BOOLEAN  DisableSci
+  );
+
+EFI_STATUS
+EFIAPI
+MultiBoardEnableAcpi (
+  IN BOOLEAN  EnableSci
+  )
+{
+  SiliconEnableAcpi (EnableSci);
+  return TglBoardEnableAcpi (EnableSci);
+}
+
+EFI_STATUS
+EFIAPI
+MultiBoardDisableAcpi (
+  IN BOOLEAN  DisableSci
+  )
+{
+  SiliconDisableAcpi (DisableSci);
+  return TglBoardDisableAcpi (DisableSci);
+}
+
+BOARD_ACPI_ENABLE_FUNC  mBoardAcpiEnableFunc = {
+  MultiBoardEnableAcpi,
+  MultiBoardDisableAcpi,
+};
+
+/**
+  The constructor function to register mBoardAcpiEnableFunc function.
+
+  @param[in]  ImageHandle  The firmware allocated handle for the EFI image.
+  @param[in]  SystemTable  A pointer to the EFI System Table.
+
+  @retval     EFI_SUCCESS  This constructor always return EFI_SUCCESS.
+                           It will ASSERT on errors.
+**/
+EFI_STATUS
+EFIAPI
+SmmMultiBoardAcpiSupportLibConstructor (
+  IN EFI_HANDLE        ImageHandle,
+  IN EFI_SYSTEM_TABLE  *SystemTable
+  )
+{
+  DEBUG ((DEBUG_INFO, "SKU_ID: 0x%x\n", LibPcdGetSku()));
+  return RegisterBoardAcpiEnableFunc (&mBoardAcpiEnableFunc);
+}
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf
new file mode 100644
index 0000000000..6f6a9272f9
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf
@@ -0,0 +1,43 @@
+## @file
+#  Tiger Lake U RVP SMM Multi-Board ACPI Support library
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010017
+  BASE_NAME                      = SmmMultiBoardAcpiSupportLib
+  FILE_GUID                      = 8929A54E-7ED8-4AB3-BEBB-C0367BDBBFF5
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = DXE_SMM_DRIVER
+  LIBRARY_CLASS                  = NULL
+  CONSTRUCTOR                    = SmmMultiBoardAcpiSupportLibConstructor
+
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES = IA32 X64 IPF EBC
+#
+
+[LibraryClasses]
+  BaseLib
+  IoLib
+  PciLib
+  MmPciLib
+  PchCycleDecodingLib
+  PchPciBdfLib
+  PmcLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+
+[Sources]
+  SmmTigerlakeURvpAcpiEnableLib.c
+  SmmSiliconAcpiEnableLib.c
+  SmmMultiBoardAcpiSupportLib.c
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c
new file mode 100644
index 0000000000..32afeb405e
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c
@@ -0,0 +1,160 @@
+/** @file
+  Tiger Lake U RVP SMM Silicon ACPI Enable library
+
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Base.h>
+#include <Uefi.h>
+#include <PiDxe.h>
+#include <Library/BaseLib.h>
+#include <Library/IoLib.h>
+#include <Library/PciSegmentLib.h>
+#include <Library/BoardAcpiEnableLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+#include <Library/MmPciLib.h>
+#include <Library/PmcLib.h>
+#include <Library/PchPciBdfLib.h>
+#include <Register/PchRegs.h>
+#include <Register/PchRegsLpc.h>
+#include <Register/PmcRegs.h>
+#include <Register/RtcRegs.h>
+
+/**
+  Clear Port 80h
+
+  SMI handler to enable ACPI mode
+
+  Dispatched on reads from APM port with value EFI_ACPI_ENABLE_SW_SMI
+
+  Disables the SW SMI Timer.
+  ACPI events are disabled and ACPI event status is cleared.
+  SCI mode is then enabled.
+
+  Clear SLP SMI status
+  Enable SLP SMI
+
+  Disable SW SMI Timer
+
+  Clear all ACPI event status and disable all ACPI events
+
+  Disable PM sources except power button
+  Clear status bits
+
+  Disable GPE0 sources
+  Clear status bits
+
+  Disable GPE1 sources
+  Clear status bits
+
+  Guarantee day-of-month alarm is invalid (ACPI 1.0 section 4.7.2.4)
+
+  Enable SCI
+**/
+EFI_STATUS
+EFIAPI
+SiliconEnableAcpi (
+  IN BOOLEAN  EnableSci
+  )
+{
+
+  UINT32                              SmiEn;
+  UINT32                              SmiSts;
+  UINT32                              ULKMC;
+  UINTN                               LpcBaseAddress;
+  UINT16                              AcpiBaseAddr;
+  UINT32                              Pm1Cnt;
+
+  LpcBaseAddress = LpcPciCfgBase ();
+
+  //
+  // Get the ACPI Base Address
+  //
+  AcpiBaseAddr = PmcGetAcpiBase();
+  //
+  // BIOS must also ensure that CF9GR is cleared and locked before handing control to the
+  // OS in order to prevent the host from issuing global resets and resetting ME
+  //
+  // EDK2: To match PCCG current BIOS behavior, do not lock CF9 Global Reset
+  // MmioWrite32 (
+  //     PmcBaseAddress + R_PCH_PMC_ETR3),
+  //     PmInit);
+
+  //
+  // Clear Port 80h
+  //
+  IoWrite8 (0x80, 0);
+
+  //
+  // Disable SW SMI Timer and clean the status
+  //
+  SmiEn = IoRead32 (AcpiBaseAddr + R_ACPI_IO_SMI_EN);
+  SmiEn &= ~(B_ACPI_IO_SMI_EN_LEGACY_USB2 | B_ACPI_IO_SMI_EN_SWSMI_TMR | B_ACPI_IO_SMI_EN_LEGACY_USB);
+  IoWrite32 (AcpiBaseAddr + R_ACPI_IO_SMI_EN, SmiEn);
+
+  SmiSts = IoRead32 (AcpiBaseAddr + R_ACPI_IO_SMI_STS);
+  SmiSts |= B_ACPI_IO_SMI_EN_LEGACY_USB2 | B_ACPI_IO_SMI_EN_SWSMI_TMR | B_ACPI_IO_SMI_EN_LEGACY_USB;
+  IoWrite32 (AcpiBaseAddr + R_ACPI_IO_SMI_STS, SmiSts);
+
+  //
+  // Disable port 60/64 SMI trap if they are enabled
+  //
+  ULKMC = MmioRead32 (LpcBaseAddress + R_LPC_CFG_ULKMC) & ~(B_LPC_CFG_ULKMC_60REN | B_LPC_CFG_ULKMC_60WEN | B_LPC_CFG_ULKMC_64REN | B_LPC_CFG_ULKMC_64WEN | B_LPC_CFG_ULKMC_A20PASSEN);
+  MmioWrite32 (LpcBaseAddress + R_LPC_CFG_ULKMC, ULKMC);
+
+  //
+  // Disable PM sources except power button
+  //
+  IoWrite16 (AcpiBaseAddr + R_ACPI_IO_PM1_EN, B_ACPI_IO_PM1_EN_PWRBTN);
+
+  //
+  // Clear PM status except Power Button status for RapidStart Resume
+  //
+  IoWrite16 (AcpiBaseAddr + R_ACPI_IO_PM1_STS, 0xFEFF);
+
+  //
+  // Guarantee day-of-month alarm is invalid (ACPI 1.0 section 4.7.2.4)
+  //
+  IoWrite8 (R_RTC_IO_INDEX_ALT, R_RTC_IO_REGD);
+  IoWrite8 (R_RTC_IO_TARGET_ALT, 0x0);
+
+  //
+  // Enable SCI
+  //
+  if (EnableSci) {
+    Pm1Cnt = IoRead32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT);
+    Pm1Cnt |= B_ACPI_IO_PM1_CNT_SCI_EN;
+    IoWrite32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT, Pm1Cnt);
+  }
+
+  return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+SiliconDisableAcpi (
+  IN BOOLEAN  DisableSci
+  )
+{
+
+  UINT16                              AcpiBaseAddr;
+  UINT32                              Pm1Cnt;
+
+  //
+  // Get the ACPI Base Address
+  //
+  AcpiBaseAddr = PmcGetAcpiBase();
+  //
+  // Disable SCI
+  //
+  if (DisableSci) {
+    Pm1Cnt = IoRead32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT);
+    Pm1Cnt &= ~B_ACPI_IO_PM1_CNT_SCI_EN;
+    IoWrite32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT, Pm1Cnt);
+  }
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmTigerlakeURvpAcpiEnableLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmTigerlakeURvpAcpiEnableLib.c
new file mode 100644
index 0000000000..3eb302c30d
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmTigerlakeURvpAcpiEnableLib.c
@@ -0,0 +1,51 @@
+/** @file
+  Tiger Lake U RVP SMM Board ACPI Enable library
+
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <Base.h>
+#include <Uefi.h>
+#include <PiDxe.h>
+#include <Library/BaseLib.h>
+#include <Library/IoLib.h>
+#include <Library/BoardAcpiTableLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+#include <PlatformBoardId.h>
+
+/**
+  Enable Board Acpi
+
+  @param[in]  EnableSci     Enable SCI if EnableSci parameters is True.
+
+  @retval     EFI_SUCCESS   The function always return successfully.
+**/
+EFI_STATUS
+EFIAPI
+TglBoardEnableAcpi (
+  IN BOOLEAN  EnableSci
+  )
+{
+  // enable additional board register
+  return EFI_SUCCESS;
+}
+
+/**
+  Disable Board Acpi
+
+  @param[in]  DisableSci    Disable SCI if DisableSci parameters is True.
+
+  @retval     EFI_SUCCESS   The function always return successfully.
+**/
+EFI_STATUS
+EFIAPI
+TglBoardDisableAcpi (
+  IN BOOLEAN  DisableSci
+  )
+{
+  // enable additional board register
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardPchInitPreMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardPchInitPreMemLib.c
new file mode 100644
index 0000000000..1c7e574f7d
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardPchInitPreMemLib.c
@@ -0,0 +1,160 @@
+/** @file
+  Source code for the board PCH configuration Pcd init functions for Pre-Memory Init phase.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include "TigerlakeURvpInit.h"
+#include "GpioTableTigerlakeUDdr4RvpPreMem.h"
+
+#include <PlatformBoardConfig.h>
+#include <Include/PlatformBoardId.h>
+
+#include <Library/GpioLib.h>
+
+/**
+  Board Root Port Clock Info configuration init function for PEI pre-memory phase.
+
+  @retval EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+RootPortClkInfoInit (
+  IN UINT16    BoardId
+  )
+{
+  PCD64_BLOB Clock[PCH_MAX_PCIE_CLOCKS];
+  UINT32 Index;
+
+  //
+  // The default clock assignment will be FREE_RUNNING, which corresponds to PchClockUsageUnspecified
+  // This is safe but power-consuming setting. If Platform code doesn't contain port-clock map for a given board,
+  // the clocks will keep on running anyway, allowing PCIe devices to operate. Downside is that clocks will
+  // continue to draw power. To prevent this, remember to provide port-clock map for every board.
+  //
+  for (Index = 0; Index < PCH_MAX_PCIE_CLOCKS; Index++) {
+    Clock[Index].PcieClock.ClkReqSupported = TRUE;
+    Clock[Index].PcieClock.ClockUsage = FREE_RUNNING;
+  }
+
+  ///
+  /// Assign ClkReq signal to root port. (Base 0)
+  /// For LP, Set 0 - 6
+  /// For H,  Set 0 - 15
+  /// Note that if GbE is enabled, ClkReq assigned to GbE will not be available for Root Port.
+  ///
+
+  switch (BoardId) {
+    // CLKREQ
+    case BoardIdTglUDdr4:
+      Clock[0].PcieClock.ClockUsage = PCIE_PEG;
+      Clock[1].PcieClock.ClockUsage = PCIE_PCH + 2;
+      Clock[2].PcieClock.ClockUsage = PCIE_PCH + 3;
+      Clock[3].PcieClock.ClockUsage = PCIE_PCH + 8;
+      Clock[4].PcieClock.ClockUsage = LAN_CLOCK;
+      Clock[5].PcieClock.ClockUsage = PCIE_PCH + 7;
+      Clock[6].PcieClock.ClockUsage = PCIE_PCH + 4;
+      break;
+    default:
+
+      break;
+  }
+
+  PcdSet64S (PcdPcieClock0,  Clock[ 0].Blob);
+  PcdSet64S (PcdPcieClock1,  Clock[ 1].Blob);
+  PcdSet64S (PcdPcieClock2,  Clock[ 2].Blob);
+  PcdSet64S (PcdPcieClock3,  Clock[ 3].Blob);
+  PcdSet64S (PcdPcieClock4,  Clock[ 4].Blob);
+  PcdSet64S (PcdPcieClock5,  Clock[ 5].Blob);
+  PcdSet64S (PcdPcieClock6,  Clock[ 6].Blob);
+  PcdSet64S (PcdPcieClock7,  Clock[ 7].Blob);
+  PcdSet64S (PcdPcieClock8,  Clock[ 8].Blob);
+  PcdSet64S (PcdPcieClock9,  Clock[ 9].Blob);
+  PcdSet64S (PcdPcieClock10, Clock[10].Blob);
+  PcdSet64S (PcdPcieClock11, Clock[11].Blob);
+  PcdSet64S (PcdPcieClock12, Clock[12].Blob);
+  PcdSet64S (PcdPcieClock13, Clock[13].Blob);
+  PcdSet64S (PcdPcieClock14, Clock[14].Blob);
+  PcdSet64S (PcdPcieClock15, Clock[15].Blob);
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Board USB related configuration init function for PEI pre-memory phase.
+
+  @param[in]  BoardId   An unsigned integrer represent the board id.
+
+  @retval EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+UsbConfigInit (
+  IN UINT16 BoardId
+  )
+{
+
+  return EFI_SUCCESS;
+}
+
+
+/**
+  Board GPIO Group Tier configuration init function for PEI pre-memory phase.
+
+  @param[in]  BoardId   An unsigned integrer represent the board id.
+
+  @retval EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+GpioGroupTierInit (
+  IN UINT16 BoardId
+  )
+{
+
+  return EFI_SUCCESS;
+}
+
+
+/**
+  GPIO init function for PEI pre-memory phase.
+
+  @param[in]  BoardId   An unsigned integrer represent the board id.
+
+  @retval EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+GpioTablePreMemInit (
+  IN UINT16 BoardId
+  )
+{
+
+  //
+  // GPIO Table Init.
+  //
+  switch (BoardId) {
+    case BoardIdTglUDdr4:
+      PcdSet32S (PcdBoardGpioTablePreMem, (UINTN) mGpioTablePreMemTglUDdr4);
+      PcdSet16S (PcdBoardGpioTablePreMemSize, mGpioTablePreMemTglUDdr4Size);
+      break;
+
+    default:
+      break;
+  }
+
+  return EFI_SUCCESS;
+}
+
+/**
+  PmConfig init function for PEI pre-memory phase.
+
+  @param[in]  BoardId   An unsigned integrer represent the board id.
+
+  @retval EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+PchPmConfigInit (
+  IN UINT16 BoardId
+  )
+{
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardSaInitPreMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardSaInitPreMemLib.c
new file mode 100644
index 0000000000..b468e21ec9
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardSaInitPreMemLib.c
@@ -0,0 +1,96 @@
+/** @file
+ Source code for the board SA configuration Pcd init functions in Pre-Memory init phase.
+
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include "TigerlakeURvpInit.h"
+#include <Pins/GpioPinsVer2Lp.h>
+#include <PlatformBoardId.h>
+#include <PlatformBoardConfig.h>
+
+/**
+  MRC configuration init function for PEI pre-memory phase.
+
+  @param[in]  BoardId           An unsigned integer represent the board id.
+
+  @retval EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+SaMiscConfigInit (
+  IN UINT16         BoardId
+  )
+{
+  //
+  // UserBd
+  //
+  switch (BoardId) {
+    case BoardIdTglUDdr4:
+      //
+      // Assign UserBd to 5 which is assigned to MrcInputs->BoardType btUser4 for ULT platforms.
+      // This is required to skip Memory voltage programming based on GPIO's in MRC
+      //
+      PcdSet8S (PcdSaMiscUserBd, 5); // MrcBoardType btUser4 for ULT platform
+      break;
+
+    default:
+      // MiscPeiPreMemConfig.UserBd = 0 by default.
+      break;
+  }
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Board Memory Init related configuration init function for PEI pre-memory phase.
+
+  @param[in]  BoardId   An unsigned integrer represent the board id.
+
+  @retval EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+MrcConfigInit (
+  IN UINT16 BoardId
+  )
+{
+
+  PcdSet8S (PcdMrcSpdAddressTable0, 0xA0);
+  PcdSet8S (PcdMrcSpdAddressTable1, 0xA2);
+  PcdSet8S (PcdMrcSpdAddressTable2, 0xA4);
+  PcdSet8S (PcdMrcSpdAddressTable3, 0xA6);
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Board SA related GPIO configuration init function for PEI pre-memory phase.
+
+  @param[in]  BoardId   An unsigned integer represent the board id.
+
+  @retval EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+SaGpioConfigInit (
+  IN UINT16 BoardId
+  )
+{
+  return EFI_SUCCESS;
+}
+
+/**
+  SA Display DDI configuration init function for PEI pre-memory phase.
+
+  @param[in]  BoardId       An unsigned integer represent the board id.
+
+  @retval     EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+SaDisplayConfigInit (
+  IN UINT16 BoardId
+  )
+{
+  return EFI_SUCCESS;
+}
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4Rvp.h b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4Rvp.h
new file mode 100644
index 0000000000..0b605698c0
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4Rvp.h
@@ -0,0 +1,93 @@
+/** @file
+  GPIO definition table for Tiger Lake U RVP
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_H_
+#define _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_H_
+
+#include <Pins/GpioPinsVer2Lp.h>
+#include <Library/GpioLib.h>
+#include <Library/GpioConfig.h>
+
+GPIO_INIT_CONFIG mGpioTableTglUDdr4[] =
+{
+  // M.2 Key-E - WLAN/BT
+  {GPIO_VER2_LP_GPP_A13, {GpioPadModeGpio, GpioHostOwnDefault, GpioDirOut,   GpioOutHigh,    GpioIntDis,              GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // BT_RF_KILL_N
+  {GPIO_VER2_LP_GPP_B15, {GpioPadModeGpio, GpioHostOwnDefault, GpioDirOut,   GpioOutHigh,    GpioIntDis,              GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // WIFI_RF_KILL_N
+  {GPIO_VER2_LP_GPP_C22, {GpioPadModeGpio, GpioHostOwnDefault, GpioDirOut,   GpioOutHigh,    GpioIntDis,              GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // WLAN_RST_N
+  {GPIO_VER2_LP_GPP_C23, {GpioPadModeGpio, GpioHostOwnAcpi,    GpioDirInInv, GpioOutDefault, GpioIntLevel|GpioIntSci, GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // WIFI_WAKE_N
+  {GPIO_VER2_LP_GPP_H19, {GpioPadModeGpio, GpioHostOwnAcpi,    GpioDirInInv, GpioOutDefault, GpioIntLevel|GpioIntSci, GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // UART_BT_WAKE_N : Not default POR
+  {GPIO_VER2_LP_GPP_A10, {GpioPadModeGpio, GpioHostOwnAcpi,    GpioDirIn,    GpioOutDefault, GpioIntDis,              GpioPlatformReset,  GpioTermNone}},                       // M.2 BT
+
+  // X4 Pcie Slot for Gen3 and Gen 4
+  {GPIO_VER2_LP_GPP_A14, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutLow,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //ONBOARD_X4_PCIE_SLOT1_PWREN_N
+  {GPIO_VER2_LP_GPP_C13, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //ONBOARD_X4_PCIE_SLOT1_RESET_N
+  {GPIO_VER2_LP_GPP_F5,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntSci,GpioHostDeepReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //ONBOARD_X4_PCIE_SLOT1_WAKE_N
+  {GPIO_VER2_LP_GPP_F20, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //ONBOARD_X4_PCIE_SLOT1_DGPU_SEL
+  {GPIO_VER2_LP_GPP_F21, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirIn,  GpioOutDefault,GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //ONBOARD_X4_PCIE_SLOT1_DGPU_PWROK
+
+  // TBT Re-Timers
+  {GPIO_VER2_LP_GPD7,    {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,  GpioIntDis,GpioDswReset,  GpioTermNone}},  //TCP_RETIMER_PERST_N
+
+  // Battery Charger Vmin to PCH PROCHOT, derived from ICL
+  {GPIO_VER2_LP_GPP_B2,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInv,  GpioOutDefault,GpioIntEdge|GpioIntSci,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //BC_PROCHOT_N
+
+  // SATA Direct Connect
+  {GPIO_VER2_LP_GPP_B4,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //SATA_DIRECT_PWREN
+
+  // FPS
+  {GPIO_VER2_LP_GPP_B14, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //FPS_RST_N
+  {GPIO_VER2_LP_GPP_E3,  {GpioPadModeGpio, GpioHostOwnGpio, GpioDirIn,  GpioOutDefault,GpioIntLevel|GpioIntApic,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //FPS_INT
+
+  // PCH M.2 SSD
+  {GPIO_VER2_LP_GPP_B16, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //M2_PCH_SSD_PWREN
+  {GPIO_VER2_LP_GPP_H0,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //M2_SSD_RST_N
+
+
+  // Camera
+  {GPIO_VER2_LP_GPP_B23, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CRD_CAM_PWREN - CAM1
+  {GPIO_VER2_LP_GPP_C15, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //WF_CAM_RST_N  - CAM1
+
+  {GPIO_VER2_LP_GPP_H12, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CAM2_RST_N
+
+  {GPIO_VER2_LP_GPP_H15, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CAM3_PWREN
+  {GPIO_VER2_LP_GPP_H13, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CAM3_RST_N
+
+  // Camera Common GPIO's for all Camera, Rework Options
+  {GPIO_VER2_LP_GPP_B18, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutLow,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CRD_CAM_STROBE_1
+  {GPIO_VER2_LP_GPP_C2,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //WF_CAM_CLK_EN
+
+  // Audio
+  {GPIO_VER2_LP_GPP_C5,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //SPKR_PD_N
+  {GPIO_VER2_LP_GPP_C12, {GpioPadModeGpio, GpioHostOwnGpio, GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntApic,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  // CODEC_INT_N
+
+  // Touch Pad
+  // Touch Pad and Touch Panel 2 share the same Power Enable, default is Touch pad
+  {GPIO_VER2_LP_GPP_H1,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //TCH_PAD_LS_EN - PWR_En
+  {GPIO_VER2_LP_GPP_C8,  {GpioPadModeGpio, GpioHostOwnGpio, GpioDirInInv,  GpioOutDefault,GpioIntEdge|GpioIntApic,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //TCH_PAD_INT_N
+
+  // EC
+  {GPIO_VER2_LP_GPP_E7,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntSmi,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //EC_SMI_N
+  {GPIO_VER2_LP_GPP_E8,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //EC_SLP_S0_CS_N
+
+  // SPI TPM, derived from ICL
+  {GPIO_VER2_LP_GPP_C14, {GpioPadModeGpio, GpioHostOwnGpio, GpioDirIn,  GpioOutDefault,GpioIntLevel | GpioIntApic, GpioHostDeepReset,  GpioTermWpu20K,  GpioPadConfigUnlock  }},  //SPI_TPM_INT_N
+
+  // TypeC BIAS : Not used by default in RVP, derived from ICL
+  {GPIO_VER2_LP_GPP_E22, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutLow,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //DISP_AUX_P_BIAS_GPIO
+  {GPIO_VER2_LP_GPP_E23, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //DISP_AUX_N_BIAS_GPIO
+
+  // LAN : Not used by Default in RVP
+
+  // X1 Pcie Slot
+  {GPIO_VER2_LP_GPP_F4,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntSci,GpioHostDeepReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //X1 Slot WAKE
+  {GPIO_VER2_LP_GPP_F10, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //X1 Slot RESET
+};
+
+
+UINT16 mGpioTableTglUDdr4Size = sizeof (mGpioTableTglUDdr4) / sizeof (GPIO_INIT_CONFIG);
+
+#endif // _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_H_
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4RvpPreMem.h b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4RvpPreMem.h
new file mode 100644
index 0000000000..7b08676037
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4RvpPreMem.h
@@ -0,0 +1,33 @@
+/** @file
+  GPIO definition table for Tiger Lake U DDR4 RVP Pre-Memory
+
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_PREMEM_H_
+#define _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_PREMEM_H_
+
+#include <Pins/GpioPinsVer2Lp.h>
+#include <Library/GpioLib.h>
+#include <Library/GpioConfig.h>
+
+GPIO_INIT_CONFIG mGpioTablePreMemTglUDdr4[] =
+{
+  { GPIO_VER2_LP_GPP_A14, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutLow,  GpioIntDis, GpioPlatformReset, GpioTermNone } },  //ONBOARD_X4_PCIE_SLOT1_PWREN_N
+  { GPIO_VER2_LP_GPP_C13, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //ONBOARD_X4_PCIE_SLOT1_RESET_N
+  // CPU M.2 SSD
+  { GPIO_VER2_LP_GPP_D16, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //CPU SSD PWREN
+  { GPIO_VER2_LP_GPP_A11, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //CPU SSD RESET
+  // X1 Pcie Slot
+  { GPIO_VER2_LP_GPP_F9,  { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //X1 Slot PWREN
+  { GPIO_VER2_LP_GPP_A23, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutLow,  GpioIntDis, GpioPlatformReset, GpioTermNone } },  //TC_RETIMER_FORCE_PWR
+  // Camera
+  { GPIO_VER2_LP_GPP_R6,  { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //CAM2_PWREN/BIOS_REC
+  { GPIO_VER2_LP_GPP_R5,  { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutLow,  GpioIntDis, GpioPlatformReset, GpioTermNone } },  //CRD_CAM_PRIVACY_LED_1
+};
+
+UINT16 mGpioTablePreMemTglUDdr4Size = sizeof (mGpioTablePreMemTglUDdr4) / sizeof (GPIO_INIT_CONFIG);
+
+#endif  //_GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_PREMEM_H_
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c
new file mode 100644
index 0000000000..f652dcf8e6
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c
@@ -0,0 +1,41 @@
+/** @file
+  Tiger Lake U RVP Multi-Board Initialization Post-Memory library
+
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiPei.h>
+#include <Library/BaseLib.h>
+#include <Library/IoLib.h>
+#include <Library/BoardInitLib.h>
+#include <Library/MultiBoardInitSupportLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+
+#include <PlatformBoardId.h>
+
+EFI_STATUS
+EFIAPI
+TigerlakeURvpBoardInitBeforeSiliconInit(
+  VOID
+  );
+
+BOARD_POST_MEM_INIT_FUNC  mTigerlakeURvpBoardInitFunc = {
+  TigerlakeURvpBoardInitBeforeSiliconInit,
+  NULL, // BoardInitAfterSiliconInit
+};
+
+EFI_STATUS
+EFIAPI
+PeiTigerlakeURvpMultiBoardInitLibConstructor (
+  VOID
+  )
+{
+  if (LibPcdGetSku () == SkuIdTglU) {
+    DEBUG ((DEBUG_INFO, "SKU_ID: 0x%x\n", LibPcdGetSku()));
+    return RegisterBoardPostMemInit (&mTigerlakeURvpBoardInitFunc);
+  }
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf
new file mode 100644
index 0000000000..d00f350dfe
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf
@@ -0,0 +1,49 @@
+## @file
+#  Component information file for TigerlakeURvpInitLib in PEI post memory phase.
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = PeiTigerlakeURvpMultiBoardInitLib
+  FILE_GUID                      = C7D39F17-E5BA-41D9-8DFE-FF9017499280
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = NULL
+  CONSTRUCTOR                    = PeiTigerlakeURvpMultiBoardInitLibConstructor
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
+  BaseMemoryLib
+  MemoryAllocationLib
+  PcdLib
+  MultiBoardInitSupportLib
+  PeiPlatformHookLib
+  PciSegmentLib
+
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+
+[Sources]
+  PeiTigerlakeURvpInitPostMemLib.c
+  PeiMultiBoardInitPostMemLib.c
+
+  GpioTableTigerlakeUDdr4Rvp.h
+
+[FixedPcd]
+
+[Pcd]
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTable
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTableSize
+
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase
+  gBoardModuleTokenSpaceGuid.PcdCpuUsb30PortEnable
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c
new file mode 100644
index 0000000000..6200f3b86e
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c
@@ -0,0 +1,88 @@
+/** @file
+  Tiger Lake U RVP Multi-Board Initialization Pre-Memory library
+
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiPei.h>
+#include <Library/BaseLib.h>
+#include <Library/IoLib.h>
+#include <Library/BoardInitLib.h>
+#include <Library/MultiBoardInitSupportLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+
+#include <PlatformBoardId.h>
+
+EFI_STATUS
+EFIAPI
+TigerlakeURvpBoardDetect (
+  VOID
+  );
+
+EFI_STATUS
+EFIAPI
+TigerlakeURvpMultiBoardDetect (
+  VOID
+  );
+
+EFI_BOOT_MODE
+EFIAPI
+TigerlakeURvpBoardBootModeDetect (
+  VOID
+  );
+
+EFI_STATUS
+EFIAPI
+TigerlakeURvpBoardDebugInit (
+  VOID
+  );
+
+EFI_STATUS
+EFIAPI
+TigerlakeURvpBoardInitBeforeMemoryInit (
+  VOID
+  );
+
+
+BOARD_DETECT_FUNC  mTigerlakeURvpBoardDetectFunc = {
+  TigerlakeURvpMultiBoardDetect
+};
+
+BOARD_PRE_MEM_INIT_FUNC  mTigerlakeURvpBoardPreMemInitFunc = {
+  TigerlakeURvpBoardDebugInit,
+  TigerlakeURvpBoardBootModeDetect,
+  TigerlakeURvpBoardInitBeforeMemoryInit,
+  NULL, // BoardInitAfterMemoryInit
+  NULL, // BoardInitBeforeTempRamExit
+  NULL, // BoardInitAfterTempRamExit
+};
+
+EFI_STATUS
+EFIAPI
+TigerlakeURvpMultiBoardDetect (
+  VOID
+  )
+{
+  DEBUG ((DEBUG_INFO, " In TglUMultiBoardDetect \n"));
+
+  TigerlakeURvpBoardDetect ();
+
+  if (LibPcdGetSku () == SkuIdTglU) {
+    RegisterBoardPreMemInit (&mTigerlakeURvpBoardPreMemInitFunc);
+  } else {
+    DEBUG ((DEBUG_WARN,"Not a Valid TigerLake U Board\n"));
+  }
+  return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+PeiTigerlakeURvpMultiBoardInitPreMemLibConstructor (
+  VOID
+  )
+{
+  return RegisterBoardDetect (&mTigerlakeURvpBoardDetectFunc);
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
new file mode 100644
index 0000000000..b8f1cf8aee
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
@@ -0,0 +1,115 @@
+## @file
+#  Component information file for PEI TigerlakeURvp Board Init Pre-Mem Library
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010005
+  BASE_NAME                      = PeiTigerlakeURvpMultiBoardInitPreMemLib
+  FILE_GUID                      = EA05BD43-136F-45EE-BBBA-27D75817574F
+  MODULE_TYPE                    = BASE
+  VERSION_STRING                 = 1.0
+  LIBRARY_CLASS                  = NULL
+  CONSTRUCTOR                    = PeiTigerlakeURvpMultiBoardInitPreMemLibConstructor
+
+[LibraryClasses]
+  BaseLib
+  DebugLib
+  BaseMemoryLib
+  MemoryAllocationLib
+  PcdLib
+  PeiPlatformHookLib
+  MultiBoardInitSupportLib
+  PeiLib
+
+[Packages]
+  MinPlatformPkg/MinPlatformPkg.dec
+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  IntelFsp2Pkg/IntelFsp2Pkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+
+[Sources]
+  PeiTigerlakeURvpInitPreMemLib.c
+  PeiMultiBoardInitPreMemLib.c
+  PeiTigerlakeURvpDetect.c
+  BoardSaInitPreMemLib.c
+  BoardPchInitPreMemLib.c
+  GpioTableTigerlakeUDdr4RvpPreMem.h
+
+[Ppis]
+  gEfiPeiReadOnlyVariable2PpiGuid
+  gEfiPeiMemoryDiscoveredPpiGuid                ## CONSUMES
+  gEfiPeiResetPpiGuid                           ## PRODUCES
+[Pcd]
+  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort
+
+  # SA Misc Config
+  gBoardModuleTokenSpaceGuid.PcdSaMiscUserBd
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdData
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdDataSize
+
+  # SPD Address Table
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable0
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable1
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable2
+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable3
+
+  #===========================================================
+  # Board Init Table List
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMem
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMemSize
+
+  # Board Information
+  gBoardModuleTokenSpaceGuid.PcdCpuRatio
+  gBoardModuleTokenSpaceGuid.PcdBiosGuard
+
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase              ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize              ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize           ## CONSUMES
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize         ## CONSUMES
+
+  # SA USB Config
+  gBoardModuleTokenSpaceGuid.PcdCpuUsb30PortEnable
+
+  # PCIe Clock Info
+  gBoardModuleTokenSpaceGuid.PcdPcieClock0
+  gBoardModuleTokenSpaceGuid.PcdPcieClock1
+  gBoardModuleTokenSpaceGuid.PcdPcieClock2
+  gBoardModuleTokenSpaceGuid.PcdPcieClock3
+  gBoardModuleTokenSpaceGuid.PcdPcieClock4
+  gBoardModuleTokenSpaceGuid.PcdPcieClock5
+  gBoardModuleTokenSpaceGuid.PcdPcieClock6
+  gBoardModuleTokenSpaceGuid.PcdPcieClock7
+  gBoardModuleTokenSpaceGuid.PcdPcieClock8
+  gBoardModuleTokenSpaceGuid.PcdPcieClock9
+  gBoardModuleTokenSpaceGuid.PcdPcieClock10
+  gBoardModuleTokenSpaceGuid.PcdPcieClock11
+  gBoardModuleTokenSpaceGuid.PcdPcieClock12
+  gBoardModuleTokenSpaceGuid.PcdPcieClock13
+  gBoardModuleTokenSpaceGuid.PcdPcieClock14
+  gBoardModuleTokenSpaceGuid.PcdPcieClock15
+
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
+
+  gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength
+  gMinPlatformPkgTokenSpaceGuid.PcdLocalApicAddress
+  gMinPlatformPkgTokenSpaceGuid.PcdLocalApicMmioSize
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize
+
+  gSiPkgTokenSpaceGuid.PcdMchBaseAddress
+  gSiPkgTokenSpaceGuid.PcdMchMmioSize
+
+  gBoardModuleTokenSpaceGuid.PcdDmiBaseAddress
+  gBoardModuleTokenSpaceGuid.PcdDmiMmioSize
+  gBoardModuleTokenSpaceGuid.PcdEpBaseAddress
+  gBoardModuleTokenSpaceGuid.PcdEpMmioSize
+
+[Guids]
+  gFspNonVolatileStorageHobGuid
+  gEfiMemoryOverwriteControlDataGuid
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpDetect.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpDetect.c
new file mode 100644
index 0000000000..a11724072f
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpDetect.c
@@ -0,0 +1,39 @@
+/** @file
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiPei.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+
+#include <PlatformBoardId.h>
+
+BOOLEAN
+TigerlakeURvp(
+  VOID
+  )
+{
+  return TRUE;
+}
+
+EFI_STATUS
+EFIAPI
+TigerlakeURvpBoardDetect (
+  VOID
+  )
+{
+  if (LibPcdGetSku () != 0) {
+    return EFI_SUCCESS;
+  }
+
+  DEBUG ((DEBUG_INFO, "TigerLakeU Board Detection Callback\n"));
+
+  if (TigerlakeURvp ()) {
+    LibPcdSetSku (SkuIdTglU);
+    DEBUG ((DEBUG_INFO, "SKU_ID: 0x%x\n", LibPcdGetSku()));
+    ASSERT (LibPcdGetSku() == SkuIdTglU);
+  }
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPostMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPostMemLib.c
new file mode 100644
index 0000000000..e775f83cce
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPostMemLib.c
@@ -0,0 +1,153 @@
+/** @file
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiPei.h>
+#include <Library/DebugLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/IoLib.h>
+#include <Library/HobLib.h>
+#include <Library/PcdLib.h>
+#include <Library/PchCycleDecodingLib.h>
+#include <Library/PciLib.h>
+#include <Library/BoardInitLib.h>
+#include <PeiPlatformHookLib.h>
+#include "TigerlakeURvpInit.h"
+#include "GpioTableTigerlakeUDdr4Rvp.h"
+#include <Library/ConfigBlockLib.h>
+
+/**
+  GPIO init function for PEI post memory phase.
+
+  @param[in]  BoardId       An unsigned integrer represent the board id.
+
+  @retval     EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+BoardGpioInit(
+  IN UINT16 BoardId
+  )
+{
+  //
+  // GPIO Table Init.
+  //
+  switch (BoardId) {
+
+    case BoardIdTglUDdr4:
+      PcdSet32S (PcdBoardGpioTable, (UINTN) mGpioTableTglUDdr4);
+      PcdSet16S (PcdBoardGpioTableSize, mGpioTableTglUDdr4Size);
+      break;
+
+    default:
+      break;
+  }
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Touch panel GPIO init function for PEI post memory phase.
+
+  @param[in]  BoardId       An unsigned integrer represent the board id.
+
+  @retval     EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+TouchPanelGpioInit (
+  IN UINT16 BoardId
+  )
+{
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Misc. init function for PEI post memory phase.
+
+  @param[in]  BoardId       An unsigned integrer represent the board id.
+
+  @retval     EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+BoardMiscInit (
+  IN UINT16 BoardId
+  )
+{
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Security GPIO init function for PEI post memory phase.
+
+  @param[in]  BoardId       An unsigned integrer represent the board id.
+
+  @retval     EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+BoardSecurityInit (
+  IN UINT16 BoardId
+  )
+{
+  return EFI_SUCCESS;
+}
+
+/**
+  Board configuration initialization in the post-memory boot phase.
+**/
+VOID
+BoardConfigInit (
+  VOID
+  )
+{
+  EFI_STATUS  Status;
+  UINT16      BoardId;
+
+  BoardId = BoardIdTglUDdr4;
+
+  Status = BoardGpioInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = TouchPanelGpioInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = BoardMiscInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = BoardSecurityInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+}
+
+
+/**
+  Configure GPIO and SIO
+
+  @retval  EFI_SUCCESS   Operation success.
+**/
+EFI_STATUS
+EFIAPI
+TigerlakeURvpBoardInitBeforeSiliconInit(
+  VOID
+  )
+{
+  EFI_STATUS      Status;
+
+  DEBUG ((DEBUG_INFO, "Board Init before Silicon Init\n"));
+
+  BoardConfigInit ();
+  //
+  // Configure GPIO and SIO
+  //
+  Status = BoardInit ();
+  ASSERT_EFI_ERROR (Status);
+
+  //
+  // Initializing Platform Specific Programming
+  //
+  Status = PlatformSpecificInit ();
+  ASSERT_EFI_ERROR(Status);
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c
new file mode 100644
index 0000000000..2ad229c1cd
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c
@@ -0,0 +1,445 @@
+/** @file
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiPei.h>
+#include <Library/DebugLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/IoLib.h>
+#include <Library/HobLib.h>
+#include <Library/PcdLib.h>
+#include <Library/PchCycleDecodingLib.h>
+#include <Library/PciLib.h>
+#include <Library/PcdLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/BoardInitLib.h>
+#include <Library/GpioNativeLib.h>
+#include <Library/GpioLib.h>
+#include <Library/PchPcrLib.h>
+#include <ConfigBlock.h>
+#include <Library/PeiServicesLib.h>
+#include <Library/PchPcrLib.h>
+#include <Register/PchRegsLpc.h>
+#include <Ppi/Reset.h>
+#include <PlatformBoardConfig.h>
+#include <Library/PmcLib.h>
+#include <Library/PciSegmentLib.h>
+#include <PeiPlatformHookLib.h>
+#include <PlatformBoardId.h>
+
+///
+/// Reset Generator I/O Port
+///
+#define RESET_GENERATOR_PORT           0xCF9
+
+typedef struct {
+  EFI_PHYSICAL_ADDRESS    BaseAddress;
+  UINT64                  Length;
+} MEMORY_MAP;
+
+GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_MAP MmioMap[] = {
+  { FixedPcdGet64 (PcdLocalApicAddress),  FixedPcdGet32 (PcdLocalApicMmioSize) },
+  { FixedPcdGet64 (PcdMchBaseAddress),    FixedPcdGet32 (PcdMchMmioSize) },
+  { FixedPcdGet64 (PcdDmiBaseAddress),    FixedPcdGet32 (PcdDmiMmioSize) },
+  { FixedPcdGet64 (PcdEpBaseAddress),     FixedPcdGet32 (PcdEpMmioSize) }
+};
+
+EFI_STATUS
+MrcConfigInit (
+  IN UINT16 BoardId
+  );
+
+EFI_STATUS
+SaGpioConfigInit (
+  IN UINT16 BoardId
+  );
+
+EFI_STATUS
+SaMiscConfigInit (
+  IN UINT16         BoardId
+  );
+
+EFI_STATUS
+RootPortClkInfoInit (
+  IN UINT16 BoardId
+  );
+
+EFI_STATUS
+UsbConfigInit (
+  IN UINT16 BoardId
+  );
+
+EFI_STATUS
+GpioGroupTierInit (
+  IN UINT16 BoardId
+  );
+
+EFI_STATUS
+GpioTablePreMemInit (
+  IN UINT16 BoardId
+  );
+
+EFI_STATUS
+PchPmConfigInit (
+  IN UINT16 BoardId
+  );
+
+EFI_STATUS
+SaDisplayConfigInit (
+  IN UINT16 BoardId
+  );
+
+EFI_STATUS
+EFIAPI
+PlatformInitPreMemCallBack (
+  IN CONST EFI_PEI_SERVICES      **PeiServices,
+  IN EFI_PEI_NOTIFY_DESCRIPTOR   *NotifyDescriptor,
+  IN VOID                        *Ppi
+  );
+
+EFI_STATUS
+EFIAPI
+MemoryDiscoveredPpiNotify (
+  IN CONST EFI_PEI_SERVICES      **PeiServices,
+  IN EFI_PEI_NOTIFY_DESCRIPTOR   *NotifyDescriptor,
+  IN VOID                        *Ppi
+  );
+
+EFI_STATUS
+EFIAPI
+PchReset (
+  IN CONST EFI_PEI_SERVICES    **PeiServices
+  );
+
+static EFI_PEI_RESET_PPI mResetPpi = {
+  PchReset
+};
+
+static EFI_PEI_PPI_DESCRIPTOR mPreMemPpiList[] = {
+  {
+    (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+    &gEfiPeiResetPpiGuid,
+    &mResetPpi
+  }
+};
+
+static EFI_PEI_NOTIFY_DESCRIPTOR mPreMemNotifyList = {
+  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gEfiPeiReadOnlyVariable2PpiGuid,
+  (EFI_PEIM_NOTIFY_ENTRY_POINT)PlatformInitPreMemCallBack
+};
+
+static EFI_PEI_NOTIFY_DESCRIPTOR mMemDiscoveredNotifyList = {
+  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
+  &gEfiPeiMemoryDiscoveredPpiGuid,
+  (EFI_PEIM_NOTIFY_ENTRY_POINT)MemoryDiscoveredPpiNotify
+};
+
+/**
+  Board misc init function for PEI pre-memory phase.
+
+  @param[in]  BoardId       An unsigned integer represent the board id.
+
+  @retval     EFI_SUCCESS   The function completed successfully.
+**/
+EFI_STATUS
+BoardMiscInitPreMem (
+  IN UINT16 BoardId
+  )
+{
+  return EFI_SUCCESS;
+}
+
+/**
+  Board configuration initialization in the pre-memory boot phase.
+**/
+VOID
+BoardConfigInitPreMem (
+  VOID
+  )
+{
+  EFI_STATUS Status;
+  UINT16 BoardId;
+
+  BoardId = BoardIdTglUDdr4;
+
+  Status = MrcConfigInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = SaGpioConfigInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = SaMiscConfigInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = RootPortClkInfoInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = UsbConfigInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = GpioGroupTierInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = GpioTablePreMemInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = PchPmConfigInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = BoardMiscInitPreMem (BoardId);
+  ASSERT_EFI_ERROR (Status);
+
+  Status = SaDisplayConfigInit (BoardId);
+  ASSERT_EFI_ERROR (Status);
+}
+
+/**
+  This function handles PlatformInit task after PeiReadOnlyVariable2 PPI produced
+
+  @param[in]  PeiServices   Pointer to PEI Services Table.
+  @param[in]  NotifyDesc    Pointer to the descriptor for the Notification event that
+                            caused this function to execute.
+  @param[in]  Ppi           Pointer to the PPI data associated with this function.
+
+  @retval     EFI_SUCCESS  The function completes successfully
+  @retval     others       Failure
+**/
+EFI_STATUS
+EFIAPI
+PlatformInitPreMemCallBack (
+  IN CONST EFI_PEI_SERVICES     **PeiServices,
+  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,
+  IN VOID                       *Ppi
+  )
+{
+  EFI_STATUS                        Status;
+
+  DEBUG ((DEBUG_INFO, "PlatformInitPreMemCallBack Start...\n"));
+  //
+  // Init Board Config Pcd.
+  //
+  BoardConfigInitPreMem ();
+
+  ///
+  /// Configure GPIO and SIO
+  ///
+  Status = BoardInitPreMem ();
+  ASSERT_EFI_ERROR (Status);
+
+  ///
+  /// Install Pre Memory PPIs
+  ///
+  Status = PeiServicesInstallPpi (&mPreMemPpiList[0]);
+  ASSERT_EFI_ERROR (Status);
+
+  DEBUG ((DEBUG_INFO, "PlatformInitPreMemCallBack End...\n"));
+
+  return Status;
+}
+
+/**
+  Provide hard reset PPI service.
+  To generate full hard reset, write 0x0E to PCH RESET_GENERATOR_PORT (0xCF9).
+
+  @param[in]  PeiServices       General purpose services available to every PEIM.
+
+  @retval     Not return        System reset occured.
+  @retval     EFI_DEVICE_ERROR  Device error, could not reset the system.
+**/
+EFI_STATUS
+EFIAPI
+PchReset (
+  IN CONST EFI_PEI_SERVICES    **PeiServices
+  )
+{
+  DEBUG ((DEBUG_INFO, "Perform Cold Reset\n"));
+  IoWrite8 (RESET_GENERATOR_PORT, 0x0E);
+
+  CpuDeadLoop ();
+
+  ///
+  /// System reset occured, should never reach at this line.
+  ///
+  ASSERT_EFI_ERROR (EFI_DEVICE_ERROR);
+  return EFI_DEVICE_ERROR;
+}
+
+/**
+  Install Firmware Volume Hob's once there is main memory
+
+  @param[in]  PeiServices       General purpose services available to every PEIM.
+  @param[in]  NotifyDescriptor  Notify that this module published.
+  @param[in]  Ppi               PPI that was installed.
+
+  @retval     EFI_SUCCESS       The function completed successfully.
+**/
+EFI_STATUS
+EFIAPI
+MemoryDiscoveredPpiNotify (
+  IN CONST EFI_PEI_SERVICES     **PeiServices,
+  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,
+  IN VOID                       *Ppi
+  )
+{
+  EFI_STATUS                    Status;
+  EFI_BOOT_MODE                 BootMode;
+  UINTN                         Index;
+  UINT8                         PhysicalAddressBits;
+  UINT32                        RegEax;
+  MEMORY_MAP                    PcieMmioMap;
+
+ DEBUG ((DEBUG_INFO, "MemoryDiscoveredPpiNotify Start!\n"));
+
+  Index = 0;
+
+  Status = PeiServicesGetBootMode (&BootMode);
+  ASSERT_EFI_ERROR (Status);
+
+  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);
+
+  ///
+  /// Build Memory Mapped IO Resource which is used to build E820 Table in LegacyBios.
+  ///
+  PcieMmioMap.BaseAddress = FixedPcdGet64 (PcdPciExpressBaseAddress);
+  PcieMmioMap.Length = PcdGet32 (PcdPciExpressRegionLength);
+
+  BuildResourceDescriptorHob (
+    EFI_RESOURCE_MEMORY_MAPPED_IO,
+     (EFI_RESOURCE_ATTRIBUTE_PRESENT      |
+      EFI_RESOURCE_ATTRIBUTE_INITIALIZED  |
+      EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
+    PcieMmioMap.BaseAddress,
+    PcieMmioMap.Length
+    );
+  BuildMemoryAllocationHob (
+    PcieMmioMap.BaseAddress,
+    PcieMmioMap.Length,
+    EfiMemoryMappedIO
+    );
+  for (Index = 0; Index < sizeof(MmioMap) / (sizeof(MEMORY_MAP)); Index++) {
+    BuildResourceDescriptorHob (
+      EFI_RESOURCE_MEMORY_MAPPED_IO,
+       (EFI_RESOURCE_ATTRIBUTE_PRESENT      |
+        EFI_RESOURCE_ATTRIBUTE_INITIALIZED  |
+        EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
+      MmioMap[Index].BaseAddress,
+      MmioMap[Index].Length
+      );
+    BuildMemoryAllocationHob (
+      MmioMap[Index].BaseAddress,
+      MmioMap[Index].Length,
+      EfiMemoryMappedIO
+      );
+  }
+
+  //
+  // Report resource HOB for flash FV
+  //
+  BuildResourceDescriptorHob (
+    EFI_RESOURCE_MEMORY_MAPPED_IO,
+     (EFI_RESOURCE_ATTRIBUTE_PRESENT      |
+      EFI_RESOURCE_ATTRIBUTE_INITIALIZED  |
+      EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
+    (UINTN) FixedPcdGet32 (PcdFlashAreaBaseAddress),
+    (UINTN) FixedPcdGet32 (PcdFlashAreaSize)
+    );
+
+  BuildMemoryAllocationHob (
+    (UINTN) FixedPcdGet32 (PcdFlashAreaBaseAddress),
+    (UINTN) FixedPcdGet32 (PcdFlashAreaSize),
+    EfiMemoryMappedIO
+    );
+
+  BuildFvHob (
+    (UINTN)FixedPcdGet32 (PcdFlashAreaBaseAddress),
+    (UINTN)FixedPcdGet32 (PcdFlashAreaSize)
+    );
+
+ DEBUG ((DEBUG_INFO, "MemoryDiscoveredPpiNotify End!\n"));
+
+  return Status;
+}
+
+/**
+  Board configuration init function for PEI pre-memory phase.
+
+  @retval EFI_SUCCESS             The function completed successfully.
+  @retval EFI_INVALID_PARAMETER   The parameter is NULL.
+**/
+EFI_STATUS
+EFIAPI
+TigerlakeURvpInitPreMem (
+  VOID
+  )
+{
+  EFI_STATUS Status;
+  DEBUG ((DEBUG_INFO, "TigerlakeURvpInitPreMem Start!\n"));
+  ///
+  /// Performing PlatformInitPreMemCallBack after PeiReadOnlyVariable2 PPI produced
+  ///
+  Status = PeiServicesNotifyPpi (&mPreMemNotifyList);
+
+  ///
+  /// After code reorangized, memorycallback will run because the PPI is already
+  /// installed when code run to here, it is supposed that the InstallEfiMemory is
+  /// done before.
+  ///
+  Status = PeiServicesNotifyPpi (&mMemDiscoveredNotifyList);
+
+  DEBUG ((DEBUG_INFO, "TigerlakeURvpInitPreMem End!\n"));
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Configure GPIO and SIO before memory ready
+
+  @retval  EFI_SUCCESS   Operation success.
+**/
+EFI_STATUS
+EFIAPI
+TigerlakeURvpBoardInitBeforeMemoryInit(
+  VOID
+  )
+{
+
+  TigerlakeURvpInitPreMem();
+
+  return EFI_SUCCESS;
+}
+
+EFI_STATUS
+EFIAPI
+TigerlakeURvpBoardDebugInit(
+  VOID
+  )
+{
+  ///
+  /// Do Early PCH init
+  ///
+  return EFI_SUCCESS;
+}
+
+EFI_BOOT_MODE
+EFIAPI
+TigerlakeURvpBoardBootModeDetect(
+  VOID
+  )
+{
+  return BOOT_WITH_FULL_CONFIGURATION;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/TigerlakeURvpInit.h b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/TigerlakeURvpInit.h
new file mode 100644
index 0000000000..ccffcc6761
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/TigerlakeURvpInit.h
@@ -0,0 +1,23 @@
+/** @file
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#ifndef _TIGER_LAKE_U_RVP_INIT_H_
+#define _TIGER_LAKE_U_RVP_INIT_H_
+
+#include <Uefi.h>
+#include <PlatformBoardId.h>
+#include <Library/BaseLib.h>
+#include <Library/PcdLib.h>
+#include <Library/MemoryAllocationLib.h>
+#include <Library/DebugLib.h>
+#include <Ppi/SiPolicy.h>
+
+extern GPIO_INIT_CONFIG mGpioTableTglUDdr4[];
+extern UINT16 mGpioTableTglUDdr4Size;
+
+
+#endif // _TIGER_LAKE_U_RVP_INIT_H_
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.c
new file mode 100644
index 0000000000..6c2587391d
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.c
@@ -0,0 +1,212 @@
+/** @file
+  PEI Library Functions. Initialize GPIOs
+
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiPei.h>
+#include <PeiPlatformHookLib.h>
+#include <Library/DebugLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/IoLib.h>
+#include <Library/HobLib.h>
+#include <Library/PcdLib.h>
+#include <Library/TimerLib.h>
+#include <Library/PchCycleDecodingLib.h>
+#include <Library/PciSegmentLib.h>
+#include <Library/PeiServicesLib.h>
+#include <Library/PmcLib.h>
+#include <Library/GpioNativeLib.h>
+#include <Library/GpioLib.h>
+#include <PlatformBoardConfig.h>
+#include <Library/PchPcrLib.h>
+#include <Library/GpioCheckConflictLib.h>
+
+#define SIO_RUNTIME_REG_BASE_ADDRESS                          0x0680
+
+#define RECOVERY_MODE_GPIO_PIN                    0                    // Platform specific @todo use PCD
+
+#define MANUFACTURE_MODE_GPIO_PIN                 0                    // Platform specific @todo use PCD
+
+/**
+  Configures GPIO
+
+  @param[in]  GpioTable       Point to Platform Gpio table
+  @param[in]  GpioTableCount  Number of Gpio table entries
+
+**/
+VOID
+ConfigureGpio (
+  IN GPIO_INIT_CONFIG                 *GpioDefinition,
+  IN UINT16                           GpioTableCount
+  )
+{
+  DEBUG ((DEBUG_INFO, "ConfigureGpio() Start\n"));
+
+
+  CreateGpioCheckConflictHob (GpioDefinition, GpioTableCount);
+
+
+  GpioConfigurePads (GpioTableCount, GpioDefinition);
+
+  DEBUG ((DEBUG_INFO, "ConfigureGpio() End\n"));
+}
+
+/**
+  Configure GPIO group GPE tier.
+
+  @retval     none.
+**/
+VOID
+GpioGroupTierInitHook(
+  VOID
+  )
+{
+  DEBUG ((DEBUG_INFO, "GpioGroupTierInitHook Start\n"));
+
+  DEBUG ((DEBUG_INFO, "GpioGroupTierInitHook End\n"));
+}
+
+/**
+  Configure single GPIO pad for touchpanel interrupt
+**/
+VOID
+TouchpanelGpioInit (
+  VOID
+  )
+{
+
+}
+
+/**
+  Configure GPIO Before Memory is not ready.
+
+**/
+VOID
+GpioInitPreMem (
+  VOID
+  )
+{
+  if (PcdGet32 (PcdBoardGpioTablePreMem) != 0 && PcdGet16 (PcdBoardGpioTablePreMemSize) != 0) {
+    DEBUG ((DEBUG_INFO, "Pre-mem Gpio Config\n"));
+    ConfigureGpio ((VOID *) (UINTN) PcdGet32 (PcdBoardGpioTablePreMem), (UINTN) PcdGet16 (PcdBoardGpioTablePreMemSize));
+  }
+}
+
+/**
+  Basic GPIO configuration before memory is ready
+
+**/
+VOID
+GpioInitEarlyPreMem (
+  VOID
+  )
+{
+
+}
+
+/**
+  Configure GPIO
+
+**/
+
+VOID
+GpioInit (
+  VOID
+  )
+{
+  DEBUG ((DEBUG_INFO, "Post-mem Gpio Config\n"));
+  ConfigureGpio ((VOID *) (UINTN) PcdGet32 (PcdBoardGpioTable), (UINTN) PcdGet16 (PcdBoardGpioTableSize));
+
+  TouchpanelGpioInit();
+
+  return;
+}
+
+/**
+  Configure Super IO
+
+**/
+VOID
+SioInit (
+  VOID
+  )
+{
+  //
+  // Program and Enable Default Super IO Configuration Port Addresses and range
+  //
+  PchLpcGenIoRangeSet (PcdGet16 (PcdLpcSioConfigDefaultPort) & (~0xF), 0x10);
+
+  PchLpcGenIoRangeSet (SIO_RUNTIME_REG_BASE_ADDRESS  & (~0x7F), 0x10);
+  return;
+}
+
+/**
+  Configure GPIO and SIO before memory ready
+
+  @retval  EFI_SUCCESS   Operation success.
+**/
+EFI_STATUS
+BoardInitPreMem (
+  VOID
+  )
+{
+  //
+  // Obtain Platform Info from HOB.
+  //
+  GpioInitPreMem ();
+  GpioGroupTierInitHook ();
+  SioInit ();
+
+  DEBUG ((DEBUG_INFO, "BoardInitPreMem Done\n"));
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Configure GPIO and SIO
+
+  @retval  EFI_SUCCESS   Operation success.
+**/
+EFI_STATUS
+BoardInit (
+  VOID
+  )
+{
+
+  GpioInit ();
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Do platform specific programming post-memory.
+
+  @retval  EFI_SUCCESS       The function completed successfully.
+**/
+
+EFI_STATUS
+PlatformSpecificInit (
+  VOID
+  )
+{
+
+  return EFI_SUCCESS;
+}
+
+/**
+  Early Board Configuration before memory is ready
+
+  @retval  EFI_SUCCESS  Operation success.
+**/
+EFI_STATUS
+BoardInitEarlyPreMem (
+  VOID
+  )
+{
+  GpioInitEarlyPreMem ();
+
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf
new file mode 100644
index 0000000000..8e4ce47d5a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf
@@ -0,0 +1,58 @@
+## @file
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010017
+  BASE_NAME                      = PeiPlatformHookLib
+  FILE_GUID                      = AD901798-B0DA-4B20-B90C-283F886E76D0
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = PEIM
+  LIBRARY_CLASS                  = PeiPlatformHookLib|PEIM PEI_CORE SEC
+
+[LibraryClasses]
+  DebugLib
+  BaseMemoryLib
+  IoLib
+  HobLib
+  PcdLib
+  TimerLib
+  PchCycleDecodingLib
+  GpioLib
+  PeiServicesLib
+  ConfigBlockLib
+  PmcLib
+  PchPcrLib
+  PciSegmentLib
+  GpioCheckConflictLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+  IntelSiliconPkg/IntelSiliconPkg.dec
+
+[Pcd]
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress                        ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort        ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdSioBaseAddress                 ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTable                 ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTableSize             ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMem           ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMemSize       ## CONSUMES
+
+[Sources]
+  PeiPlatformHooklib.c
+
+[Ppis]
+  gEfiPeiReadOnlyVariable2PpiGuid               ## CONSUMES
+  gSiPolicyPpiGuid                              ## CONSUMES
+
+[Guids]
+  gSaDataHobGuid                                ## CONSUMES
+  gEfiGlobalVariableGuid                        ## CONSUMES
+  gGpioCheckConflictHobGuid                     ## CONSUMES
+
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules
  2021-02-09  8:45 [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Heng Luo
                   ` (2 preceding siblings ...)
  2021-02-09  8:45 ` [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: " Heng Luo
@ 2021-02-09  8:45 ` Heng Luo
  2021-02-10  0:22   ` Chaganty, Rangasai V
  2021-02-10  0:27   ` Chaganty, Rangasai V
  2021-02-09  8:45 ` [Patch V2 6/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add DSC and build files Heng Luo
                   ` (3 subsequent siblings)
  7 siblings, 2 replies; 18+ messages in thread
From: Heng Luo @ 2021-02-09  8:45 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Nate DeSimone

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

Adds the following modules:
  * BiosInfo

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c   | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf |  83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 283 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c
new file mode 100644
index 0000000000..46c3d439c2
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c
@@ -0,0 +1,200 @@
+/** @file
+  Driver for BIOS Info support.
+
+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+  SPDX-License-Identifier: BSD-2-Clause-Patent
+**/
+
+#include <PiPei.h>
+#include <Guid/BiosInfo.h>
+#include <Library/PeiServicesLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/DebugLib.h>
+#include <Library/HobLib.h>
+#include <Library/PcdLib.h>
+#include <IndustryStandard/FirmwareInterfaceTable.h>
+#include <Ppi/FirmwareVolumeInfoMeasurementExcluded.h>
+#include <Library/MemoryAllocationLib.h>
+
+#define BASE_FV_SIZE 10
+
+#define FSP_WRAPPER_FV_SIZE 3
+
+#define TSN_MAC_ADDRESS_FV_SIZE 0
+
+#define BIOS_INFO_STRUCT_SIZE (BASE_FV_SIZE + FSP_WRAPPER_FV_SIZE + TSN_MAC_ADDRESS_FV_SIZE)
+
+
+/*
+  BIOS_INFO structure is the base of the firmware volume layout for Intel platform BIOS implementation
+  so security checker module can run based on the structure and throw warnings, error or deadloop
+  when any unexpected firmware volumes are detected.
+
+  BIOS_INFO is recommended to support full entries of firmware volumes present in a flash
+  with right type, attribute, version, flash map base address and size,
+  all associated information which is defined by BIOS_INFO_STRUCT structure.
+  - IBB firmware volumes, which are expected to be measured or/and verified
+    by hardware base security solution to meet SecureBoot chain of trust
+    (Intel BootGuard for example), have attribute 0x0.
+  - Post IBB firmware volumes, which are expected to be measured or/and verified
+    by BIOS (TCG code for measurement, RSA2048SHA256Sign algorithm for verification for example),
+    have attribute BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB.
+  - Else, follows Firmware Interface Table specification.
+*/
+#pragma pack (1)
+typedef struct {
+  BIOS_INFO_HEADER  Header;
+  BIOS_INFO_STRUCT  Entry[BIOS_INFO_STRUCT_SIZE];
+} BIOS_INFO;
+#pragma pack ()
+
+GLOBAL_REMOVE_IF_UNREFERENCED BIOS_INFO  mBiosInfo = {
+  {
+    BIOS_INFO_SIGNATURE,
+    BIOS_INFO_STRUCT_SIZE,
+    0,
+  },
+  {
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      BIOS_INFO_STRUCT_ATTRIBUTE_GENERAL_EXCLUDE_FROM_FIT,
+      0x0100,
+      FixedPcdGet32 (PcdFlashNvStorageVariableSize) + FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) + FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize),
+      FixedPcdGet32 (PcdFlashNvStorageVariableBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvAdvancedSize),
+      FixedPcdGet32 (PcdFlashFvAdvancedBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvOptionalSize),
+      FixedPcdGet32 (PcdFlashFvOptionalBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvOsBootSize),
+      FixedPcdGet32 (PcdFlashFvOsBootBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvUefiBootSize),
+      FixedPcdGet32 (PcdFlashFvUefiBootBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvPostMemorySize),
+      FixedPcdGet32 (PcdFlashFvPostMemoryBase)
+    },
+    {
+      /*
+        Note :
+        Startup ACM is one of the binaries in FvFirmwareBinaries,
+        so put type 07 but not type 02.
+        FIT table will contain a type 02 entry with actual address
+        of ACM binary (it is passed as an input to FitGen tool).
+      */
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      BIOS_INFO_STRUCT_ATTRIBUTE_GENERAL_EXCLUDE_FROM_FIT,
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvFirmwareBinariesSize),
+      FixedPcdGet32 (PcdFlashFvFirmwareBinariesBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvFspSSize),
+      FixedPcdGet32 (PcdFlashFvFspSBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      0x00,    // IBB FV
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvFspMSize),
+      FixedPcdGet32 (PcdFlashFvFspMBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      0x00,    // IBB FV
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvFspTSize),
+      FixedPcdGet32 (PcdFlashFvFspTBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      0x00,    // IBB FV
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvSecuritySize),
+      FixedPcdGet32 (PcdFlashFvSecurityBase)
+    },
+    {
+      FIT_TYPE_07_BIOS_STARTUP_MODULE,
+      0x00,    // IBB FV
+      0x0100,
+      FixedPcdGet32 (PcdFlashFvPreMemorySize),
+      FixedPcdGet32 (PcdFlashFvPreMemoryBase)
+    },
+    {
+      FIT_TYPE_01_MICROCODE,
+      BIOS_INFO_STRUCT_ATTRIBUTE_MICROCODE_WHOLE_REGION,
+      0x0100,
+      FixedPcdGet32 (PcdFlashMicrocodeFvSize),
+      FixedPcdGet32 (PcdFlashMicrocodeFvBase)
+    },
+  }
+};
+
+GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_PPI_DESCRIPTOR  mBiosInfoPpiList = {
+  EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,
+  &gBiosInfoGuid,
+  &mBiosInfo
+};
+
+/**
+  Installs BiosInfo Ppi.
+
+  @param  FileHandle  Handle of the file being invoked.
+  @param  PeiServices Describes the list of possible PEI Services.
+
+  @retval EFI_SUCCESS   Install the BiosInfo Ppi successfully.
+
+**/
+EFI_STATUS
+EFIAPI
+BiosInfoEntryPoint (
+  IN       EFI_PEI_FILE_HANDLE  FileHandle,
+  IN CONST EFI_PEI_SERVICES     **PeiServices
+  )
+{
+  EFI_STATUS  Status;
+  VOID        *HobData;
+
+    //
+    // Install PPI, so that other PEI module can add dependency.
+    //
+    Status = PeiServicesInstallPpi (&mBiosInfoPpiList);
+    ASSERT_EFI_ERROR (Status);
+
+    //
+    // Build hob, so that DXE module can also get the data.
+    //
+    HobData = BuildGuidHob (&gBiosInfoGuid, sizeof (mBiosInfo));
+    ASSERT (HobData != NULL);
+    if (HobData == NULL) {
+      return EFI_OUT_OF_RESOURCES;
+    }
+    CopyMem (HobData, &mBiosInfo, sizeof (mBiosInfo));
+  return EFI_SUCCESS;
+}
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf
new file mode 100644
index 0000000000..66c8814c97
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf
@@ -0,0 +1,83 @@
+## @file
+#  Module Information description file for BIOS Info Driver
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  INF_VERSION                    = 0x00010017
+  BASE_NAME                      = BiosInfo
+  FILE_GUID                      = 4A4CA1C6-871C-45BB-8801-6910A7AA5807
+  VERSION_STRING                 = 1.0
+  MODULE_TYPE                    = PEIM
+  ENTRY_POINT                    = BiosInfoEntryPoint
+#
+# The following information is for reference only and not required by the build tools.
+#
+# VALID_ARCHITECTURES IA32 X64
+#
+
+[LibraryClasses]
+  PeimEntryPoint
+  PeiServicesLib
+  PeiServicesTablePointerLib
+  HobLib
+  BaseMemoryLib
+  MemoryAllocationLib
+  DebugLib
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  TigerlakeSiliconPkg/SiPkg.dec
+  IntelSiliconPkg/IntelSiliconPkg.dec
+  MinPlatformPkg/MinPlatformPkg.dec
+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
+  SecurityPkg/SecurityPkg.dec
+  BoardModulePkg/BoardModulePkg.dec
+
+[Pcd]
+  gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress                     ## CONSUMES
+  gSiPkgTokenSpaceGuid.PcdBiosSize                                ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase    ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize    ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase  ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize  ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase    ## CONSUMES
+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize    ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesBase       ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize       ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize            ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalBase               ## CONSUMES
+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize               ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase              ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize              ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize            ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase          ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize          ## CONSUMES
+  gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase                    ## CONSUMES
+  gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize                    ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase                ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize                ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase                ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize                ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase                ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryBase           ## CONSUMES
+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize           ## CONSUMES
+
+
+[Sources]
+  BiosInfo.c
+
+[Guids]
+  gBiosInfoGuid                                 ## PRODUCES
+
+[Depex]
+  gEfiPeiMasterBootModePpiGuid
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Patch V2 6/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add DSC and build files
  2021-02-09  8:45 [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Heng Luo
                   ` (3 preceding siblings ...)
  2021-02-09  8:45 ` [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules Heng Luo
@ 2021-02-09  8:45 ` Heng Luo
  2021-02-10  0:29   ` Chaganty, Rangasai V
  2021-02-09  8:45 ` [Patch V2 7/8] Enable build for TigerlakeOpenBoardPkg Heng Luo
                   ` (2 subsequent siblings)
  7 siblings, 1 reply; 18+ messages in thread
From: Heng Luo @ 2021-02-09  8:45 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Nate DeSimone

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

Adds the DSC and build files necessary to build the
TigerlakeURvp board instance.

Key files:
  * build_config.cfg - Board-specific build configuration file.
  * OpenBoardPkg.dsc - The TigerlakeURvp board description file.
  * OpenBoardPkgPcd.dsc - Used for other PCD customization.
  * OpenBoardPkg.fdf - The TigerlakeURvp board flash file.
  * OpenBoardPkgBuildOption.dsc - Sets build options Based on PCD values.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc            | 347 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.fdf            | 702 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgBuildOption.dsc | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc         | 392 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg            |  34 ++++++++++++++++++++++++++++++++++
 5 files changed, 1616 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
new file mode 100644
index 0000000000..a4265a839c
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
@@ -0,0 +1,347 @@
+## @file
+#  The main build description file for the TigerlakeURvp board.
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+  DEFINE      PLATFORM_PACKAGE          = MinPlatformPkg
+  DEFINE      PLATFORM_SI_PACKAGE       = TigerlakeSiliconPkg
+  DEFINE      PLATFORM_SI_BIN_PACKAGE   = TigerlakeSiliconBinPkg
+  DEFINE      PLATFORM_FSP_BIN_PACKAGE  = TigerLakeFspBinPkg/Client
+  DEFINE      PLATFORM_BOARD_PACKAGE    = TigerlakeOpenBoardPkg
+  DEFINE      BOARD                     = TigerlakeURvp
+  DEFINE      PROJECT                   = $(PLATFORM_BOARD_PACKAGE)/$(BOARD)
+  DEFINE      PEI_ARCH                  = IA32
+  DEFINE      DXE_ARCH                  = X64
+  DEFINE      TOP_MEMORY_ADDRESS        = 0x0
+
+  #
+  # Default value for OpenBoardPkg.fdf use
+  #
+  DEFINE BIOS_SIZE_OPTION = SIZE_120
+
+[Defines]
+  PLATFORM_NAME                         = $(PLATFORM_BOARD_PACKAGE)
+  PLATFORM_GUID                         = 465B0A0B-7AC1-443b-8F67-7B8DEC145F90
+  PLATFORM_VERSION                      = 0.1
+  DSC_SPECIFICATION                     = 0x00010005
+  OUTPUT_DIRECTORY                      = Build/$(PROJECT)
+  SUPPORTED_ARCHITECTURES               = IA32|X64
+  BUILD_TARGETS                         = DEBUG|RELEASE
+  SKUID_IDENTIFIER                      = ALL
+
+  FLASH_DEFINITION                      = $(PROJECT)/OpenBoardPkg.fdf
+  FIX_LOAD_TOP_MEMORY_ADDRESS           = 0x0
+
+  #
+  # Include PCD configuration for this board.
+  #
+  !include OpenBoardPkgPcd.dsc
+
+################################################################################
+#
+# SKU Identification section - list of all SKU IDs supported by this board.
+#
+################################################################################
+[SkuIds]
+  0|DEFAULT              # 0|DEFAULT is reserved and always required.
+  0x01|SkuIdTglU
+
+
+################################################################################
+#
+# Includes section - other DSC file contents included for this board build.
+#
+################################################################################
+
+#######################################
+# Library Includes
+#######################################
+!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreCommonLib.dsc
+!include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiLib.dsc
+!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeLib.dsc
+
+[LibraryClasses.common]
+
+  PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf
+  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf
+
+  PciHostBridgeLib|$(PLATFORM_PACKAGE)/Pci/Library/PciHostBridgeLibSimple/PciHostBridgeLibSimple.inf
+  PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf
+  PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf
+
+  PlatformHookLib|$(PLATFORM_BOARD_PACKAGE)/Library/BasePlatformHookLib/BasePlatformHookLib.inf
+
+  FspWrapperHobProcessLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf
+  PlatformSecLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf
+  PeiGetVtdPmrAlignmentLib|IntelSiliconPkg/Library/PeiGetVtdPmrAlignmentLib/PeiGetVtdPmrAlignmentLib.inf
+
+  FspWrapperApiLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/BaseFspWrapperApiLib.inf
+  FspWrapperApiTestLib|IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf
+
+  ConfigBlockLib|IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf
+
+  BoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/BoardInitLibNull/BoardInitLibNull.inf
+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
+
+  PciSegmentLib|$(PLATFORM_SI_PACKAGE)/Library/BasePciSegmentMultiSegLibPci/BasePciSegmentMultiSegLibPci.inf
+  PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf
+  ReportCpuHobLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf
+
+  #
+  # Silicon Init Package
+  #
+  !include $(PLATFORM_SI_PACKAGE)/SiPkgCommonLib.dsc
+
+  #
+  # Shell
+  #
+  ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf
+  HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf
+  BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf
+
+[LibraryClasses.IA32]
+ FspWrapperPlatformLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
+!if $(TARGET) == DEBUG
+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.inf
+!endif
+  TestPointLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointLib/PeiTestPointLib.inf
+  MultiBoardInitSupportLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/MultiBoardInitSupportLib/PeiMultiBoardInitSupportLib.inf
+  BoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/MultiBoardInitSupportLib/PeiMultiBoardInitSupportLib.inf
+
+  #
+  # Silicon Init Package
+  #
+  !include $(PLATFORM_SI_PACKAGE)/SiPkgPeiLib.dsc
+
+  #
+  # Use Null library instance to skip MTRR initialization from MinPlatformPkg PlatformInit modules.
+  # MTRR configuration will be done by FSP or PlatformInitAdvanced modules.
+  #
+  SetCacheMtrrLib|$(PLATFORM_PACKAGE)/Library/SetCacheMtrrLib/SetCacheMtrrLibNull.inf
+
+  #
+  # SmmAccess
+  #
+  SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf
+
+  SiliconPolicyInitLib|$(PLATFORM_BOARD_PACKAGE)/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
+  SiliconPolicyUpdateLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf
+
+  #######################################
+  # Board-specific
+  #######################################
+  PeiPlatformHookLib|$(PROJECT)/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf
+
+!if $(TARGET) == DEBUG
+  GpioCheckConflictLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Gpio/Library/BaseGpioCheckConflictLib/BaseGpioCheckConflictLib.inf
+!else
+  GpioCheckConflictLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Gpio/Library/BaseGpioCheckConflictLibNull/BaseGpioCheckConflictLibNull.inf
+!endif
+
+[LibraryClasses.IA32.SEC]
+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SecTestPointCheckLib.inf
+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf
+  SecBoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SecBoardInitLibNull/SecBoardInitLibNull.inf
+
+[LibraryClasses.X64]
+  #
+  # DXE phase common
+  #
+  FspWrapperPlatformLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/DxeFspWrapperPlatformLib/DxeFspWrapperPlatformLib.inf
+!if $(TARGET) == DEBUG
+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf
+!endif
+  TestPointLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointLib/DxeTestPointLib.inf
+  MultiBoardInitSupportLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/MultiBoardInitSupportLib/DxeMultiBoardInitSupportLib.inf
+  BoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/MultiBoardInitSupportLib/DxeMultiBoardInitSupportLib.inf
+  MultiBoardAcpiSupportLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf
+  BoardAcpiTableLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf
+  AslUpdateLib|$(PLATFORM_PACKAGE)/Acpi/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf
+
+  SiliconPolicyInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyInitLibNull/SiliconPolicyInitLibNull.inf
+  SiliconPolicyUpdateLib|$(PLATFORM_BOARD_PACKAGE)/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf
+  BoardBdsHookLib|BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf
+  BoardBootManagerLib|BoardModulePkg/Library/BoardBootManagerLib/BoardBootManagerLib.inf
+
+  #
+  # Silicon Init Package
+  #
+  !include $(PLATFORM_SI_PACKAGE)/SiPkgDxeLib.dsc
+
+[LibraryClasses.X64.DXE_SMM_DRIVER]
+  SpiFlashCommonLib|$(PLATFORM_BOARD_PACKAGE)/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf
+!if $(TARGET) == DEBUG
+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf
+!endif
+  BoardAcpiEnableLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.inf
+  MultiBoardAcpiSupportLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.inf
+  TestPointLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointLib/SmmTestPointLib.inf
+
+[LibraryClasses.X64.DXE_RUNTIME_DRIVER]
+  ResetSystemLib|$(PLATFORM_SI_PACKAGE)/Pch/Library/BaseResetSystemLib/BaseResetSystemLib.inf
+
+[Components.IA32]
+
+  #
+  # Common
+  #
+  !include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc
+
+  #
+  # FSP wrapper SEC Core
+  #
+  UefiCpuPkg/SecCore/SecCore.inf {
+    <LibraryClasses>
+      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf
+  }
+
+  #
+  # Silicon
+  #
+  !include $(PLATFORM_SI_PACKAGE)/SiPkgPei.dsc
+
+  #
+  # Platform
+  #
+  $(PLATFORM_PACKAGE)/PlatformInit/ReportFv/ReportFvPei.inf
+  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf {
+    <LibraryClasses>
+      NULL|$(PROJECT)/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
+  }
+  IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf {
+    <LibraryClasses>
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0
+      SiliconPolicyInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyInitLibNull/SiliconPolicyInitLibNull.inf
+      SiliconPolicyUpdateLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf
+!endif
+  }
+
+  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf {
+    <LibraryClasses>
+      NULL|$(PROJECT)/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf
+  }
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0
+  $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf  {
+    <LibraryClasses>
+      NULL|$(PLATFORM_BOARD_PACKAGE)/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf
+  }
+  $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPreMem.inf {
+    <LibraryClasses>
+      NULL|$(PLATFORM_BOARD_PACKAGE)/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf
+      #
+      # In FSP Dispatch mode below dummy library should be linked to bootloader PEIM
+      # to build all DynamicEx PCDs that FSP consumes into bootloader PCD database.
+      #
+      NULL|$(PLATFORM_FSP_BIN_PACKAGE)/Library/FspPcdListLib/FspPcdListLibNull.inf
+  }
+!endif
+  $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf
+  $(PLATFORM_PACKAGE)/Services/StallServicePei/StallServicePei.inf
+
+  IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
+
+  #
+  MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.inf
+  # Security
+  #
+!if gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable == TRUE
+  $(PLATFORM_PACKAGE)/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf
+!endif
+ MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf {
+   <LibraryClasses>
+     ResetSystemLib|$(PLATFORM_SI_PACKAGE)/Pch/Library/BaseResetSystemLib/BaseResetSystemLib.inf
+ }
+
+[Components.X64]
+
+  #
+  # Common
+  #
+  !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc
+
+  #
+  #UEFI Shell
+  #
+  ShellPkg/Application/Shell/Shell.inf {
+    <LibraryClasses>
+      NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf
+      NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf
+      NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf
+      NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf
+      NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf
+      NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf
+      NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf
+
+    <PcdsFixedAtBuild>
+      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE
+  }
+
+  UefiCpuPkg/CpuDxe/CpuDxe.inf
+  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
+
+  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
+  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
+  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
+  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+
+  BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.inf
+
+  #
+  # Silicon
+  #
+  !include $(PLATFORM_SI_PACKAGE)/SiPkgDxe.dsc
+  $(PLATFORM_SI_BIN_PACKAGE)/Microcode/MicrocodeUpdates.inf
+
+  #
+  # SmmAccess
+  #
+  IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccess.inf
+
+  #
+  # Platform
+  #
+  $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyDxe/SiliconPolicyDxe.inf
+  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitDxe/PlatformInitDxe.inf
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1
+  IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
+!endif
+  $(PLATFORM_PACKAGE)/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
+
+  $(PLATFORM_PACKAGE)/Test/TestPointStubDxe/TestPointStubDxe.inf
+  $(PLATFORM_PACKAGE)/Test/TestPointDumpApp/TestPointDumpApp.inf
+
+  #
+  # OS Boot
+  #
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
+  $(PLATFORM_PACKAGE)/Acpi/AcpiTables/AcpiPlatform.inf
+  $(PLATFORM_PACKAGE)/Acpi/MinDsdt/MinDsdt.inf
+  $(PLATFORM_PACKAGE)/Acpi/AcpiSmm/AcpiSmm.inf {
+    <LibraryClasses>
+      NULL|$(PROJECT)/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf
+  }
+
+  $(PLATFORM_PACKAGE)/Flash/SpiFvbService/SpiFvbServiceSmm.inf
+  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitSmm/PlatformInitSmm.inf
+
+  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf {
+    <LibraryClasses>
+      SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf
+  }
+!endif
+
+  #
+  # Security
+  #
+  $(PLATFORM_PACKAGE)/Hsti/HstiIbvPlatformDxe/HstiIbvPlatformDxe.inf
+!if gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable == TRUE
+  $(PLATFORM_PACKAGE)/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf
+!endif
+
+  !include $(PLATFORM_SI_PACKAGE)/SiPkgBuildOption.dsc
+  !include OpenBoardPkgBuildOption.dsc
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.fdf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.fdf
new file mode 100644
index 0000000000..0f645ed63e
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.fdf
@@ -0,0 +1,702 @@
+## @file
+#  FDF file of Platform.
+#
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[Defines]
+   !include $(PROJECT)/Include/Fdf/FlashMapInclude.fdf
+
+################################################################################
+#
+# FD Section
+# The [FD] Section is made up of the definition statements and a
+# description of what goes into  the Flash Device Image.  Each FD section
+# defines one flash "device" image.  A flash device image may be one of
+# the following: Removable media bootable image (like a boot floppy
+# image,) an Option ROM image (that would be "flashed" into an add-in
+# card,) a System "Flash"  image (that would be burned into a system's
+# flash) or an Update ("Capsule") image that will be used to update and
+# existing system flash.
+#
+################################################################################
+[FD.TigerlakeURvp]
+#
+# FD Tokens, BaseAddress, Size, ErasePolarity, BlockSize, and NumBlocks, cannot be
+# assigned with PCD values. Instead, it uses the definitions for its variety, which
+# are FLASH_BASE, FLASH_SIZE, FLASH_BLOCK_SIZE and FLASH_NUM_BLOCKS.
+#
+BaseAddress   = $(FLASH_BASE) | gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress  #The base address of the FLASH Device.
+Size          = $(FLASH_SIZE) | gSiPkgTokenSpaceGuid.PcdBiosSize             #The size in bytes of the FLASH Device
+ErasePolarity = 1
+BlockSize     = $(FLASH_BLOCK_SIZE)
+NumBlocks     = $(FLASH_NUM_BLOCKS)
+
+DEFINE SIPKG_DXE_SMM_BIN  = INF
+DEFINE SIPKG_PEI_BIN      = INF
+
+# Set FLASH_REGION_FV_RECOVERY_OFFSET to PcdNemCodeCacheBase, because macro expression is not supported.
+# So, PlatformSecLib uses PcdFlashAreaBaseAddress + PcdNemCodeCacheBase to get the real CodeCache base address.
+SET gSiPkgTokenSpaceGuid.PcdNemCodeCacheBase = $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset)
+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset)
+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeOffset = 0x1000
+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset)
+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize = $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize)
+SET gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchAddress = $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase) + $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeOffset)
+SET gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize = $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize) - $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeOffset)
+SET gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchAddress = $(gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchAddress)
+SET gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize = $(gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize)
+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFlashMicrocodeOffset = $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeOffset)
+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheAddress = gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress
+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheSize    = gSiPkgTokenSpaceGuid.PcdBiosSize
+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset)
+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset)
+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset)
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeBase    = gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeSize    = gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeOffset  = gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress    = gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress
+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize           = gSiPkgTokenSpaceGuid.PcdBiosSize
+################################################################################
+#
+# Following are lists of FD Region layout which correspond to the locations of different
+# images within the flash device.
+#
+# Regions must be defined in ascending order and may not overlap.
+#
+# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by
+# the pipe "|" character, followed by the size of the region, also in hex with the leading
+# "0x" characters. Like:
+# Offset|Size
+# PcdOffsetCName|PcdSizeCName
+# RegionType <FV, DATA, or FILE>
+# Fv Size can be adjusted
+#
+################################################################################
+gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageVariableOffset|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
+gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize
+#NV_VARIABLE_STORE
+DATA = {
+  ## This is the EFI_FIRMWARE_VOLUME_HEADER
+  # ZeroVector []
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  # FileSystemGuid
+  0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,
+  0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,
+  # FvLength: 0x60000
+  0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,
+  #Signature "_FVH"       #Attributes
+  0x5F, 0x46, 0x56, 0x48, 0xFF, 0xFE, 0x04, 0x00,
+  #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision
+  #
+  # Be careful on CheckSum field.
+  #
+  0x48, 0x00, 0x2E, 0x09, 0x00, 0x00, 0x00, 0x02,
+  #Blockmap[0]: 6 Blocks  0x10000 Bytes / Block
+  0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,
+  #Blockmap[1]: End
+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
+  ## This is the VARIABLE_STORE_HEADER
+!if gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable == TRUE
+  #  Signature: gEfiAuthenticatedVariableGuid = { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }}
+  0x78, 0x2c, 0xf3, 0xaa, 0x7b, 0x94, 0x9a, 0x43,
+  0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92,
+!else
+  #  Signature: gEfiVariableGuid = { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}
+  0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41,
+  0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d,
+!endif
+  #Size: 0x2E000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0x2DFB8
+  # This can speed up the Variable Dispatch a bit.
+  0xB8, 0xDF, 0x02, 0x00,
+  #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32
+  0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+}
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingOffset|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
+gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize
+#NV_FTW_WORKING
+DATA = {
+  # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEdkiiWorkingBlockSignatureGuid         =
+  #  { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65,  0x0, 0xfd, 0x9f, 0x1b, 0x95 }}
+  0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49,
+  0xa0, 0xce, 0x65,  0x0, 0xfd, 0x9f, 0x1b, 0x95,
+  # Crc:UINT32            #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved
+  0xE2, 0x33, 0xF2, 0x03, 0xFE, 0xFF, 0xFF, 0xFF,
+  # WriteQueueSize: UINT64
+  0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00
+}
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareOffset|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
+gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize
+#NV_FTW_SPARE
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize
+FV = FvAdvanced
+
+gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalOffset|gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize
+gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalBase|gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize
+FV = FvOptional
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize
+FV = FvOsBoot
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize
+FV = FvUefiBoot
+
+gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesOffset|gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize
+gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesBase|gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize
+FV = FvFwBinaries
+
+gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset|gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize
+gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase|gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize
+#Microcode
+FV = FvMicrocode
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize
+FV = FvPostMemory
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize
+# FSP_S Section
+FILE = $(PLATFORM_FSP_BIN_PACKAGE)/Fsp_Rebased_S.fd
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize
+# FSP_M Section
+FILE = $(PLATFORM_FSP_BIN_PACKAGE)/Fsp_Rebased_M.fd
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize
+# FSP_T Section
+FILE = $(PLATFORM_FSP_BIN_PACKAGE)/Fsp_Rebased_T.fd
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize
+FV = FvSecurityPreMemory
+
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize
+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize
+FV = FvPreMemory
+
+################################################################################
+#
+# FV Section
+#
+# [FV] section is used to define what components or modules are placed within a flash
+# device file.  This section also defines order the components and modules are positioned
+# within the image.  The [FV] section consists of define statements, set statements and
+# module statements.
+#
+################################################################################
+[FV.FvMicrocode]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+
+INF RuleOverride = MICROCODE $(PLATFORM_SI_BIN_PACKAGE)/Microcode/MicrocodeUpdates.inf
+
+[FV.FvPreMemory]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = FC8FE6B5-CD9B-411E-BD8F-31824D0CDE3D
+
+INF  UefiCpuPkg/SecCore/SecCore.inf
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1
+INF  MdeModulePkg/Core/Pei/PeiMain.inf
+!endif
+!include $(PLATFORM_PACKAGE)/Include/Fdf/CorePreMemoryInclude.fdf
+
+INF $(PLATFORM_PACKAGE)/PlatformInit/ReportFv/ReportFvPei.inf
+INF IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf
+
+INF $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf
+INF $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf
+INF MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0
+INF $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPreMem.inf
+# Provide gEfiPeiStallPpiGuid for FSP dispatch mode
+INF $(PLATFORM_PACKAGE)/Services/StallServicePei/StallServicePei.inf
+!endif
+
+[FV.FvPostMemoryUncompact]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = 7C4DCFC6-AECA-4707-85B9-FD4B2EEA49E7
+
+!include $(PLATFORM_PACKAGE)/Include/Fdf/CorePostMemoryInclude.fdf
+
+# Init Board Config PCD
+INF $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf
+INF IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0
+INF $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf
+
+!endif
+
+!if gSiPkgTokenSpaceGuid.PcdPeiDisplayEnable == TRUE
+FILE FREEFORM = PCD(gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid) {
+  SECTION RAW = $(PLATFORM_FSP_BIN_PACKAGE)/SampleCode/Vbt/Vbt.bin
+  SECTION UI  = "Vbt"
+}
+FILE FREEFORM = 7BB28B99-61BB-11D5-9A5D-0090273FC14D {
+  SECTION RAW = MdeModulePkg/Logo/Logo.bmp
+}
+!endif # PcdPeiDisplayEnable
+INF MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.inf
+
+[FV.FvPostMemory]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = 9DFE49DB-8EF0-4D9C-B273-0036144DE917
+
+FILE FV_IMAGE = 244FAAF4-FAE1-4892-8B7D-7EF84CBFA709 {
+      SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
+        SECTION FV_IMAGE = FvPostMemoryUncompact
+      }
+      SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
+        SECTION FV_IMAGE = FvSecurityPostMemory
+      }
+      SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
+        SECTION FV_IMAGE = FvSecurityLate
+      }
+}
+
+[FV.FvUefiBootUncompact]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = A881D567-6CB0-4eee-8435-2E72D33E45B5
+
+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreUefiBootInclude.fdf
+
+INF  UefiCpuPkg/CpuDxe/CpuDxe.inf
+INF  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf
+
+INF  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf
+INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf
+INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf
+INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf
+INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf
+INF  BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.inf
+
+#
+#UEFI Shell
+#
+# Note : gUefiShellFileGuid is FILE GUID for MinUefiShell.inf/UefiShell.inf/Shell.inf.
+#        The GUID has to be changed according to the change you make to override MinUefiShell.inf/UefiShell.inf/Shell.inf FILE_GUID.
+#
+FILE APPLICATION = 7C04A583-9E3E-4F1C-AD65-E05268D0B4D1 {
+!if $(TARGET) == DEBUG
+  SECTION PE32 = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/X64/ShellPkg/Application/Shell/Shell/OUTPUT/Shell.efi
+!else
+  SECTION PE32 = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/X64/ShellPkg/Application/Shell/Shell/OUTPUT/Shell.efi
+!endif
+  SECTION UI = "EdkShell"
+}
+
+INF  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitDxe/PlatformInitDxe.inf
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1
+INF  IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
+!endif
+INF  $(PLATFORM_PACKAGE)/Test/TestPointStubDxe/TestPointStubDxe.inf
+
+FILE FV_IMAGE = C6CE361E-4554-41E5-AF27-C3FADBA6DA9C {
+  SECTION FV_IMAGE = $(PLATFORM_FSP_BIN_PACKAGE)/FvLateSilicon.fv
+}
+
+[FV.FvUefiBoot]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = 0496D33D-EA79-495C-B65D-ABF607184E3B
+
+FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {
+       SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
+         SECTION FV_IMAGE = FvUefiBootUncompact
+       }
+     }
+
+[FV.FvOsBootUncompact]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = A0F04529-B715-44C6-BCA4-2DEBDD01EEEC
+
+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreOsBootInclude.fdf
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
+INF  $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyDxe/SiliconPolicyDxe.inf
+INF  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitSmm/PlatformInitSmm.inf
+INF  $(PLATFORM_PACKAGE)/Flash/SpiFvbService/SpiFvbServiceSmm.inf
+
+INF  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf
+INF  $(PLATFORM_PACKAGE)/Acpi/AcpiTables/AcpiPlatform.inf
+INF  $(PLATFORM_PACKAGE)/Acpi/AcpiSmm/AcpiSmm.inf
+
+INF  RuleOverride = DRIVER_ACPITABLE $(PLATFORM_PACKAGE)/Acpi/MinDsdt/MinDsdt.inf
+INF  $(PLATFORM_PACKAGE)/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf
+
+!endif
+
+[FV.FvLateSilicon]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = 97F09B89-9E83-4DDC-A3D1-10C4AF539D1E
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/Pch/PchInit/Dxe/PchInitDxeTgl.inf
+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/SystemAgent/SaInit/Dxe/SaInitDxe.inf
+
+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/Pch/PchSmiDispatcher/Smm/PchSmiDispatcher.inf
+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/Pch/SmmControl/RuntimeDxe/SmmControl.inf
+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/IpBlock/Spi/Smm/SpiSmm.inf
+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/Pch/PchInit/Smm/PchInitSmm.inf
+
+!if gSiPkgTokenSpaceGuid.PcdAcpiEnable == TRUE
+INF  RuleOverride = ACPITABLE $(PLATFORM_SI_PACKAGE)/SystemAgent/AcpiTables/SaSsdt/SaSsdt.inf
+INF  RuleOverride = ACPITABLE $(PLATFORM_SI_PACKAGE)/IpBlock/Graphics/AcpiTables/IgfxSsdt.inf
+!endif
+!endif #PcdBootToShellOnly
+
+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/SystemAgent/SaInit/Smm/SaLateInitSmm.inf
+
+[FV.FvOsBoot]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = 13BF8810-75FD-4B1A-91E6-E16C4201F80A
+
+FILE FV_IMAGE = B9020753-84A8-4BB6-947C-CE7D41F5CE39 {
+       SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
+         SECTION FV_IMAGE = FvOsBootUncompact
+       }
+     }
+
+FILE FV_IMAGE = D4632741-510C-44E3-BE21-C3D6D7881485 {
+       SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {
+         SECTION FV_IMAGE = FvLateSilicon
+       }
+     }
+
+[FV.FvSecurityPreMemory]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16         #FV alignment and FV attributes setting.
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = 9B7FA59D-71C6-4A36-906E-9725EA6ADD5B
+
+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreSecurityPreMemoryInclude.fdf
+
+[FV.FvSecurityPostMemory]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16         #FV alignment and FV attributes setting.
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = 4199E560-54AE-45E5-91A4-F7BC3804E14A
+
+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreSecurityPostMemoryInclude.fdf
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable == TRUE
+INF $(CLIENT_COMMON_PACKAGE)/Universal/Tcg2PlatformPei/Tcg2PlatformPei.inf
+!endif
+
+[FV.FvSecurityLate]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = F753FE9A-EEFD-485B-840B-E032D538102C
+
+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreSecurityLateInclude.fdf
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE
+
+INF  $(PLATFORM_PACKAGE)/Hsti/HstiIbvPlatformDxe/HstiIbvPlatformDxe.inf
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable == TRUE
+INF  $(PLATFORM_PACKAGE)/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf
+!endif
+
+!endif
+INF  IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccess.inf
+
+#
+# Do not use nested FV in PEI phase as current FMMT cannot handle it properly when deleting modules.
+#
+#[FV.FvSecurity]
+#BlockSize          = $(FLASH_BLOCK_SIZE)
+#FvAlignment        = 16
+#ERASE_POLARITY     = 1
+#MEMORY_MAPPED      = TRUE
+#STICKY_WRITE       = TRUE
+#LOCK_CAP           = TRUE
+#LOCK_STATUS        = TRUE
+#WRITE_DISABLED_CAP = TRUE
+#WRITE_ENABLED_CAP  = TRUE
+#WRITE_STATUS       = TRUE
+#WRITE_LOCK_CAP     = TRUE
+#WRITE_LOCK_STATUS  = TRUE
+#READ_DISABLED_CAP  = TRUE
+#READ_ENABLED_CAP   = TRUE
+#READ_STATUS        = TRUE
+#READ_LOCK_CAP      = TRUE
+#READ_LOCK_STATUS   = TRUE
+#FvNameGuid         = 5A9A8B4E-149A-4CB2-BDC7-C8D62DE2C8CF
+
+#FILE FV_IMAGE = 757CC075-1428-423D-A73C-22639706C119 {
+#       SECTION FV_IMAGE = FvSecurityPreMemory
+#     }
+
+
+[FV.FvAdvanced]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = B23E7388-9953-45C7-9201-0473DDE5487A
+
+
+[FV.FvFwBinaries]
+BlockSize     = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = 8B98AB22-E354-42f0-88B9-049810F0FDAA
+
+
+
+
+
+[FV.FvOptional]
+BlockSize          = $(FLASH_BLOCK_SIZE)
+FvAlignment        = 16
+ERASE_POLARITY     = 1
+MEMORY_MAPPED      = TRUE
+STICKY_WRITE       = TRUE
+LOCK_CAP           = TRUE
+LOCK_STATUS        = TRUE
+WRITE_DISABLED_CAP = TRUE
+WRITE_ENABLED_CAP  = TRUE
+WRITE_STATUS       = TRUE
+WRITE_LOCK_CAP     = TRUE
+WRITE_LOCK_STATUS  = TRUE
+READ_DISABLED_CAP  = TRUE
+READ_ENABLED_CAP   = TRUE
+READ_STATUS        = TRUE
+READ_LOCK_CAP      = TRUE
+READ_LOCK_STATUS   = TRUE
+FvNameGuid         = 9574B1CE-EE93-451E-B500-3E5F564244DE
+################################################################################
+#
+# Rules are use with the [FV] section's module INF type to define
+# how an FFS file is created for a given INF file. The following Rule are the default
+# rules for the different module type. User can add the customized rules to define the
+# content of the FFS file.
+#
+################################################################################
+
+!include $(PLATFORM_PACKAGE)/Include/Fdf/RuleInclude.fdf
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgBuildOption.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgBuildOption.dsc
new file mode 100644
index 0000000000..b72329846a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgBuildOption.dsc
@@ -0,0 +1,141 @@
+## @file
+# platform build option configuration file.
+#
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+[BuildOptions]
+# Define Build Options both for EDK and EDKII drivers.
+
+
+  DEFINE DSC_S3_BUILD_OPTIONS =
+
+!if gSiPkgTokenSpaceGuid.PcdAcpiEnable == TRUE
+  DEFINE DSC_ACPI_BUILD_OPTIONS = -DACPI_SUPPORT=1
+!else
+  DEFINE DSC_ACPI_BUILD_OPTIONS =
+!endif
+
+  DEFINE BIOS_GUARD_BUILD_OPTIONS =
+
+  DEFINE OVERCLOCKING_BUILD_OPTION =
+
+  DEFINE FSP_BINARY_BUILD_OPTIONS =
+
+  DEFINE FSP_WRAPPER_BUILD_OPTIONS = -DFSP_WRAPPER_FLAG
+
+  DEFINE SKIP_FSP_TEMPRAM_INIT_AND_EXIT_OPTIONS =
+
+!if gSiPkgTokenSpaceGuid.PcdOptimizeCompilerEnable == FALSE
+  DEFINE OPTIMIZE_DISABLE_OPTIONS = -Od -GL-
+!else
+  DEFINE OPTIMIZE_DISABLE_OPTIONS =
+!endif
+
+  DEFINE UP_SERVER_SUPPORT_BUILD_OPTIONS =
+
+
+  DEFINE TPM_BUILD_OPTION =
+
+  DEFINE TPM2_BUILD_OPTION =
+
+  DEFINE DSC_TBT_BUILD_OPTIONS =
+
+  DEFINE DSC_DCTT_BUILD_OPTIONS =
+
+  DEFINE EMB_BUILD_OPTIONS =
+
+  DEFINE DSC_MEMORY_DOWN_BUILD_OPTIONS = -DMEM_DOWN_FLAG=1
+
+  DEFINE DSC_KBCEMUL_BUILD_OPTIONS =
+
+  DEFINE BOOT_GUARD_BUILD_OPTIONS =
+
+  DEFINE SECURE_BOOT_BUILD_OPTIONS =
+
+  DEFINE USBTYPEC_BUILD_OPTION =
+
+  DEFINE CAPSULE_BUILD_OPTIONS =
+
+  DEFINE PERFORMANCE_BUILD_OPTION =
+
+  DEFINE DEBUGUSEUSB_BUILD_OPTION =
+
+  DEFINE DISABLE_NEW_DEPRECATED_INTERFACES_BUILD_OPTION = -DDISABLE_NEW_DEPRECATED_INTERFACES=1
+
+  DEFINE SINITBIN_BUILD_OPTION =
+
+  DEFINE MINTREE_FLAG_BUILD_OPTION = -DMINTREE_FLAG=1
+
+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_SIPKG_FEATURE_BUILD_OPTIONS)  $(OVERCLOCKING_BUILD_OPTION) $(PERFORMANCE_BUILD_OPTION) $(EMB_BUILD_OPTIONS) $(BIOS_GUARD_BUILD_OPTIONS) $(DSC_TBT_BUILD_OPTIONS)
+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(BOOT_GUARD_BUILD_OPTIONS) $(DSC_MEMORY_DOWN_BUILD_OPTIONS) $(DEBUGUSEUSB_BUILD_OPTION) $(DSC_S3_BUILD_OPTIONS)
+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(FSP_BINARY_BUILD_OPTIONS) $(FSP_WRAPPER_BUILD_OPTIONS) $(SKIP_FSP_TEMPRAM_INIT_AND_EXIT_OPTIONS)
+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(DSC_KBCEMUL_BUILD_OPTIONS) $(CAPSULE_BUILD_OPTIONS) $(SECURE_BOOT_BUILD_OPTIONS) $(DISABLE_NEW_DEPRECATED_INTERFACES_BUILD_OPTION)
+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(TPM2_BUILD_OPTION) $(TPM_BUILD_OPTION) $(DSC_DCTT_BUILD_OPTIONS)
+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(DSC_ACPI_BUILD_OPTIONS) $(UP_SERVER_SUPPORT_BUILD_OPTIONS) $(USBTYPEC_BUILD_OPTION) $(SINITBIN_BUILD_OPTION) $(MINTREE_FLAG_BUILD_OPTION)
+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+
+[BuildOptions.Common.EDKII]
+
+#
+# For IA32 Global Build Flag
+#
+       *_*_IA32_CC_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) -D PI_SPECIFICATION_VERSION=0x00010015 -DASF_PEI
+       *_*_IA32_VFRPP_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+       *_*_IA32_APP_FLAGS     = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+       *_*_IA32_ASLPP_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+       *_*_IA32_ASLCC_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+       *_*_IA32_NASM_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+
+#
+# For IA32 Specific Build Flag
+#
+GCC:   *_*_IA32_PP_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+MSFT:  *_*_IA32_ASM_FLAGS     = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+MSFT:  *_*_IA32_CC_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS) -D PI_SPECIFICATION_VERSION=0x00010015 -DASF_PEI
+MSFT:  *_*_IA32_VFRPP_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)
+MSFT:  *_*_IA32_APP_FLAGS     = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)
+MSFT:  *_*_IA32_ASLPP_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)
+MSFT:  *_*_IA32_ASLCC_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)
+
+#
+# For X64 Global Build Flag
+#
+       *_*_X64_CC_FLAGS       = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) -D PI_SPECIFICATION_VERSION=0x00010015
+       *_*_X64_VFRPP_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+       *_*_X64_APP_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+       *_*_X64_ASLPP_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+       *_*_X64_ASLCC_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+       *_*_X64_NASM_FLAGS     = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+
+
+#
+# For X64 Specific Build Flag
+#
+GCC:   *_*_X64_PP_FLAGS       = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+MSFT:  *_*_X64_ASM_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+MSFT:  *_*_X64_CC_FLAGS       = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS) -D PI_SPECIFICATION_VERSION=0x00010015
+MSFT:  *_*_X64_VFRPP_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)
+MSFT:  *_*_X64_APP_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)
+MSFT:  *_*_X64_ASLPP_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+MSFT:  *_*_X64_ASLCC_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)
+
+
+# Force PE/COFF sections to be aligned at 4KB boundaries to support page level protection
+[BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_CORE]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
+# Force PE/COFF sections to be aligned at 4KB boundaries to support MemoryAttribute table
+[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]
+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
+# Force PE/COFF sections to be aligned at 4KB boundaries to support NX protection
+[BuildOptions.common.EDKII.DXE_DRIVER, BuildOptions.common.EDKII.DXE_CORE, BuildOptions.common.EDKII.UEFI_DRIVER, BuildOptions.common.EDKII.UEFI_APPLICATION]
+  #MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096
+  #GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc
new file mode 100644
index 0000000000..a048efcc18
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc
@@ -0,0 +1,392 @@
+## @file
+#  PCD configuration build description file for the TigerlakeURvp board.
+#
+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+#  SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+################################################################################
+#
+# Pcd Section - list of all PCD Entries used by this board.
+#
+################################################################################
+
+[PcdsFixedAtBuild.common]
+  ######################################
+  # Key Boot Stage and FSP configuration
+  ######################################
+  #
+  # Please select the Boot Stage here.
+  # Stage 1 - enable debug (system deadloop after debug init)
+  # Stage 2 - mem init (system deadloop after mem init)
+  # Stage 3 - boot to shell only
+  # Stage 4 - boot to OS
+  # Stage 5 - boot to OS with security boot enabled
+  # Stage 6 - boot with advanced features enabled
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4
+
+  #
+  # 0: FSP Wrapper is running in Dispatch mode.
+  # 1: FSP Wrapper is running in API mode.
+  # Note: Dispatch mode is currently NOT supported for this board.
+  #
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0
+
+  #
+  # FALSE: The board is not a FSP wrapper (FSP binary not used)
+  # TRUE:  The board is a FSP wrapper (FSP binary is used)
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode|TRUE
+
+  #
+  # FSP Base address PCD will be updated in FDF basing on flash map.
+  #
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0
+
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase|0xFEF00000
+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize|0x00080000
+  gSiPkgTokenSpaceGuid.PcdTemporaryRamBase|0xFEF80000
+  gSiPkgTokenSpaceGuid.PcdTemporaryRamSize|0x00040000
+  gSiPkgTokenSpaceGuid.PcdTsegSize|0x1000000
+
+  #
+  # PCD declared for TigerlakeSiliconPkg Fru
+  #
+  gSiPkgTokenSpaceGuid.PcdBiosGuardEnable|FALSE
+  gSiPkgTokenSpaceGuid.PcdCpuPcieEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdEmbeddedEnable|0x0
+  gSiPkgTokenSpaceGuid.PcdThcEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdMrcTraceMessageSupported|TRUE
+
+  ######################################
+  # Silicon Configuration
+  ######################################
+  # Build switches
+  gSiPkgTokenSpaceGuid.PcdOptimizeCompilerEnable|TRUE
+
+  # CPU
+  gSiPkgTokenSpaceGuid.PcdSourceDebugEnable|FALSE
+
+  # SA
+  gSiPkgTokenSpaceGuid.PcdIgdEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdPegEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdSaDmiEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdVtdEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdPeiDisplayEnable|TRUE
+
+  # ME
+  gSiPkgTokenSpaceGuid.PcdAtaEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdPttEnable|FALSE
+  gSiPkgTokenSpaceGuid.PcdJhiEnable|TRUE
+
+  # Others
+  gSiPkgTokenSpaceGuid.PcdAcpiEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdBdatEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdCpuPowerOnConfigEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdIntegratedTouchEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdOcWdtEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdOverclockEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdPpmEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdS3Enable|TRUE
+  gSiPkgTokenSpaceGuid.PcdSerialIoUartEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdSiCatalogDebugEnable|FALSE
+  gSiPkgTokenSpaceGuid.PcdSmbiosEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdSmmVariableEnable|TRUE
+  gSiPkgTokenSpaceGuid.PcdFspWrapperEnable|TRUE
+
+  #
+  # When sharing stack with boot loader, FSP only needs a small temp ram for heap
+  #
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize|0x00020000
+!else
+      #
+      # FSP Dispatch mode will not establish separate Stack or Heap.
+      #
+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize|0
+!endif
+
+  #
+  # Boot loader stack size has to be large enough for FSP execution
+  #
+  gSiPkgTokenSpaceGuid.PcdPeiTemporaryRamStackSize|0x30000
+
+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xC0000000
+#!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1
+  gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength|0x10000000
+#!endif
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize|0x40000
+[PcdsFeatureFlag.common]
+  ######################################
+  # Edk2 Configuration
+  ######################################
+  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|FALSE
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmProfileEnable|FALSE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE
+
+  ######################################
+  # Platform Configuration
+  ######################################
+  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3
+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE
+  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4
+  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5
+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE
+  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE
+!endif
+
+!if $(TARGET) == DEBUG
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|TRUE
+!else
+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE
+!endif
+
+  ######################################
+  # Board Configuration
+  ######################################
+  gBoardModuleTokenSpaceGuid.PcdIntelGopEnable|TRUE
+
+[PcdsFixedAtBuild.common]
+  ######################################
+  # Edk2 Configuration
+  ######################################
+!if $(TARGET) == RELEASE
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0
+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x3
+!else
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F
+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07
+!endif
+!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE
+  gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask|0x1
+!endif
+
+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE
+!if $(TARGET) == RELEASE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE
+!else
+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE
+!endif
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAriSupport|FALSE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x01
+  gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x0
+  gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize|0x00000800
+  gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable|$(TOP_MEMORY_ADDRESS)
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x400
+!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|140
+!endif
+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000
+  gEfiMdeModulePkgTokenSpaceGuid.PcdReclaimVariableSpaceAtEndOfDxe|TRUE
+!if gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable == TRUE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSmiHandlerProfilePropertyMask|0x1
+!endif
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSupport|FALSE
+!if $(TARGET) == DEBUG
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE
+!endif
+
+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoBarEnableMask|0x80
+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBarRegisterOffset|0x00
+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBusNumber|0x0
+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciDeviceNumber|0x1F
+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciEnableRegisterOffset|0x44
+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciFunctionNumber|0x2
+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddress|0x1800
+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddressMask|0xFFFC
+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiPm1TmrOffset|0x08
+
+  # Specifies timeout value in microseconds for the BSP to detect all APs for the first time.
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|50000
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuNumberOfReservedVariableMtrrs|0x0
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout|10000
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x20000
+
+  #
+  # In non-FSP build (EDK2 build) or FSP API mode below PCD are FixedAtBuild
+  # (They will be DynamicEx in FSP Dispatch mode)
+  #
+
+  ## Specifies the size of the microcode Region.
+  # @Prompt Microcode Region size.
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize|0
+
+  ## Specifies the AP wait loop state during POST phase.
+  #  The value is defined as below.
+  #  1: Place AP in the Hlt-Loop state.
+  #  2: Place AP in the Mwait-Loop state.
+  #  3: Place AP in the Run-Loop state.
+  # @Prompt The AP wait loop state.
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuApLoopMode|2
+
+  ######################################
+  # Platform Configuration
+  ######################################
+  gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuSocketCount|1
+  gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuCoreCount|8
+  gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuThreadCount|2
+
+  gMinPlatformPkgTokenSpaceGuid.PcdPciReservedMemBase|0xA0000000
+  gMinPlatformPkgTokenSpaceGuid.PcdPciReservedMemLimit|0xDFFFFFFF
+  #
+  # The PCDs are used to control the Windows SMM Security Mitigations Table - Protection Flags
+  #
+  # BIT0: If set, expresses that for all synchronous SMM entries,SMM will validate that input and output buffers lie entirely within the expected fixed memory regions.
+  # BIT1: If set, expresses that for all synchronous SMM entries, SMM will validate that input and output pointers embedded within the fixed communication buffer only refer to address ranges \
+  #       that lie entirely within the expected fixed memory regions.
+  # BIT2: Firmware setting this bit is an indication that it will not allow reconfiguration of system resources via non-architectural mechanisms.
+  # BIT3-31: Reserved
+  #
+  gMinPlatformPkgTokenSpaceGuid.PcdWsmtProtectionFlags|0x07
+
+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiReclaimMemorySize|0xCC
+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiNvsMemorySize|0xA2
+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiReservedMemorySize|0x3100
+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiRtDataMemorySize|0x2A
+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiRtCodeMemorySize|0xC4
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 1
+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 2
+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 3
+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x07, 0x03, 0x05, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 4
+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x07, 0x03, 0x05, 0x1F, 0x00, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 5
+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+!endif
+
+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 6
+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}
+!endif
+
+[PcdsFixedAtBuild.IA32]
+  ######################################
+  # Edk2 Configuration
+  ######################################
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0
+  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress|0xFED00148
+  gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x3800000
+
+  ######################################
+  # Platform Configuration
+  ######################################
+  gMinPlatformPkgTokenSpaceGuid.PcdPeiPhaseStackTop|0xA0000
+
+[PcdsFixedAtBuild.X64]
+  ######################################
+  # Edk2 Configuration
+  ######################################
+
+  # Default platform supported RFC 4646 languages: (American) English
+  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en-US"
+
+[PcdsPatchableInModule.common]
+  ######################################
+  # Edk2 Configuration
+  ######################################
+  gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0301
+  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046
+
+  ######################################
+  # Silicon Configuration
+  ######################################
+!if $(TARGET) == DEBUG
+  gSiPkgTokenSpaceGuid.PcdSerialIoUartDebugEnable|1
+!endif
+
+[PcdsDynamicDefault]
+  ######################################
+  # Edk2 Configuration
+  ######################################
+  gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable|TRUE
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand|FALSE
+  ######################################
+  # Silicon Configuration
+  ######################################
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1
+  gSiPkgTokenSpaceGuid.PcdPciExpressRegionLength|gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength
+!endif
+
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|0x0
+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|0x0
+  #gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr|0x0
+
+  #
+  #  Set video to native resolution as Windows 8 WHCK requirement.
+  #
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|0
+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|0
+
+  gEfiSecurityPkgTokenSpaceGuid.PcdTpm2CurrentIrqNum|0x00
+
+  #
+  # FSP Base address PCD will be updated in FDF basing on flash map.
+  #
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0
+
+  # Platform will pre-allocate UPD buffer and pass it to FspWrapper
+  # Those dummy address will be patched before FspWrapper executing
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress|0x0
+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress|0x0
+
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuApTargetCstate|0
+  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|16
+
+[PcdsDynamicHii.X64.DEFAULT]
+  ######################################
+  # Edk2 Configuration
+  ######################################
+  gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|L"HwErrRecSupport"|gEfiGlobalVariableGuid|0x0|1 # Variable: L"HwErrRecSupport"
+!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE
+  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|1 # Variable: L"Timeout"
+!else
+  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5 # Variable: L"Timeout"
+!endif
+
+[PcdsDynamicExDefault]
+  gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr|0x0
+
+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0
+  #
+  # Include FSP PCD settings.
+  #
+  !include $(PLATFORM_FSP_BIN_PACKAGE)/TigerLakeFspPcds.dsc
+!endif
+
diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg
new file mode 100644
index 0000000000..f8047701f8
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg
@@ -0,0 +1,34 @@
+# @ build_config.cfg
+# This is the WhiskeylakeURvp board specific build settings
+#
+# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+
+
+[CONFIG]
+WORKSPACE_PLATFORM_BIN =
+EDK_SETUP_OPTION =
+openssl_path =
+PLATFORM_BOARD_PACKAGE = TigerlakeOpenBoardPkg
+PROJECT = TigerlakeOpenBoardPkg/TigerlakeURvp
+BOARD = TigerlakeURvp
+FLASH_MAP_FDF = TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf
+PROJECT_DSC = TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
+BOARD_PKG_PCD_DSC = TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc
+PrepRELEASE = DEBUG
+SILENT_MODE = FALSE
+EXT_CONFIG_CLEAR =
+CapsuleBuild = FALSE
+EXT_BUILD_FLAGS =
+CAPSULE_BUILD = 0
+TARGET = DEBUG
+TARGET_SHORT = D
+PERFORMANCE_BUILD = FALSE
+FSP_WRAPPER_BUILD = TRUE
+FSP_BIN_PKG = TigerLakeFspBinPkg/Client
+FSP_PKG_NAME = TigerlakeSiliconPkg
+FSP_BINARY_BUILD = FALSE
+FSP_TEST_RELEASE = FALSE
+SECURE_BOOT_ENABLE = FALSE
+BIOS_INFO_GUID = 4A4CA1C6-871C-45BB-8801-6910A7AA5807
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Patch V2 7/8] Enable build for TigerlakeOpenBoardPkg
  2021-02-09  8:45 [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Heng Luo
                   ` (4 preceding siblings ...)
  2021-02-09  8:45 ` [Patch V2 6/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add DSC and build files Heng Luo
@ 2021-02-09  8:45 ` Heng Luo
  2021-02-10  0:30   ` Chaganty, Rangasai V
  2021-02-09  8:45 ` [Patch V2 8/8] Update Maintainers.txt " Heng Luo
  2021-02-09 23:41 ` [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Chaganty, Rangasai V
  7 siblings, 1 reply; 18+ messages in thread
From: Heng Luo @ 2021-02-09  8:45 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Nate DeSimone

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

This change adds the configuration to enable build for TigerlakeURvp.
Also it updates Tigerlake U Rvp details to the Readme.md.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/Readme.md | 11 +++++++++++
 Platform/Intel/build.cfg |  1 +
 2 files changed, 12 insertions(+)

diff --git a/Platform/Intel/Readme.md b/Platform/Intel/Readme.md
index f7bfc7aad2..b3b15405af 100644
--- a/Platform/Intel/Readme.md
+++ b/Platform/Intel/Readme.md
@@ -57,6 +57,7 @@ A UEFI firmware implementation using MinPlatformPkg is constructed using the fol
 * The `SimicsOpenBoardPkg` contains board implementations for the Simics hardware simulator.
 * The `WhiskeylakeOpenBoardPkg` contains board implementations for WhiskeyLake systems.
 * The `CometlakeOpenBoardPkg` contains board implementations for CometLake systems.
+* The `TigerlakeOpenBoardPkg` contains board implementations for TigerLake systems.
 
 ### **Supported Hardware**
 
@@ -75,6 +76,7 @@ A UEFI firmware implementation using MinPlatformPkg is constructed using the fol
 | RVP 3                                 | SkyLake, KabyLake, KabyLake Refresh        | KabylakeOpenBoardPkg         | KabylakeRvp3       |
 | WHL-U DDR4 RVP                        | WhiskeyLake                                | WhiskeylakeOpenBoardPkg      | WhiskeylakeURvp    |
 | CML-U LPDDR3 RVP                      | CometLake V1                               | CometlakeOpenBoardPkg        | CometlakeURvp      |
+| TGL-U LPDDR4 RVP                      | TigerLake                                  | TigerlakeOpenBoardPkg        | TigerlakeURvp      |
 
 *Note: RVP = Reference and Validation Platform*
 
@@ -253,6 +255,11 @@ return back to the minimum platform caller.
           |       |        |               |---build_config.cfg: CometlakeURvp specific build
           |       |        |                                     settings environment variables.
           |       |        |
+          |       |        |------TigerlakeOpenBoardPkg
+          |       |        |       |------TigerlakeURvp
+          |       |        |               |---build_config.cfg: TigerlakeURvp specific build
+          |       |        |                                     settings environment variables.
+          |       |        |
           |------FSP
   </pre>
 
@@ -283,6 +290,10 @@ return back to the minimum platform caller.
 1. This firmware project has been tested booting to Microsoft Windows 10 x64 with AHCI mode and External Graphic Device.
 2. This firmware project has been also tested booting to Ubuntu 17.10 with AHCI mode and Integrated Graphic Device.
 
+**TigerlakeOpenBoardPkg**
+1. This firmware project has been tested booting to Microsoft Windows 10 x64 with AHCI mode and Integrated Graphic Device.
+2. This firmware project has been also tested booting to Puppy Linux BionicPup64 8.0 with AHCI mode and Integrated Graphic Device.
+
 ### **Package Builds**
 
 In some cases, such as BoardModulePkg, a package may provide a set of functionality that is included in other
diff --git a/Platform/Intel/build.cfg b/Platform/Intel/build.cfg
index 8aa6b22956..97c5c9a290 100644
--- a/Platform/Intel/build.cfg
+++ b/Platform/Intel/build.cfg
@@ -60,3 +60,4 @@ KabylakeRvp3 = KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
 UpXtreme = WhiskeylakeOpenBoardPkg/UpXtreme/build_config.cfg
 WhiskeylakeURvp = WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/build_config.cfg
 CometlakeURvp = CometlakeOpenBoardPkg/CometlakeURvp/build_config.cfg
+TigerlakeURvp = TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* [Patch V2 8/8] Update Maintainers.txt for TigerlakeOpenBoardPkg
  2021-02-09  8:45 [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Heng Luo
                   ` (5 preceding siblings ...)
  2021-02-09  8:45 ` [Patch V2 7/8] Enable build for TigerlakeOpenBoardPkg Heng Luo
@ 2021-02-09  8:45 ` Heng Luo
  2021-02-10  0:31   ` Chaganty, Rangasai V
  2021-02-09 23:41 ` [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Chaganty, Rangasai V
  7 siblings, 1 reply; 18+ messages in thread
From: Heng Luo @ 2021-02-09  8:45 UTC (permalink / raw)
  To: devel; +Cc: Sai Chaganty, Nate DeSimone

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

This change adds owners to the the Maintainers.txt for TigerlakeOpenBoardPkg

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Maintainers.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt
index 34f0b58581..b2f1b67cf9 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -195,6 +195,12 @@ M: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
 R: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com>
 R: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com>
 
+Platform/Intel/TigerlakeOpenBoardPkg
+F: Platform/Intel/TigerlakeOpenBoardPkg/
+M: Sai Chaganty <rangasai.v.chaganty@intel.com>
+M: Nate DeSimone <nathaniel.l.desimone@intel.com>
+R: Heng Luo <heng.luo@intel.com>
+
 Platform/Intel/SimicsOpenBoardPkg
 F: Platform/Intel/SimicsOpenBoardPkg/
 M: Agyeman Prince <prince.agyeman@intel.com>
-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers
  2021-02-09  8:45 [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Heng Luo
                   ` (6 preceding siblings ...)
  2021-02-09  8:45 ` [Patch V2 8/8] Update Maintainers.txt " Heng Luo
@ 2021-02-09 23:41 ` Chaganty, Rangasai V
  7 siblings, 0 replies; 18+ messages in thread
From: Chaganty, Rangasai V @ 2021-02-09 23:41 UTC (permalink / raw)
  To: Luo, Heng, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>  

-----Original Message-----
From: Luo, Heng <heng.luo@intel.com> 
Sent: Tuesday, February 09, 2021 12:46 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers

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

Create the TigerlakeOpenBoardPkg to provide board support code. The package may support Tigerlake boards. The package serves as a board support package in the EDK II Minimum Platform design. Silicon support for this package is provided in TigerLakeFspBinPkg in the FSP repository and TigerlakeSiliconPkg in the edk2-platforms repository.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardConfig.h |  61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardId.h     |  17 +++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Include/PolicyUpdateMacro.h   |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/OpenBoardPkg.dec              | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 4 files changed, 280 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardConfig.h b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardConfig.h
new file mode 100644
index 0000000000..148abcce74
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardConfig.h
@@ -0,0 +1,61 @@
+/** @file+  Header file for Platform Boards Configurations.+++  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>+  SPDX-License-Identifier: BSD-2-Clause-Patent+**/++#ifndef _PLATFORM_BOARD_CONFIG_H+#define _PLATFORM_BOARD_CONFIG_H++#include <ConfigBlock.h>+#include <PchPolicyCommon.h>+++#pragma pack(1)++typedef struct {+  UINT8 ClkReqNumber : 4;+  UINT8 ClkReqSupported : 1;+  UINT8 DeviceResetPadActiveHigh : 1;+  UINT32 DeviceResetPad;+} ROOT_PORT_CLK_INFO;++typedef struct {+  UINT8 Section;+  UINT8 Pin;+} EXPANDER_GPIO_CONFIG;++typedef struct {+  UINT8 Type;+  UINT8 Reserved[3];  // alignment for COMMON_GPIO_CONFIG+  union {+    UINT32 Pin;+    EXPANDER_GPIO_CONFIG Expander;+  } u;+} BOARD_GPIO_CONFIG;++// Do not change the encoding. It must correspond with PCH_PCIE_CLOCK_USAGE from PCH RC.+#define NOT_USED     0xFF+#define FREE_RUNNING 0x80+#define LAN_CLOCK    0x70+#define PCIE_PEG     0x40+#define PCIE_PCH     0x00++typedef struct {+  UINT32 ClockUsage;+  UINT32 ClkReqSupported;+} PCIE_CLOCK_CONFIG;++typedef union {+  UINT64 Blob;+  BOARD_GPIO_CONFIG  BoardGpioConfig;+  ROOT_PORT_CLK_INFO Info;+  PCIE_CLOCK_CONFIG  PcieClock;+} PCD64_BLOB;++#pragma pack()++#endif // _PLATFORM_BOARD_CONFIG_H+diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardId.h b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardId.h
new file mode 100644
index 0000000000..2e1ee9eca4
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PlatformBoardId.h
@@ -0,0 +1,17 @@
+/** @file+  Defines Platform BoardIds++  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>+  SPDX-License-Identifier: BSD-2-Clause-Patent+**/++#ifndef _PLATFORM_BOARD_ID_H_+#define _PLATFORM_BOARD_ID_H_++// TigerLake Sku IDs+#define SkuIdTglU                         0x1++// TigerLake Board Id 0x01+#define BoardIdTglUDdr4                   0x01++#endif // _PLATFORM_BOARD_ID_H_diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Include/PolicyUpdateMacro.h b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PolicyUpdateMacro.h
new file mode 100644
index 0000000000..0848efe5b6
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Include/PolicyUpdateMacro.h
@@ -0,0 +1,49 @@
++/** @file+  Macros for platform to update different types of policy.++  
++Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>+  
++SPDX-License-Identifier: BSD-2-Clause-Patent+**/++#ifndef 
++_POLICY_UPDATE_MACRO_H_+#define _POLICY_UPDATE_MACRO_H_++#ifdef 
++UPDATE_POLICY+#undef UPDATE_POLICY+#endif++#ifdef COPY_POLICY+#undef 
++COPY_POLICY+#endif++#ifdef GET_POLICY+#undef GET_POLICY+#endif++#ifdef 
++AND_POLICY+#undef AND_POLICY+#endif++#ifdef OR_POLICY+#undef 
++OR_POLICY+#endif++#if FixedPcdGetBool(PcdFspModeSelection) == 1+//+// 
++MACROS for platform code use+//+#define UPDATE_POLICY(UpdField, 
++ConfigField, Value)  UpdField = Value;+#define COPY_POLICY(UpdField, 
++ConfigField, Value, Size)  CopyMem (UpdField, Value, Size);+#define 
++GET_POLICY(UpdField, ConfigField, Value)  Value = UpdField;+#define 
++AND_POLICY(UpdField, ConfigField, Value)  UpdField &= Value;+#define 
++OR_POLICY(UpdField, ConfigField, Value)  UpdField |= 
++Value;+#else+#define UPDATE_POLICY(UpdField, ConfigField, Value)  
++ConfigField = Value;+#define COPY_POLICY(UpdField, ConfigField, Value, 
++Size)  CopyMem (ConfigField, Value, Size);+#define 
++GET_POLICY(UpdField, ConfigField, Value)  Value = ConfigField;+#define 
++AND_POLICY(UpdField, ConfigField, Value)  ConfigField &= 
++Value;+#define OR_POLICY(UpdField, ConfigField, Value)  ConfigField |= 
++Value;+#endif++#endif //_POLICY_UPDATE_MACRO_H_diff --git 
++a/Platform/Intel/TigerlakeOpenBoardPkg/OpenBoardPkg.dec 
++b/Platform/Intel/TigerlakeOpenBoardPkg/OpenBoardPkg.dec
new file mode 100644
index 0000000000..91f0a88470
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/OpenBoardPkg.dec
@@ -0,0 +1,153 @@
+## @file+#+# The DEC files are used by the utilities that parse DSC and+# INF files to generate AutoGen.c and AutoGen.h files+# for the build infrastructure.+#+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>+#  SPDX-License-Identifier: BSD-2-Clause-Patent+#+##+++[Defines]+DEC_SPECIFICATION = 0x00010017+PACKAGE_NAME = OpenBoardPkg+PACKAGE_VERSION = 0.1+PACKAGE_GUID = 734F5E12-4C70-4EC9-908B-D7421B4B128C++[Includes]+Include+TigerlakeURvp/Include++[Guids]+  gBoardModuleTokenSpaceGuid            =  {0x72d1fff7, 0xa42a, 0x4219, {0xb9, 0x95, 0x5a, 0x67, 0x53, 0x6e, 0xa4, 0x2a}}+  # gUefiShellFileGuid is FILE GUID for MinUefiShell.inf/UefiShell.inf/Shell.inf.+  gUefiShellFileGuid                    =  {0x7c04a583, 0x9e3e, 0x4f1c, {0xad, 0x65, 0xe0, 0x52, 0x68, 0xd0, 0xb4, 0xd1}}+  gPlatformInitFvLocationGuid           =  {0xa564010a, 0x1d90, 0x4b1c, {0x8d, 0x10, 0xcb, 0xba, 0xff, 0xb2, 0x55, 0x42}}+  gTianoLogoGuid                        =  {0x7BB28B99, 0x61BB, 0x11D5, {0x9A, 0x5D, 0x00, 0x90, 0x27, 0x3F, 0xC1, 0x4D}}++[Protocols]+  gPlatformNvsAreaProtocolGuid          =  {0xc77ae556, 0x40a3, 0x41c0, {0xac, 0xe6, 0x71, 0x43, 0x8c, 0x60, 0xf8, 0x71}}++[Ppis]++[LibraryClasses]++[PcdsFixedAtBuild, PcdsPatchableInModule]++[PcdsFixedAtBuild]+  gBoardModuleTokenSpaceGuid.PcdLpcIoDecodeRange|0x0010|UINT16|0x10001004+  gBoardModuleTokenSpaceGuid.PchLpcIoEnableDecoding|0x3c03|UINT16|0x10001005++  gBoardModuleTokenSpaceGuid.PcdLpcSioIndexPort|0x4e|UINT16|0x90000018+  gBoardModuleTokenSpaceGuid.PcdLpcSioDataPort|0x4f|UINT16|0x9000001F++  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort|0x164E|UINT16|0x9000001C+  gBoardModuleTokenSpaceGuid.PcdSioBaseAddress|0x0680|UINT16|0x9000001D++  gBoardModuleTokenSpaceGuid.PcdDmiBaseAddress|0xFED18000|UINT64|0x90000003+  gBoardModuleTokenSpaceGuid.PcdDmiMmioSize|0x1000|UINT32|0x90000004++  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesBase|0x00000000|UINT32|0x20000040+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize|0x00000000|UINT32|0x20000041+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesOffset|0x00000000|UINT32|0x20000042+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalBase|0x00000000|UINT32|0x2000004C+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize|0x00000000|UINT32|0x2000004D+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalOffset|0x00000000|UINT32|0x2000004E+  gBoardModuleTokenSpaceGuid.PcdEpBaseAddress|0xFED19000|UINT64|0x90000005+  gBoardModuleTokenSpaceGuid.PcdEpMmioSize|0x1000|UINT32|0x90000006++[PcdsDynamic]+  # Board GPIO Table+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTable|0|UINT32|0x00000040+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTableSize|0|UINT16|0x00000041+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMem|0|UINT32|0x00000042+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMemSize|0|UINT16|0x00000043++  # SA Misc Configuration+  gBoardModuleTokenSpaceGuid.PcdSaMiscUserBd|0|UINT8|0x00000066+  gBoardModuleTokenSpaceGuid.PcdSaMiscMmioSizeAdjustment|0|UINT16|0x00000067++  # DRAM Configuration+  gBoardModuleTokenSpaceGuid.PcdMrcSpdData|0|UINT32|0x00000174+  gBoardModuleTokenSpaceGuid.PcdMrcSpdDataSize|0|UINT16|0x00000175++  # SPD Address Table+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable0|0|UINT8|0x00000099+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable1|0|UINT8|0x0000009A+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable2|0|UINT8|0x0000009B+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable3|0|UINT8|0x0001009C++  # Root Port Clock Info+  gBoardModuleTokenSpaceGuid.PcdPcieClock0|0|UINT64|0x0000009E+  gBoardModuleTokenSpaceGuid.PcdPcieClock1|0|UINT64|0x0000009F+  gBoardModuleTokenSpaceGuid.PcdPcieClock2|0|UINT64|0x000000A0+  gBoardModuleTokenSpaceGuid.PcdPcieClock3|0|UINT64|0x000000A1+  gBoardModuleTokenSpaceGuid.PcdPcieClock4|0|UINT64|0x000000A2+  gBoardModuleTokenSpaceGuid.PcdPcieClock5|0|UINT64|0x000000A3+  gBoardModuleTokenSpaceGuid.PcdPcieClock6|0|UINT64|0x000000A4+  gBoardModuleTokenSpaceGuid.PcdPcieClock7|0|UINT64|0x000000A5+  gBoardModuleTokenSpaceGuid.PcdPcieClock8|0|UINT64|0x000000A6+  gBoardModuleTokenSpaceGuid.PcdPcieClock9|0|UINT64|0x000000A7+  gBoardModuleTokenSpaceGuid.PcdPcieClock10|0|UINT64|0x000000A8+  gBoardModuleTokenSpaceGuid.PcdPcieClock11|0|UINT64|0x000000A9+  gBoardModuleTokenSpaceGuid.PcdPcieClock12|0|UINT64|0x000000AA+  gBoardModuleTokenSpaceGuid.PcdPcieClock13|0|UINT64|0x000000AB+  gBoardModuleTokenSpaceGuid.PcdPcieClock14|0|UINT64|0x000000AC+  gBoardModuleTokenSpaceGuid.PcdPcieClock15|0|UINT64|0x000000AD++  # USB 2.0 Port Over Current Pin+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort0|0xFF|UINT8|0x000000CF+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort1|0xFF|UINT8|0x000000D0+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort2|0xFF|UINT8|0x000000D1+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort3|0xFF|UINT8|0x000000D2+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort4|0xFF|UINT8|0x000000D3+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort5|0xFF|UINT8|0x000000D4+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort6|0xFF|UINT8|0x000000D5+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort7|0xFF|UINT8|0x000000D6+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort8|0xFF|UINT8|0x000000D7+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort9|0xFF|UINT8|0x000000D8+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort10|0xFF|UINT8|0x000000D9+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort11|0xFF|UINT8|0x000000DA+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort12|0xFF|UINT8|0x000000DB+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort13|0xFF|UINT8|0x000000DC+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort14|0xFF|UINT8|0x000000DD+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort15|0xFF|UINT8|0x000000DE++  # USB 3.0 Port Over Current Pin+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort0|0xFF|UINT8|0x000000DF+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort1|0xFF|UINT8|0x000000E0+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort2|0xFF|UINT8|0x000000E1+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort3|0xFF|UINT8|0x000000E2+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort4|0xFF|UINT8|0x000000E3+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort5|0xFF|UINT8|0x000000E4+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort6|0xFF|UINT8|0x000000E5+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort7|0xFF|UINT8|0x000000E6+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort8|0xFF|UINT8|0x000000E7+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort9|0xFF|UINT8|0x000000E8+  gBoardModuleTokenSpaceGuid.PcdCpuUsb30PortEnable|0|UINT8|0x00100032++  # CPU+  gBoardModuleTokenSpaceGuid.PcdCpuRatio|0x0|UINT8|0x00000200+  gBoardModuleTokenSpaceGuid.PcdBiosGuard|0x0|UINT8|0x00000201++  # ACPI+  gBoardModuleTokenSpaceGuid.PcdAcpiSleepState|1|UINT8|0x40000002+  gBoardModuleTokenSpaceGuid.PcdAcpiHibernate|1|UINT8|0x40000003+  gBoardModuleTokenSpaceGuid.PcdLowPowerS0Idle|0|UINT8|0x40000004+  gBoardModuleTokenSpaceGuid.PcdDisableActiveTripPoints|1|UINT8|0x4000000A+  gBoardModuleTokenSpaceGuid.PcdDisablePassiveTripPoints|0|UINT8|0x4000000B+  gBoardModuleTokenSpaceGuid.PcdDisableCriticalTripPoints|1|UINT8|0x4000000C+  gBoardModuleTokenSpaceGuid.PcdAcpiGnvsAddress|0|UINT64|0x40000013++  gBoardModuleTokenSpaceGuid.PcdGraphicsVbtGuid|{0x22, 0x61, 0xd4, 0x4a, 0xeb, 0xff, 0x52, 0x4a, 0xbf, 0xb0, 0x51, 0x8c, 0xfc, 0xa0, 0x2d, 0xb0}|VOID*|0x40000014++[PcdsDynamicEx]++[PcdsDynamic, PcdsDynamicEx]++[PcdsPatchableInModule]++[PcdsFeatureFlag]+  gBoardModuleTokenSpaceGuid.PcdIntelGopEnable      |TRUE|BOOLEAN|0xF0000062-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Patch V2 2/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add fdf and header file
  2021-02-09  8:45 ` [Patch V2 2/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add fdf and header file Heng Luo
@ 2021-02-09 23:42   ` Chaganty, Rangasai V
  0 siblings, 0 replies; 18+ messages in thread
From: Chaganty, Rangasai V @ 2021-02-09 23:42 UTC (permalink / raw)
  To: Luo, Heng, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>  

-----Original Message-----
From: Luo, Heng <heng.luo@intel.com> 
Sent: Tuesday, February 09, 2021 12:46 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [Patch V2 2/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add fdf and header file

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

Adds the following files:
  * TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf
  * TigerlakeURvp/Include/PeiPlatformHookLib.h

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf |  54 ++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/PeiPlatformHookLib.h    | 130 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 184 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf
new file mode 100644
index 0000000000..b21ae6401f
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf
@@ -0,0 +1,54 @@
+## @file

+#  FDF file of Platform.

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+#=================================================================================#

+# 12 M BIOS - for FSP wrapper

+#=================================================================================#

+DEFINE FLASH_BASE                                                   = 0xFF400000  #

+DEFINE FLASH_SIZE                                                   = 0x00C00000  #

+DEFINE FLASH_BLOCK_SIZE                                             = 0x00010000  #

+DEFINE FLASH_NUM_BLOCKS                                             = 0x000000C0  #

+#=================================================================================#

+

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageOffset             = 0x00000000  # Flash addr (0xFF400000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageSize               = 0x00060000  #

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageVariableOffset     = 0x00000000  # Flash addr (0xFF400000)

+SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize      = 0x0002E000  #

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingOffset   = 0x0002E000  # Flash addr (0xFF42E000)

+SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize    = 0x00002000  #

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareOffset     = 0x00030000  # Flash addr (0xFF430000)

+SET gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize      = 0x00030000  #

+

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedOffset            = 0x000E0000  # Flash addr (0xFF4E0000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize              = 0x001A0000  #

+SET gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalOffset               = 0x00280000  # Flash addr (0xFF680000)

+SET gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize                 = 0x00300000  #

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset              = 0x00580000  # Flash addr (0xFF980000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize                = 0x000A0000  #

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset            = 0x00620000  # Flash addr (0xFFA20000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize              = 0x001D0000  #

+

+## Firmware binaries FV absolute address requires 256kB alignment

+## Build script checks the requirement.

+SET gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesOffset       = 0x00800000  # Flash addr (0xFFC00000)

+SET gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize         = 0x00080000  # Keep 0x80000 or larger

+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset                    = 0x00880000  # Flash addr (0xFFC80000)

+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize                      = 0x00070000  # Keep 0x70000 or larger, change MicrocodeFv.fdf in case that this value change

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset          = 0x008F0000  # Flash addr (0xFFC00000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize            = 0x00080000  #

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset                = 0x00970000  # Flash addr (0xFFD70000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize                  = 0x000A0000  #

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset                = 0x00A10000  # Flash addr (0xFFE10000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize                  = 0x00110000  #

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset                = 0x00B20000  # Flash addr (0xFFF20000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                  = 0x00010000  #

+

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset            = 0x00B30000  # Flash addr (0xFFF30000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize              = 0x00020000  #

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset           = 0x00B50000  # Flash addr (0xFFF50000)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize             = 0x000B0000  #

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/PeiPlatformHookLib.h b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/PeiPlatformHookLib.h
new file mode 100644
index 0000000000..f8611764f5
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Include/PeiPlatformHookLib.h
@@ -0,0 +1,130 @@
+/** @file

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#ifndef _PEI_PLATFORM_HOOK_LIB_H_

+#define _PEI_PLATFORM_HOOK_LIB_H_

+

+#include <Library/PeiServicesLib.h>

+#include <Library/GpioLib.h>

+

+

+//EC Command to provide one byte of debug indication

+#define BSSB_DEBUG_INDICATION 0xAE

+/**

+  Configure EC for specific devices

+

+  @param[in] PchLan       - The PchLan of PCH_SETUP variable.

+  @param[in] BootMode     - The current boot mode.

+**/

+VOID

+EcInit (

+  IN UINT8                PchLan,

+  IN EFI_BOOT_MODE        BootMode

+  );

+

+/**

+  Checks if Premium PMIC present

+

+  @retval  TRUE  if present

+  @retval  FALSE it discrete/other PMIC

+**/

+BOOLEAN

+IsPremiumPmicPresent (

+  VOID

+  );

+

+/**

+  Pmic Programming to supprort LPAL Feature

+

+  @retval     NONE

+**/

+VOID

+PremiumPmicDisableSlpS0Voltage (

+  VOID

+  );

+

+/**

+Pmic Programming to supprort LPAL Feature

+  @retval     NONE

+**/

+VOID

+PremiumPmicEnableSlpS0Voltage(

+  VOID

+  );

+

+/**

+  Do platform specific programming pre-memory. For example, EC init, Chipset programming

+

+  @retval  Status

+**/

+EFI_STATUS

+PlatformSpecificInitPreMem (

+  VOID

+  );

+

+/**

+  Do platform specific programming post-memory.

+

+  @retval  Status

+**/

+EFI_STATUS

+PlatformSpecificInit (

+  VOID

+  );

+

+/**

+  Configure GPIO and SIO Before Memory is ready.

+

+  @retval  EFI_SUCCESS   Operation success.

+**/

+EFI_STATUS

+BoardInitPreMem (

+  VOID

+  );

+

+/**

+  Configure GPIO and SIO

+

+  @retval  EFI_SUCCESS   Operation success.

+**/

+EFI_STATUS

+BoardInit (

+  VOID

+  );

+

+/**

+Voltage Margining Routine

+

+@retval  EFI_SUCCESS   Operation success

+**/

+EFI_STATUS

+VoltageMarginingRoutine(

+  VOID

+  );

+

+/**

+  Detect recovery mode

+

+  @retval  EFI_SUCCESS       System in Recovery Mode

+  @retval  EFI_UNSUPPORTED   System doesn't support Recovery Mode

+  @retval  EFI_NOT_FOUND     System is not in Recovery Mode

+**/

+EFI_STATUS

+IsRecoveryMode (

+  VOID

+  );

+

+/**

+  Early board Configuration before Memory is ready.

+

+  @retval  EFI_SUCCESS  Operation success.

+**/

+EFI_STATUS

+BoardInitEarlyPreMem (

+  VOID

+  );

+#endif

+

-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances
  2021-02-09  8:45 ` [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances Heng Luo
@ 2021-02-09 23:45   ` Chaganty, Rangasai V
  0 siblings, 0 replies; 18+ messages in thread
From: Chaganty, Rangasai V @ 2021-02-09 23:45 UTC (permalink / raw)
  To: Luo, Heng, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com> 

-----Original Message-----
From: Luo, Heng <heng.luo@intel.com> 
Sent: Tuesday, February 09, 2021 12:46 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances

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

Adds the following library instances:
  * FspWrapper/Library/PeiFspPolicyInitLib
  * FspWrapper/Library/PeiSiDefaultPolicyInitLib
  * FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib
  * Library/BasePlatformHookLib
  * Library/SmmSpiFlashCommonLib
  * Policy/Library/DxeSiliconPolicyUpdateLib

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c                        |  79 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c                         |  51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c                          |  27 +++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c                        | 372 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c                           | 308 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h                           | 187 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf                         | 183 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c                         | 240 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c                   |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c               |  39 +++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf             |  38 ++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c   |  40 ++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf |  38 ++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c                                      | 391 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.inf                                    |  51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf                                  |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommon.c                                          | 210 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c                                    |  58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c                            | 168 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxePchPolicyInit.c                            |  61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.c                             |  61 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLate.c                  |  97 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf                 |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 23 files changed, 2846 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c
new file mode 100644
index 0000000000..1358d6a19b
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspCpuPolicyInitLib.c
@@ -0,0 +1,79 @@
+/** @file

+  Implementation of Fsp CPU Policy Initialization.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PeiFspPolicyInitLib.h>

+

+#include <Ppi/SiPolicy.h>

+#include <Ppi/SecPlatformInformation2.h>

+

+#include <CpuAccess.h>

+#include <Library/HobLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/ConfigBlockLib.h>

+#include <Library/MemoryAllocationLib.h>

+#include <Library/PeiServicesLib.h>

+#include <Library/PeiServicesTablePointerLib.h>

+#include <Library/PcdLib.h>

+#include <FspEas.h>

+#include <PolicyUpdateMacro.h>

+

+/**

+  Performs FSP CPU PEI Policy initialization.

+

+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspCpuPolicyInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  )

+{

+  CPU_CONFIG_LIB_PREMEM_CONFIG    *CpuConfigLibPreMemConfig;

+  CPU_SECURITY_PREMEM_CONFIG      *CpuSecurityPreMemConfig;

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  EFI_STATUS                      Status;

+  SI_PREMEM_POLICY_PPI            *SiPreMemPolicyPpi;

+  SiPreMemPolicyPpi = NULL;

+#endif

+

+  CpuConfigLibPreMemConfig = NULL;

+  CpuSecurityPreMemConfig = NULL;

+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Update SiCpuPolicy Pre-Mem Start\n"));

+

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  //

+  // Locate SiPreMemPolicyPpi

+  //

+  Status = PeiServicesLocatePpi (

+             &gSiPreMemPolicyPpiGuid,

+             0,

+             NULL,

+             (VOID **) &SiPreMemPolicyPpi

+             );

+  if (EFI_ERROR (Status)) {

+    return EFI_NOT_FOUND;

+  }

+  Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gCpuConfigLibPreMemConfigGuid, (VOID *) &CpuConfigLibPreMemConfig);

+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Update SiCpuPolicy Pre-Mem End\n"));

+  Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gCpuSecurityPreMemConfigGuid, (VOID *) &CpuSecurityPreMemConfig);

+  ASSERT_EFI_ERROR(Status);

+#endif

+  //

+  //  Cpu Config Lib policies

+  //

+  UPDATE_POLICY (FspmUpd->FspmConfig.CpuRatio, CpuConfigLibPreMemConfig->CpuRatio, 0);

+  DEBUG ((DEBUG_INFO, "BIOS Guard PCD and Policy are disabled\n"));

+  UPDATE_POLICY (FspmUpd->FspmConfig.BiosGuard, CpuSecurityPreMemConfig->BiosGuard, 0);

+  UPDATE_POLICY (FspmUpd->FspmConfig.PrmrrSize, CpuSecurityPreMemConfig->PrmrrSize, SIZE_1MB);

+  UPDATE_POLICY (FspmUpd->FspmConfig.EnableC6Dram, CpuSecurityPreMemConfig->EnableC6Dram, 1);

+

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c
new file mode 100644
index 0000000000..53b5ef43cd
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMePolicyInitLib.c
@@ -0,0 +1,51 @@
+/** @file

+  Implementation of Fsp Me Policy Initialization.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PeiFspPolicyInitLib.h>

+#include <Ppi/SiPolicy.h>

+#include <Library/ConfigBlockLib.h>

+

+/**

+  Performs FSP ME PEI Policy pre mem initialization.

+

+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspMePolicyInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  )

+{

+  DEBUG ((DEBUG_INFO, "PeiFspMePolicyInitPreMem\n"));

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Performs FSP ME PEI Policy initialization.

+

+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspMePolicyInit (

+  IN OUT FSPS_UPD    *FspsUpd

+  )

+{

+  DEBUG ((DEBUG_INFO, "PeiFspMePolicyInit \n"));

+

+  return EFI_SUCCESS;

+}

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c
new file mode 100644
index 0000000000..5a12e569d9
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspMiscUpdInitLib.c
@@ -0,0 +1,27 @@
+/** @file

+  Implementation of Fsp Misc UPD Initialization.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PeiFspPolicyInitLib.h>

+

+#include <Library/MemoryAllocationLib.h>

+#include <Library/HobLib.h>

+/**

+  Performs FSP Misc UPD initialization.

+

+  @param[in][out]  FspmUpd             Pointer to FSPM_UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspMiscUpdInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  )

+{

+  return EFI_SUCCESS;

+}

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c
new file mode 100644
index 0000000000..67b75d6faf
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPchPolicyInitLib.c
@@ -0,0 +1,372 @@
+/** @file

+  Implementation of Fsp PCH Policy Initialization.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PeiFspPolicyInitLib.h>

+

+#include <Ppi/SiPolicy.h>

+#include <Library/MemoryAllocationLib.h>

+#include <Library/PeiServicesLib.h>

+#include <Library/PchInfoLib.h>

+#include <Library/ConfigBlockLib.h>

+#include <Pins/GpioPinsVer2Lp.h>

+#include <TcssInfo.h>

+#include <TcssPeiConfig.h>

+#include <PolicyUpdateMacro.h>

+#include <PlatformBoardConfig.h>

+

+//

+// USB limits

+//

+#define PCH_MAX_USB2_PORTS                  16

+#define PCH_MAX_USB3_PORTS                  10

+

+//

+// TypeC port map GPIO pin

+//

+IOM_AUX_ORI_PAD_CONFIG mIomAuxNullTable[MAX_IOM_AUX_BIAS_COUNT] = {

+  // Pull UP GPIO Pin, Pull Down GPIO pin

+  {0,                  0}, // Port 0

+  {0,                  0}, // Port 1

+  {0,                  0}, // Port 2

+  {0,                  0}, // Port 3

+};

+

+

+VOID

+UpdatePcieClockInfo (

+  PCH_PCIE_RP_PREMEM_CONFIG  *PcieRpPreMemConfig,

+  IN FSPM_UPD                 *FspmUpd,

+  UINTN                      Index,

+  UINT64                     Data

+  )

+{

+  PCD64_BLOB Pcd64;

+

+  Pcd64.Blob = Data;

+  DEBUG ((DEBUG_INFO, "UpdatePcieClockInfo ClkIndex %x ClkUsage %x, Supported %x\n", Index, Pcd64.PcieClock.ClockUsage, Pcd64.PcieClock.ClkReqSupported));

+

+  UPDATE_POLICY (FspmUpd->FspmConfig.PcieClkSrcUsage[Index], PcieRpPreMemConfig->PcieClock[Index].Usage, (UINT8)Pcd64.PcieClock.ClockUsage);

+  UPDATE_POLICY (FspmUpd->FspmConfig.PcieClkSrcClkReq[Index], PcieRpPreMemConfig->PcieClock[Index].ClkReq, Pcd64.PcieClock.ClkReqSupported ? (UINT8)Index : 0xFF);

+}

+/**

+  Performs FSP PCH PEI Policy pre mem initialization.

+

+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspPchPolicyInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  )

+{

+  UINTN                        Index;

+  PCH_PCIE_RP_PREMEM_CONFIG    *PcieRpPreMemConfig;

+  HDAUDIO_PREMEM_CONFIG        *HdaPreMemConfig;

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  SI_PREMEM_POLICY_PPI         *SiPreMemPolicy;

+  EFI_STATUS                   Status;

+

+  //

+  // Locate PchPreMemPolicyPpi

+  //

+  SiPreMemPolicy = NULL;

+  PcieRpPreMemConfig = NULL;

+  HdaPreMemConfig = NULL;

+  Status = PeiServicesLocatePpi (

+             &gSiPreMemPolicyPpiGuid,

+             0,

+             NULL,

+             (VOID **) &SiPreMemPolicy

+             );

+  if (EFI_ERROR (Status)) {

+    return EFI_NOT_FOUND;

+  }

+

+  Status = GetConfigBlock ((VOID *) SiPreMemPolicy, &gPcieRpPreMemConfigGuid, (VOID *) &PcieRpPreMemConfig);

+  ASSERT_EFI_ERROR (Status);

+  Status = GetConfigBlock ((VOID *) SiPreMemPolicy, &gHdAudioPreMemConfigGuid, (VOID *) &HdaPreMemConfig);

+  ASSERT_EFI_ERROR (Status);

+#else

+  PcieRpPreMemConfig = NULL;

+  HdaPreMemConfig = NULL;

+#endif

+

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 0, PcdGet64  (PcdPcieClock0));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 1, PcdGet64  (PcdPcieClock1));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 2, PcdGet64  (PcdPcieClock2));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 3, PcdGet64  (PcdPcieClock3));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 4, PcdGet64  (PcdPcieClock4));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 5, PcdGet64  (PcdPcieClock5));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 6, PcdGet64  (PcdPcieClock6));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 7, PcdGet64  (PcdPcieClock7));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 8, PcdGet64  (PcdPcieClock8));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 9, PcdGet64  (PcdPcieClock9));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 10, PcdGet64 (PcdPcieClock10));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 11, PcdGet64 (PcdPcieClock11));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 12, PcdGet64 (PcdPcieClock12));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 13, PcdGet64 (PcdPcieClock13));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 14, PcdGet64 (PcdPcieClock14));

+  UpdatePcieClockInfo (PcieRpPreMemConfig, FspmUpd, 15, PcdGet64 (PcdPcieClock15));

+

+  //

+  // Update HDA policies

+  //

+  UPDATE_POLICY (FspmUpd->FspmConfig.PchHdaIDispLinkTmode, HdaPreMemConfig->IDispLinkTmode, 0);

+  UPDATE_POLICY (FspmUpd->FspmConfig.PchHdaSdiEnable[0], HdaPreMemConfig->AudioLinkHda.SdiEnable[0], FALSE);

+

+  for (Index = 0; Index < GetPchHdaMaxDmicLinkNum (); Index++) {

+    UPDATE_POLICY (FspmUpd->FspmConfig.PchHdaAudioLinkDmicClockSelect[Index], HdaPreMemConfig->AudioLinkDmic[Index].DmicClockSelect, 0);

+  }

+  DEBUG((DEBUG_INFO | DEBUG_INIT, "UpdatePeiPchPolicyPreMem\n"));

+  return EFI_SUCCESS;

+}

+

+/**

+  This function updates USB Policy per port OC Pin number

+

+  @param[in]  PchUsbConfig     Pointer to USB_CONFIG data buffer

+  @param[in]  PortIndex        USB Port index

+  @param[in]  Pin              OverCurrent pin number

+**/

+VOID

+UpdateUsb20OverCurrentPolicy (

+  IN OUT FSPS_UPD               *FspsUpd,

+  IN USB_CONFIG                 *UsbConfig,

+  IN UINT8                      PortIndex,

+  UINT8                         Pin

+)

+{

+  if (PortIndex < MAX_USB2_PORTS && ((Pin < USB_OC_MAX_PINS) || (Pin == USB_OC_SKIP))) {

+      UPDATE_POLICY (

+        FspsUpd->FspsConfig.Usb2OverCurrentPin[PortIndex],

+        UsbConfig->PortUsb20[PortIndex].OverCurrentPin,

+        Pin

+        );

+  } else {

+    if (PortIndex >= MAX_USB2_PORTS) {

+      DEBUG ((DEBUG_ERROR, "UpdateUsb20OverCurrentPolicy: USB2 port number %d is not a valid USB2 port number\n", PortIndex));

+    } else {

+      DEBUG ((DEBUG_ERROR, "UpdateUsb20OverCurrentPolicy: Invalid OverCurrent pin specified USB2 port %d\n", PortIndex));

+    }

+  }

+}

+

+/**

+  This function updates USB Policy per port OC Pin number

+

+  @param[in]  PchUsbConfig     Pointer to USB_CONFIG data buffer

+  @param[in]  PortIndex        USB Port index

+  @param[in]  Pin              OverCurrent pin number

+**/

+VOID

+UpdateUsb30OverCurrentPolicy (

+  IN OUT FSPS_UPD               *FspsUpd,

+  IN USB_CONFIG                 *UsbConfig,

+  IN UINT8                      PortIndex,

+  UINT8                         Pin

+)

+{

+  if (PortIndex < MAX_USB3_PORTS && ((Pin < USB_OC_MAX_PINS) || (Pin == USB_OC_SKIP))) {

+    UPDATE_POLICY (

+        FspsUpd->FspsConfig.Usb3OverCurrentPin[PortIndex],

+        UsbConfig->PortUsb30[PortIndex].OverCurrentPin,

+        Pin

+        );

+  } else {

+    if (PortIndex >= MAX_USB2_PORTS) {

+      DEBUG ((DEBUG_ERROR, "UpdateUsb30OverCurrentPolicy: USB3 port number %d is not a valid USB3 port number\n", PortIndex));

+    } else {

+      DEBUG ((DEBUG_ERROR, "UpdateUsb30OverCurrentPolicy: Invalid OverCurrent pin specified USB3 port %d\n", PortIndex));

+    }

+  }

+}

+

+/**

+  This function performs PCH USB Platform Policy initialization

+

+  @param[in] PchUsbConfig         Pointer to USB_CONFIG data buffer

+  @param[in] PchSetup             Pointer to PCH_SETUP data buffer

+**/

+VOID

+UpdatePchUsbConfig (

+  IN OUT FSPS_UPD    *FspsUpd,

+  IN OUT USB_CONFIG  *UsbConfig

+  )

+{

+  UINTN              PortIndex;

+

+  UPDATE_POLICY (FspsUpd->FspsConfig.PchUsbOverCurrentEnable, UsbConfig->OverCurrentEnable, TRUE);

+

+  for (PortIndex = 0; PortIndex < GetPchUsb2MaxPhysicalPortNum (); PortIndex++) {

+    UPDATE_POLICY (FspsUpd->FspsConfig.PortUsb20Enable[PortIndex], UsbConfig->PortUsb20[PortIndex].Enable, TRUE);

+  }

+  for (PortIndex = 0; PortIndex < GetPchXhciMaxUsb3PortNum (); PortIndex++) {

+    UPDATE_POLICY (FspsUpd->FspsConfig.PortUsb30Enable[PortIndex], UsbConfig->PortUsb30[PortIndex].Enable, TRUE);

+  }

+

+  UPDATE_POLICY (FspsUpd->FspsConfig.XdciEnable, UsbConfig->XdciConfig.Enable, FALSE);

+

+  //

+  // Platform Board programming per the layout of each port.

+  //

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 0, PcdGet8 (PcdUsb20OverCurrentPinPort0));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 1, PcdGet8 (PcdUsb20OverCurrentPinPort1));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 2, PcdGet8 (PcdUsb20OverCurrentPinPort2));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 3, PcdGet8 (PcdUsb20OverCurrentPinPort3));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 4, PcdGet8 (PcdUsb20OverCurrentPinPort4));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 5, PcdGet8 (PcdUsb20OverCurrentPinPort5));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 6, PcdGet8 (PcdUsb20OverCurrentPinPort6));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 7, PcdGet8 (PcdUsb20OverCurrentPinPort7));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 8, PcdGet8 (PcdUsb20OverCurrentPinPort8));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig, 9, PcdGet8 (PcdUsb20OverCurrentPinPort9));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,10, PcdGet8 (PcdUsb20OverCurrentPinPort10));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,11, PcdGet8 (PcdUsb20OverCurrentPinPort11));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,12, PcdGet8 (PcdUsb20OverCurrentPinPort12));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,13, PcdGet8 (PcdUsb20OverCurrentPinPort13));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,14, PcdGet8 (PcdUsb20OverCurrentPinPort14));

+  UpdateUsb20OverCurrentPolicy (FspsUpd, UsbConfig,15, PcdGet8 (PcdUsb20OverCurrentPinPort15));

+

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 0, PcdGet8 (PcdUsb30OverCurrentPinPort0));

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 1, PcdGet8 (PcdUsb30OverCurrentPinPort1));

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 2, PcdGet8 (PcdUsb30OverCurrentPinPort2));

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 3, PcdGet8 (PcdUsb30OverCurrentPinPort3));

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 4, PcdGet8 (PcdUsb30OverCurrentPinPort4));

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 5, PcdGet8 (PcdUsb30OverCurrentPinPort5));

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 6, PcdGet8 (PcdUsb30OverCurrentPinPort6));

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 7, PcdGet8 (PcdUsb30OverCurrentPinPort7));

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 8, PcdGet8 (PcdUsb30OverCurrentPinPort8));

+  UpdateUsb30OverCurrentPolicy (FspsUpd, UsbConfig, 9, PcdGet8 (PcdUsb30OverCurrentPinPort9));

+

+}

+

+/**

+  Update CNVi config

+

+  @param[in] SiPolicy             Pointer to SI_POLICY_PPI

+  @param[in] FspsUpd              Pointer to FspsUpd structure

+  @param[in] PchSetup             Pointer to PCH_SETUP buffer

+**/

+STATIC

+VOID

+UpdateCnviConfig (

+  IN OUT FSPS_UPD              *FspsUpd,

+  IN OUT CNVI_CONFIG           *CnviConfig

+  )

+{

+

+  UPDATE_POLICY (FspsUpd->FspsConfig.CnviMode,           CnviConfig->Mode,           CnviModeDisabled);

+  UPDATE_POLICY (FspsUpd->FspsConfig.CnviBtCore,         CnviConfig->BtCore,         FALSE);

+  UPDATE_POLICY (FspsUpd->FspsConfig.CnviBtAudioOffload, CnviConfig->BtAudioOffload, 0);

+}

+

+/**

+  Performs FSP PCH PEI Policy initialization.

+

+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspPchPolicyInit (

+  IN OUT FSPS_UPD    *FspsUpd

+  )

+{

+  UINTN                        Index;

+  SATA_CONFIG                  *SataConfig;

+  USB_CONFIG                   *UsbConfig;

+  TCSS_PEI_CONFIG              *TcssConfig;

+  SERIAL_IO_CONFIG             *SerialIoConfig;

+  CNVI_CONFIG                  *CnviConfig;

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  SI_POLICY_PPI                *SiPolicy;

+  EFI_STATUS                   Status;

+#endif

+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP UpdatePeiPchPolicy\n"));

+

+  SataConfig = NULL;

+  UsbConfig = NULL;

+  TcssConfig = NULL;

+  SerialIoConfig = NULL;

+  CnviConfig = NULL;

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  //

+  // Locate SiPolicyPpi

+  //

+  SiPolicy = NULL;

+  Status = PeiServicesLocatePpi (

+             &gSiPolicyPpiGuid,

+             0,

+             NULL,

+             (VOID **) &SiPolicy

+             );

+  if (EFI_ERROR (Status)) {

+    return EFI_NOT_FOUND;

+  }

+

+  Status = GetConfigBlock ((VOID *) SiPolicy, &gSataConfigGuid, (VOID *) &SataConfig);

+  ASSERT_EFI_ERROR (Status);

+  Status = GetConfigBlock ((VOID *) SiPolicy, &gUsbConfigGuid, (VOID *) &UsbConfig);

+  ASSERT_EFI_ERROR (Status);

+  Status = GetConfigBlock ((VOID *) SiPolicy, &gTcssPeiConfigGuid, (VOID *) &TcssConfig);

+  ASSERT_EFI_ERROR (Status);

+  Status = GetConfigBlock ((VOID *) SiPolicy, &gSerialIoConfigGuid, (VOID *) &SerialIoConfig);

+  ASSERT_EFI_ERROR (Status);

+  Status = GetConfigBlock ((VOID *) SiPolicy, &gCnviConfigGuid, (VOID *) &CnviConfig);

+  ASSERT_EFI_ERROR (Status);

+  if (EFI_ERROR (Status)) {

+    return Status;

+  }

+#endif

+

+  //

+  // Update Sata Policies

+  //

+  UPDATE_POLICY (FspsUpd->FspsConfig.SataEnable, SataConfig->Enable, TRUE);

+  UPDATE_POLICY (FspsUpd->FspsConfig.SataMode, SataConfig->SataMode, SataModeAhci);

+

+  for (Index = 0; Index < PCH_MAX_SATA_PORTS; Index++) {

+    UPDATE_POLICY (FspsUpd->FspsConfig.SataPortsEnable[Index], SataConfig->PortSettings[Index].Enable, TRUE);

+  }

+

+  //

+  // Update Pch Usb Config

+  //

+  UpdatePchUsbConfig (FspsUpd, UsbConfig);

+

+  //

+  // I2C

+  //

+  for (Index = 0; Index < 8; Index++) {

+    UPDATE_POLICY (FspsUpd->FspsConfig.SerialIoI2cMode[Index], SerialIoConfig->I2cDeviceConfig[Index].Mode, 0);

+    UPDATE_POLICY (FspsUpd->FspsConfig.PchSerialIoI2cPadsTermination[Index], SerialIoConfig->I2cDeviceConfig[Index].PadTermination, 0);

+  }

+

+  UPDATE_POLICY (FspsUpd->FspsConfig.PchSerialIoI2cSdaPinMux[4],  SerialIoConfig->I2cDeviceConfig[4].PinMux.Sda,  GPIO_VER2_LP_MUXING_SERIALIO_I2C4_SDA_GPP_H8);

+  UPDATE_POLICY (FspsUpd->FspsConfig.PchSerialIoI2cSclPinMux[4],  SerialIoConfig->I2cDeviceConfig[4].PinMux.Scl,  GPIO_VER2_LP_MUXING_SERIALIO_I2C4_SCL_GPP_H9);

+

+  //

+  // Type C

+  //

+  for (Index = 0; Index < MAX_IOM_AUX_BIAS_COUNT; Index++) {

+    UPDATE_POLICY (FspsUpd->FspsConfig.IomTypeCPortPadCfg[(Index * 2)],     TcssConfig->IomConfig.IomAuxPortPad[Index].GpioPullN, mIomAuxNullTable[Index].GpioPullN);

+    UPDATE_POLICY (FspsUpd->FspsConfig.IomTypeCPortPadCfg[(Index * 2) + 1], TcssConfig->IomConfig.IomAuxPortPad[Index].GpioPullP, mIomAuxNullTable[Index].GpioPullP);

+  }

+

+  //

+  // Cnvi

+  //

+  UpdateCnviConfig (FspsUpd, CnviConfig);

+

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c
new file mode 100644
index 0000000000..fc523e93d1
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.c
@@ -0,0 +1,308 @@
+/** @file

+  Instance of Fsp Policy Initialization Library.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PeiFspPolicyInitLib.h>

+#include <Library/FspWrapperApiLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/MemoryAllocationLib.h>

+#include <Ppi/FspmArchConfigPpi.h>

+

+VOID

+EFIAPI

+FspPolicyInitPreMem(

+  IN FSPM_UPD           *FspmUpdDataPtr

+);

+

+VOID *

+EFIAPI

+SiliconPolicyInitPreMem(

+  IN OUT VOID    *FspmUpd

+)

+{

+  DEBUG ((DEBUG_INFO, "FspmUpd - 0x%x\n", FspmUpd));

+  FspPolicyInitPreMem ((FSPM_UPD *) FspmUpd);

+  return FspmUpd;

+}

+

+/**

+  SiPreMemInstallPolicyReadyPpi installs SiPreMemPolicyReadyPpi.

+  While installed, RC assumes the Policy is ready and finalized. So please update and override

+  any setting before calling this function.

+

+  @retval EFI_SUCCESS            The policy is installed.

+  @retval EFI_OUT_OF_RESOURCES   Insufficient resources to create buffer

+**/

+EFI_STATUS

+EFIAPI

+SiPreMemInstallPolicyReadyPpi (

+  VOID

+  )

+{

+  EFI_STATUS             Status;

+  EFI_PEI_PPI_DESCRIPTOR *SiPolicyReadyPreMemPpiDesc;

+

+  SiPolicyReadyPreMemPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR));

+  if (SiPolicyReadyPreMemPpiDesc == NULL) {

+    ASSERT (FALSE);

+    return EFI_OUT_OF_RESOURCES;

+  }

+

+  SiPolicyReadyPreMemPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;

+  SiPolicyReadyPreMemPpiDesc->Guid  = &gSiPreMemPolicyReadyPpiGuid;

+  SiPolicyReadyPreMemPpiDesc->Ppi   = NULL;

+

+  //

+  // Install PreMem Silicon Policy Ready PPI

+  //

+  Status = PeiServicesInstallPpi (SiPolicyReadyPreMemPpiDesc);

+  ASSERT_EFI_ERROR (Status);

+  return Status;

+}

+

+RETURN_STATUS

+EFIAPI

+SiliconPolicyDonePreMem(

+  IN VOID *FspmUpd

+)

+{

+  EFI_STATUS                   Status;

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  FSPM_ARCH_CONFIG_PPI                  *FspmArchConfigPpi;

+  EFI_PEI_PPI_DESCRIPTOR                *FspmArchConfigPpiDesc;

+

+  FspmArchConfigPpi = (FSPM_ARCH_CONFIG_PPI *) AllocateZeroPool (sizeof (FSPM_ARCH_CONFIG_PPI));

+  if (FspmArchConfigPpi == NULL) {

+    ASSERT (FALSE);

+    return EFI_OUT_OF_RESOURCES;

+  }

+  FspmArchConfigPpi->Revision            = 1;

+  FspmArchConfigPpi->NvsBufferPtr        = NULL;

+  FspmArchConfigPpi->BootLoaderTolumSize = 0;

+

+  FspmArchConfigPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR));

+  if (FspmArchConfigPpiDesc == NULL) {

+    ASSERT (FALSE);

+    return EFI_OUT_OF_RESOURCES;

+  }

+  FspmArchConfigPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;

+  FspmArchConfigPpiDesc->Guid  = &gFspmArchConfigPpiGuid;

+  FspmArchConfigPpiDesc->Ppi   = FspmArchConfigPpi;

+  //

+  // Install FSP-M Arch Config PPI

+  //

+  Status = PeiServicesInstallPpi (FspmArchConfigPpiDesc);

+  ASSERT_EFI_ERROR (Status);

+#endif

+

+  //

+  // Install Policy Ready PPI

+  // While installed, RC assumes the Policy is ready and finalized. So please

+  // update and override any setting before calling this function.

+  //

+  Status = SiPreMemInstallPolicyReadyPpi ();

+  ASSERT_EFI_ERROR (Status);

+

+  DEBUG ((DEBUG_INFO, "Silicon PEI Policy Initialization Done in Pre-Memory\n"));

+

+  return Status;

+}

+

+/**

+  Performs FSP PEI Policy Pre-memory initialization.

+

+  @param[in] FspmUpdDataPtr       Pointer to FSPM UPD data.

+**/

+VOID

+EFIAPI

+FspPolicyInitPreMem (

+  IN FSPM_UPD           *FspmUpdDataPtr

+  )

+{

+  EFI_STATUS            Status;

+

+  //

+  // PCH Pei Fsp Policy Initialization

+  //

+  Status = PeiFspPchPolicyInitPreMem (FspmUpdDataPtr);

+  if (EFI_ERROR (Status)) {

+    DEBUG ((DEBUG_ERROR, "ERROR - PCH Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));

+  }

+

+  //

+  // Cpu Pei Fsp Policy Initialization

+  //

+  Status = PeiFspCpuPolicyInitPreMem (FspmUpdDataPtr);

+  if (EFI_ERROR (Status)) {

+    DEBUG ((DEBUG_ERROR, "ERROR - CPU Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));

+  }

+

+  //

+  // Security Pei Fsp Policy Initialization

+  //

+  Status = PeiFspSecurityPolicyInitPreMem (FspmUpdDataPtr);

+  if (EFI_ERROR (Status)) {

+    DEBUG ((DEBUG_ERROR, "ERROR - Security Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));

+  }

+

+  //

+  // ME Pei Fsp Policy Initialization

+  //

+  Status = PeiFspMePolicyInitPreMem (FspmUpdDataPtr);

+  if (EFI_ERROR (Status)) {

+    DEBUG ((DEBUG_ERROR, "ERROR - ME Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));

+  }

+

+  //

+  // SystemAgent Pei Fsp Policy Initialization

+  //

+  Status = PeiFspSaPolicyInitPreMem (FspmUpdDataPtr);

+  if (EFI_ERROR (Status)) {

+    DEBUG ((DEBUG_ERROR, "ERROR - SystemAgent Pei Fsp Policy in Pre-Memory Initialization fail, Status = %r\n", Status));

+  }

+

+  //

+  // Other Upd Initialization

+  //

+  Status = PeiFspMiscUpdInitPreMem (FspmUpdDataPtr);

+

+}

+

+/**

+  Performs FSP PEI Policy initialization.

+

+  @param[in][out] FspsUpd  Pointer UPD data region

+

+**/

+VOID

+EFIAPI

+FspPolicyInit (

+  IN OUT FSPS_UPD    *FspsUpd

+  )

+{

+  EFI_STATUS            Status;

+

+  //

+  // PCH Pei Fsp Policy Initialization

+  //

+  Status = PeiFspPchPolicyInit (FspsUpd);

+  if (EFI_ERROR (Status)) {

+    DEBUG ((DEBUG_ERROR, "ERROR - PCH Pei Fsp Policy iInitialization fail, Status = %r\n", Status));

+  }

+

+  //

+  // ME Pei Fsp Policy Initialization

+  //

+  Status = PeiFspMePolicyInit (FspsUpd);

+  if (EFI_ERROR (Status)) {

+    DEBUG ((DEBUG_ERROR, "ERROR - ME Pei Fsp Policy Initialization fail, Status = %r\n", Status));

+  }

+

+  //

+  // SystemAgent Pei Fsp Policy Initialization

+  //

+  Status = PeiFspSaPolicyInit (FspsUpd);

+  if (EFI_ERROR (Status)) {

+    DEBUG ((DEBUG_ERROR, "ERROR - SystemAgent Pei Fsp Policy Initialization fail, Status = %r\n", Status));

+  }

+

+  //

+  // Security Pei Fsp Policy Initialization

+  //

+  Status = PeiFspSecurityPolicyInit(FspsUpd);

+  if (EFI_ERROR(Status)) {

+    DEBUG((DEBUG_ERROR, "ERROR - Security Pei Fsp Policy Initialization fail, Status = %r\n", Status));

+  }

+

+}

+

+/**

+Performs silicon post-mem policy initialization.

+

+The meaning of Policy is defined by silicon code.

+It could be the raw data, a handle, a PPI, etc.

+

+The returned data must be used as input data for SiliconPolicyDonePostMem(),

+and SiliconPolicyUpdateLib.SiliconPolicyUpdatePostMem().

+

+1) In FSP path, the input Policy should be FspsUpd.

+Value of FspsUpd has been initialized by FSP binary default value.

+Only a subset of FspsUpd needs to be updated for different silicon sku.

+The return data is same FspsUpd.

+

+2) In non-FSP path, the input policy could be NULL.

+The return data is the initialized policy.

+

+@param[in, out] Policy       Pointer to policy.

+

+@return the initialized policy.

+**/

+VOID *

+EFIAPI

+SiliconPolicyInitPostMem(

+  IN OUT VOID    *FspsUpd

+)

+{

+  DEBUG ((DEBUG_INFO, "FspsUpd - 0x%x\n", FspsUpd));

+  FspPolicyInit ((FSPS_UPD *) FspsUpd);

+  return FspsUpd;

+}

+

+/**

+  SiInstallPolicyReadyPpi installs SiPolicyReadyPpi.

+  While installed, RC assumes the Policy is ready and finalized. So please update and override

+  any setting before calling this function.

+

+  @retval EFI_SUCCESS            The policy is installed.

+  @retval EFI_OUT_OF_RESOURCES   Insufficient resources to create buffer

+**/

+EFI_STATUS

+EFIAPI

+SiInstallPolicyReadyPpi (

+  VOID

+  )

+{

+  EFI_STATUS             Status;

+  EFI_PEI_PPI_DESCRIPTOR *SiPolicyReadyPpiDesc;

+

+  SiPolicyReadyPpiDesc = (EFI_PEI_PPI_DESCRIPTOR *) AllocateZeroPool (sizeof (EFI_PEI_PPI_DESCRIPTOR));

+  if (SiPolicyReadyPpiDesc == NULL) {

+    ASSERT (FALSE);

+    return EFI_OUT_OF_RESOURCES;

+  }

+

+  SiPolicyReadyPpiDesc->Flags = EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST;

+  SiPolicyReadyPpiDesc->Guid  = &gSiPolicyReadyPpiGuid;

+  SiPolicyReadyPpiDesc->Ppi   = NULL;

+

+  //

+  // Install Silicon Policy Ready PPI

+  //

+  Status = PeiServicesInstallPpi (SiPolicyReadyPpiDesc);

+  ASSERT_EFI_ERROR (Status);

+  return Status;

+}

+

+/*

+The silicon post-mem policy is finalized.

+Silicon code can do initialization based upon the policy data.

+

+The input Policy must be returned by SiliconPolicyInitPostMem().

+

+@param[in] Policy       Pointer to policy.

+

+@retval EFI_SUCCESS The policy is handled consumed by silicon code.

+*/

+EFI_STATUS

+EFIAPI

+SiliconPolicyDonePostMem(

+  IN OUT VOID    *FspsUpd

+)

+{

+  SiInstallPolicyReadyPpi();

+  return EFI_SUCCESS;

+}

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h
new file mode 100644
index 0000000000..cce0de0089
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.h
@@ -0,0 +1,187 @@
+/** @file

+  Internal header file for Fsp Policy Initialization Library.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#ifndef _PEI_FSP_POLICY_INIT_LIB_H_

+#define _PEI_FSP_POLICY_INIT_LIB_H_

+

+#include <PiPei.h>

+

+#include <Library/DebugLib.h>

+#include <Library/PeiServicesLib.h>

+

+#include <FspEas.h>

+#include <FspmUpd.h>

+#include <FspsUpd.h>

+

+/**

+  Performs FSP PCH PEI Policy pre mem initialization.

+

+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspPchPolicyInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  );

+

+/**

+  Performs FSP PCH PEI Policy initialization.

+

+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspPchPolicyInit (

+  IN OUT FSPS_UPD     *FspsUpd

+  );

+

+/**

+  Performs FSP CPU PEI Policy initialization.

+

+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspCpuPolicyInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  );

+

+/**

+Performs FSP Security PEI Policy initialization.

+

+@param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+@retval          EFI_SUCCESS         FSP UPD Data is updated.

+@retval          EFI_NOT_FOUND       Fail to locate required PPI.

+@retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspSecurityPolicyInitPreMem(

+IN OUT FSPM_UPD    *FspmUpd

+);

+

+/**

+  Performs FSP ME PEI Policy pre mem initialization.

+

+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspMePolicyInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  );

+

+/**

+  Performs FSP ME PEI Policy initialization.

+

+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspMePolicyInit (

+  IN OUT FSPS_UPD     *FspsUpd

+  );

+

+/**

+  Performs FSP SA PEI Policy initialization in pre-memory.

+

+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspSaPolicyInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  );

+

+/**

+  Performs FSP SA PEI Policy initialization.

+

+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspSaPolicyInit (

+  IN OUT FSPS_UPD    *FspsUpd

+  );

+

+

+/**

+Performs FSP Security PEI Policy post memory initialization.

+

+@param[in][out]  FspsUpd             Pointer to FSP UPD Data.

+

+@retval          EFI_SUCCESS         FSP UPD Data is updated.

+@retval          EFI_NOT_FOUND       Fail to locate required PPI.

+@retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspSecurityPolicyInit(

+IN OUT FSPS_UPD    *FspsUpd

+);

+

+/**

+  PeiGetSectionFromFv finds the file in FV and gets file Address and Size

+

+  @param[in] NameGuid              - File GUID

+  @param[out] Address              - Pointer to the File Address

+  @param[out] Size                 - Pointer to File Size

+

+  @retval EFI_SUCCESS                Successfull in reading the section from FV

+**/

+EFI_STATUS

+EFIAPI

+PeiGetSectionFromFv (

+  IN CONST  EFI_GUID        NameGuid,

+  OUT VOID                  **Address,

+  OUT UINT32               *Size

+  );

+

+/**

+  Performs FSP Misc UPD initialization.

+

+  @param[in][out]  FspmUpd             Pointer to FSPM_UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspMiscUpdInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  );

+

+#endif // _PEI_FSP_POLICY_INIT_LIB_H_

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
new file mode 100644
index 0000000000..9d85d855f5
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
@@ -0,0 +1,183 @@
+## @file

+# Library functions for Fsp Policy Initialization Library.

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+################################################################################

+#

+# Defines Section - statements that will be processed to create a Makefile.

+#

+################################################################################

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = PeiFspPolicyInitLib

+  FILE_GUID                      = 2CB87D67-D1A4-4CD3-8CD7-91A1FA1DF6E0

+  MODULE_TYPE                    = BASE

+  VERSION_STRING                 = 1.0

+  LIBRARY_CLASS                  = SiliconPolicyInitLib

+

+#

+# The following information is for reference only and not required by the build tools.

+#

+#  VALID_ARCHITECTURES           = IA32

+#

+

+################################################################################

+#

+# Sources Section - list of files that are required for the build to succeed.

+#

+################################################################################

+

+[Sources]

+  PeiFspPolicyInitLib.c

+  PeiFspPchPolicyInitLib.c

+  PeiFspCpuPolicyInitLib.c

+  PeiFspMePolicyInitLib.c

+  PeiFspSaPolicyInitLib.c

+  PeiFspSecurityPolicyInitLib.c

+  PeiFspMiscUpdInitLib.c

+

+################################################################################

+#

+# Package Dependency Section - list of Package files that are required for

+#                              this module.

+#

+################################################################################

+

+[Packages]

+  MdePkg/MdePkg.dec

+  MdeModulePkg/MdeModulePkg.dec

+  IntelFsp2Pkg/IntelFsp2Pkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+  TigerLakeFspBinPkg/TigerLakeFspBinPkg.dec

+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec

+  UefiCpuPkg/UefiCpuPkg.dec

+  IntelSiliconPkg/IntelSiliconPkg.dec

+  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec

+  MinPlatformPkg/MinPlatformPkg.dec

+

+[LibraryClasses]

+  BaseMemoryLib

+  DebugLib

+  IoLib

+  PeiServicesLib

+  ConfigBlockLib

+  PcdLib

+  MemoryAllocationLib

+  PchInfoLib

+  FspWrapperApiLib

+  PeiLib

+  BmpSupportLib

+

+[Pcd]

+  gSiPkgTokenSpaceGuid.PcdTsegSize                                  ## CONSUMES

+

+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase                   ## CONSUMES

+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize                   ## CONSUMES

+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize                ## CONSUMES

+  gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize              ## CONSUMES

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress             ## CONSUMES

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress                ## CONSUMES

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress             ## CONSUMES

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress                ## CONSUMES

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection               ## CONSUMES

+  # SA Misc Config

+  gBoardModuleTokenSpaceGuid.PcdSaMiscUserBd                        ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdSaMiscMmioSizeAdjustment            ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdData                          ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdDataSize                      ## CONSUMES

+

+  # SPD Address Table

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable0            ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable1            ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable2            ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable3            ## CONSUMES

+

+  # PCIe Clock Info

+  gBoardModuleTokenSpaceGuid.PcdPcieClock0                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock1                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock2                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock3                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock4                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock5                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock6                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock7                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock8                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock9                     ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock10                    ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock11                    ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock12                    ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock13                    ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock14                    ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdPcieClock15                    ## CONSUMES

+

+  # USB 2.0 Port Over Current Pin

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort0       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort1       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort2       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort3       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort4       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort5       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort6       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort7       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort8       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort9       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort10      ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort11      ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort12      ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort13      ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort14      ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb20OverCurrentPinPort15      ## CONSUMES

+

+  # USB 3.0 Port Over Current Pin

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort0       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort1       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort2       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort3       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort4       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort5       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort6       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort7       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort8       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdUsb30OverCurrentPinPort9       ## CONSUMES

+

+  gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid   ## CONSUMES

+

+  gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr    ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateSmmDataPtr ## CONSUMES

+

+[Ppis]

+  gSiPolicyPpiGuid                        ## CONSUMES

+  gSiPreMemPolicyPpiGuid                  ## CONSUMES

+  gSiPreMemPolicyReadyPpiGuid             ## CONSUMES

+  gSiPolicyReadyPpiGuid                   ## CONSUMES

+  gFspmArchConfigPpiGuid                  ## SOMETIMES_PRODUCES

+

+[Guids]

+  gPcieRpPreMemConfigGuid                 ## CONSUMES

+  gPchGeneralPreMemConfigGuid             ## CONSUMES

+  gPcieRpPreMemConfigGuid                 ## CONSUMES

+  gSataConfigGuid                         ## CONSUMES

+  gHdAudioConfigGuid                      ## CONSUMES

+  gSataConfigGuid                         ## CONSUMES

+  gUsbConfigGuid                          ## CONSUMES

+  gSaMiscPeiPreMemConfigGuid              ## PRODUCES

+  gHostBridgePeiPreMemConfigGuid          ## CONSUMES

+  gSaMiscPeiConfigGuid                    ## PRODUCES

+  gMemoryConfigNoCrcGuid                  ## CONSUMES

+  gSaMiscPeiConfigGuid                    ## CONSUMES

+  gGraphicsPeiConfigGuid                  ## CONSUMES

+  gMePeiPreMemConfigGuid                  ## CONSUMES

+  gMePeiConfigGuid                        ## CONSUMES

+  gPchGeneralConfigGuid                   ## CONSUMES

+  gCpuConfigGuid                          ## CONSUMES

+  gCpuConfigLibPreMemConfigGuid           ## CONSUMES

+  gTcssPeiConfigGuid                      ## CONSUMES

+  gSerialIoConfigGuid                     ## CONSUMES

+  gCpuSecurityPreMemConfigGuid            ## CONSUMES

+  gTianoLogoGuid                          ## CONSUMES

+  gCnviConfigGuid                         ## CONSUMES

+  gHdAudioPreMemConfigGuid                ## CONSUMES

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c
new file mode 100644
index 0000000000..8f426ddb8d
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSaPolicyInitLib.c
@@ -0,0 +1,240 @@
+/** @file

+  Implementation of Fsp SA Policy Initialization.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PeiFspPolicyInitLib.h>

+

+#include <Ppi/SiPolicy.h>

+#include <MemoryConfig.h>

+#include <Library/IoLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/ConfigBlockLib.h>

+#include <Library/PcdLib.h>

+#include <Library/PeiLib.h>

+#include <IndustryStandard/Pci.h>

+#include <IndustryStandard/Bmp.h>

+#include <Ppi/FirmwareVolume.h>

+#include <Pi/PiFirmwareFile.h>

+#include <Pi/PiPeiCis.h>

+#include <Core/Pei/PeiMain.h>

+#include <Library/ConfigBlockLib.h>

+#include <PolicyUpdateMacro.h>

+#include <Pi/PiFirmwareFile.h>

+#include <Protocol/GraphicsOutput.h>

+#include <Library/BmpSupportLib.h>

+

+/**

+  Performs FSP SA PEI Policy initialization in pre-memory.

+

+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspSaPolicyInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  )

+{

+  SA_MISC_PEI_PREMEM_CONFIG   *MiscPeiPreMemConfig;

+  HOST_BRIDGE_PREMEM_CONFIG   *HostBridgePreMemConfig;

+  MEMORY_CONFIG_NO_CRC        *MemConfigNoCrc;

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  EFI_STATUS                  Status;

+  SI_PREMEM_POLICY_PPI        *SiPreMemPolicyPpi;

+#endif

+

+  DEBUG((DEBUG_INFO, "\nUpdating SA Policy in Pre Mem\n"));

+  MiscPeiPreMemConfig = NULL;

+  HostBridgePreMemConfig = NULL;

+  MemConfigNoCrc      = NULL;

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  //

+  // Locate SiPreMemPolicyPpi

+  //

+  SiPreMemPolicyPpi   = NULL;

+  Status = PeiServicesLocatePpi(

+             &gSiPreMemPolicyPpiGuid,

+             0,

+             NULL,

+             (VOID **) &SiPreMemPolicyPpi

+             );

+  ASSERT_EFI_ERROR (Status);

+  if ((Status == EFI_SUCCESS) && (SiPreMemPolicyPpi != NULL)) {

+    Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gSaMiscPeiPreMemConfigGuid, (VOID *) &MiscPeiPreMemConfig);

+    ASSERT_EFI_ERROR (Status);

+    Status = GetConfigBlock((VOID *) SiPreMemPolicyPpi, &gHostBridgePeiPreMemConfigGuid, (VOID *) &HostBridgePreMemConfig);

+    ASSERT_EFI_ERROR(Status);

+    Status = GetConfigBlock ((VOID *) SiPreMemPolicyPpi, &gMemoryConfigNoCrcGuid, (VOID *) &MemConfigNoCrc);

+    ASSERT_EFI_ERROR (Status);

+    ZeroMem ((VOID *) MemConfigNoCrc->SpdData->SpdData, sizeof (SPD_DATA_BUFFER));

+  }

+#endif

+

+  UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[0], MiscPeiPreMemConfig->SpdAddressTable[0], PcdGet8 (PcdMrcSpdAddressTable0));

+  UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[1], MiscPeiPreMemConfig->SpdAddressTable[1], PcdGet8 (PcdMrcSpdAddressTable1));

+  UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[2], MiscPeiPreMemConfig->SpdAddressTable[2], PcdGet8 (PcdMrcSpdAddressTable2));

+  UPDATE_POLICY (FspmUpd->FspmConfig.SpdAddressTable[3], MiscPeiPreMemConfig->SpdAddressTable[3], PcdGet8 (PcdMrcSpdAddressTable3));

+

+  if (PcdGet32 (PcdMrcSpdData)) {

+    DEBUG((DEBUG_INFO, "PcdMrcSpdData != NULL, MemConfigNoCrc->SpdData\n"));

+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr000, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][0][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));

+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr010, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][1][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));

+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr020, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][2][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));

+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr030, (VOID *)MemConfigNoCrc->SpdData->SpdData[0][3][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));

+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr100, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][0][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));

+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr110, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][1][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));

+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr120, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][2][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));

+    COPY_POLICY ((VOID *)((FSPM_UPD *) FspmUpd)->FspmConfig.MemorySpdPtr130, (VOID *)MemConfigNoCrc->SpdData->SpdData[1][3][0], (VOID *)(UINTN)PcdGet32 (PcdMrcSpdData), PcdGet16(PcdMrcSpdDataSize));

+  }

+  UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmConfig.TsegSize,           MiscPeiPreMemConfig->TsegSize,           PcdGet32 (PcdTsegSize));

+  UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmConfig.UserBd,             MiscPeiPreMemConfig->UserBd,             PcdGet8 (PcdSaMiscUserBd));

+  UPDATE_POLICY (((FSPM_UPD *) FspmUpd)->FspmConfig.MmioSizeAdjustment, HostBridgePreMemConfig->MmioSizeAdjustment, PcdGet16 (PcdSaMiscMmioSizeAdjustment));

+

+  return EFI_SUCCESS;

+}

+

+

+/**

+  Performs FSP SA PEI Policy initialization.

+

+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+UpdateGraphics(

+    IN OUT FSPS_UPD *FspsUpd,

+    GRAPHICS_PEI_CONFIG *GtConfig

+  )

+{

+  EFI_STATUS                      Status;

+  VOID                            *Buffer;

+  UINT32                          Size;

+  EFI_GRAPHICS_OUTPUT_BLT_PIXEL   *Blt;

+  UINTN                           BltSize;

+  UINTN                           Height;

+  UINTN                           Width;

+

+  DEBUG((DEBUG_INFO, "\nUpdating SA Policy in Post Mem\n"));

+  UPDATE_POLICY (FspsUpd->FspsConfig.PeiGraphicsPeimInit, GtConfig->PeiGraphicsPeimInit, 1);

+

+  Size = 0;

+  Buffer = NULL;

+  PeiGetSectionFromAnyFv(PcdGetPtr(PcdIntelGraphicsVbtFileGuid), EFI_SECTION_RAW, 0, &Buffer, &Size);

+  DEBUG((DEBUG_INFO, "Vbt Pointer from PeiGetSectionFromAnyFv is 0x%x\n", Buffer));

+  DEBUG((DEBUG_INFO, "Vbt Size from PeiGetSectionFromAnyFv is 0x%x\n", Size));

+#if FixedPcdGet8(PcdFspModeSelection) == 1

+  FspsUpd->FspsConfig.GraphicsConfigPtr = (UINT32)(UINTN)Buffer;

+#else

+  GtConfig->GraphicsConfigPtr = Buffer;

+#endif

+

+  Size = 0;

+  Buffer = NULL;

+  PeiGetSectionFromAnyFv(&gTianoLogoGuid, EFI_SECTION_RAW, 0, &Buffer, &Size);

+  DEBUG((DEBUG_INFO, "LogoPtr from PeiGetSectionFromAnyFv is 0x%x\n", Buffer));

+  DEBUG((DEBUG_INFO, "LogoSize from PeiGetSectionFromAnyFv is 0x%x\n", Size));

+#if FixedPcdGet8(PcdFspModeSelection) == 1

+  FspsUpd->FspsConfig.LogoPtr = (UINT32)Buffer;

+  FspsUpd->FspsConfig.LogoSize = Size;

+#else

+  GtConfig->LogoPtr = Buffer;

+  GtConfig->LogoSize = Size;

+#endif

+

+  if (Buffer != NULL) {

+    Blt = NULL;

+    Status = TranslateBmpToGopBlt (

+              Buffer,

+              Size,

+              &Blt,

+              &BltSize,

+              &Height,

+              &Width

+              );

+    if (EFI_ERROR (Status)) {

+        DEBUG ((DEBUG_ERROR, "TranslateBmpToGopBlt, Status = %r\n", Status));

+        ASSERT_EFI_ERROR (Status);

+        return Status;

+    }

+

+    UPDATE_POLICY(FspsUpd->FspsConfig.BltBufferSize,  GtConfig->BltBufferSize, BltSize);

+    UPDATE_POLICY(FspsUpd->FspsConfig.LogoPixelWidth,  GtConfig->LogoPixelWidth, Width);

+    UPDATE_POLICY(FspsUpd->FspsConfig.LogoPixelHeight,  GtConfig->LogoPixelHeight, Height);

+#if FixedPcdGet8(PcdFspModeSelection) == 1

+    FspsUpd->FspsConfig.BltBufferAddress  = (UINT32) Blt;

+#else

+    GtConfig->BltBufferAddress = (VOID *) Blt;

+#endif

+  }

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Performs FSP SA PEI Policy initialization.

+

+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspSaPolicyInit (

+  IN OUT FSPS_UPD    *FspsUpd

+  )

+{

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  EFI_STATUS                Status;

+  SI_POLICY_PPI             *SiPolicyPpi;

+#endif

+  SA_MISC_PEI_CONFIG        *MiscPeiConfig;

+  GRAPHICS_PEI_CONFIG       *GtConfig;

+

+  MiscPeiConfig = NULL;

+  GtConfig      = NULL;

+

+#if FixedPcdGet8(PcdFspModeSelection) == 0

+  //

+  // Locate SiPolicyPpi

+  //

+  SiPolicyPpi = NULL;

+  Status = PeiServicesLocatePpi(

+             &gSiPolicyPpiGuid,

+             0,

+             NULL,

+             (VOID **)&SiPolicyPpi

+             );

+  if ((Status == EFI_SUCCESS) && (SiPolicyPpi != NULL)) {

+    MiscPeiConfig = NULL;

+    Status = GetConfigBlock ((VOID *) SiPolicyPpi, &gSaMiscPeiConfigGuid, (VOID *) &MiscPeiConfig);

+    ASSERT_EFI_ERROR (Status);

+

+    GtConfig = NULL;

+    Status = GetConfigBlock ((VOID *) SiPolicyPpi, &gGraphicsPeiConfigGuid, (VOID *) &GtConfig);

+    ASSERT_EFI_ERROR (Status);

+

+  }

+#endif

+

+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Wrapper UpdatePeiSaPolicy\n"));

+

+  //

+  // Update UPD: VBT & LogoPtr

+  //

+  UpdateGraphics(FspsUpd, GtConfig);

+

+  return EFI_SUCCESS;

+}

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c
new file mode 100644
index 0000000000..91a60a6bd3
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspSecurityPolicyInitLib.c
@@ -0,0 +1,49 @@
+/** @file

+  Implementation of Fsp Security Policy Initialization.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PeiFspPolicyInitLib.h>

+#include <Library/PeiServicesLib.h>

+#include <Ppi/SiPolicy.h>

+

+/**

+  Performs FSP Security PEI Policy initialization.

+

+  @param[in][out]  FspmUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspSecurityPolicyInitPreMem (

+  IN OUT FSPM_UPD    *FspmUpd

+  )

+{

+  DEBUG ((DEBUG_INFO | DEBUG_INIT, "FSP Update SecurityPolicy Pre-Mem End\n"));

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Performs FSP Security PEI Policy post memory initialization.

+

+  @param[in][out]  FspsUpd             Pointer to FSP UPD Data.

+

+  @retval          EFI_SUCCESS         FSP UPD Data is updated.

+  @retval          EFI_NOT_FOUND       Fail to locate required PPI.

+  @retval          Other               FSP UPD Data update process fail.

+**/

+EFI_STATUS

+EFIAPI

+PeiFspSecurityPolicyInit (

+  IN OUT FSPS_UPD    *FspsUpd

+  )

+{

+  return EFI_SUCCESS;

+}

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c
new file mode 100644
index 0000000000..b864753258
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.c
@@ -0,0 +1,39 @@
+/** @file

+  Instance of Fsp Policy Initialization Library.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <Library/DebugLib.h>

+#include <Library/PeiServicesLib.h>

+#include <Ppi/PeiSiDefaultPolicy.h>

+

+EFI_STATUS

+EFIAPI

+PeiSiDefaultPolicyInitLibConstructor (

+  VOID

+  )

+{

+  EFI_STATUS Status;

+  PEI_SI_DEFAULT_POLICY_INIT_PPI *PeiSiDefaultPolicyInitPpi;

+

+  //

+  // Locate Policy init PPI to install default silicon policy

+  //

+  Status = PeiServicesLocatePpi (

+              &gSiDefaultPolicyInitPpiGuid,

+              0,

+              NULL,

+              (VOID **) &PeiSiDefaultPolicyInitPpi

+              );

+  ASSERT_EFI_ERROR (Status);

+  if (PeiSiDefaultPolicyInitPpi == NULL) {

+    return Status;

+  }

+  Status = PeiSiDefaultPolicyInitPpi->PeiPolicyInit ();

+  ASSERT_EFI_ERROR (Status);

+

+  return Status;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf
new file mode 100644
index 0000000000..bcad97c267
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf
@@ -0,0 +1,38 @@
+## @file

+# Library functions for Fsp Policy Initialization Library.

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+################################################################################

+#

+# Defines Section - statements that will be processed to create a Makefile.

+#

+################################################################################

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = PeiSiDefaultPolicyInitLib

+  FILE_GUID                      = ADA1D87B-6891-453C-A0DB-92D4CFD46693

+  MODULE_TYPE                    = BASE

+  VERSION_STRING                 = 1.0

+  LIBRARY_CLASS                  = NULL

+  CONSTRUCTOR                    = PeiSiDefaultPolicyInitLibConstructor

+

+[Packages]

+  MdePkg/MdePkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+

+[Sources]

+  PeiSiDefaultPolicyInitLib.c

+

+[LibraryClasses]

+  PeiServicesLib

+  DebugLib

+

+[Ppis]

+  gSiDefaultPolicyInitPpiGuid             ## CONSUMES

+

+[Depex]

+  gSiDefaultPolicyInitPpiGuid

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c
new file mode 100644
index 0000000000..f0eb3f3f14
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.c
@@ -0,0 +1,40 @@
+/** @file

+  Instance of Fsp Policy Initialization Library.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <Library/DebugLib.h>

+#include <Library/PeiServicesLib.h>

+#include <Ppi/PeiPreMemSiDefaultPolicy.h>

+

+EFI_STATUS

+EFIAPI

+PeiSiPreMemDefaultPolicyInitLibConstructor (

+  VOID

+  )

+{

+  EFI_STATUS Status;

+  PEI_PREMEM_SI_DEFAULT_POLICY_INIT_PPI *PeiPreMemSiDefaultPolicyInitPpi;

+

+  //

+  // Locate Policy init PPI to install default silicon policy

+  //

+  Status = PeiServicesLocatePpi (

+              &gSiPreMemDefaultPolicyInitPpiGuid,

+              0,

+              NULL,

+              (VOID **) &PeiPreMemSiDefaultPolicyInitPpi

+              );

+  ASSERT_EFI_ERROR (Status);

+  if (PeiPreMemSiDefaultPolicyInitPpi == NULL) {

+    return Status;

+  }

+  DEBUG ((DEBUG_INFO, "PeiPreMemSiDefaultPolicyInitPpi->PeiPreMemPolicyInit ()\n", Status));

+  Status = PeiPreMemSiDefaultPolicyInitPpi->PeiPreMemPolicyInit ();

+  ASSERT_EFI_ERROR (Status);

+

+  return Status;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf
new file mode 100644
index 0000000000..c118d7fe2c
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf
@@ -0,0 +1,38 @@
+## @file

+# Library functions for Fsp Policy Initialization Library.

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+################################################################################

+#

+# Defines Section - statements that will be processed to create a Makefile.

+#

+################################################################################

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = PeiSiPreMemDefaultPolicyInitLib

+  FILE_GUID                      = F13311AD-9C5C-4212-AB02-9D0435B3FCF1

+  MODULE_TYPE                    = BASE

+  VERSION_STRING                 = 1.0

+  LIBRARY_CLASS                  = NULL

+  CONSTRUCTOR                    = PeiSiPreMemDefaultPolicyInitLibConstructor

+

+[Packages]

+  MdePkg/MdePkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+

+[Sources]

+  PeiSiPreMemDefaultPolicyInitLib.c

+

+[LibraryClasses]

+  PeiServicesLib

+  DebugLib

+

+[Ppis]

+  gSiPreMemDefaultPolicyInitPpiGuid       ## CONSUMES

+

+[Depex]

+  gSiPreMemDefaultPolicyInitPpiGuid

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c
new file mode 100644
index 0000000000..6209e50450
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.c
@@ -0,0 +1,391 @@
+/** @file

+  Platform Hook Library instances

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <Base.h>

+#include <Uefi/UefiBaseType.h>

+#include <Library/PlatformHookLib.h>

+#include <Library/BaseLib.h>

+#include <Library/IoLib.h>

+#include <Library/PciSegmentLib.h>

+#include <Library/PcdLib.h>

+#include <Library/MmPciLib.h>

+#include <Library/PchCycleDecodingLib.h>

+#include <Register/PchRegs.h>

+#include <Register/PchRegsLpc.h>

+#include <Library/SaPlatformLib.h>

+#include <Library/PchPciBdfLib.h>

+

+#define COM1_BASE                                 0x3f8

+#define COM2_BASE                                 0x2f8

+

+#define SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS   0x0690

+

+#define LPC_SIO_INDEX_DEFAULT_PORT_2              0x2E

+#define LPC_SIO_DATA_DEFAULT_PORT_2               0x2F

+#define LPC_SIO_GPIO_REGISTER_ADDRESS_2           0x0A20

+

+#define LEGACY_DAUGHTER_CARD_SIO_INDEX_PORT       0x2E

+#define LEGACY_DAUGHTER_CARD_SIO_DATA_PORT        0x2F

+#define LEGACY_DAUGHTER_CARD_2_SIO_INDEX_PORT     0x4E

+#define LEGACY_DAUGHTER_CARD_2_SIO_DATA_PORT      0x4F

+

+#define IT8628_ENTER_CONFIG_WRITE_SEQ_0           0x87

+#define IT8628_ENTER_CONFIG_WRITE_SEQ_1           0x01

+#define IT8628_ENTER_CONFIG_WRITE_SEQ_2           0x55

+#define IT8628_ENTER_CONFIG_WRITE_SEQ_3           0x55

+#define IT8628_EXIT_CONFIG                        0x2

+#define IT8628_CHIPID_BYTE1                       0x86

+#define IT8628_CHIPID_BYTE2                       0x28

+

+typedef struct {

+  UINT8 Register;

+  UINT8 Value;

+} EFI_SIO_TABLE;

+

+

+GLOBAL_REMOVE_IF_UNREFERENCED EFI_SIO_TABLE mSioTableWpcn381u[] = {

+  {0x29, 0x0A0},                  // Enable super I/O clock and set to 48MHz

+  {0x22, 0x003},                  //

+  {0x07, 0x003},                  // Select UART0 device

+  {0x60, (COM1_BASE >> 8)},       // Set Base Address MSB

+  {0x61, (COM1_BASE & 0x00FF)},   // Set Base Address LSB

+  {0x70, 0x004},                  // Set to IRQ4

+  {0x30, 0x001},                  // Enable it with Activation bit

+  {0x07, 0x002},                  // Select UART1 device

+  {0x60, (COM2_BASE >> 8)},       // Set Base Address MSB

+  {0x61, (COM2_BASE & 0x00FF)},   // Set Base Address LSB

+  {0x70, 0x003},                  // Set to IRQ3

+  {0x30, 0x001},                  // Enable it with Activation bit

+  {0x07, 0x007},                  // Select GPIO device

+  {0x60, (LPC_SIO_GPIO_REGISTER_ADDRESS_2 >> 8)},      // Set Base Address MSB

+  {0x61, (LPC_SIO_GPIO_REGISTER_ADDRESS_2 & 0x00FF)},  // Set Base Address LSB

+  {0x30, 0x001},                  // Enable it with Activation bit

+  {0x21, 0x001},                  // Global Device Enable

+  {0x26, 0x000}                   // Fast Enable UART 0 & 1 as their enable & activation bit

+};

+

+//

+// IT8628

+//

+GLOBAL_REMOVE_IF_UNREFERENCED EFI_SIO_TABLE mSioIt8628TableSerialPort[] = {

+  {0x023, 0x09}, // Clock Selection register

+  {0x007, 0x01}, // Com1 Logical Device Number select

+  {0x061, 0xF8}, // Serial Port 1 Base Address MSB Register

+  {0x060, 0x03}, // Serial Port 1 Base Address LSB Register

+  {0x070, 0x04}, // Serial Port 1 Interrupt Level Select

+  {0x030, 0x01}, // Serial Port 1 Activate

+  {0x007, 0x02}, // Com1 Logical Device Number select

+  {0x061, 0xF8}, // Serial Port 2 Base Address MSB Register

+  {0x060, 0x02}, // Serial Port 2 Base Address MSB Register

+  {0x070, 0x03}, // Serial Port 2 Interrupt Level Select

+  {0x030, 0x01}  // Serial Port 2 Activate

+

+};

+

+GLOBAL_REMOVE_IF_UNREFERENCED EFI_SIO_TABLE mSioTableWinbond_x374[] = {

+  {0x07, 0x03},                   // Select UART0 device

+  {0x60, (COM1_BASE >> 8)},       // Set Base Address MSB

+  {0x61, (COM1_BASE & 0x00FF)},   // Set Base Address LSB

+  {0x70, 0x04},                   // Set to IRQ4

+  {0x30, 0x01}                    // Enable it with Activation bit

+};

+

+/**

+  Detect if a National 393 SIO is docked. If yes, enable the docked SIO

+  and its serial port, and disable the onboard serial port.

+

+  @retval EFI_SUCCESS     Operations performed successfully.

+**/

+STATIC

+VOID

+CheckNationalSio (

+  VOID

+  )

+{

+  UINT8           Data8;

+

+  //

+  // Pc87393 access is through either (0x2e, 0x2f) or (0x4e, 0x4f).

+  // We use (0x2e, 0x2f) which is determined by BADD default strapping

+  //

+

+  //

+  // Read the Pc87393 signature

+  //

+  IoWrite8 (0x2e, 0x20);

+  Data8 = IoRead8 (0x2f);

+

+  if (Data8 == 0xea) {

+    //

+    // Signature matches - National PC87393 SIO is docked

+    //

+

+    //

+    // Enlarge the LPC decode scope to accommodate the Docking LPC Switch

+    // Register (SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS is allocated at

+    // SIO_BASE_ADDRESS + 0x10)

+    //

+    PchLpcGenIoRangeSet ((FixedPcdGet16 (PcdSioBaseAddress) & (UINT16)~0x7F), 0x20);

+

+    //

+    // Enable port switch

+    //

+    IoWrite8 (SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS, 0x06);

+

+    //

+    // Turn on docking power

+    //

+    IoWrite8 (FixedPcdGet16 (PcdSioBaseAddress) + 0x0E, 0x8c);

+

+    IoWrite8 (FixedPcdGet16 (PcdSioBaseAddress) + 0x0E, 0x9c);

+

+    IoWrite8 (FixedPcdGet16 (PcdSioBaseAddress) + 0x0E, 0xBc);

+

+    //

+    // Enable port switch

+    //

+    IoWrite8 (SIO_DOCKING_LPC_SWITCH_REGISTER_ADDRESS, 0x7);

+

+    //

+    // GPIO setting

+    //

+    IoWrite8 (0x2e, 0x24);

+    IoWrite8 (0x2f, 0x29);

+

+    //

+    // Enable chip clock

+    //

+    IoWrite8 (0x2e, 0x29);

+    IoWrite8 (0x2f, 0x1e);

+

+

+    //

+    // Enable serial port

+    //

+

+    //

+    // Select com1

+    //

+    IoWrite8 (0x2e, 0x7);

+    IoWrite8 (0x2f, 0x3);

+

+    //

+    // Base address: 0x3f8

+    //

+    IoWrite8 (0x2e, 0x60);

+    IoWrite8 (0x2f, 0x03);

+    IoWrite8 (0x2e, 0x61);

+    IoWrite8 (0x2f, 0xf8);

+

+    //

+    // Interrupt: 4

+    //

+    IoWrite8 (0x2e, 0x70);

+    IoWrite8 (0x2f, 0x04);

+

+    //

+    // Enable bank selection

+    //

+    IoWrite8 (0x2e, 0xf0);

+    IoWrite8 (0x2f, 0x82);

+

+    //

+    // Activate

+    //

+    IoWrite8 (0x2e, 0x30);

+    IoWrite8 (0x2f, 0x01);

+

+    //

+    // Disable onboard serial port

+    //

+    IoWrite8 (FixedPcdGet16 (PcdLpcSioConfigDefaultPort), 0x55);

+

+    //

+    // Power Down UARTs

+    //

+    IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x2);

+    IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0x00);

+

+    //

+    // Dissable COM1 decode

+    //

+    IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x24);

+    IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0);

+

+    //

+    // Disable COM2 decode

+    //

+    IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x25);

+    IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0);

+

+    //

+    // Disable interrupt

+    //

+    IoWrite8 (PcdGet16 (PcdLpcSioIndexPort), 0x28);

+    IoWrite8 (PcdGet16 (PcdLpcSioDataPort), 0x0);

+

+    IoWrite8 (FixedPcdGet16 (PcdLpcSioConfigDefaultPort), 0xAA);

+

+    //

+    // Enable floppy

+    //

+

+    //

+    // Select floppy

+    //

+    IoWrite8 (0x2e, 0x7);

+    IoWrite8 (0x2f, 0x0);

+

+    //

+    // Base address: 0x3f0

+    //

+    IoWrite8 (0x2e, 0x60);

+    IoWrite8 (0x2f, 0x03);

+    IoWrite8 (0x2e, 0x61);

+    IoWrite8 (0x2f, 0xf0);

+

+    //

+    // Interrupt: 6

+    //

+    IoWrite8 (0x2e, 0x70);

+    IoWrite8 (0x2f, 0x06);

+

+    //

+    // DMA 2

+    //

+    IoWrite8 (0x2e, 0x74);

+    IoWrite8 (0x2f, 0x02);

+

+    //

+    // Activate

+    //

+    IoWrite8 (0x2e, 0x30);

+    IoWrite8 (0x2f, 0x01);

+

+  } else {

+

+    //

+    // No National pc87393 SIO is docked, turn off dock power and

+    // disable port switch

+    //

+    // IoWrite8 (SIO_BASE_ADDRESS + 0x0E, 0xbf);

+    // IoWrite8 (0x690, 0);

+

+    //

+    // If no National pc87393, just return

+    //

+    return ;

+  }

+}

+

+/**

+Check whether the IT8628 SIO present on LPC. If yes, enable its serial ports

+

+@retval EFI_SUCCESS     Operations performed successfully.

+**/

+STATIC

+VOID

+It8628SioSerialPortInit (

+  VOID

+  )

+{

+  UINT8   ChipId0              = 0;

+  UINT8   ChipId1              = 0;

+  UINT16  LpcIoDecondeRangeSet = 0;

+  UINT16  LpcIoDecoodeSet      = 0;

+  UINT8   Index;

+  UINTN   LpcBaseAddr;

+

+

+

+  //

+  // Enable I/O decoding for COM1 (3F8h-3FFh), COM2(2F8h-2FFh), I/O port 2Eh/2Fh.

+  //

+  LpcBaseAddr = MmPciBase (

+                  DEFAULT_PCI_BUS_NUMBER_PCH,

+                  LpcDevNumber (),

+                  LpcFuncNumber ()

+                  );

+

+  LpcIoDecondeRangeSet = (UINT16) MmioRead16 (LpcBaseAddr + R_LPC_CFG_IOD);

+  LpcIoDecoodeSet = (UINT16) MmioRead16 (LpcBaseAddr + R_LPC_CFG_IOE);

+  MmioWrite16 ((LpcBaseAddr + R_LPC_CFG_IOD), (LpcIoDecondeRangeSet | ((V_LPC_CFG_IOD_COMB_2F8 << 4) | V_LPC_CFG_IOD_COMA_3F8)));

+  MmioWrite16 ((LpcBaseAddr + R_LPC_CFG_IOE), (LpcIoDecoodeSet | (B_LPC_CFG_IOE_SE | B_LPC_CFG_IOE_CBE | B_LPC_CFG_IOE_CAE|B_LPC_CFG_IOE_KE)));

+

+

+  //

+  // Enter MB PnP Mode

+  //

+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_0);

+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_1);

+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_2);

+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_ENTER_CONFIG_WRITE_SEQ_3);

+

+  //

+  // Read Chip Id of SIO IT8628 (registers 0x20 and 0x21)

+  //

+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, 0x20);

+  ChipId0 = IoRead8 (LPC_SIO_DATA_DEFAULT_PORT_2);

+

+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, 0x21);

+  ChipId1 = IoRead8 (LPC_SIO_DATA_DEFAULT_PORT_2);

+

+  //

+  // Enable Serial Port 1, Port 2

+  //

+  if ((ChipId0 == IT8628_CHIPID_BYTE1) && (ChipId1 == IT8628_CHIPID_BYTE2)) {

+    for (Index = 0; Index < sizeof (mSioIt8628TableSerialPort) / sizeof (EFI_SIO_TABLE); Index++) {

+      IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, mSioIt8628TableSerialPort[Index].Register);

+      IoWrite8 (LPC_SIO_DATA_DEFAULT_PORT_2, mSioIt8628TableSerialPort[Index].Value);

+    }

+  }

+

+  //

+  // Exit MB PnP Mode

+  //

+  IoWrite8 (LPC_SIO_INDEX_DEFAULT_PORT_2, IT8628_EXIT_CONFIG);

+  IoWrite8 (LPC_SIO_DATA_DEFAULT_PORT_2, IT8628_EXIT_CONFIG);

+

+  return;

+}

+

+/**

+  Performs platform specific initialization required for the CPU to access

+  the hardware associated with a SerialPortLib instance.  This function does

+  not initialize the serial port hardware itself.  Instead, it initializes

+  hardware devices that are required for the CPU to access the serial port

+  hardware.  This function may be called more than once.

+

+  @retval RETURN_SUCCESS       The platform specific initialization succeeded.

+  @retval RETURN_DEVICE_ERROR  The platform specific initialization could not be completed.

+

+**/

+RETURN_STATUS

+EFIAPI

+PlatformHookSerialPortInitialize (

+  VOID

+  )

+{

+  UINT16  IndexPort;

+  UINT16  DataPort;

+  UINT8   Index;

+

+  IndexPort = 0;

+  DataPort = 0;

+  Index = 0;

+

+  //

+  // Enable I/O decoding for COM1(3F8h-3FFh), COM2(2F8h-2FFh), I/O port 2Eh/2Fh, 4Eh/4Fh, 60h/64Fh and 62h/66h.

+  //

+  PchLpcIoDecodeRangesSet (PcdGet16 (PcdLpcIoDecodeRange));

+  PchLpcIoEnableDecodingSet (PcdGet16 (PchLpcIoEnableDecoding));

+

+  // Configure Sio IT8628

+  It8628SioSerialPortInit ();

+

+  return RETURN_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.inf
new file mode 100644
index 0000000000..cf01780101
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/BasePlatformHookLib/BasePlatformHookLib.inf
@@ -0,0 +1,51 @@
+## @file

+# Platform Hook Library instance for Tigerlake Mobile/Desktop CRB.

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010017

+  BASE_NAME                      = BasePlatformHookLib

+  FILE_GUID                      = E22ADCC6-ED90-4A90-9837-C8E7FF9E963D

+  VERSION_STRING                 = 1.0

+  MODULE_TYPE                    = BASE

+  LIBRARY_CLASS                  = PlatformHookLib

+#

+# The following information is for reference only and not required by the build tools.

+#

+# VALID_ARCHITECTURES = IA32 X64 IPF EBC

+#

+

+[LibraryClasses]

+  BaseLib

+  IoLib

+  PciSegmentLib

+  MmPciLib

+  PciLib

+  PchCycleDecodingLib

+  SaPlatformLib

+  PchPciBdfLib

+

+[Packages]

+  MdePkg/MdePkg.dec

+  MdeModulePkg/MdeModulePkg.dec

+  MinPlatformPkg/MinPlatformPkg.dec

+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+

+[Pcd]

+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress            ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdLpcSioIndexPort                ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdLpcSioDataPort                 ## CONSUMES

+

+[FixedPcd]

+  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort        ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdSioBaseAddress                 ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdLpcIoDecodeRange               ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PchLpcIoEnableDecoding            ## CONSUMES

+

+[Sources]

+  BasePlatformHookLib.c

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf
new file mode 100644
index 0000000000..374f5ea52b
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf
@@ -0,0 +1,49 @@
+## @file

+# SMM Library instance of Spi Flash Common Library Class

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010017

+  BASE_NAME                      = SmmSpiFlashCommonLib

+  FILE_GUID                      = 9632D96E-E849-4217-9217-DC500B8AAE47

+  VERSION_STRING                 = 1.0

+  MODULE_TYPE                    = DXE_SMM_DRIVER

+  LIBRARY_CLASS                  = SpiFlashCommonLib|DXE_SMM_DRIVER

+  CONSTRUCTOR                    = SmmSpiFlashCommonLibConstructor

+#

+# The following information is for reference only and not required by the build tools.

+#

+# VALID_ARCHITECTURES = IA32 X64

+#

+

+[LibraryClasses]

+  IoLib

+  MemoryAllocationLib

+  BaseLib

+  UefiLib

+  SmmServicesTableLib

+  BaseMemoryLib

+  DebugLib

+

+[Packages]

+  MdePkg/MdePkg.dec

+  MinPlatformPkg/MinPlatformPkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+

+[Pcd]

+  gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress   ## CONSUMES

+  gSiPkgTokenSpaceGuid.PcdBiosSize              ## CONSUMES

+

+[Sources]

+  SpiFlashCommonSmmLib.c

+  SpiFlashCommon.c

+

+[Protocols]

+  gPchSmmSpiProtocolGuid                        ## CONSUMES

+

+[Depex.X64.DXE_SMM_DRIVER]

+  gPchSmmSpiProtocolGuid

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommon.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommon.c
new file mode 100644
index 0000000000..f86896dd1f
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommon.c
@@ -0,0 +1,210 @@
+/** @file

+  Wrap EFI_SPI_PROTOCOL to provide some library level interfaces

+  for module use.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <Library/SpiFlashCommonLib.h>

+#include <Library/IoLib.h>

+#include <Protocol/Spi.h>

+

+PCH_SPI_PROTOCOL       *mSpiProtocol;

+

+//

+// Variables for boottime and runtime usage.

+//

+UINTN mBiosAreaBaseAddress = 0;

+UINTN mBiosSize            = 0;

+UINTN mBiosOffset          = 0;

+

+/**

+  Enable block protection on the Serial Flash device.

+

+  @retval     EFI_SUCCESS       Opertion is successful.

+  @retval     EFI_DEVICE_ERROR  If there is any device errors.

+

+**/

+EFI_STATUS

+EFIAPI

+SpiFlashLock (

+  VOID

+  )

+{

+  return EFI_SUCCESS;

+}

+

+/**

+  Read NumBytes bytes of data from the address specified by

+  PAddress into Buffer.

+

+  @param[in]      Address       The starting physical address of the read.

+  @param[in,out]  NumBytes      On input, the number of bytes to read. On output, the number

+                                of bytes actually read.

+  @param[out]     Buffer        The destination data buffer for the read.

+

+  @retval         EFI_SUCCESS       Operation is successful.

+  @retval         EFI_DEVICE_ERROR  If there is any device errors.

+

+**/

+EFI_STATUS

+EFIAPI

+SpiFlashRead (

+  IN     UINTN                        Address,

+  IN OUT UINT32                       *NumBytes,

+     OUT UINT8                        *Buffer

+  )

+{

+  ASSERT ((NumBytes != NULL) && (Buffer != NULL));

+  if ((NumBytes == NULL) || (Buffer == NULL)) {

+    return EFI_INVALID_PARAMETER;

+  }

+

+  //

+  // This function is implemented specifically for those platforms

+  // at which the SPI device is memory mapped for read. So this

+  // function just do a memory copy for Spi Flash Read.

+  //

+  CopyMem (Buffer, (VOID *) Address, *NumBytes);

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Write NumBytes bytes of data from Buffer to the address specified by

+  PAddresss.

+

+  @param[in]      Address         The starting physical address of the write.

+  @param[in,out]  NumBytes        On input, the number of bytes to write. On output,

+                                  the actual number of bytes written.

+  @param[in]      Buffer          The source data buffer for the write.

+

+  @retval         EFI_SUCCESS            Operation is successful.

+  @retval         EFI_DEVICE_ERROR       If there is any device errors.

+  @retval         EFI_INVALID_PARAMETER  Invalid parameter.

+

+**/

+EFI_STATUS

+EFIAPI

+SpiFlashWrite (

+  IN     UINTN                      Address,

+  IN OUT UINT32                     *NumBytes,

+  IN     UINT8                      *Buffer

+  )

+{

+  EFI_STATUS                Status;

+  UINTN                     Offset;

+  UINT32                    Length;

+  UINT32                    RemainingBytes;

+

+  ASSERT ((NumBytes != NULL) && (Buffer != NULL));

+  if ((NumBytes == NULL) || (Buffer == NULL)) {

+    return EFI_INVALID_PARAMETER;

+  }

+

+  ASSERT (Address >= mBiosAreaBaseAddress);

+  if (Address < mBiosAreaBaseAddress) {

+    return EFI_INVALID_PARAMETER;

+  }

+

+  Offset = Address - mBiosAreaBaseAddress;

+

+  ASSERT ((*NumBytes + Offset) <= mBiosSize);

+  if ((*NumBytes + Offset) > mBiosSize) {

+    return EFI_INVALID_PARAMETER;

+  }

+

+  Status = EFI_SUCCESS;

+  RemainingBytes = *NumBytes;

+

+

+  while (RemainingBytes > 0) {

+    if (RemainingBytes > SECTOR_SIZE_4KB) {

+      Length = SECTOR_SIZE_4KB;

+    } else {

+      Length = RemainingBytes;

+    }

+    Status = mSpiProtocol->FlashWrite (

+                             mSpiProtocol,

+                             FlashRegionBios,

+                             (UINT32) Offset,

+                             Length,

+                             Buffer

+                             );

+    if (EFI_ERROR (Status)) {

+      break;

+    }

+    RemainingBytes -= Length;

+    Offset += Length;

+    Buffer += Length;

+  }

+

+  //

+  // Actual number of bytes written

+  //

+  *NumBytes -= RemainingBytes;

+

+  return Status;

+}

+

+/**

+  Erase the block starting at Address.

+

+  @param[in]  Address         The starting physical address of the block to be erased.

+                              This library assume that caller garantee that the PAddress

+                              is at the starting address of this block.

+  @param[in]  NumBytes        On input, the number of bytes of the logical block to be erased.

+                              On output, the actual number of bytes erased.

+

+  @retval     EFI_SUCCESS.           Operation is successful.

+  @retval     EFI_DEVICE_ERROR       If there is any device errors.

+  @retval     EFI_INVALID_PARAMETER  Invalid parameter.

+

+**/

+EFI_STATUS

+EFIAPI

+SpiFlashBlockErase (

+  IN    UINTN                     Address,

+  IN    UINTN                     *NumBytes

+  )

+{

+  EFI_STATUS          Status;

+  UINTN               Offset;

+  UINTN               RemainingBytes;

+

+  ASSERT (NumBytes != NULL);

+  if (NumBytes == NULL) {

+    return EFI_INVALID_PARAMETER;

+  }

+

+  ASSERT (Address >= mBiosAreaBaseAddress);

+  if (Address < mBiosAreaBaseAddress) {

+    return EFI_INVALID_PARAMETER;

+  }

+

+  Offset = Address - mBiosAreaBaseAddress;

+

+  ASSERT ((*NumBytes % SECTOR_SIZE_4KB) == 0);

+  if ((*NumBytes % SECTOR_SIZE_4KB) != 0) {

+    return EFI_INVALID_PARAMETER;

+  }

+

+  ASSERT ((*NumBytes + Offset) <= mBiosSize);

+  if ((*NumBytes + Offset) > mBiosSize) {

+    return EFI_INVALID_PARAMETER;

+  }

+

+  Status = EFI_SUCCESS;

+  RemainingBytes = *NumBytes;

+

+

+  Status = mSpiProtocol->FlashErase (

+                           mSpiProtocol,

+                           FlashRegionBios,

+                           (UINT32) Offset,

+                           (UINT32) RemainingBytes

+                           );

+  return Status;

+}

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c
new file mode 100644
index 0000000000..7941b8f872
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Library/SmmSpiFlashCommonLib/SpiFlashCommonSmmLib.c
@@ -0,0 +1,58 @@
+/** @file

+  SMM Library instance of SPI Flash Common Library Class

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <Library/SmmServicesTableLib.h>

+#include <Protocol/Spi.h>

+#include <Library/DebugLib.h>

+

+extern PCH_SPI_PROTOCOL   *mSpiProtocol;

+

+extern UINTN mBiosAreaBaseAddress;

+extern UINTN mBiosSize;

+extern UINTN mBiosOffset;

+

+/**

+  The library constructuor.

+

+  The function does the necessary initialization work for this library

+  instance.

+

+  @param[in]  ImageHandle       The firmware allocated handle for the UEFI image.

+  @param[in]  SystemTable       A pointer to the EFI system table.

+

+  @retval     EFI_SUCCESS       The function always return EFI_SUCCESS for now.

+                                It will ASSERT on error for debug version.

+  @retval     EFI_ERROR         Please reference LocateProtocol for error code details.

+**/

+EFI_STATUS

+EFIAPI

+SmmSpiFlashCommonLibConstructor (

+  IN EFI_HANDLE        ImageHandle,

+  IN EFI_SYSTEM_TABLE  *SystemTable

+  )

+{

+  EFI_STATUS Status;

+  UINT32     BaseAddr;

+  UINT32     RegionSize;

+

+  mBiosAreaBaseAddress = (UINTN)PcdGet32 (PcdBiosAreaBaseAddress);

+  mBiosSize            = (UINTN)PcdGet32 (PcdBiosSize);

+

+  //

+  // Locate the SMM SPI protocol.

+  //

+  Status = gSmst->SmmLocateProtocol (

+                    &gPchSmmSpiProtocolGuid,

+                    NULL,

+                    (VOID **) &mSpiProtocol

+                    );

+  ASSERT_EFI_ERROR (Status);

+

+  mSpiProtocol->GetRegionAddress (mSpiProtocol, FlashRegionBios, &BaseAddr, &RegionSize);

+  mBiosOffset = BaseAddr;

+  return Status;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c
new file mode 100644
index 0000000000..a2367047cd
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c
@@ -0,0 +1,168 @@
+/** @file

+  This file initialises and Installs GopPolicy Protocol.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiDxe.h>

+#include <Library/UefiBootServicesTableLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/MemoryAllocationLib.h>

+#include <Protocol/FirmwareVolume2.h>

+#include <Protocol/GopPolicy.h>

+

+GLOBAL_REMOVE_IF_UNREFERENCED GOP_POLICY_PROTOCOL        mGOPPolicy;

+GLOBAL_REMOVE_IF_UNREFERENCED UINT32                     mVbtSize = 0;

+GLOBAL_REMOVE_IF_UNREFERENCED EFI_PHYSICAL_ADDRESS       mVbtAddress = 0;

+

+/**

+  @param[out] CurrentLidStatus

+

+  @retval     EFI_SUCCESS

+  @retval     EFI_UNSUPPORTED

+**/

+EFI_STATUS

+EFIAPI

+GetPlatformLidStatus (

+  OUT LID_STATUS *CurrentLidStatus

+  )

+{

+  return EFI_UNSUPPORTED;

+}

+

+/**

+  @param[out] CurrentDockStatus

+

+  @retval     EFI_SUCCESS

+  @retval     EFI_UNSUPPORTED

+**/

+EFI_STATUS

+EFIAPI

+GetPlatformDockStatus (

+  OUT DOCK_STATUS  CurrentDockStatus

+  )

+{

+    return EFI_UNSUPPORTED;

+}

+

+/**

+  @param[out] VbtAddress

+  @param[out] VbtSize

+

+  @retval     EFI_SUCCESS

+  @retval     EFI_NOT_FOUND

+**/

+EFI_STATUS

+EFIAPI

+GetVbtData (

+  OUT EFI_PHYSICAL_ADDRESS *VbtAddress,

+  OUT UINT32               *VbtSize

+  )

+{

+  EFI_STATUS                    Status;

+  UINTN                         FvProtocolCount;

+  EFI_HANDLE                    *FvHandles;

+  EFI_FIRMWARE_VOLUME2_PROTOCOL *Fv;

+  UINTN                         Index;

+  UINT32                        AuthenticationStatus;

+  UINT8                         *Buffer;

+  UINTN                         VbtBufferSize;

+

+

+  Status = EFI_NOT_FOUND;

+  if ( mVbtAddress == 0) {

+    Fv           = NULL;

+

+    Buffer = 0;

+    FvHandles = NULL;

+    Status = gBS->LocateHandleBuffer (

+                    ByProtocol,

+                    &gEfiFirmwareVolume2ProtocolGuid,

+                    NULL,

+                    &FvProtocolCount,

+                    &FvHandles

+                    );

+    if (!EFI_ERROR (Status)) {

+      for (Index = 0; Index < FvProtocolCount; Index++) {

+        Status = gBS->HandleProtocol (

+                        FvHandles[Index],

+                        &gEfiFirmwareVolume2ProtocolGuid,

+                        (VOID **) &Fv

+                        );

+        VbtBufferSize = 0;

+        Status = Fv->ReadSection (

+                       Fv,

+                       PcdGetPtr (PcdIntelGraphicsVbtFileGuid),

+                       EFI_SECTION_RAW,

+                       0,

+                       (VOID **) &Buffer,

+                       &VbtBufferSize,

+                       &AuthenticationStatus

+                       );

+        if (!EFI_ERROR (Status)) {

+          *VbtAddress = (EFI_PHYSICAL_ADDRESS)Buffer;

+          *VbtSize = (UINT32)VbtBufferSize;

+          mVbtAddress = *VbtAddress;

+          mVbtSize = *VbtSize;

+          Status = EFI_SUCCESS;

+          break;

+        }

+      }

+    } else {

+      Status = EFI_NOT_FOUND;

+    }

+

+    if (FvHandles != NULL) {

+      FreePool (FvHandles);

+      FvHandles = NULL;

+    }

+  } else {

+    *VbtAddress = mVbtAddress;

+    *VbtSize = mVbtSize;

+    Status = EFI_SUCCESS;

+  }

+

+  return Status;

+}

+

+/**

+Initialize GOP DXE Policy

+

+@param[in] ImageHandle          Image handle of this driver.

+

+@retval EFI_SUCCESS             Initialization complete.

+@retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.

+@retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.

+@retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.

+**/

+EFI_STATUS

+EFIAPI

+GopPolicyInitDxe (

+  IN EFI_HANDLE       ImageHandle

+  )

+{

+  EFI_STATUS         Status;

+

+  //

+  // Initialize the EFI Driver Library

+  //

+  SetMem (&mGOPPolicy, sizeof (GOP_POLICY_PROTOCOL), 0);

+

+  mGOPPolicy.Revision                = GOP_POLICY_PROTOCOL_REVISION_03;

+  mGOPPolicy.GetPlatformLidStatus    = GetPlatformLidStatus;

+  mGOPPolicy.GetVbtData              = GetVbtData;

+  mGOPPolicy.GetPlatformDockStatus   = GetPlatformDockStatus;

+

+  //

+  // Install protocol to allow access to this Policy.

+  //

+  Status = gBS->InstallMultipleProtocolInterfaces (

+                  &ImageHandle,

+                  &gGopPolicyProtocolGuid,

+                  &mGOPPolicy,

+                  NULL

+                  );

+

+  return Status;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxePchPolicyInit.c b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxePchPolicyInit.c
new file mode 100644
index 0000000000..e75abcb42a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxePchPolicyInit.c
@@ -0,0 +1,61 @@
+/** @file

+  This file initialises and Installs GopPolicy Protocol.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <Uefi.h>

+#include <Library/DebugLib.h>

+

+EFI_STATUS

+EFIAPI

+CreatePchDxeConfigBlocks (

+  IN OUT  VOID      **SaPolicy

+  );

+

+EFI_STATUS

+EFIAPI

+PchInstallPolicyProtocol (

+  IN  EFI_HANDLE                  ImageHandle,

+  IN  VOID                        *PchPolicy

+  );

+

+/**

+  Initialize PCH DXE Policy

+

+  @param[in] ImageHandle          Image handle of this driver.

+

+  @retval EFI_SUCCESS             Initialization complete.

+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.

+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.

+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.

+**/

+EFI_STATUS

+EFIAPI

+PchPolicyInitDxe (

+  IN EFI_HANDLE           ImageHandle

+  )

+{

+  EFI_STATUS    Status;

+  EFI_HANDLE    PchHandle;

+  VOID          *PchPolicy;

+

+  //

+  // Call CreatePchDxeConfigBlocks to create & initialize platform policy structure

+  // and get all Intel default policy settings.

+  //

+  Status = CreatePchDxeConfigBlocks (&PchPolicy);

+  ASSERT_EFI_ERROR (Status);

+

+  //

+  // Install PchInstallPolicyProtocol.

+  // While installed, RC assumes the Policy is ready and finalized. So please

+  // update and override any setting before calling this function.

+  //

+  PchHandle = NULL;

+  Status = PchInstallPolicyProtocol (PchHandle, PchPolicy);

+  ASSERT_EFI_ERROR (Status);

+

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.c b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.c
new file mode 100644
index 0000000000..5a9def9d13
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.c
@@ -0,0 +1,61 @@
+/** @file

+  This file initialises and Installs GopPolicy Protocol.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <Uefi.h>

+#include <Library/DebugLib.h>

+

+EFI_STATUS

+EFIAPI

+CreateSaDxeConfigBlocks (

+  IN OUT  VOID      **SaPolicy

+  );

+

+EFI_STATUS

+EFIAPI

+SaInstallPolicyProtocol (

+  IN  EFI_HANDLE                  ImageHandle,

+  IN  VOID                        *SaPolicy

+  );

+

+/**

+  Initialize SA DXE Policy

+

+  @param[in] ImageHandle          Image handle of this driver.

+

+  @retval EFI_SUCCESS             Initialization complete.

+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.

+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.

+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.

+**/

+EFI_STATUS

+EFIAPI

+SaPolicyInitDxe (

+  IN EFI_HANDLE           ImageHandle

+  )

+{

+  EFI_STATUS    Status;

+  EFI_HANDLE    SaHandle;

+  VOID          *SaPolicy;

+

+  //

+  // Call CreateSaDxeConfigBlocks to create & initialize platform policy structure

+  // and get all Intel default policy settings.

+  //

+  Status = CreateSaDxeConfigBlocks (&SaPolicy);

+  ASSERT_EFI_ERROR (Status);

+

+  //

+  // Install SaInstallPolicyProtocol.

+  // While installed, RC assumes the Policy is ready and finalized. So please

+  // update and override any setting before calling this function.

+  //

+  SaHandle = NULL;

+  Status = SaInstallPolicyProtocol (SaHandle, SaPolicy);

+  ASSERT_EFI_ERROR (Status);

+

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLate.c b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLate.c
new file mode 100644
index 0000000000..2eee9958be
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLate.c
@@ -0,0 +1,97 @@
+/** @file

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiDxe.h>

+#include <Library/PcdLib.h>

+#include <Library/DebugLib.h>

+#include <Library/UefiBootServicesTableLib.h>

+

+/**

+  Initialize SA DXE Policy

+

+  @param[in] ImageHandle          Image handle of this driver.

+

+  @retval EFI_SUCCESS             Initialization complete.

+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.

+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.

+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.

+**/

+EFI_STATUS

+EFIAPI

+SaPolicyInitDxe (

+  IN EFI_HANDLE           ImageHandle

+  );

+

+/**

+  Initialize PCH DXE Policy

+

+  @param[in] ImageHandle          Image handle of this driver.

+

+  @retval EFI_SUCCESS             Initialization complete.

+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.

+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.

+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.

+**/

+EFI_STATUS

+EFIAPI

+PchPolicyInitDxe (

+  IN EFI_HANDLE           ImageHandle

+  );

+

+/**

+  Initialize GOP DXE Policy

+

+  @param[in] ImageHandle          Image handle of this driver.

+

+  @retval EFI_SUCCESS             Initialization complete.

+  @retval EFI_UNSUPPORTED         The chipset is unsupported by this driver.

+  @retval EFI_OUT_OF_RESOURCES    Do not have enough resources to initialize the driver.

+  @retval EFI_DEVICE_ERROR        Device error, driver exits abnormally.

+**/

+EFI_STATUS

+EFIAPI

+GopPolicyInitDxe (

+  IN EFI_HANDLE           ImageHandle

+  );

+

+/**

+  Performs silicon late policy update.

+

+  The meaning of Policy is defined by silicon code.

+  It could be the raw data, a handle, a Protocol, etc.

+

+  The input Policy must be returned by SiliconPolicyDoneLate().

+

+  In FSP or non-FSP path, the board may use additional way to get

+  the silicon policy data field based upon the input Policy.

+

+  @param[in, out] Policy       Pointer to policy.

+

+  @return the updated policy.

+**/

+VOID *

+EFIAPI

+SiliconPolicyUpdateLate (

+  IN OUT VOID *Policy

+  )

+{

+  EFI_STATUS               Status;

+

+  SaPolicyInitDxe (gImageHandle);

+  PchPolicyInitDxe (gImageHandle);

+

+  if (PcdGetBool (PcdIntelGopEnable)) {

+    //

+    // GOP Dxe Policy Initialization

+    //

+    Status = GopPolicyInitDxe (gImageHandle);

+    RETURN_ERROR (Status);

+    DEBUG ((DEBUG_INFO, "GOP Dxe Policy Initialization done\n"));

+  }

+

+  return Policy;

+}

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf
new file mode 100644
index 0000000000..573dbfa04a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf
@@ -0,0 +1,49 @@
+## @file

+#  Component information file for Silicon Policy Update Library

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = DxeSiliconUpdateLib

+  FILE_GUID                      = C523609D-E354-416B-B24F-33468D4BD21D

+  MODULE_TYPE                    = DXE_DRIVER

+  VERSION_STRING                 = 1.0

+  LIBRARY_CLASS                  = SiliconPolicyUpdateLib

+

+[LibraryClasses]

+  BaseLib

+  PcdLib

+  DebugLib

+  UefiBootServicesTableLib

+  DxeSaPolicyLib

+  DxePchPolicyLib

+

+[Packages]

+  MdePkg/MdePkg.dec

+  MdeModulePkg/MdeModulePkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+  MinPlatformPkg/MinPlatformPkg.dec

+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec

+  IntelSiliconPkg/IntelSiliconPkg.dec

+

+[Sources]

+  DxeSiliconPolicyUpdateLate.c

+  DxeSaPolicyInit.c

+  DxePchPolicyInit.c

+  DxeGopPolicyInit.c

+

+[Pcd]

+  gBoardModuleTokenSpaceGuid.PcdIntelGopEnable

+  gBoardModuleTokenSpaceGuid.PcdGraphicsVbtGuid

+  gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid

+

+[Protocols]

+  gEfiFirmwareVolume2ProtocolGuid               ## CONSUMES

+  gGopPolicyProtocolGuid                        ## PRODUCES

+

+[Depex]

+  gEfiVariableArchProtocolGuid

-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules
  2021-02-09  8:45 ` [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules Heng Luo
@ 2021-02-10  0:22   ` Chaganty, Rangasai V
  2021-02-10  0:27   ` Chaganty, Rangasai V
  1 sibling, 0 replies; 18+ messages in thread
From: Chaganty, Rangasai V @ 2021-02-10  0:22 UTC (permalink / raw)
  To: Luo, Heng, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com>

-----Original Message-----
From: Luo, Heng <heng.luo@intel.com> 
Sent: Tuesday, February 09, 2021 12:46 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules

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

Adds the following modules:
  * BiosInfo

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c   | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf |  83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 283 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c
new file mode 100644
index 0000000000..46c3d439c2
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c
@@ -0,0 +1,200 @@
+/** @file

+  Driver for BIOS Info support.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <Guid/BiosInfo.h>

+#include <Library/PeiServicesLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/DebugLib.h>

+#include <Library/HobLib.h>

+#include <Library/PcdLib.h>

+#include <IndustryStandard/FirmwareInterfaceTable.h>

+#include <Ppi/FirmwareVolumeInfoMeasurementExcluded.h>

+#include <Library/MemoryAllocationLib.h>

+

+#define BASE_FV_SIZE 10

+

+#define FSP_WRAPPER_FV_SIZE 3

+

+#define TSN_MAC_ADDRESS_FV_SIZE 0

+

+#define BIOS_INFO_STRUCT_SIZE (BASE_FV_SIZE + FSP_WRAPPER_FV_SIZE + TSN_MAC_ADDRESS_FV_SIZE)

+

+

+/*

+  BIOS_INFO structure is the base of the firmware volume layout for Intel platform BIOS implementation

+  so security checker module can run based on the structure and throw warnings, error or deadloop

+  when any unexpected firmware volumes are detected.

+

+  BIOS_INFO is recommended to support full entries of firmware volumes present in a flash

+  with right type, attribute, version, flash map base address and size,

+  all associated information which is defined by BIOS_INFO_STRUCT structure.

+  - IBB firmware volumes, which are expected to be measured or/and verified

+    by hardware base security solution to meet SecureBoot chain of trust

+    (Intel BootGuard for example), have attribute 0x0.

+  - Post IBB firmware volumes, which are expected to be measured or/and verified

+    by BIOS (TCG code for measurement, RSA2048SHA256Sign algorithm for verification for example),

+    have attribute BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB.

+  - Else, follows Firmware Interface Table specification.

+*/

+#pragma pack (1)

+typedef struct {

+  BIOS_INFO_HEADER  Header;

+  BIOS_INFO_STRUCT  Entry[BIOS_INFO_STRUCT_SIZE];

+} BIOS_INFO;

+#pragma pack ()

+

+GLOBAL_REMOVE_IF_UNREFERENCED BIOS_INFO  mBiosInfo = {

+  {

+    BIOS_INFO_SIGNATURE,

+    BIOS_INFO_STRUCT_SIZE,

+    0,

+  },

+  {

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_GENERAL_EXCLUDE_FROM_FIT,

+      0x0100,

+      FixedPcdGet32 (PcdFlashNvStorageVariableSize) + FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) + FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize),

+      FixedPcdGet32 (PcdFlashNvStorageVariableBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvAdvancedSize),

+      FixedPcdGet32 (PcdFlashFvAdvancedBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvOptionalSize),

+      FixedPcdGet32 (PcdFlashFvOptionalBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvOsBootSize),

+      FixedPcdGet32 (PcdFlashFvOsBootBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvUefiBootSize),

+      FixedPcdGet32 (PcdFlashFvUefiBootBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvPostMemorySize),

+      FixedPcdGet32 (PcdFlashFvPostMemoryBase)

+    },

+    {

+      /*

+        Note :

+        Startup ACM is one of the binaries in FvFirmwareBinaries,

+        so put type 07 but not type 02.

+        FIT table will contain a type 02 entry with actual address

+        of ACM binary (it is passed as an input to FitGen tool).

+      */

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_GENERAL_EXCLUDE_FROM_FIT,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvFirmwareBinariesSize),

+      FixedPcdGet32 (PcdFlashFvFirmwareBinariesBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvFspSSize),

+      FixedPcdGet32 (PcdFlashFvFspSBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      0x00,    // IBB FV

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvFspMSize),

+      FixedPcdGet32 (PcdFlashFvFspMBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      0x00,    // IBB FV

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvFspTSize),

+      FixedPcdGet32 (PcdFlashFvFspTBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      0x00,    // IBB FV

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvSecuritySize),

+      FixedPcdGet32 (PcdFlashFvSecurityBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      0x00,    // IBB FV

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvPreMemorySize),

+      FixedPcdGet32 (PcdFlashFvPreMemoryBase)

+    },

+    {

+      FIT_TYPE_01_MICROCODE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_MICROCODE_WHOLE_REGION,

+      0x0100,

+      FixedPcdGet32 (PcdFlashMicrocodeFvSize),

+      FixedPcdGet32 (PcdFlashMicrocodeFvBase)

+    },

+  }

+};

+

+GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_PPI_DESCRIPTOR  mBiosInfoPpiList = {

+  EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,

+  &gBiosInfoGuid,

+  &mBiosInfo

+};

+

+/**

+  Installs BiosInfo Ppi.

+

+  @param  FileHandle  Handle of the file being invoked.

+  @param  PeiServices Describes the list of possible PEI Services.

+

+  @retval EFI_SUCCESS   Install the BiosInfo Ppi successfully.

+

+**/

+EFI_STATUS

+EFIAPI

+BiosInfoEntryPoint (

+  IN       EFI_PEI_FILE_HANDLE  FileHandle,

+  IN CONST EFI_PEI_SERVICES     **PeiServices

+  )

+{

+  EFI_STATUS  Status;

+  VOID        *HobData;

+

+    //

+    // Install PPI, so that other PEI module can add dependency.

+    //

+    Status = PeiServicesInstallPpi (&mBiosInfoPpiList);

+    ASSERT_EFI_ERROR (Status);

+

+    //

+    // Build hob, so that DXE module can also get the data.

+    //

+    HobData = BuildGuidHob (&gBiosInfoGuid, sizeof (mBiosInfo));

+    ASSERT (HobData != NULL);

+    if (HobData == NULL) {

+      return EFI_OUT_OF_RESOURCES;

+    }

+    CopyMem (HobData, &mBiosInfo, sizeof (mBiosInfo));

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf
new file mode 100644
index 0000000000..66c8814c97
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf
@@ -0,0 +1,83 @@
+## @file

+#  Module Information description file for BIOS Info Driver

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010017

+  BASE_NAME                      = BiosInfo

+  FILE_GUID                      = 4A4CA1C6-871C-45BB-8801-6910A7AA5807

+  VERSION_STRING                 = 1.0

+  MODULE_TYPE                    = PEIM

+  ENTRY_POINT                    = BiosInfoEntryPoint

+#

+# The following information is for reference only and not required by the build tools.

+#

+# VALID_ARCHITECTURES IA32 X64

+#

+

+[LibraryClasses]

+  PeimEntryPoint

+  PeiServicesLib

+  PeiServicesTablePointerLib

+  HobLib

+  BaseMemoryLib

+  MemoryAllocationLib

+  DebugLib

+

+[Packages]

+  MdePkg/MdePkg.dec

+  MdeModulePkg/MdeModulePkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+  IntelSiliconPkg/IntelSiliconPkg.dec

+  MinPlatformPkg/MinPlatformPkg.dec

+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec

+  SecurityPkg/SecurityPkg.dec

+  BoardModulePkg/BoardModulePkg.dec

+

+[Pcd]

+  gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress                     ## CONSUMES

+  gSiPkgTokenSpaceGuid.PcdBiosSize                                ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase    ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize    ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase  ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize  ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase    ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize    ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesBase       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize       ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize            ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalBase               ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize               ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase              ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize              ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase          ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize          ## CONSUMES

+  gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase                    ## CONSUMES

+  gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize                    ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryBase           ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize           ## CONSUMES

+

+

+[Sources]

+  BiosInfo.c

+

+[Guids]

+  gBiosInfoGuid                                 ## PRODUCES

+

+[Depex]

+  gEfiPeiMasterBootModePpiGuid

-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules
  2021-02-09  8:45 ` [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules Heng Luo
  2021-02-10  0:22   ` Chaganty, Rangasai V
@ 2021-02-10  0:27   ` Chaganty, Rangasai V
  1 sibling, 0 replies; 18+ messages in thread
From: Chaganty, Rangasai V @ 2021-02-10  0:27 UTC (permalink / raw)
  To: Luo, Heng, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com> 
 
-----Original Message-----
From: Luo, Heng <heng.luo@intel.com> 
Sent: Tuesday, February 09, 2021 12:46 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules

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

Adds the following modules:
  * BiosInfo

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c   | 200 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf |  83 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 283 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c
new file mode 100644
index 0000000000..46c3d439c2
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.c
@@ -0,0 +1,200 @@
+/** @file

+  Driver for BIOS Info support.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <Guid/BiosInfo.h>

+#include <Library/PeiServicesLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/DebugLib.h>

+#include <Library/HobLib.h>

+#include <Library/PcdLib.h>

+#include <IndustryStandard/FirmwareInterfaceTable.h>

+#include <Ppi/FirmwareVolumeInfoMeasurementExcluded.h>

+#include <Library/MemoryAllocationLib.h>

+

+#define BASE_FV_SIZE 10

+

+#define FSP_WRAPPER_FV_SIZE 3

+

+#define TSN_MAC_ADDRESS_FV_SIZE 0

+

+#define BIOS_INFO_STRUCT_SIZE (BASE_FV_SIZE + FSP_WRAPPER_FV_SIZE + TSN_MAC_ADDRESS_FV_SIZE)

+

+

+/*

+  BIOS_INFO structure is the base of the firmware volume layout for Intel platform BIOS implementation

+  so security checker module can run based on the structure and throw warnings, error or deadloop

+  when any unexpected firmware volumes are detected.

+

+  BIOS_INFO is recommended to support full entries of firmware volumes present in a flash

+  with right type, attribute, version, flash map base address and size,

+  all associated information which is defined by BIOS_INFO_STRUCT structure.

+  - IBB firmware volumes, which are expected to be measured or/and verified

+    by hardware base security solution to meet SecureBoot chain of trust

+    (Intel BootGuard for example), have attribute 0x0.

+  - Post IBB firmware volumes, which are expected to be measured or/and verified

+    by BIOS (TCG code for measurement, RSA2048SHA256Sign algorithm for verification for example),

+    have attribute BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB.

+  - Else, follows Firmware Interface Table specification.

+*/

+#pragma pack (1)

+typedef struct {

+  BIOS_INFO_HEADER  Header;

+  BIOS_INFO_STRUCT  Entry[BIOS_INFO_STRUCT_SIZE];

+} BIOS_INFO;

+#pragma pack ()

+

+GLOBAL_REMOVE_IF_UNREFERENCED BIOS_INFO  mBiosInfo = {

+  {

+    BIOS_INFO_SIGNATURE,

+    BIOS_INFO_STRUCT_SIZE,

+    0,

+  },

+  {

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_GENERAL_EXCLUDE_FROM_FIT,

+      0x0100,

+      FixedPcdGet32 (PcdFlashNvStorageVariableSize) + FixedPcdGet32 (PcdFlashNvStorageFtwWorkingSize) + FixedPcdGet32 (PcdFlashNvStorageFtwSpareSize),

+      FixedPcdGet32 (PcdFlashNvStorageVariableBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvAdvancedSize),

+      FixedPcdGet32 (PcdFlashFvAdvancedBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvOptionalSize),

+      FixedPcdGet32 (PcdFlashFvOptionalBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvOsBootSize),

+      FixedPcdGet32 (PcdFlashFvOsBootBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvUefiBootSize),

+      FixedPcdGet32 (PcdFlashFvUefiBootBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvPostMemorySize),

+      FixedPcdGet32 (PcdFlashFvPostMemoryBase)

+    },

+    {

+      /*

+        Note :

+        Startup ACM is one of the binaries in FvFirmwareBinaries,

+        so put type 07 but not type 02.

+        FIT table will contain a type 02 entry with actual address

+        of ACM binary (it is passed as an input to FitGen tool).

+      */

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_GENERAL_EXCLUDE_FROM_FIT,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvFirmwareBinariesSize),

+      FixedPcdGet32 (PcdFlashFvFirmwareBinariesBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_BIOS_POST_IBB,

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvFspSSize),

+      FixedPcdGet32 (PcdFlashFvFspSBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      0x00,    // IBB FV

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvFspMSize),

+      FixedPcdGet32 (PcdFlashFvFspMBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      0x00,    // IBB FV

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvFspTSize),

+      FixedPcdGet32 (PcdFlashFvFspTBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      0x00,    // IBB FV

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvSecuritySize),

+      FixedPcdGet32 (PcdFlashFvSecurityBase)

+    },

+    {

+      FIT_TYPE_07_BIOS_STARTUP_MODULE,

+      0x00,    // IBB FV

+      0x0100,

+      FixedPcdGet32 (PcdFlashFvPreMemorySize),

+      FixedPcdGet32 (PcdFlashFvPreMemoryBase)

+    },

+    {

+      FIT_TYPE_01_MICROCODE,

+      BIOS_INFO_STRUCT_ATTRIBUTE_MICROCODE_WHOLE_REGION,

+      0x0100,

+      FixedPcdGet32 (PcdFlashMicrocodeFvSize),

+      FixedPcdGet32 (PcdFlashMicrocodeFvBase)

+    },

+  }

+};

+

+GLOBAL_REMOVE_IF_UNREFERENCED EFI_PEI_PPI_DESCRIPTOR  mBiosInfoPpiList = {

+  EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST,

+  &gBiosInfoGuid,

+  &mBiosInfo

+};

+

+/**

+  Installs BiosInfo Ppi.

+

+  @param  FileHandle  Handle of the file being invoked.

+  @param  PeiServices Describes the list of possible PEI Services.

+

+  @retval EFI_SUCCESS   Install the BiosInfo Ppi successfully.

+

+**/

+EFI_STATUS

+EFIAPI

+BiosInfoEntryPoint (

+  IN       EFI_PEI_FILE_HANDLE  FileHandle,

+  IN CONST EFI_PEI_SERVICES     **PeiServices

+  )

+{

+  EFI_STATUS  Status;

+  VOID        *HobData;

+

+    //

+    // Install PPI, so that other PEI module can add dependency.

+    //

+    Status = PeiServicesInstallPpi (&mBiosInfoPpiList);

+    ASSERT_EFI_ERROR (Status);

+

+    //

+    // Build hob, so that DXE module can also get the data.

+    //

+    HobData = BuildGuidHob (&gBiosInfoGuid, sizeof (mBiosInfo));

+    ASSERT (HobData != NULL);

+    if (HobData == NULL) {

+      return EFI_OUT_OF_RESOURCES;

+    }

+    CopyMem (HobData, &mBiosInfo, sizeof (mBiosInfo));

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf
new file mode 100644
index 0000000000..66c8814c97
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/BiosInfo/BiosInfo.inf
@@ -0,0 +1,83 @@
+## @file

+#  Module Information description file for BIOS Info Driver

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010017

+  BASE_NAME                      = BiosInfo

+  FILE_GUID                      = 4A4CA1C6-871C-45BB-8801-6910A7AA5807

+  VERSION_STRING                 = 1.0

+  MODULE_TYPE                    = PEIM

+  ENTRY_POINT                    = BiosInfoEntryPoint

+#

+# The following information is for reference only and not required by the build tools.

+#

+# VALID_ARCHITECTURES IA32 X64

+#

+

+[LibraryClasses]

+  PeimEntryPoint

+  PeiServicesLib

+  PeiServicesTablePointerLib

+  HobLib

+  BaseMemoryLib

+  MemoryAllocationLib

+  DebugLib

+

+[Packages]

+  MdePkg/MdePkg.dec

+  MdeModulePkg/MdeModulePkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+  IntelSiliconPkg/IntelSiliconPkg.dec

+  MinPlatformPkg/MinPlatformPkg.dec

+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec

+  SecurityPkg/SecurityPkg.dec

+  BoardModulePkg/BoardModulePkg.dec

+

+[Pcd]

+  gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress                     ## CONSUMES

+  gSiPkgTokenSpaceGuid.PcdBiosSize                                ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase    ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize    ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase  ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize  ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase    ## CONSUMES

+  gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize    ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesBase       ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize       ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize            ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalBase               ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize               ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase              ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize              ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize            ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase          ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize          ## CONSUMES

+  gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase                    ## CONSUMES

+  gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize                    ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize                ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryBase           ## CONSUMES

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize           ## CONSUMES

+

+

+[Sources]

+  BiosInfo.c

+

+[Guids]

+  gBiosInfoGuid                                 ## PRODUCES

+

+[Depex]

+  gEfiPeiMasterBootModePpiGuid

-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Patch V2 6/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add DSC and build files
  2021-02-09  8:45 ` [Patch V2 6/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add DSC and build files Heng Luo
@ 2021-02-10  0:29   ` Chaganty, Rangasai V
  0 siblings, 0 replies; 18+ messages in thread
From: Chaganty, Rangasai V @ 2021-02-10  0:29 UTC (permalink / raw)
  To: Luo, Heng, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com> 

-----Original Message-----
From: Luo, Heng <heng.luo@intel.com> 
Sent: Tuesday, February 09, 2021 12:46 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [Patch V2 6/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add DSC and build files

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

Adds the DSC and build files necessary to build the
TigerlakeURvp board instance.

Key files:
  * build_config.cfg - Board-specific build configuration file.
  * OpenBoardPkg.dsc - The TigerlakeURvp board description file.
  * OpenBoardPkgPcd.dsc - Used for other PCD customization.
  * OpenBoardPkg.fdf - The TigerlakeURvp board flash file.
  * OpenBoardPkgBuildOption.dsc - Sets build options Based on PCD values.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc            | 347 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.fdf            | 702 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgBuildOption.dsc | 141 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc         | 392 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg            |  34 ++++++++++++++++++++++++++++++++++
 5 files changed, 1616 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
new file mode 100644
index 0000000000..a4265a839c
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc
@@ -0,0 +1,347 @@
+## @file

+#  The main build description file for the TigerlakeURvp board.

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  DEFINE      PLATFORM_PACKAGE          = MinPlatformPkg

+  DEFINE      PLATFORM_SI_PACKAGE       = TigerlakeSiliconPkg

+  DEFINE      PLATFORM_SI_BIN_PACKAGE   = TigerlakeSiliconBinPkg

+  DEFINE      PLATFORM_FSP_BIN_PACKAGE  = TigerLakeFspBinPkg/Client

+  DEFINE      PLATFORM_BOARD_PACKAGE    = TigerlakeOpenBoardPkg

+  DEFINE      BOARD                     = TigerlakeURvp

+  DEFINE      PROJECT                   = $(PLATFORM_BOARD_PACKAGE)/$(BOARD)

+  DEFINE      PEI_ARCH                  = IA32

+  DEFINE      DXE_ARCH                  = X64

+  DEFINE      TOP_MEMORY_ADDRESS        = 0x0

+

+  #

+  # Default value for OpenBoardPkg.fdf use

+  #

+  DEFINE BIOS_SIZE_OPTION = SIZE_120

+

+[Defines]

+  PLATFORM_NAME                         = $(PLATFORM_BOARD_PACKAGE)

+  PLATFORM_GUID                         = 465B0A0B-7AC1-443b-8F67-7B8DEC145F90

+  PLATFORM_VERSION                      = 0.1

+  DSC_SPECIFICATION                     = 0x00010005

+  OUTPUT_DIRECTORY                      = Build/$(PROJECT)

+  SUPPORTED_ARCHITECTURES               = IA32|X64

+  BUILD_TARGETS                         = DEBUG|RELEASE

+  SKUID_IDENTIFIER                      = ALL

+

+  FLASH_DEFINITION                      = $(PROJECT)/OpenBoardPkg.fdf

+  FIX_LOAD_TOP_MEMORY_ADDRESS           = 0x0

+

+  #

+  # Include PCD configuration for this board.

+  #

+  !include OpenBoardPkgPcd.dsc

+

+################################################################################

+#

+# SKU Identification section - list of all SKU IDs supported by this board.

+#

+################################################################################

+[SkuIds]

+  0|DEFAULT              # 0|DEFAULT is reserved and always required.

+  0x01|SkuIdTglU

+

+

+################################################################################

+#

+# Includes section - other DSC file contents included for this board build.

+#

+################################################################################

+

+#######################################

+# Library Includes

+#######################################

+!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreCommonLib.dsc

+!include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiLib.dsc

+!include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeLib.dsc

+

+[LibraryClasses.common]

+

+  PeiLib|$(PLATFORM_PACKAGE)/Library/PeiLib/PeiLib.inf

+  ReportFvLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/PeiReportFvLib/PeiReportFvLib.inf

+

+  PciHostBridgeLib|$(PLATFORM_PACKAGE)/Pci/Library/PciHostBridgeLibSimple/PciHostBridgeLibSimple.inf

+  PciSegmentInfoLib|$(PLATFORM_PACKAGE)/Pci/Library/PciSegmentInfoLibSimple/PciSegmentInfoLibSimple.inf

+  PlatformBootManagerLib|$(PLATFORM_PACKAGE)/Bds/Library/DxePlatformBootManagerLib/DxePlatformBootManagerLib.inf

+

+  PlatformHookLib|$(PLATFORM_BOARD_PACKAGE)/Library/BasePlatformHookLib/BasePlatformHookLib.inf

+

+  FspWrapperHobProcessLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/PeiFspWrapperHobProcessLib/PeiFspWrapperHobProcessLib.inf

+  PlatformSecLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/SecFspWrapperPlatformSecLib/SecFspWrapperPlatformSecLib.inf

+  PeiGetVtdPmrAlignmentLib|IntelSiliconPkg/Library/PeiGetVtdPmrAlignmentLib/PeiGetVtdPmrAlignmentLib.inf

+

+  FspWrapperApiLib|IntelFsp2WrapperPkg/Library/BaseFspWrapperApiLib/BaseFspWrapperApiLib.inf

+  FspWrapperApiTestLib|IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf

+

+  ConfigBlockLib|IntelSiliconPkg/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf

+

+  BoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/BoardInitLibNull/BoardInitLibNull.inf

+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf

+

+  PciSegmentLib|$(PLATFORM_SI_PACKAGE)/Library/BasePciSegmentMultiSegLibPci/BasePciSegmentMultiSegLibPci.inf

+  PciLib|MdePkg/Library/BasePciLibPciExpress/BasePciLibPciExpress.inf

+  ReportCpuHobLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/ReportCpuHobLib/ReportCpuHobLib.inf

+

+  #

+  # Silicon Init Package

+  #

+  !include $(PLATFORM_SI_PACKAGE)/SiPkgCommonLib.dsc

+

+  #

+  # Shell

+  #

+  ShellCommandLib|ShellPkg/Library/UefiShellCommandLib/UefiShellCommandLib.inf

+  HandleParsingLib|ShellPkg/Library/UefiHandleParsingLib/UefiHandleParsingLib.inf

+  BcfgCommandLib|ShellPkg/Library/UefiShellBcfgCommandLib/UefiShellBcfgCommandLib.inf

+

+[LibraryClasses.IA32]

+ FspWrapperPlatformLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf

+!if $(TARGET) == DEBUG

+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/PeiTestPointCheckLib.inf

+!endif

+  TestPointLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointLib/PeiTestPointLib.inf

+  MultiBoardInitSupportLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/MultiBoardInitSupportLib/PeiMultiBoardInitSupportLib.inf

+  BoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/MultiBoardInitSupportLib/PeiMultiBoardInitSupportLib.inf

+

+  #

+  # Silicon Init Package

+  #

+  !include $(PLATFORM_SI_PACKAGE)/SiPkgPeiLib.dsc

+

+  #

+  # Use Null library instance to skip MTRR initialization from MinPlatformPkg PlatformInit modules.

+  # MTRR configuration will be done by FSP or PlatformInitAdvanced modules.

+  #

+  SetCacheMtrrLib|$(PLATFORM_PACKAGE)/Library/SetCacheMtrrLib/SetCacheMtrrLibNull.inf

+

+  #

+  # SmmAccess

+  #

+  SmmAccessLib|IntelSiliconPkg/Feature/SmmAccess/Library/PeiSmmAccessLib/PeiSmmAccessLib.inf

+

+  SiliconPolicyInitLib|$(PLATFORM_BOARD_PACKAGE)/FspWrapper/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf

+  SiliconPolicyUpdateLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf

+

+  #######################################

+  # Board-specific

+  #######################################

+  PeiPlatformHookLib|$(PROJECT)/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf

+

+!if $(TARGET) == DEBUG

+  GpioCheckConflictLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Gpio/Library/BaseGpioCheckConflictLib/BaseGpioCheckConflictLib.inf

+!else

+  GpioCheckConflictLib|$(PLATFORM_SI_PACKAGE)/IpBlock/Gpio/Library/BaseGpioCheckConflictLibNull/BaseGpioCheckConflictLibNull.inf

+!endif

+

+[LibraryClasses.IA32.SEC]

+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SecTestPointCheckLib.inf

+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLibNull/TestPointCheckLibNull.inf

+  SecBoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SecBoardInitLibNull/SecBoardInitLibNull.inf

+

+[LibraryClasses.X64]

+  #

+  # DXE phase common

+  #

+  FspWrapperPlatformLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/DxeFspWrapperPlatformLib/DxeFspWrapperPlatformLib.inf

+!if $(TARGET) == DEBUG

+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/DxeTestPointCheckLib.inf

+!endif

+  TestPointLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointLib/DxeTestPointLib.inf

+  MultiBoardInitSupportLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/MultiBoardInitSupportLib/DxeMultiBoardInitSupportLib.inf

+  BoardInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/MultiBoardInitSupportLib/DxeMultiBoardInitSupportLib.inf

+  MultiBoardAcpiSupportLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf

+  BoardAcpiTableLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf

+  AslUpdateLib|$(PLATFORM_PACKAGE)/Acpi/Library/DxeAslUpdateLib/DxeAslUpdateLib.inf

+

+  SiliconPolicyInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyInitLibNull/SiliconPolicyInitLibNull.inf

+  SiliconPolicyUpdateLib|$(PLATFORM_BOARD_PACKAGE)/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf

+  BoardBdsHookLib|BoardModulePkg/Library/BoardBdsHookLib/BoardBdsHookLib.inf

+  BoardBootManagerLib|BoardModulePkg/Library/BoardBootManagerLib/BoardBootManagerLib.inf

+

+  #

+  # Silicon Init Package

+  #

+  !include $(PLATFORM_SI_PACKAGE)/SiPkgDxeLib.dsc

+

+[LibraryClasses.X64.DXE_SMM_DRIVER]

+  SpiFlashCommonLib|$(PLATFORM_BOARD_PACKAGE)/Library/SmmSpiFlashCommonLib/SmmSpiFlashCommonLib.inf

+!if $(TARGET) == DEBUG

+  TestPointCheckLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointCheckLib/SmmTestPointCheckLib.inf

+!endif

+  BoardAcpiEnableLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.inf

+  MultiBoardAcpiSupportLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/SmmMultiBoardAcpiSupportLib.inf

+  TestPointLib|$(PLATFORM_PACKAGE)/Test/Library/TestPointLib/SmmTestPointLib.inf

+

+[LibraryClasses.X64.DXE_RUNTIME_DRIVER]

+  ResetSystemLib|$(PLATFORM_SI_PACKAGE)/Pch/Library/BaseResetSystemLib/BaseResetSystemLib.inf

+

+[Components.IA32]

+

+  #

+  # Common

+  #

+  !include $(PLATFORM_PACKAGE)/Include/Dsc/CorePeiInclude.dsc

+

+  #

+  # FSP wrapper SEC Core

+  #

+  UefiCpuPkg/SecCore/SecCore.inf {

+    <LibraryClasses>

+      PcdLib|MdePkg/Library/PeiPcdLib/PeiPcdLib.inf

+  }

+

+  #

+  # Silicon

+  #

+  !include $(PLATFORM_SI_PACKAGE)/SiPkgPei.dsc

+

+  #

+  # Platform

+  #

+  $(PLATFORM_PACKAGE)/PlatformInit/ReportFv/ReportFvPei.inf

+  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf {

+    <LibraryClasses>

+      NULL|$(PROJECT)/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf

+  }

+  IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf {

+    <LibraryClasses>

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0

+      SiliconPolicyInitLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyInitLibNull/SiliconPolicyInitLibNull.inf

+      SiliconPolicyUpdateLib|$(PLATFORM_PACKAGE)/PlatformInit/Library/SiliconPolicyUpdateLibNull/SiliconPolicyUpdateLibNull.inf

+!endif

+  }

+

+  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf {

+    <LibraryClasses>

+      NULL|$(PROJECT)/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf

+  }

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0

+  $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf  {

+    <LibraryClasses>

+      NULL|$(PLATFORM_BOARD_PACKAGE)/FspWrapper/Library/PeiSiDefaultPolicyInitLib/PeiSiDefaultPolicyInitLib.inf

+  }

+  $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPreMem.inf {

+    <LibraryClasses>

+      NULL|$(PLATFORM_BOARD_PACKAGE)/FspWrapper/Library/PeiSiPreMemDefaultPolicyInitLib/PeiSiPreMemDefaultPolicyInitLib.inf

+      #

+      # In FSP Dispatch mode below dummy library should be linked to bootloader PEIM

+      # to build all DynamicEx PCDs that FSP consumes into bootloader PCD database.

+      #

+      NULL|$(PLATFORM_FSP_BIN_PACKAGE)/Library/FspPcdListLib/FspPcdListLibNull.inf

+  }

+!endif

+  $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf

+  $(PLATFORM_PACKAGE)/Services/StallServicePei/StallServicePei.inf

+

+  IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf

+

+  #

+  MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.inf

+  # Security

+  #

+!if gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable == TRUE

+  $(PLATFORM_PACKAGE)/Tcg/Tcg2PlatformPei/Tcg2PlatformPei.inf

+!endif

+ MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf {

+   <LibraryClasses>

+     ResetSystemLib|$(PLATFORM_SI_PACKAGE)/Pch/Library/BaseResetSystemLib/BaseResetSystemLib.inf

+ }

+

+[Components.X64]

+

+  #

+  # Common

+  #

+  !include $(PLATFORM_PACKAGE)/Include/Dsc/CoreDxeInclude.dsc

+

+  #

+  #UEFI Shell

+  #

+  ShellPkg/Application/Shell/Shell.inf {

+    <LibraryClasses>

+      NULL|ShellPkg/Library/UefiShellLevel2CommandsLib/UefiShellLevel2CommandsLib.inf

+      NULL|ShellPkg/Library/UefiShellLevel1CommandsLib/UefiShellLevel1CommandsLib.inf

+      NULL|ShellPkg/Library/UefiShellLevel3CommandsLib/UefiShellLevel3CommandsLib.inf

+      NULL|ShellPkg/Library/UefiShellDriver1CommandsLib/UefiShellDriver1CommandsLib.inf

+      NULL|ShellPkg/Library/UefiShellInstall1CommandsLib/UefiShellInstall1CommandsLib.inf

+      NULL|ShellPkg/Library/UefiShellDebug1CommandsLib/UefiShellDebug1CommandsLib.inf

+      NULL|ShellPkg/Library/UefiShellNetwork1CommandsLib/UefiShellNetwork1CommandsLib.inf

+

+    <PcdsFixedAtBuild>

+      gEfiShellPkgTokenSpaceGuid.PcdShellLibAutoInitialize|FALSE

+  }

+

+  UefiCpuPkg/CpuDxe/CpuDxe.inf

+  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf

+

+  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf

+  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf

+  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf

+  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf

+  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf

+

+  BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.inf

+

+  #

+  # Silicon

+  #

+  !include $(PLATFORM_SI_PACKAGE)/SiPkgDxe.dsc

+  $(PLATFORM_SI_BIN_PACKAGE)/Microcode/MicrocodeUpdates.inf

+

+  #

+  # SmmAccess

+  #

+  IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccess.inf

+

+  #

+  # Platform

+  #

+  $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyDxe/SiliconPolicyDxe.inf

+  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitDxe/PlatformInitDxe.inf

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1

+  IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf

+!endif

+  $(PLATFORM_PACKAGE)/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf

+

+  $(PLATFORM_PACKAGE)/Test/TestPointStubDxe/TestPointStubDxe.inf

+  $(PLATFORM_PACKAGE)/Test/TestPointDumpApp/TestPointDumpApp.inf

+

+  #

+  # OS Boot

+  #

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE

+  $(PLATFORM_PACKAGE)/Acpi/AcpiTables/AcpiPlatform.inf

+  $(PLATFORM_PACKAGE)/Acpi/MinDsdt/MinDsdt.inf

+  $(PLATFORM_PACKAGE)/Acpi/AcpiSmm/AcpiSmm.inf {

+    <LibraryClasses>

+      NULL|$(PROJECT)/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf

+  }

+

+  $(PLATFORM_PACKAGE)/Flash/SpiFvbService/SpiFvbServiceSmm.inf

+  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitSmm/PlatformInitSmm.inf

+

+  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf {

+    <LibraryClasses>

+      SmmCpuFeaturesLib|UefiCpuPkg/Library/SmmCpuFeaturesLib/SmmCpuFeaturesLib.inf

+  }

+!endif

+

+  #

+  # Security

+  #

+  $(PLATFORM_PACKAGE)/Hsti/HstiIbvPlatformDxe/HstiIbvPlatformDxe.inf

+!if gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable == TRUE

+  $(PLATFORM_PACKAGE)/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf

+!endif

+

+  !include $(PLATFORM_SI_PACKAGE)/SiPkgBuildOption.dsc

+  !include OpenBoardPkgBuildOption.dsc

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.fdf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.fdf
new file mode 100644
index 0000000000..0f645ed63e
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.fdf
@@ -0,0 +1,702 @@
+## @file

+#  FDF file of Platform.

+#

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+   !include $(PROJECT)/Include/Fdf/FlashMapInclude.fdf

+

+################################################################################

+#

+# FD Section

+# The [FD] Section is made up of the definition statements and a

+# description of what goes into  the Flash Device Image.  Each FD section

+# defines one flash "device" image.  A flash device image may be one of

+# the following: Removable media bootable image (like a boot floppy

+# image,) an Option ROM image (that would be "flashed" into an add-in

+# card,) a System "Flash"  image (that would be burned into a system's

+# flash) or an Update ("Capsule") image that will be used to update and

+# existing system flash.

+#

+################################################################################

+[FD.TigerlakeURvp]

+#

+# FD Tokens, BaseAddress, Size, ErasePolarity, BlockSize, and NumBlocks, cannot be

+# assigned with PCD values. Instead, it uses the definitions for its variety, which

+# are FLASH_BASE, FLASH_SIZE, FLASH_BLOCK_SIZE and FLASH_NUM_BLOCKS.

+#

+BaseAddress   = $(FLASH_BASE) | gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress  #The base address of the FLASH Device.

+Size          = $(FLASH_SIZE) | gSiPkgTokenSpaceGuid.PcdBiosSize             #The size in bytes of the FLASH Device

+ErasePolarity = 1

+BlockSize     = $(FLASH_BLOCK_SIZE)

+NumBlocks     = $(FLASH_NUM_BLOCKS)

+

+DEFINE SIPKG_DXE_SMM_BIN  = INF

+DEFINE SIPKG_PEI_BIN      = INF

+

+# Set FLASH_REGION_FV_RECOVERY_OFFSET to PcdNemCodeCacheBase, because macro expression is not supported.

+# So, PlatformSecLib uses PcdFlashAreaBaseAddress + PcdNemCodeCacheBase to get the real CodeCache base address.

+SET gSiPkgTokenSpaceGuid.PcdNemCodeCacheBase = $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset)

+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset)

+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeOffset = 0x1000

+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset)

+SET gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize = $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize)

+SET gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchAddress = $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase) + $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeOffset)

+SET gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize = $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize) - $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeOffset)

+SET gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchAddress = $(gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchAddress)

+SET gIntelFsp2WrapperTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize = $(gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize)

+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFlashMicrocodeOffset = $(gSiPkgTokenSpaceGuid.PcdFlashMicrocodeOffset)

+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheAddress = gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress

+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFlashCodeCacheSize    = gSiPkgTokenSpaceGuid.PcdBiosSize

+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset)

+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset)

+SET gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress = $(gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress) + $(gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset)

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeBase    = gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeSize    = gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashFvMicrocodeOffset  = gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress    = gSiPkgTokenSpaceGuid.PcdBiosAreaBaseAddress

+SET gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize           = gSiPkgTokenSpaceGuid.PcdBiosSize

+################################################################################

+#

+# Following are lists of FD Region layout which correspond to the locations of different

+# images within the flash device.

+#

+# Regions must be defined in ascending order and may not overlap.

+#

+# A Layout Region start with a eight digit hex offset (leading "0x" required) followed by

+# the pipe "|" character, followed by the size of the region, also in hex with the leading

+# "0x" characters. Like:

+# Offset|Size

+# PcdOffsetCName|PcdSizeCName

+# RegionType <FV, DATA, or FILE>

+# Fv Size can be adjusted

+#

+################################################################################

+gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageVariableOffset|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize

+gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize

+#NV_VARIABLE_STORE

+DATA = {

+  ## This is the EFI_FIRMWARE_VOLUME_HEADER

+  # ZeroVector []

+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+  # FileSystemGuid

+  0x8D, 0x2B, 0xF1, 0xFF, 0x96, 0x76, 0x8B, 0x4C,

+  0xA9, 0x85, 0x27, 0x47, 0x07, 0x5B, 0x4F, 0x50,

+  # FvLength: 0x60000

+  0x00, 0x00, 0x06, 0x00, 0x00, 0x00, 0x00, 0x00,

+  #Signature "_FVH"       #Attributes

+  0x5F, 0x46, 0x56, 0x48, 0xFF, 0xFE, 0x04, 0x00,

+  #HeaderLength #CheckSum #ExtHeaderOffset #Reserved #Revision

+  #

+  # Be careful on CheckSum field.

+  #

+  0x48, 0x00, 0x2E, 0x09, 0x00, 0x00, 0x00, 0x02,

+  #Blockmap[0]: 6 Blocks  0x10000 Bytes / Block

+  0x06, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x00,

+  #Blockmap[1]: End

+  0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,

+  ## This is the VARIABLE_STORE_HEADER

+!if gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable == TRUE

+  #  Signature: gEfiAuthenticatedVariableGuid = { 0xaaf32c78, 0x947b, 0x439a, { 0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92 }}

+  0x78, 0x2c, 0xf3, 0xaa, 0x7b, 0x94, 0x9a, 0x43,

+  0xa1, 0x80, 0x2e, 0x14, 0x4e, 0xc3, 0x77, 0x92,

+!else

+  #  Signature: gEfiVariableGuid = { 0xddcf3616, 0x3275, 0x4164, { 0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d }}

+  0x16, 0x36, 0xcf, 0xdd, 0x75, 0x32, 0x64, 0x41,

+  0x98, 0xb6, 0xfe, 0x85, 0x70, 0x7f, 0xfe, 0x7d,

+!endif

+  #Size: 0x2E000 (gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageVariableSize) - 0x48 (size of EFI_FIRMWARE_VOLUME_HEADER) = 0x2DFB8

+  # This can speed up the Variable Dispatch a bit.

+  0xB8, 0xDF, 0x02, 0x00,

+  #FORMATTED: 0x5A #HEALTHY: 0xFE #Reserved: UINT16 #Reserved1: UINT32

+  0x5A, 0xFE, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

+}

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingOffset|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize

+gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwWorkingSize

+#NV_FTW_WORKING

+DATA = {

+  # EFI_FAULT_TOLERANT_WORKING_BLOCK_HEADER->Signature = gEdkiiWorkingBlockSignatureGuid         =

+  #  { 0x9e58292b, 0x7c68, 0x497d, { 0xa0, 0xce, 0x65,  0x0, 0xfd, 0x9f, 0x1b, 0x95 }}

+  0x2b, 0x29, 0x58, 0x9e, 0x68, 0x7c, 0x7d, 0x49,

+  0xa0, 0xce, 0x65,  0x0, 0xfd, 0x9f, 0x1b, 0x95,

+  # Crc:UINT32            #WorkingBlockValid:1, WorkingBlockInvalid:1, Reserved

+  0xE2, 0x33, 0xF2, 0x03, 0xFE, 0xFF, 0xFF, 0xFF,

+  # WriteQueueSize: UINT64

+  0xE0, 0x1F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00

+}

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareOffset|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize

+gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareBase|gEfiMdeModulePkgTokenSpaceGuid.PcdFlashNvStorageFtwSpareSize

+#NV_FTW_SPARE

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvAdvancedSize

+FV = FvAdvanced

+

+gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalOffset|gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize

+gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalBase|gBoardModuleTokenSpaceGuid.PcdFlashFvOptionalSize

+FV = FvOptional

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvOsBootSize

+FV = FvOsBoot

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvUefiBootSize

+FV = FvUefiBoot

+

+gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesOffset|gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize

+gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesBase|gBoardModuleTokenSpaceGuid.PcdFlashFvFirmwareBinariesSize

+FV = FvFwBinaries

+

+gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvOffset|gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize

+gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvBase|gSiPkgTokenSpaceGuid.PcdFlashMicrocodeFvSize

+#Microcode

+FV = FvMicrocode

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemorySize

+FV = FvPostMemory

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspSSize

+# FSP_S Section

+FILE = $(PLATFORM_FSP_BIN_PACKAGE)/Fsp_Rebased_S.fd

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspMSize

+# FSP_M Section

+FILE = $(PLATFORM_FSP_BIN_PACKAGE)/Fsp_Rebased_M.fd

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvFspTSize

+# FSP_T Section

+FILE = $(PLATFORM_FSP_BIN_PACKAGE)/Fsp_Rebased_T.fd

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecurityBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvSecuritySize

+FV = FvSecurityPreMemory

+

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryOffset|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize

+gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemoryBase|gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPreMemorySize

+FV = FvPreMemory

+

+################################################################################

+#

+# FV Section

+#

+# [FV] section is used to define what components or modules are placed within a flash

+# device file.  This section also defines order the components and modules are positioned

+# within the image.  The [FV] section consists of define statements, set statements and

+# module statements.

+#

+################################################################################

+[FV.FvMicrocode]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+

+INF RuleOverride = MICROCODE $(PLATFORM_SI_BIN_PACKAGE)/Microcode/MicrocodeUpdates.inf

+

+[FV.FvPreMemory]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = FC8FE6B5-CD9B-411E-BD8F-31824D0CDE3D

+

+INF  UefiCpuPkg/SecCore/SecCore.inf

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1

+INF  MdeModulePkg/Core/Pei/PeiMain.inf

+!endif

+!include $(PLATFORM_PACKAGE)/Include/Fdf/CorePreMemoryInclude.fdf

+

+INF $(PLATFORM_PACKAGE)/PlatformInit/ReportFv/ReportFvPei.inf

+INF IntelFsp2WrapperPkg/FspmWrapperPeim/FspmWrapperPeim.inf

+

+INF $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitPei/PlatformInitPreMem.inf

+INF $(PLATFORM_BOARD_PACKAGE)/BiosInfo/BiosInfo.inf

+INF MdeModulePkg/Universal/ResetSystemPei/ResetSystemPei.inf

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0

+INF $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPreMem.inf

+# Provide gEfiPeiStallPpiGuid for FSP dispatch mode

+INF $(PLATFORM_PACKAGE)/Services/StallServicePei/StallServicePei.inf

+!endif

+

+[FV.FvPostMemoryUncompact]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = 7C4DCFC6-AECA-4707-85B9-FD4B2EEA49E7

+

+!include $(PLATFORM_PACKAGE)/Include/Fdf/CorePostMemoryInclude.fdf

+

+# Init Board Config PCD

+INF $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitPei/PlatformInitPostMem.inf

+INF IntelFsp2WrapperPkg/FspsWrapperPeim/FspsWrapperPeim.inf

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0

+INF $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyPei/SiliconPolicyPeiPostMem.inf

+

+!endif

+

+!if gSiPkgTokenSpaceGuid.PcdPeiDisplayEnable == TRUE

+FILE FREEFORM = PCD(gIntelSiliconPkgTokenSpaceGuid.PcdIntelGraphicsVbtFileGuid) {

+  SECTION RAW = $(PLATFORM_FSP_BIN_PACKAGE)/SampleCode/Vbt/Vbt.bin

+  SECTION UI  = "Vbt"

+}

+FILE FREEFORM = 7BB28B99-61BB-11D5-9A5D-0090273FC14D {

+  SECTION RAW = MdeModulePkg/Logo/Logo.bmp

+}

+!endif # PcdPeiDisplayEnable

+INF MdeModulePkg/Bus/Pci/NvmExpressPei/NvmExpressPei.inf

+

+[FV.FvPostMemory]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = 9DFE49DB-8EF0-4D9C-B273-0036144DE917

+

+FILE FV_IMAGE = 244FAAF4-FAE1-4892-8B7D-7EF84CBFA709 {

+      SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {

+        SECTION FV_IMAGE = FvPostMemoryUncompact

+      }

+      SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {

+        SECTION FV_IMAGE = FvSecurityPostMemory

+      }

+      SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {

+        SECTION FV_IMAGE = FvSecurityLate

+      }

+}

+

+[FV.FvUefiBootUncompact]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = A881D567-6CB0-4eee-8435-2E72D33E45B5

+

+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreUefiBootInclude.fdf

+

+INF  UefiCpuPkg/CpuDxe/CpuDxe.inf

+INF  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridgeDxe.inf

+

+INF  MdeModulePkg/Bus/Pci/SataControllerDxe/SataControllerDxe.inf

+INF  MdeModulePkg/Bus/Ata/AtaBusDxe/AtaBusDxe.inf

+INF  MdeModulePkg/Bus/Ata/AtaAtapiPassThru/AtaAtapiPassThru.inf

+INF  MdeModulePkg/Bus/Pci/NvmExpressDxe/NvmExpressDxe.inf

+INF  MdeModulePkg/Universal/Console/GraphicsOutputDxe/GraphicsOutputDxe.inf

+INF  BoardModulePkg/BoardBdsHookDxe/BoardBdsHookDxe.inf

+

+#

+#UEFI Shell

+#

+# Note : gUefiShellFileGuid is FILE GUID for MinUefiShell.inf/UefiShell.inf/Shell.inf.

+#        The GUID has to be changed according to the change you make to override MinUefiShell.inf/UefiShell.inf/Shell.inf FILE_GUID.

+#

+FILE APPLICATION = 7C04A583-9E3E-4F1C-AD65-E05268D0B4D1 {

+!if $(TARGET) == DEBUG

+  SECTION PE32 = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/X64/ShellPkg/Application/Shell/Shell/OUTPUT/Shell.efi

+!else

+  SECTION PE32 = $(OUTPUT_DIRECTORY)/$(TARGET)_$(TOOL_CHAIN_TAG)/X64/ShellPkg/Application/Shell/Shell/OUTPUT/Shell.efi

+!endif

+  SECTION UI = "EdkShell"

+}

+

+INF  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitDxe/PlatformInitDxe.inf

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1

+INF  IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf

+!endif

+INF  $(PLATFORM_PACKAGE)/Test/TestPointStubDxe/TestPointStubDxe.inf

+

+FILE FV_IMAGE = C6CE361E-4554-41E5-AF27-C3FADBA6DA9C {

+  SECTION FV_IMAGE = $(PLATFORM_FSP_BIN_PACKAGE)/FvLateSilicon.fv

+}

+

+[FV.FvUefiBoot]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = 0496D33D-EA79-495C-B65D-ABF607184E3B

+

+FILE FV_IMAGE = 9E21FD93-9C72-4c15-8C4B-E77F1DB2D792 {

+       SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {

+         SECTION FV_IMAGE = FvUefiBootUncompact

+       }

+     }

+

+[FV.FvOsBootUncompact]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = A0F04529-B715-44C6-BCA4-2DEBDD01EEEC

+

+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreOsBootInclude.fdf

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE

+INF  $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyDxe/SiliconPolicyDxe.inf

+INF  $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitSmm/PlatformInitSmm.inf

+INF  $(PLATFORM_PACKAGE)/Flash/SpiFvbService/SpiFvbServiceSmm.inf

+

+INF  UefiCpuPkg/PiSmmCpuDxeSmm/PiSmmCpuDxeSmm.inf

+INF  $(PLATFORM_PACKAGE)/Acpi/AcpiTables/AcpiPlatform.inf

+INF  $(PLATFORM_PACKAGE)/Acpi/AcpiSmm/AcpiSmm.inf

+

+INF  RuleOverride = DRIVER_ACPITABLE $(PLATFORM_PACKAGE)/Acpi/MinDsdt/MinDsdt.inf

+INF  $(PLATFORM_PACKAGE)/FspWrapper/SaveMemoryConfig/SaveMemoryConfig.inf

+

+!endif

+

+[FV.FvLateSilicon]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = 97F09B89-9E83-4DDC-A3D1-10C4AF539D1E

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE

+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/Pch/PchInit/Dxe/PchInitDxeTgl.inf

+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/SystemAgent/SaInit/Dxe/SaInitDxe.inf

+

+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/Pch/PchSmiDispatcher/Smm/PchSmiDispatcher.inf

+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/Pch/SmmControl/RuntimeDxe/SmmControl.inf

+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/IpBlock/Spi/Smm/SpiSmm.inf

+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/Pch/PchInit/Smm/PchInitSmm.inf

+

+!if gSiPkgTokenSpaceGuid.PcdAcpiEnable == TRUE

+INF  RuleOverride = ACPITABLE $(PLATFORM_SI_PACKAGE)/SystemAgent/AcpiTables/SaSsdt/SaSsdt.inf

+INF  RuleOverride = ACPITABLE $(PLATFORM_SI_PACKAGE)/IpBlock/Graphics/AcpiTables/IgfxSsdt.inf

+!endif

+!endif #PcdBootToShellOnly

+

+$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/SystemAgent/SaInit/Smm/SaLateInitSmm.inf

+

+[FV.FvOsBoot]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = 13BF8810-75FD-4B1A-91E6-E16C4201F80A

+

+FILE FV_IMAGE = B9020753-84A8-4BB6-947C-CE7D41F5CE39 {

+       SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {

+         SECTION FV_IMAGE = FvOsBootUncompact

+       }

+     }

+

+FILE FV_IMAGE = D4632741-510C-44E3-BE21-C3D6D7881485 {

+       SECTION GUIDED EE4E5898-3914-4259-9D6E-DC7BD79403CF PROCESSING_REQUIRED = TRUE {

+         SECTION FV_IMAGE = FvLateSilicon

+       }

+     }

+

+[FV.FvSecurityPreMemory]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16         #FV alignment and FV attributes setting.

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = 9B7FA59D-71C6-4A36-906E-9725EA6ADD5B

+

+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreSecurityPreMemoryInclude.fdf

+

+[FV.FvSecurityPostMemory]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16         #FV alignment and FV attributes setting.

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = 4199E560-54AE-45E5-91A4-F7BC3804E14A

+

+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreSecurityPostMemoryInclude.fdf

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable == TRUE

+INF $(CLIENT_COMMON_PACKAGE)/Universal/Tcg2PlatformPei/Tcg2PlatformPei.inf

+!endif

+

+[FV.FvSecurityLate]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = F753FE9A-EEFD-485B-840B-E032D538102C

+

+!include $(PLATFORM_PACKAGE)/Include/Fdf/CoreSecurityLateInclude.fdf

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly == FALSE

+

+INF  $(PLATFORM_PACKAGE)/Hsti/HstiIbvPlatformDxe/HstiIbvPlatformDxe.inf

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable == TRUE

+INF  $(PLATFORM_PACKAGE)/Tcg/Tcg2PlatformDxe/Tcg2PlatformDxe.inf

+!endif

+

+!endif

+INF  IntelSiliconPkg/Feature/SmmAccess/SmmAccessDxe/SmmAccess.inf

+

+#

+# Do not use nested FV in PEI phase as current FMMT cannot handle it properly when deleting modules.

+#

+#[FV.FvSecurity]

+#BlockSize          = $(FLASH_BLOCK_SIZE)

+#FvAlignment        = 16

+#ERASE_POLARITY     = 1

+#MEMORY_MAPPED      = TRUE

+#STICKY_WRITE       = TRUE

+#LOCK_CAP           = TRUE

+#LOCK_STATUS        = TRUE

+#WRITE_DISABLED_CAP = TRUE

+#WRITE_ENABLED_CAP  = TRUE

+#WRITE_STATUS       = TRUE

+#WRITE_LOCK_CAP     = TRUE

+#WRITE_LOCK_STATUS  = TRUE

+#READ_DISABLED_CAP  = TRUE

+#READ_ENABLED_CAP   = TRUE

+#READ_STATUS        = TRUE

+#READ_LOCK_CAP      = TRUE

+#READ_LOCK_STATUS   = TRUE

+#FvNameGuid         = 5A9A8B4E-149A-4CB2-BDC7-C8D62DE2C8CF

+

+#FILE FV_IMAGE = 757CC075-1428-423D-A73C-22639706C119 {

+#       SECTION FV_IMAGE = FvSecurityPreMemory

+#     }

+

+

+[FV.FvAdvanced]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = B23E7388-9953-45C7-9201-0473DDE5487A

+

+

+[FV.FvFwBinaries]

+BlockSize     = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = 8B98AB22-E354-42f0-88B9-049810F0FDAA

+

+

+

+

+

+[FV.FvOptional]

+BlockSize          = $(FLASH_BLOCK_SIZE)

+FvAlignment        = 16

+ERASE_POLARITY     = 1

+MEMORY_MAPPED      = TRUE

+STICKY_WRITE       = TRUE

+LOCK_CAP           = TRUE

+LOCK_STATUS        = TRUE

+WRITE_DISABLED_CAP = TRUE

+WRITE_ENABLED_CAP  = TRUE

+WRITE_STATUS       = TRUE

+WRITE_LOCK_CAP     = TRUE

+WRITE_LOCK_STATUS  = TRUE

+READ_DISABLED_CAP  = TRUE

+READ_ENABLED_CAP   = TRUE

+READ_STATUS        = TRUE

+READ_LOCK_CAP      = TRUE

+READ_LOCK_STATUS   = TRUE

+FvNameGuid         = 9574B1CE-EE93-451E-B500-3E5F564244DE

+################################################################################

+#

+# Rules are use with the [FV] section's module INF type to define

+# how an FFS file is created for a given INF file. The following Rule are the default

+# rules for the different module type. User can add the customized rules to define the

+# content of the FFS file.

+#

+################################################################################

+

+!include $(PLATFORM_PACKAGE)/Include/Fdf/RuleInclude.fdf

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgBuildOption.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgBuildOption.dsc
new file mode 100644
index 0000000000..b72329846a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgBuildOption.dsc
@@ -0,0 +1,141 @@
+## @file

+# platform build option configuration file.

+#

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[BuildOptions]

+# Define Build Options both for EDK and EDKII drivers.

+

+

+  DEFINE DSC_S3_BUILD_OPTIONS =

+

+!if gSiPkgTokenSpaceGuid.PcdAcpiEnable == TRUE

+  DEFINE DSC_ACPI_BUILD_OPTIONS = -DACPI_SUPPORT=1

+!else

+  DEFINE DSC_ACPI_BUILD_OPTIONS =

+!endif

+

+  DEFINE BIOS_GUARD_BUILD_OPTIONS =

+

+  DEFINE OVERCLOCKING_BUILD_OPTION =

+

+  DEFINE FSP_BINARY_BUILD_OPTIONS =

+

+  DEFINE FSP_WRAPPER_BUILD_OPTIONS = -DFSP_WRAPPER_FLAG

+

+  DEFINE SKIP_FSP_TEMPRAM_INIT_AND_EXIT_OPTIONS =

+

+!if gSiPkgTokenSpaceGuid.PcdOptimizeCompilerEnable == FALSE

+  DEFINE OPTIMIZE_DISABLE_OPTIONS = -Od -GL-

+!else

+  DEFINE OPTIMIZE_DISABLE_OPTIONS =

+!endif

+

+  DEFINE UP_SERVER_SUPPORT_BUILD_OPTIONS =

+

+

+  DEFINE TPM_BUILD_OPTION =

+

+  DEFINE TPM2_BUILD_OPTION =

+

+  DEFINE DSC_TBT_BUILD_OPTIONS =

+

+  DEFINE DSC_DCTT_BUILD_OPTIONS =

+

+  DEFINE EMB_BUILD_OPTIONS =

+

+  DEFINE DSC_MEMORY_DOWN_BUILD_OPTIONS = -DMEM_DOWN_FLAG=1

+

+  DEFINE DSC_KBCEMUL_BUILD_OPTIONS =

+

+  DEFINE BOOT_GUARD_BUILD_OPTIONS =

+

+  DEFINE SECURE_BOOT_BUILD_OPTIONS =

+

+  DEFINE USBTYPEC_BUILD_OPTION =

+

+  DEFINE CAPSULE_BUILD_OPTIONS =

+

+  DEFINE PERFORMANCE_BUILD_OPTION =

+

+  DEFINE DEBUGUSEUSB_BUILD_OPTION =

+

+  DEFINE DISABLE_NEW_DEPRECATED_INTERFACES_BUILD_OPTION = -DDISABLE_NEW_DEPRECATED_INTERFACES=1

+

+  DEFINE SINITBIN_BUILD_OPTION =

+

+  DEFINE MINTREE_FLAG_BUILD_OPTION = -DMINTREE_FLAG=1

+

+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_SIPKG_FEATURE_BUILD_OPTIONS)  $(OVERCLOCKING_BUILD_OPTION) $(PERFORMANCE_BUILD_OPTION) $(EMB_BUILD_OPTIONS) $(BIOS_GUARD_BUILD_OPTIONS) $(DSC_TBT_BUILD_OPTIONS)

+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(BOOT_GUARD_BUILD_OPTIONS) $(DSC_MEMORY_DOWN_BUILD_OPTIONS) $(DEBUGUSEUSB_BUILD_OPTION) $(DSC_S3_BUILD_OPTIONS)

+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(FSP_BINARY_BUILD_OPTIONS) $(FSP_WRAPPER_BUILD_OPTIONS) $(SKIP_FSP_TEMPRAM_INIT_AND_EXIT_OPTIONS)

+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(DSC_KBCEMUL_BUILD_OPTIONS) $(CAPSULE_BUILD_OPTIONS) $(SECURE_BOOT_BUILD_OPTIONS) $(DISABLE_NEW_DEPRECATED_INTERFACES_BUILD_OPTION)

+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(TPM2_BUILD_OPTION) $(TPM_BUILD_OPTION) $(DSC_DCTT_BUILD_OPTIONS)

+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(DSC_ACPI_BUILD_OPTIONS) $(UP_SERVER_SUPPORT_BUILD_OPTIONS) $(USBTYPEC_BUILD_OPTION) $(SINITBIN_BUILD_OPTION) $(MINTREE_FLAG_BUILD_OPTION)

+DEFINE DSC_PLTPKG_FEATURE_BUILD_OPTIONS = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+

+[BuildOptions.Common.EDKII]

+

+#

+# For IA32 Global Build Flag

+#

+       *_*_IA32_CC_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) -D PI_SPECIFICATION_VERSION=0x00010015 -DASF_PEI

+       *_*_IA32_VFRPP_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+       *_*_IA32_APP_FLAGS     = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+       *_*_IA32_ASLPP_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+       *_*_IA32_ASLCC_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+       *_*_IA32_NASM_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+

+#

+# For IA32 Specific Build Flag

+#

+GCC:   *_*_IA32_PP_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+MSFT:  *_*_IA32_ASM_FLAGS     = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+MSFT:  *_*_IA32_CC_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS) -D PI_SPECIFICATION_VERSION=0x00010015 -DASF_PEI

+MSFT:  *_*_IA32_VFRPP_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)

+MSFT:  *_*_IA32_APP_FLAGS     = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)

+MSFT:  *_*_IA32_ASLPP_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)

+MSFT:  *_*_IA32_ASLCC_FLAGS   = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)

+

+#

+# For X64 Global Build Flag

+#

+       *_*_X64_CC_FLAGS       = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) -D PI_SPECIFICATION_VERSION=0x00010015

+       *_*_X64_VFRPP_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+       *_*_X64_APP_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+       *_*_X64_ASLPP_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+       *_*_X64_ASLCC_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+       *_*_X64_NASM_FLAGS     = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+

+

+#

+# For X64 Specific Build Flag

+#

+GCC:   *_*_X64_PP_FLAGS       = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+MSFT:  *_*_X64_ASM_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+MSFT:  *_*_X64_CC_FLAGS       = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS) -D PI_SPECIFICATION_VERSION=0x00010015

+MSFT:  *_*_X64_VFRPP_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)

+MSFT:  *_*_X64_APP_FLAGS      = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS) $(OPTIMIZE_DISABLE_OPTIONS)

+MSFT:  *_*_X64_ASLPP_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+MSFT:  *_*_X64_ASLCC_FLAGS    = $(DSC_PLTPKG_FEATURE_BUILD_OPTIONS)

+

+

+# Force PE/COFF sections to be aligned at 4KB boundaries to support page level protection

+[BuildOptions.common.EDKII.DXE_SMM_DRIVER, BuildOptions.common.EDKII.SMM_CORE]

+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096

+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000

+

+# Force PE/COFF sections to be aligned at 4KB boundaries to support MemoryAttribute table

+[BuildOptions.common.EDKII.DXE_RUNTIME_DRIVER]

+  MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096

+  GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000

+

+# Force PE/COFF sections to be aligned at 4KB boundaries to support NX protection

+[BuildOptions.common.EDKII.DXE_DRIVER, BuildOptions.common.EDKII.DXE_CORE, BuildOptions.common.EDKII.UEFI_DRIVER, BuildOptions.common.EDKII.UEFI_APPLICATION]

+  #MSFT:*_*_*_DLINK_FLAGS = /ALIGN:4096

+  #GCC:*_*_*_DLINK_FLAGS = -z common-page-size=0x1000

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc
new file mode 100644
index 0000000000..a048efcc18
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc
@@ -0,0 +1,392 @@
+## @file

+#  PCD configuration build description file for the TigerlakeURvp board.

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+################################################################################

+#

+# Pcd Section - list of all PCD Entries used by this board.

+#

+################################################################################

+

+[PcdsFixedAtBuild.common]

+  ######################################

+  # Key Boot Stage and FSP configuration

+  ######################################

+  #

+  # Please select the Boot Stage here.

+  # Stage 1 - enable debug (system deadloop after debug init)

+  # Stage 2 - mem init (system deadloop after mem init)

+  # Stage 3 - boot to shell only

+  # Stage 4 - boot to OS

+  # Stage 5 - boot to OS with security boot enabled

+  # Stage 6 - boot with advanced features enabled

+  #

+  gMinPlatformPkgTokenSpaceGuid.PcdBootStage|4

+

+  #

+  # 0: FSP Wrapper is running in Dispatch mode.

+  # 1: FSP Wrapper is running in API mode.

+  # Note: Dispatch mode is currently NOT supported for this board.

+  #

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection|0

+

+  #

+  # FALSE: The board is not a FSP wrapper (FSP binary not used)

+  # TRUE:  The board is a FSP wrapper (FSP binary is used)

+  #

+  gMinPlatformPkgTokenSpaceGuid.PcdFspWrapperBootMode|TRUE

+

+  #

+  # FSP Base address PCD will be updated in FDF basing on flash map.

+  #

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0

+

+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase|0xFEF00000

+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize|0x00080000

+  gSiPkgTokenSpaceGuid.PcdTemporaryRamBase|0xFEF80000

+  gSiPkgTokenSpaceGuid.PcdTemporaryRamSize|0x00040000

+  gSiPkgTokenSpaceGuid.PcdTsegSize|0x1000000

+

+  #

+  # PCD declared for TigerlakeSiliconPkg Fru

+  #

+  gSiPkgTokenSpaceGuid.PcdBiosGuardEnable|FALSE

+  gSiPkgTokenSpaceGuid.PcdCpuPcieEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdEmbeddedEnable|0x0

+  gSiPkgTokenSpaceGuid.PcdThcEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdMrcTraceMessageSupported|TRUE

+

+  ######################################

+  # Silicon Configuration

+  ######################################

+  # Build switches

+  gSiPkgTokenSpaceGuid.PcdOptimizeCompilerEnable|TRUE

+

+  # CPU

+  gSiPkgTokenSpaceGuid.PcdSourceDebugEnable|FALSE

+

+  # SA

+  gSiPkgTokenSpaceGuid.PcdIgdEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdPegEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdSaDmiEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdVtdEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdPeiDisplayEnable|TRUE

+

+  # ME

+  gSiPkgTokenSpaceGuid.PcdAtaEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdPttEnable|FALSE

+  gSiPkgTokenSpaceGuid.PcdJhiEnable|TRUE

+

+  # Others

+  gSiPkgTokenSpaceGuid.PcdAcpiEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdBdatEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdCpuPowerOnConfigEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdIntegratedTouchEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdOcWdtEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdOverclockEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdPpmEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdS3Enable|TRUE

+  gSiPkgTokenSpaceGuid.PcdSerialIoUartEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdSiCatalogDebugEnable|FALSE

+  gSiPkgTokenSpaceGuid.PcdSmbiosEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdSmmVariableEnable|TRUE

+  gSiPkgTokenSpaceGuid.PcdFspWrapperEnable|TRUE

+

+  #

+  # When sharing stack with boot loader, FSP only needs a small temp ram for heap

+  #

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1

+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize|0x00020000

+!else

+      #

+      # FSP Dispatch mode will not establish separate Stack or Heap.

+      #

+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize|0

+!endif

+

+  #

+  # Boot loader stack size has to be large enough for FSP execution

+  #

+  gSiPkgTokenSpaceGuid.PcdPeiTemporaryRamStackSize|0x30000

+

+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xC0000000

+#!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1

+  gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength|0x10000000

+#!endif

+  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreMaxPeiStackSize|0x40000

+[PcdsFeatureFlag.common]

+  ######################################

+  # Edk2 Configuration

+  ######################################

+  gEfiMdeModulePkgTokenSpaceGuid.PcdPeiCoreImageLoaderSearchTeSectionFirst|FALSE

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmEnableBspElection|FALSE

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmProfileEnable|FALSE

+  gEfiMdeModulePkgTokenSpaceGuid.PcdInstallAcpiSdtProtocol|TRUE

+

+  ######################################

+  # Platform Configuration

+  ######################################

+  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE

+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE

+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE

+  gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable|FALSE

+  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|FALSE

+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|FALSE

+  gMinPlatformPkgTokenSpaceGuid.PcdSerialTerminalEnable|TRUE

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 1

+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|TRUE

+!endif

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 2

+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterDebugInit|FALSE

+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|TRUE

+!endif

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 3

+  gMinPlatformPkgTokenSpaceGuid.PcdStopAfterMemInit|FALSE

+  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|TRUE

+!endif

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 4

+  gMinPlatformPkgTokenSpaceGuid.PcdBootToShellOnly|FALSE

+!endif

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 5

+  gMinPlatformPkgTokenSpaceGuid.PcdUefiSecureBootEnable|TRUE

+  gMinPlatformPkgTokenSpaceGuid.PcdTpm2Enable|TRUE

+!endif

+

+!if $(TARGET) == DEBUG

+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|TRUE

+!else

+  gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable|FALSE

+!endif

+

+  ######################################

+  # Board Configuration

+  ######################################

+  gBoardModuleTokenSpaceGuid.PcdIntelGopEnable|TRUE

+

+[PcdsFixedAtBuild.common]

+  ######################################

+  # Edk2 Configuration

+  ######################################

+!if $(TARGET) == RELEASE

+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x0

+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x3

+!else

+  gEfiMdePkgTokenSpaceGuid.PcdDebugPropertyMask|0x2F

+  gEfiMdePkgTokenSpaceGuid.PcdReportStatusCodePropertyMask|0x07

+!endif

+!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE

+  gEfiMdePkgTokenSpaceGuid.PcdPerformanceLibraryPropertyMask|0x1

+!endif

+

+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseMemory|FALSE

+!if $(TARGET) == RELEASE

+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|FALSE

+!else

+  gEfiMdeModulePkgTokenSpaceGuid.PcdStatusCodeUseSerial|TRUE

+!endif

+  gEfiMdeModulePkgTokenSpaceGuid.PcdAriSupport|FALSE

+  gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserFieldTextColor|0x01

+  gEfiMdeModulePkgTokenSpaceGuid.PcdBrowserSubtitleTextColor|0x0

+  gEfiMdeModulePkgTokenSpaceGuid.PcdHwErrStorageSize|0x00000800

+  gEfiMdeModulePkgTokenSpaceGuid.PcdLoadModuleAtFixAddressEnable|$(TOP_MEMORY_ADDRESS)

+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxHardwareErrorVariableSize|0x400

+!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE

+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxPeiPerformanceLogEntries|140

+!endif

+  gEfiMdeModulePkgTokenSpaceGuid.PcdMaxVariableSize|0x10000

+  gEfiMdeModulePkgTokenSpaceGuid.PcdReclaimVariableSpaceAtEndOfDxe|TRUE

+!if gMinPlatformPkgTokenSpaceGuid.PcdSmiHandlerProfileEnable == TRUE

+  gEfiMdeModulePkgTokenSpaceGuid.PcdSmiHandlerProfilePropertyMask|0x1

+!endif

+  gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSupport|FALSE

+!if $(TARGET) == DEBUG

+  gEfiMdeModulePkgTokenSpaceGuid.PcdSerialUseHardwareFlowControl|FALSE

+!endif

+

+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoBarEnableMask|0x80

+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBarRegisterOffset|0x00

+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciBusNumber|0x0

+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciDeviceNumber|0x1F

+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciEnableRegisterOffset|0x44

+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPciFunctionNumber|0x2

+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddress|0x1800

+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiIoPortBaseAddressMask|0xFFFC

+  gPcAtChipsetPkgTokenSpaceGuid.PcdAcpiPm1TmrOffset|0x08

+

+  # Specifies timeout value in microseconds for the BSP to detect all APs for the first time.

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuApInitTimeOutInMicroSeconds|50000

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuNumberOfReservedVariableMtrrs|0x0

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmApSyncTimeout|10000

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuSmmStackSize|0x20000

+

+  #

+  # In non-FSP build (EDK2 build) or FSP API mode below PCD are FixedAtBuild

+  # (They will be DynamicEx in FSP Dispatch mode)

+  #

+

+  ## Specifies the size of the microcode Region.

+  # @Prompt Microcode Region size.

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuMicrocodePatchRegionSize|0

+

+  ## Specifies the AP wait loop state during POST phase.

+  #  The value is defined as below.

+  #  1: Place AP in the Hlt-Loop state.

+  #  2: Place AP in the Mwait-Loop state.

+  #  3: Place AP in the Run-Loop state.

+  # @Prompt The AP wait loop state.

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuApLoopMode|2

+

+  ######################################

+  # Platform Configuration

+  ######################################

+  gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuSocketCount|1

+  gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuCoreCount|8

+  gMinPlatformPkgTokenSpaceGuid.PcdMaxCpuThreadCount|2

+

+  gMinPlatformPkgTokenSpaceGuid.PcdPciReservedMemBase|0xA0000000

+  gMinPlatformPkgTokenSpaceGuid.PcdPciReservedMemLimit|0xDFFFFFFF

+  #

+  # The PCDs are used to control the Windows SMM Security Mitigations Table - Protection Flags

+  #

+  # BIT0: If set, expresses that for all synchronous SMM entries,SMM will validate that input and output buffers lie entirely within the expected fixed memory regions.

+  # BIT1: If set, expresses that for all synchronous SMM entries, SMM will validate that input and output pointers embedded within the fixed communication buffer only refer to address ranges \

+  #       that lie entirely within the expected fixed memory regions.

+  # BIT2: Firmware setting this bit is an indication that it will not allow reconfiguration of system resources via non-architectural mechanisms.

+  # BIT3-31: Reserved

+  #

+  gMinPlatformPkgTokenSpaceGuid.PcdWsmtProtectionFlags|0x07

+

+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiReclaimMemorySize|0xCC

+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiAcpiNvsMemorySize|0xA2

+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiReservedMemorySize|0x3100

+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiRtDataMemorySize|0x2A

+  gMinPlatformPkgTokenSpaceGuid.PcdPlatformEfiRtCodeMemorySize|0xC4

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 1

+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

+!endif

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 2

+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

+!endif

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 3

+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x07, 0x03, 0x05, 0x0F, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

+!endif

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 4

+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x07, 0x03, 0x05, 0x1F, 0x00, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

+!endif

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage == 5

+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

+!endif

+

+!if gMinPlatformPkgTokenSpaceGuid.PcdBootStage >= 6

+  gMinPlatformPkgTokenSpaceGuid.PcdTestPointIbvPlatformFeature|{0x03, 0x0F, 0x07, 0x1F, 0x1F, 0x0F, 0x0F, 0x07, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00}

+!endif

+

+[PcdsFixedAtBuild.IA32]

+  ######################################

+  # Edk2 Configuration

+  ######################################

+  gEfiMdeModulePkgTokenSpaceGuid.PcdVpdBaseAddress|0x0

+  gIntelFsp2PkgTokenSpaceGuid.PcdGlobalDataPointerAddress|0xFED00148

+  gIntelFsp2WrapperTokenSpaceGuid.PcdPeiMinMemSize|0x3800000

+

+  ######################################

+  # Platform Configuration

+  ######################################

+  gMinPlatformPkgTokenSpaceGuid.PcdPeiPhaseStackTop|0xA0000

+

+[PcdsFixedAtBuild.X64]

+  ######################################

+  # Edk2 Configuration

+  ######################################

+

+  # Default platform supported RFC 4646 languages: (American) English

+  gEfiMdePkgTokenSpaceGuid.PcdUefiVariableDefaultPlatformLangCodes|"en-US"

+

+[PcdsPatchableInModule.common]

+  ######################################

+  # Edk2 Configuration

+  ######################################

+  gEfiMdeModulePkgTokenSpaceGuid.PcdSmbiosVersion|0x0301

+  gEfiMdePkgTokenSpaceGuid.PcdDebugPrintErrorLevel|0x80000046

+

+  ######################################

+  # Silicon Configuration

+  ######################################

+!if $(TARGET) == DEBUG

+  gSiPkgTokenSpaceGuid.PcdSerialIoUartDebugEnable|1

+!endif

+

+[PcdsDynamicDefault]

+  ######################################

+  # Edk2 Configuration

+  ######################################

+  gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable|TRUE

+  gEfiMdeModulePkgTokenSpaceGuid.PcdConInConnectOnDemand|FALSE

+  ######################################

+  # Silicon Configuration

+  ######################################

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 1

+  gSiPkgTokenSpaceGuid.PcdPciExpressRegionLength|gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength

+!endif

+

+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutColumn|0x0

+  gEfiMdeModulePkgTokenSpaceGuid.PcdConOutRow|0x0

+  #gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr|0x0

+

+  #

+  #  Set video to native resolution as Windows 8 WHCK requirement.

+  #

+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoHorizontalResolution|0

+  gEfiMdeModulePkgTokenSpaceGuid.PcdVideoVerticalResolution|0

+

+  gEfiSecurityPkgTokenSpaceGuid.PcdTpm2CurrentIrqNum|0x00

+

+  #

+  # FSP Base address PCD will be updated in FDF basing on flash map.

+  #

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0

+

+  # Platform will pre-allocate UPD buffer and pass it to FspWrapper

+  # Those dummy address will be patched before FspWrapper executing

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress|0x0

+  gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress|0x0

+

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuApTargetCstate|0

+  gUefiCpuPkgTokenSpaceGuid.PcdCpuMaxLogicalProcessorNumber|16

+

+[PcdsDynamicHii.X64.DEFAULT]

+  ######################################

+  # Edk2 Configuration

+  ######################################

+  gEfiMdePkgTokenSpaceGuid.PcdHardwareErrorRecordLevel|L"HwErrRecSupport"|gEfiGlobalVariableGuid|0x0|1 # Variable: L"HwErrRecSupport"

+!if gMinPlatformPkgTokenSpaceGuid.PcdPerformanceEnable == TRUE

+  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|1 # Variable: L"Timeout"

+!else

+  gEfiMdePkgTokenSpaceGuid.PcdPlatformBootTimeOut|L"Timeout"|gEfiGlobalVariableGuid|0x0|5 # Variable: L"Timeout"

+!endif

+

+[PcdsDynamicExDefault]

+  gEfiMdeModulePkgTokenSpaceGuid.PcdS3BootScriptTablePrivateDataPtr|0x0

+

+!if gIntelFsp2WrapperTokenSpaceGuid.PcdFspModeSelection == 0

+  #

+  # Include FSP PCD settings.

+  #

+  !include $(PLATFORM_FSP_BIN_PACKAGE)/TigerLakeFspPcds.dsc

+!endif

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg
new file mode 100644
index 0000000000..f8047701f8
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg
@@ -0,0 +1,34 @@
+# @ build_config.cfg

+# This is the WhiskeylakeURvp board specific build settings

+#

+# Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+# SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+

+

+[CONFIG]

+WORKSPACE_PLATFORM_BIN =

+EDK_SETUP_OPTION =

+openssl_path =

+PLATFORM_BOARD_PACKAGE = TigerlakeOpenBoardPkg

+PROJECT = TigerlakeOpenBoardPkg/TigerlakeURvp

+BOARD = TigerlakeURvp

+FLASH_MAP_FDF = TigerlakeOpenBoardPkg/TigerlakeURvp/Include/Fdf/FlashMapInclude.fdf

+PROJECT_DSC = TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkg.dsc

+BOARD_PKG_PCD_DSC = TigerlakeOpenBoardPkg/TigerlakeURvp/OpenBoardPkgPcd.dsc

+PrepRELEASE = DEBUG

+SILENT_MODE = FALSE

+EXT_CONFIG_CLEAR =

+CapsuleBuild = FALSE

+EXT_BUILD_FLAGS =

+CAPSULE_BUILD = 0

+TARGET = DEBUG

+TARGET_SHORT = D

+PERFORMANCE_BUILD = FALSE

+FSP_WRAPPER_BUILD = TRUE

+FSP_BIN_PKG = TigerLakeFspBinPkg/Client

+FSP_PKG_NAME = TigerlakeSiliconPkg

+FSP_BINARY_BUILD = FALSE

+FSP_TEST_RELEASE = FALSE

+SECURE_BOOT_ENABLE = FALSE

+BIOS_INFO_GUID = 4A4CA1C6-871C-45BB-8801-6910A7AA5807

-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Patch V2 7/8] Enable build for TigerlakeOpenBoardPkg
  2021-02-09  8:45 ` [Patch V2 7/8] Enable build for TigerlakeOpenBoardPkg Heng Luo
@ 2021-02-10  0:30   ` Chaganty, Rangasai V
  0 siblings, 0 replies; 18+ messages in thread
From: Chaganty, Rangasai V @ 2021-02-10  0:30 UTC (permalink / raw)
  To: Luo, Heng, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com> 

-----Original Message-----
From: Luo, Heng <heng.luo@intel.com> 
Sent: Tuesday, February 09, 2021 12:46 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [Patch V2 7/8] Enable build for TigerlakeOpenBoardPkg

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

This change adds the configuration to enable build for TigerlakeURvp.
Also it updates Tigerlake U Rvp details to the Readme.md.

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/Readme.md | 11 +++++++++++  Platform/Intel/build.cfg |  1 +
 2 files changed, 12 insertions(+)

diff --git a/Platform/Intel/Readme.md b/Platform/Intel/Readme.md index f7bfc7aad2..b3b15405af 100644
--- a/Platform/Intel/Readme.md
+++ b/Platform/Intel/Readme.md
@@ -57,6 +57,7 @@ A UEFI firmware implementation using MinPlatformPkg is constructed using the fol
 * The `SimicsOpenBoardPkg` contains board implementations for the Simics hardware simulator. * The `WhiskeylakeOpenBoardPkg` contains board implementations for WhiskeyLake systems. * The `CometlakeOpenBoardPkg` contains board implementations for CometLake systems.+* The `TigerlakeOpenBoardPkg` contains board implementations for TigerLake systems.  ### **Supported Hardware** @@ -75,6 +76,7 @@ A UEFI firmware implementation using MinPlatformPkg is constructed using the fol
 | RVP 3                                 | SkyLake, KabyLake, KabyLake Refresh        | KabylakeOpenBoardPkg         | KabylakeRvp3       | | WHL-U DDR4 RVP                        | WhiskeyLake                                | WhiskeylakeOpenBoardPkg      | WhiskeylakeURvp    | | CML-U LPDDR3 RVP                      | CometLake V1                               | CometlakeOpenBoardPkg        | CometlakeURvp      |+| TGL-U LPDDR4 RVP                      | TigerLake                                  | TigerlakeOpenBoardPkg        | TigerlakeURvp      |  *Note: RVP = Reference and Validation Platform* @@ -253,6 +255,11 @@ return back to the minimum platform caller.
           |       |        |               |---build_config.cfg: CometlakeURvp specific build           |       |        |                                     settings environment variables.           |       |        |+          |       |        |------TigerlakeOpenBoardPkg+          |       |        |       |------TigerlakeURvp+          |       |        |               |---build_config.cfg: TigerlakeURvp specific build+          |       |        |                                     settings environment variables.+          |       |        |           |------FSP   </pre> @@ -283,6 +290,10 @@ return back to the minimum platform caller.
 1. This firmware project has been tested booting to Microsoft Windows 10 x64 with AHCI mode and External Graphic Device. 2. This firmware project has been also tested booting to Ubuntu 17.10 with AHCI mode and Integrated Graphic Device. +**TigerlakeOpenBoardPkg**+1. This firmware project has been tested booting to Microsoft Windows 10 x64 with AHCI mode and Integrated Graphic Device.+2. This firmware project has been also tested booting to Puppy Linux BionicPup64 8.0 with AHCI mode and Integrated Graphic Device.+ ### **Package Builds**  In some cases, such as BoardModulePkg, a package may provide a set of functionality that is included in otherdiff --git a/Platform/Intel/build.cfg b/Platform/Intel/build.cfg index 8aa6b22956..97c5c9a290 100644
--- a/Platform/Intel/build.cfg
+++ b/Platform/Intel/build.cfg
@@ -60,3 +60,4 @@ KabylakeRvp3 = KabylakeOpenBoardPkg/KabylakeRvp3/build_config.cfg
 UpXtreme = WhiskeylakeOpenBoardPkg/UpXtreme/build_config.cfg WhiskeylakeURvp = WhiskeylakeOpenBoardPkg/WhiskeylakeURvp/build_config.cfg CometlakeURvp = CometlakeOpenBoardPkg/CometlakeURvp/build_config.cfg+TigerlakeURvp = TigerlakeOpenBoardPkg/TigerlakeURvp/build_config.cfg--
2.24.0.windows.2


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch V2 8/8] Update Maintainers.txt for TigerlakeOpenBoardPkg
  2021-02-09  8:45 ` [Patch V2 8/8] Update Maintainers.txt " Heng Luo
@ 2021-02-10  0:31   ` Chaganty, Rangasai V
  0 siblings, 0 replies; 18+ messages in thread
From: Chaganty, Rangasai V @ 2021-02-10  0:31 UTC (permalink / raw)
  To: Luo, Heng, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

Reviewed-by: Sai Chaganty <rangasai.v.chaganty@intel.com> 

-----Original Message-----
From: Luo, Heng <heng.luo@intel.com> 
Sent: Tuesday, February 09, 2021 12:46 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [Patch V2 8/8] Update Maintainers.txt for TigerlakeOpenBoardPkg

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

This change adds owners to the the Maintainers.txt for TigerlakeOpenBoardPkg

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Maintainers.txt | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Maintainers.txt b/Maintainers.txt index 34f0b58581..b2f1b67cf9 100644
--- a/Maintainers.txt
+++ b/Maintainers.txt
@@ -195,6 +195,12 @@ M: Rangasai V Chaganty <rangasai.v.chaganty@intel.com>
 R: Deepika Kethi Reddy <deepika.kethi.reddy@intel.com> R: Kathappan Esakkithevar <kathappan.esakkithevar@intel.com> +Platform/Intel/TigerlakeOpenBoardPkg+F: Platform/Intel/TigerlakeOpenBoardPkg/+M: Sai Chaganty <rangasai.v.chaganty@intel.com>+M: Nate DeSimone <nathaniel.l.desimone@intel.com>+R: Heng Luo <heng.luo@intel.com>+ Platform/Intel/SimicsOpenBoardPkg F: Platform/Intel/SimicsOpenBoardPkg/ M: Agyeman Prince <prince.agyeman@intel.com>--
2.24.0.windows.2


^ permalink raw reply	[flat|nested] 18+ messages in thread

* Re: [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add library instances
  2021-02-09  8:45 ` [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: " Heng Luo
@ 2021-02-10  0:38   ` Chaganty, Rangasai V
  2021-02-10  3:58     ` Heng Luo
  0 siblings, 1 reply; 18+ messages in thread
From: Chaganty, Rangasai V @ 2021-02-10  0:38 UTC (permalink / raw)
  To: Luo, Heng, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

Please remove commented code in SiliconEnableAcpi() and associated comments.

Thanks,
Sai

-----Original Message-----
From: Luo, Heng <heng.luo@intel.com> 
Sent: Tuesday, February 09, 2021 12:46 AM
To: devel@edk2.groups.io
Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
Subject: [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add library instances

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

Adds the following library instances:
  * TigerlakeURvp/Library/BoardAcpiLib
  * TigerlakeURvp/Library/BoardInitLib
  * TigerlakeURvp/Library/PeiPlatformHookLib

Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
Signed-off-by: Heng Luo <heng.luo@intel.com>
---
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c      |  88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf    |  43 +++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c          | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmTigerlakeURvpAcpiEnableLib.c    |  51 +++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardPchInitPreMemLib.c            | 160 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardSaInitPreMemLib.c             |  96 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4Rvp.h       |  93 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4RvpPreMem.h |  33 +++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c      |  41 +++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf    |  49 +++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c       |  88 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf     | 115 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpDetect.c           |  39 +++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPostMemLib.c   | 153 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c    | 445 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/TigerlakeURvpInit.h                |  23 +++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.c         | 212 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf       |  58 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 18 files changed, 1947 insertions(+)

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c
new file mode 100644
index 0000000000..1436d9b79a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.c
@@ -0,0 +1,88 @@
+/** @file

+  Tiger Lake U RVP SMM Multi-Board ACPI Support library

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <Base.h>

+#include <Uefi.h>

+#include <PiDxe.h>

+#include <Library/BaseLib.h>

+#include <Library/IoLib.h>

+#include <Library/BoardAcpiEnableLib.h>

+#include <Library/MultiBoardAcpiSupportLib.h>

+#include <Library/PcdLib.h>

+#include <Library/DebugLib.h>

+

+#include <PlatformBoardId.h>

+

+EFI_STATUS

+EFIAPI

+TglBoardEnableAcpi (

+  IN BOOLEAN  EnableSci

+  );

+

+EFI_STATUS

+EFIAPI

+TglBoardDisableAcpi (

+  IN BOOLEAN  DisableSci

+  );

+

+EFI_STATUS

+EFIAPI

+SiliconEnableAcpi (

+  IN BOOLEAN  EnableSci

+  );

+

+EFI_STATUS

+EFIAPI

+SiliconDisableAcpi (

+  IN BOOLEAN  DisableSci

+  );

+

+EFI_STATUS

+EFIAPI

+MultiBoardEnableAcpi (

+  IN BOOLEAN  EnableSci

+  )

+{

+  SiliconEnableAcpi (EnableSci);

+  return TglBoardEnableAcpi (EnableSci);

+}

+

+EFI_STATUS

+EFIAPI

+MultiBoardDisableAcpi (

+  IN BOOLEAN  DisableSci

+  )

+{

+  SiliconDisableAcpi (DisableSci);

+  return TglBoardDisableAcpi (DisableSci);

+}

+

+BOARD_ACPI_ENABLE_FUNC  mBoardAcpiEnableFunc = {

+  MultiBoardEnableAcpi,

+  MultiBoardDisableAcpi,

+};

+

+/**

+  The constructor function to register mBoardAcpiEnableFunc function.

+

+  @param[in]  ImageHandle  The firmware allocated handle for the EFI image.

+  @param[in]  SystemTable  A pointer to the EFI System Table.

+

+  @retval     EFI_SUCCESS  This constructor always return EFI_SUCCESS.

+                           It will ASSERT on errors.

+**/

+EFI_STATUS

+EFIAPI

+SmmMultiBoardAcpiSupportLibConstructor (

+  IN EFI_HANDLE        ImageHandle,

+  IN EFI_SYSTEM_TABLE  *SystemTable

+  )

+{

+  DEBUG ((DEBUG_INFO, "SKU_ID: 0x%x\n", LibPcdGetSku()));

+  return RegisterBoardAcpiEnableFunc (&mBoardAcpiEnableFunc);

+}

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf
new file mode 100644
index 0000000000..6f6a9272f9
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmMultiBoardAcpiSupportLib.inf
@@ -0,0 +1,43 @@
+## @file

+#  Tiger Lake U RVP SMM Multi-Board ACPI Support library

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010017

+  BASE_NAME                      = SmmMultiBoardAcpiSupportLib

+  FILE_GUID                      = 8929A54E-7ED8-4AB3-BEBB-C0367BDBBFF5

+  VERSION_STRING                 = 1.0

+  MODULE_TYPE                    = DXE_SMM_DRIVER

+  LIBRARY_CLASS                  = NULL

+  CONSTRUCTOR                    = SmmMultiBoardAcpiSupportLibConstructor

+

+#

+# The following information is for reference only and not required by the build tools.

+#

+# VALID_ARCHITECTURES = IA32 X64 IPF EBC

+#

+

+[LibraryClasses]

+  BaseLib

+  IoLib

+  PciLib

+  MmPciLib

+  PchCycleDecodingLib

+  PchPciBdfLib

+  PmcLib

+

+[Packages]

+  MdePkg/MdePkg.dec

+  MdeModulePkg/MdeModulePkg.dec

+  MinPlatformPkg/MinPlatformPkg.dec

+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+

+[Sources]

+  SmmTigerlakeURvpAcpiEnableLib.c

+  SmmSiliconAcpiEnableLib.c

+  SmmMultiBoardAcpiSupportLib.c

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c
new file mode 100644
index 0000000000..32afeb405e
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmSiliconAcpiEnableLib.c
@@ -0,0 +1,160 @@
+/** @file

+  Tiger Lake U RVP SMM Silicon ACPI Enable library

+

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <Base.h>

+#include <Uefi.h>

+#include <PiDxe.h>

+#include <Library/BaseLib.h>

+#include <Library/IoLib.h>

+#include <Library/PciSegmentLib.h>

+#include <Library/BoardAcpiEnableLib.h>

+#include <Library/PcdLib.h>

+#include <Library/DebugLib.h>

+#include <Library/MmPciLib.h>

+#include <Library/PmcLib.h>

+#include <Library/PchPciBdfLib.h>

+#include <Register/PchRegs.h>

+#include <Register/PchRegsLpc.h>

+#include <Register/PmcRegs.h>

+#include <Register/RtcRegs.h>

+

+/**

+  Clear Port 80h

+

+  SMI handler to enable ACPI mode

+

+  Dispatched on reads from APM port with value EFI_ACPI_ENABLE_SW_SMI

+

+  Disables the SW SMI Timer.

+  ACPI events are disabled and ACPI event status is cleared.

+  SCI mode is then enabled.

+

+  Clear SLP SMI status

+  Enable SLP SMI

+

+  Disable SW SMI Timer

+

+  Clear all ACPI event status and disable all ACPI events

+

+  Disable PM sources except power button

+  Clear status bits

+

+  Disable GPE0 sources

+  Clear status bits

+

+  Disable GPE1 sources

+  Clear status bits

+

+  Guarantee day-of-month alarm is invalid (ACPI 1.0 section 4.7.2.4)

+

+  Enable SCI

+**/

+EFI_STATUS

+EFIAPI

+SiliconEnableAcpi (

+  IN BOOLEAN  EnableSci

+  )

+{

+

+  UINT32                              SmiEn;

+  UINT32                              SmiSts;

+  UINT32                              ULKMC;

+  UINTN                               LpcBaseAddress;

+  UINT16                              AcpiBaseAddr;

+  UINT32                              Pm1Cnt;

+

+  LpcBaseAddress = LpcPciCfgBase ();

+

+  //

+  // Get the ACPI Base Address

+  //

+  AcpiBaseAddr = PmcGetAcpiBase();

+  //

+  // BIOS must also ensure that CF9GR is cleared and locked before handing control to the

+  // OS in order to prevent the host from issuing global resets and resetting ME

+  //

+  // EDK2: To match PCCG current BIOS behavior, do not lock CF9 Global Reset

+  // MmioWrite32 (

+  //     PmcBaseAddress + R_PCH_PMC_ETR3),

+  //     PmInit);

+

+  //

+  // Clear Port 80h

+  //

+  IoWrite8 (0x80, 0);

+

+  //

+  // Disable SW SMI Timer and clean the status

+  //

+  SmiEn = IoRead32 (AcpiBaseAddr + R_ACPI_IO_SMI_EN);

+  SmiEn &= ~(B_ACPI_IO_SMI_EN_LEGACY_USB2 | B_ACPI_IO_SMI_EN_SWSMI_TMR | B_ACPI_IO_SMI_EN_LEGACY_USB);

+  IoWrite32 (AcpiBaseAddr + R_ACPI_IO_SMI_EN, SmiEn);

+

+  SmiSts = IoRead32 (AcpiBaseAddr + R_ACPI_IO_SMI_STS);

+  SmiSts |= B_ACPI_IO_SMI_EN_LEGACY_USB2 | B_ACPI_IO_SMI_EN_SWSMI_TMR | B_ACPI_IO_SMI_EN_LEGACY_USB;

+  IoWrite32 (AcpiBaseAddr + R_ACPI_IO_SMI_STS, SmiSts);

+

+  //

+  // Disable port 60/64 SMI trap if they are enabled

+  //

+  ULKMC = MmioRead32 (LpcBaseAddress + R_LPC_CFG_ULKMC) & ~(B_LPC_CFG_ULKMC_60REN | B_LPC_CFG_ULKMC_60WEN | B_LPC_CFG_ULKMC_64REN | B_LPC_CFG_ULKMC_64WEN | B_LPC_CFG_ULKMC_A20PASSEN);

+  MmioWrite32 (LpcBaseAddress + R_LPC_CFG_ULKMC, ULKMC);

+

+  //

+  // Disable PM sources except power button

+  //

+  IoWrite16 (AcpiBaseAddr + R_ACPI_IO_PM1_EN, B_ACPI_IO_PM1_EN_PWRBTN);

+

+  //

+  // Clear PM status except Power Button status for RapidStart Resume

+  //

+  IoWrite16 (AcpiBaseAddr + R_ACPI_IO_PM1_STS, 0xFEFF);

+

+  //

+  // Guarantee day-of-month alarm is invalid (ACPI 1.0 section 4.7.2.4)

+  //

+  IoWrite8 (R_RTC_IO_INDEX_ALT, R_RTC_IO_REGD);

+  IoWrite8 (R_RTC_IO_TARGET_ALT, 0x0);

+

+  //

+  // Enable SCI

+  //

+  if (EnableSci) {

+    Pm1Cnt = IoRead32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT);

+    Pm1Cnt |= B_ACPI_IO_PM1_CNT_SCI_EN;

+    IoWrite32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT, Pm1Cnt);

+  }

+

+  return EFI_SUCCESS;

+}

+

+EFI_STATUS

+EFIAPI

+SiliconDisableAcpi (

+  IN BOOLEAN  DisableSci

+  )

+{

+

+  UINT16                              AcpiBaseAddr;

+  UINT32                              Pm1Cnt;

+

+  //

+  // Get the ACPI Base Address

+  //

+  AcpiBaseAddr = PmcGetAcpiBase();

+  //

+  // Disable SCI

+  //

+  if (DisableSci) {

+    Pm1Cnt = IoRead32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT);

+    Pm1Cnt &= ~B_ACPI_IO_PM1_CNT_SCI_EN;

+    IoWrite32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT, Pm1Cnt);

+  }

+

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmTigerlakeURvpAcpiEnableLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmTigerlakeURvpAcpiEnableLib.c
new file mode 100644
index 0000000000..3eb302c30d
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/SmmTigerlakeURvpAcpiEnableLib.c
@@ -0,0 +1,51 @@
+/** @file

+  Tiger Lake U RVP SMM Board ACPI Enable library

+

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <Base.h>

+#include <Uefi.h>

+#include <PiDxe.h>

+#include <Library/BaseLib.h>

+#include <Library/IoLib.h>

+#include <Library/BoardAcpiTableLib.h>

+#include <Library/PcdLib.h>

+#include <Library/DebugLib.h>

+#include <PlatformBoardId.h>

+

+/**

+  Enable Board Acpi

+

+  @param[in]  EnableSci     Enable SCI if EnableSci parameters is True.

+

+  @retval     EFI_SUCCESS   The function always return successfully.

+**/

+EFI_STATUS

+EFIAPI

+TglBoardEnableAcpi (

+  IN BOOLEAN  EnableSci

+  )

+{

+  // enable additional board register

+  return EFI_SUCCESS;

+}

+

+/**

+  Disable Board Acpi

+

+  @param[in]  DisableSci    Disable SCI if DisableSci parameters is True.

+

+  @retval     EFI_SUCCESS   The function always return successfully.

+**/

+EFI_STATUS

+EFIAPI

+TglBoardDisableAcpi (

+  IN BOOLEAN  DisableSci

+  )

+{

+  // enable additional board register

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardPchInitPreMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardPchInitPreMemLib.c
new file mode 100644
index 0000000000..1c7e574f7d
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardPchInitPreMemLib.c
@@ -0,0 +1,160 @@
+/** @file

+  Source code for the board PCH configuration Pcd init functions for Pre-Memory Init phase.

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include "TigerlakeURvpInit.h"

+#include "GpioTableTigerlakeUDdr4RvpPreMem.h"

+

+#include <PlatformBoardConfig.h>

+#include <Include/PlatformBoardId.h>

+

+#include <Library/GpioLib.h>

+

+/**

+  Board Root Port Clock Info configuration init function for PEI pre-memory phase.

+

+  @retval EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+RootPortClkInfoInit (

+  IN UINT16    BoardId

+  )

+{

+  PCD64_BLOB Clock[PCH_MAX_PCIE_CLOCKS];

+  UINT32 Index;

+

+  //

+  // The default clock assignment will be FREE_RUNNING, which corresponds to PchClockUsageUnspecified

+  // This is safe but power-consuming setting. If Platform code doesn't contain port-clock map for a given board,

+  // the clocks will keep on running anyway, allowing PCIe devices to operate. Downside is that clocks will

+  // continue to draw power. To prevent this, remember to provide port-clock map for every board.

+  //

+  for (Index = 0; Index < PCH_MAX_PCIE_CLOCKS; Index++) {

+    Clock[Index].PcieClock.ClkReqSupported = TRUE;

+    Clock[Index].PcieClock.ClockUsage = FREE_RUNNING;

+  }

+

+  ///

+  /// Assign ClkReq signal to root port. (Base 0)

+  /// For LP, Set 0 - 6

+  /// For H,  Set 0 - 15

+  /// Note that if GbE is enabled, ClkReq assigned to GbE will not be available for Root Port.

+  ///

+

+  switch (BoardId) {

+    // CLKREQ

+    case BoardIdTglUDdr4:

+      Clock[0].PcieClock.ClockUsage = PCIE_PEG;

+      Clock[1].PcieClock.ClockUsage = PCIE_PCH + 2;

+      Clock[2].PcieClock.ClockUsage = PCIE_PCH + 3;

+      Clock[3].PcieClock.ClockUsage = PCIE_PCH + 8;

+      Clock[4].PcieClock.ClockUsage = LAN_CLOCK;

+      Clock[5].PcieClock.ClockUsage = PCIE_PCH + 7;

+      Clock[6].PcieClock.ClockUsage = PCIE_PCH + 4;

+      break;

+    default:

+

+      break;

+  }

+

+  PcdSet64S (PcdPcieClock0,  Clock[ 0].Blob);

+  PcdSet64S (PcdPcieClock1,  Clock[ 1].Blob);

+  PcdSet64S (PcdPcieClock2,  Clock[ 2].Blob);

+  PcdSet64S (PcdPcieClock3,  Clock[ 3].Blob);

+  PcdSet64S (PcdPcieClock4,  Clock[ 4].Blob);

+  PcdSet64S (PcdPcieClock5,  Clock[ 5].Blob);

+  PcdSet64S (PcdPcieClock6,  Clock[ 6].Blob);

+  PcdSet64S (PcdPcieClock7,  Clock[ 7].Blob);

+  PcdSet64S (PcdPcieClock8,  Clock[ 8].Blob);

+  PcdSet64S (PcdPcieClock9,  Clock[ 9].Blob);

+  PcdSet64S (PcdPcieClock10, Clock[10].Blob);

+  PcdSet64S (PcdPcieClock11, Clock[11].Blob);

+  PcdSet64S (PcdPcieClock12, Clock[12].Blob);

+  PcdSet64S (PcdPcieClock13, Clock[13].Blob);

+  PcdSet64S (PcdPcieClock14, Clock[14].Blob);

+  PcdSet64S (PcdPcieClock15, Clock[15].Blob);

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Board USB related configuration init function for PEI pre-memory phase.

+

+  @param[in]  BoardId   An unsigned integrer represent the board id.

+

+  @retval EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+UsbConfigInit (

+  IN UINT16 BoardId

+  )

+{

+

+  return EFI_SUCCESS;

+}

+

+

+/**

+  Board GPIO Group Tier configuration init function for PEI pre-memory phase.

+

+  @param[in]  BoardId   An unsigned integrer represent the board id.

+

+  @retval EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+GpioGroupTierInit (

+  IN UINT16 BoardId

+  )

+{

+

+  return EFI_SUCCESS;

+}

+

+

+/**

+  GPIO init function for PEI pre-memory phase.

+

+  @param[in]  BoardId   An unsigned integrer represent the board id.

+

+  @retval EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+GpioTablePreMemInit (

+  IN UINT16 BoardId

+  )

+{

+

+  //

+  // GPIO Table Init.

+  //

+  switch (BoardId) {

+    case BoardIdTglUDdr4:

+      PcdSet32S (PcdBoardGpioTablePreMem, (UINTN) mGpioTablePreMemTglUDdr4);

+      PcdSet16S (PcdBoardGpioTablePreMemSize, mGpioTablePreMemTglUDdr4Size);

+      break;

+

+    default:

+      break;

+  }

+

+  return EFI_SUCCESS;

+}

+

+/**

+  PmConfig init function for PEI pre-memory phase.

+

+  @param[in]  BoardId   An unsigned integrer represent the board id.

+

+  @retval EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+PchPmConfigInit (

+  IN UINT16 BoardId

+  )

+{

+

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardSaInitPreMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardSaInitPreMemLib.c
new file mode 100644
index 0000000000..b468e21ec9
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/BoardSaInitPreMemLib.c
@@ -0,0 +1,96 @@
+/** @file

+ Source code for the board SA configuration Pcd init functions in Pre-Memory init phase.

+

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include "TigerlakeURvpInit.h"

+#include <Pins/GpioPinsVer2Lp.h>

+#include <PlatformBoardId.h>

+#include <PlatformBoardConfig.h>

+

+/**

+  MRC configuration init function for PEI pre-memory phase.

+

+  @param[in]  BoardId           An unsigned integer represent the board id.

+

+  @retval EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+SaMiscConfigInit (

+  IN UINT16         BoardId

+  )

+{

+  //

+  // UserBd

+  //

+  switch (BoardId) {

+    case BoardIdTglUDdr4:

+      //

+      // Assign UserBd to 5 which is assigned to MrcInputs->BoardType btUser4 for ULT platforms.

+      // This is required to skip Memory voltage programming based on GPIO's in MRC

+      //

+      PcdSet8S (PcdSaMiscUserBd, 5); // MrcBoardType btUser4 for ULT platform

+      break;

+

+    default:

+      // MiscPeiPreMemConfig.UserBd = 0 by default.

+      break;

+  }

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Board Memory Init related configuration init function for PEI pre-memory phase.

+

+  @param[in]  BoardId   An unsigned integrer represent the board id.

+

+  @retval EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+MrcConfigInit (

+  IN UINT16 BoardId

+  )

+{

+

+  PcdSet8S (PcdMrcSpdAddressTable0, 0xA0);

+  PcdSet8S (PcdMrcSpdAddressTable1, 0xA2);

+  PcdSet8S (PcdMrcSpdAddressTable2, 0xA4);

+  PcdSet8S (PcdMrcSpdAddressTable3, 0xA6);

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Board SA related GPIO configuration init function for PEI pre-memory phase.

+

+  @param[in]  BoardId   An unsigned integer represent the board id.

+

+  @retval EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+SaGpioConfigInit (

+  IN UINT16 BoardId

+  )

+{

+  return EFI_SUCCESS;

+}

+

+/**

+  SA Display DDI configuration init function for PEI pre-memory phase.

+

+  @param[in]  BoardId       An unsigned integer represent the board id.

+

+  @retval     EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+SaDisplayConfigInit (

+  IN UINT16 BoardId

+  )

+{

+  return EFI_SUCCESS;

+}

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4Rvp.h b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4Rvp.h
new file mode 100644
index 0000000000..0b605698c0
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4Rvp.h
@@ -0,0 +1,93 @@
+/** @file

+  GPIO definition table for Tiger Lake U RVP

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#ifndef _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_H_

+#define _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_H_

+

+#include <Pins/GpioPinsVer2Lp.h>

+#include <Library/GpioLib.h>

+#include <Library/GpioConfig.h>

+

+GPIO_INIT_CONFIG mGpioTableTglUDdr4[] =

+{

+  // M.2 Key-E - WLAN/BT

+  {GPIO_VER2_LP_GPP_A13, {GpioPadModeGpio, GpioHostOwnDefault, GpioDirOut,   GpioOutHigh,    GpioIntDis,              GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // BT_RF_KILL_N

+  {GPIO_VER2_LP_GPP_B15, {GpioPadModeGpio, GpioHostOwnDefault, GpioDirOut,   GpioOutHigh,    GpioIntDis,              GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // WIFI_RF_KILL_N

+  {GPIO_VER2_LP_GPP_C22, {GpioPadModeGpio, GpioHostOwnDefault, GpioDirOut,   GpioOutHigh,    GpioIntDis,              GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // WLAN_RST_N

+  {GPIO_VER2_LP_GPP_C23, {GpioPadModeGpio, GpioHostOwnAcpi,    GpioDirInInv, GpioOutDefault, GpioIntLevel|GpioIntSci, GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // WIFI_WAKE_N

+  {GPIO_VER2_LP_GPP_H19, {GpioPadModeGpio, GpioHostOwnAcpi,    GpioDirInInv, GpioOutDefault, GpioIntLevel|GpioIntSci, GpioHostDeepReset,  GpioTermNone, GpioPadConfigUnlock }}, // UART_BT_WAKE_N : Not default POR

+  {GPIO_VER2_LP_GPP_A10, {GpioPadModeGpio, GpioHostOwnAcpi,    GpioDirIn,    GpioOutDefault, GpioIntDis,              GpioPlatformReset,  GpioTermNone}},                       // M.2 BT

+

+  // X4 Pcie Slot for Gen3 and Gen 4

+  {GPIO_VER2_LP_GPP_A14, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutLow,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //ONBOARD_X4_PCIE_SLOT1_PWREN_N

+  {GPIO_VER2_LP_GPP_C13, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //ONBOARD_X4_PCIE_SLOT1_RESET_N

+  {GPIO_VER2_LP_GPP_F5,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntSci,GpioHostDeepReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //ONBOARD_X4_PCIE_SLOT1_WAKE_N

+  {GPIO_VER2_LP_GPP_F20, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //ONBOARD_X4_PCIE_SLOT1_DGPU_SEL

+  {GPIO_VER2_LP_GPP_F21, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirIn,  GpioOutDefault,GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //ONBOARD_X4_PCIE_SLOT1_DGPU_PWROK

+

+  // TBT Re-Timers

+  {GPIO_VER2_LP_GPD7,    {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,  GpioIntDis,GpioDswReset,  GpioTermNone}},  //TCP_RETIMER_PERST_N

+

+  // Battery Charger Vmin to PCH PROCHOT, derived from ICL

+  {GPIO_VER2_LP_GPP_B2,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInv,  GpioOutDefault,GpioIntEdge|GpioIntSci,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //BC_PROCHOT_N

+

+  // SATA Direct Connect

+  {GPIO_VER2_LP_GPP_B4,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //SATA_DIRECT_PWREN

+

+  // FPS

+  {GPIO_VER2_LP_GPP_B14, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //FPS_RST_N

+  {GPIO_VER2_LP_GPP_E3,  {GpioPadModeGpio, GpioHostOwnGpio, GpioDirIn,  GpioOutDefault,GpioIntLevel|GpioIntApic,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //FPS_INT

+

+  // PCH M.2 SSD

+  {GPIO_VER2_LP_GPP_B16, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //M2_PCH_SSD_PWREN

+  {GPIO_VER2_LP_GPP_H0,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //M2_SSD_RST_N

+

+

+  // Camera

+  {GPIO_VER2_LP_GPP_B23, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CRD_CAM_PWREN - CAM1

+  {GPIO_VER2_LP_GPP_C15, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //WF_CAM_RST_N  - CAM1

+

+  {GPIO_VER2_LP_GPP_H12, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CAM2_RST_N

+

+  {GPIO_VER2_LP_GPP_H15, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CAM3_PWREN

+  {GPIO_VER2_LP_GPP_H13, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CAM3_RST_N

+

+  // Camera Common GPIO's for all Camera, Rework Options

+  {GPIO_VER2_LP_GPP_B18, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutLow,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //CRD_CAM_STROBE_1

+  {GPIO_VER2_LP_GPP_C2,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //WF_CAM_CLK_EN

+

+  // Audio

+  {GPIO_VER2_LP_GPP_C5,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //SPKR_PD_N

+  {GPIO_VER2_LP_GPP_C12, {GpioPadModeGpio, GpioHostOwnGpio, GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntApic,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  // CODEC_INT_N

+

+  // Touch Pad

+  // Touch Pad and Touch Panel 2 share the same Power Enable, default is Touch pad

+  {GPIO_VER2_LP_GPP_H1,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //TCH_PAD_LS_EN - PWR_En

+  {GPIO_VER2_LP_GPP_C8,  {GpioPadModeGpio, GpioHostOwnGpio, GpioDirInInv,  GpioOutDefault,GpioIntEdge|GpioIntApic,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //TCH_PAD_INT_N

+

+  // EC

+  {GPIO_VER2_LP_GPP_E7,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntSmi,GpioPlatformReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //EC_SMI_N

+  {GPIO_VER2_LP_GPP_E8,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //EC_SLP_S0_CS_N

+

+  // SPI TPM, derived from ICL

+  {GPIO_VER2_LP_GPP_C14, {GpioPadModeGpio, GpioHostOwnGpio, GpioDirIn,  GpioOutDefault,GpioIntLevel | GpioIntApic, GpioHostDeepReset,  GpioTermWpu20K,  GpioPadConfigUnlock  }},  //SPI_TPM_INT_N

+

+  // TypeC BIAS : Not used by default in RVP, derived from ICL

+  {GPIO_VER2_LP_GPP_E22, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutLow,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //DISP_AUX_P_BIAS_GPIO

+  {GPIO_VER2_LP_GPP_E23, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //DISP_AUX_N_BIAS_GPIO

+

+  // LAN : Not used by Default in RVP

+

+  // X1 Pcie Slot

+  {GPIO_VER2_LP_GPP_F4,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntSci,GpioHostDeepReset,  GpioTermNone,  GpioPadConfigUnlock  }},  //X1 Slot WAKE

+  {GPIO_VER2_LP_GPP_F10, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},  //X1 Slot RESET

+};

+

+

+UINT16 mGpioTableTglUDdr4Size = sizeof (mGpioTableTglUDdr4) / sizeof (GPIO_INIT_CONFIG);

+

+#endif // _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_H_

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4RvpPreMem.h b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4RvpPreMem.h
new file mode 100644
index 0000000000..7b08676037
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/GpioTableTigerlakeUDdr4RvpPreMem.h
@@ -0,0 +1,33 @@
+/** @file

+  GPIO definition table for Tiger Lake U DDR4 RVP Pre-Memory

+

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#ifndef _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_PREMEM_H_

+#define _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_PREMEM_H_

+

+#include <Pins/GpioPinsVer2Lp.h>

+#include <Library/GpioLib.h>

+#include <Library/GpioConfig.h>

+

+GPIO_INIT_CONFIG mGpioTablePreMemTglUDdr4[] =

+{

+  { GPIO_VER2_LP_GPP_A14, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutLow,  GpioIntDis, GpioPlatformReset, GpioTermNone } },  //ONBOARD_X4_PCIE_SLOT1_PWREN_N

+  { GPIO_VER2_LP_GPP_C13, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //ONBOARD_X4_PCIE_SLOT1_RESET_N

+  // CPU M.2 SSD

+  { GPIO_VER2_LP_GPP_D16, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //CPU SSD PWREN

+  { GPIO_VER2_LP_GPP_A11, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //CPU SSD RESET

+  // X1 Pcie Slot

+  { GPIO_VER2_LP_GPP_F9,  { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //X1 Slot PWREN

+  { GPIO_VER2_LP_GPP_A23, { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutLow,  GpioIntDis, GpioPlatformReset, GpioTermNone } },  //TC_RETIMER_FORCE_PWR

+  // Camera

+  { GPIO_VER2_LP_GPP_R6,  { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },  //CAM2_PWREN/BIOS_REC

+  { GPIO_VER2_LP_GPP_R5,  { GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut, GpioOutLow,  GpioIntDis, GpioPlatformReset, GpioTermNone } },  //CRD_CAM_PRIVACY_LED_1

+};

+

+UINT16 mGpioTablePreMemTglUDdr4Size = sizeof (mGpioTablePreMemTglUDdr4) / sizeof (GPIO_INIT_CONFIG);

+

+#endif  //_GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_PREMEM_H_

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c
new file mode 100644
index 0000000000..f652dcf8e6
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.c
@@ -0,0 +1,41 @@
+/** @file

+  Tiger Lake U RVP Multi-Board Initialization Post-Memory library

+

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <Library/BaseLib.h>

+#include <Library/IoLib.h>

+#include <Library/BoardInitLib.h>

+#include <Library/MultiBoardInitSupportLib.h>

+#include <Library/PcdLib.h>

+#include <Library/DebugLib.h>

+

+#include <PlatformBoardId.h>

+

+EFI_STATUS

+EFIAPI

+TigerlakeURvpBoardInitBeforeSiliconInit(

+  VOID

+  );

+

+BOARD_POST_MEM_INIT_FUNC  mTigerlakeURvpBoardInitFunc = {

+  TigerlakeURvpBoardInitBeforeSiliconInit,

+  NULL, // BoardInitAfterSiliconInit

+};

+

+EFI_STATUS

+EFIAPI

+PeiTigerlakeURvpMultiBoardInitLibConstructor (

+  VOID

+  )

+{

+  if (LibPcdGetSku () == SkuIdTglU) {

+    DEBUG ((DEBUG_INFO, "SKU_ID: 0x%x\n", LibPcdGetSku()));

+    return RegisterBoardPostMemInit (&mTigerlakeURvpBoardInitFunc);

+  }

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf
new file mode 100644
index 0000000000..d00f350dfe
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPostMemLib.inf
@@ -0,0 +1,49 @@
+## @file

+#  Component information file for TigerlakeURvpInitLib in PEI post memory phase.

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = PeiTigerlakeURvpMultiBoardInitLib

+  FILE_GUID                      = C7D39F17-E5BA-41D9-8DFE-FF9017499280

+  MODULE_TYPE                    = BASE

+  VERSION_STRING                 = 1.0

+  LIBRARY_CLASS                  = NULL

+  CONSTRUCTOR                    = PeiTigerlakeURvpMultiBoardInitLibConstructor

+

+[LibraryClasses]

+  BaseLib

+  DebugLib

+  BaseMemoryLib

+  MemoryAllocationLib

+  PcdLib

+  MultiBoardInitSupportLib

+  PeiPlatformHookLib

+  PciSegmentLib

+

+[Packages]

+  MinPlatformPkg/MinPlatformPkg.dec

+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec

+  MdePkg/MdePkg.dec

+  MdeModulePkg/MdeModulePkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+

+[Sources]

+  PeiTigerlakeURvpInitPostMemLib.c

+  PeiMultiBoardInitPostMemLib.c

+

+  GpioTableTigerlakeUDdr4Rvp.h

+

+[FixedPcd]

+

+[Pcd]

+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTable

+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTableSize

+

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase

+  gBoardModuleTokenSpaceGuid.PcdCpuUsb30PortEnable

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c
new file mode 100644
index 0000000000..6200f3b86e
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.c
@@ -0,0 +1,88 @@
+/** @file

+  Tiger Lake U RVP Multi-Board Initialization Pre-Memory library

+

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <Library/BaseLib.h>

+#include <Library/IoLib.h>

+#include <Library/BoardInitLib.h>

+#include <Library/MultiBoardInitSupportLib.h>

+#include <Library/PcdLib.h>

+#include <Library/DebugLib.h>

+

+#include <PlatformBoardId.h>

+

+EFI_STATUS

+EFIAPI

+TigerlakeURvpBoardDetect (

+  VOID

+  );

+

+EFI_STATUS

+EFIAPI

+TigerlakeURvpMultiBoardDetect (

+  VOID

+  );

+

+EFI_BOOT_MODE

+EFIAPI

+TigerlakeURvpBoardBootModeDetect (

+  VOID

+  );

+

+EFI_STATUS

+EFIAPI

+TigerlakeURvpBoardDebugInit (

+  VOID

+  );

+

+EFI_STATUS

+EFIAPI

+TigerlakeURvpBoardInitBeforeMemoryInit (

+  VOID

+  );

+

+

+BOARD_DETECT_FUNC  mTigerlakeURvpBoardDetectFunc = {

+  TigerlakeURvpMultiBoardDetect

+};

+

+BOARD_PRE_MEM_INIT_FUNC  mTigerlakeURvpBoardPreMemInitFunc = {

+  TigerlakeURvpBoardDebugInit,

+  TigerlakeURvpBoardBootModeDetect,

+  TigerlakeURvpBoardInitBeforeMemoryInit,

+  NULL, // BoardInitAfterMemoryInit

+  NULL, // BoardInitBeforeTempRamExit

+  NULL, // BoardInitAfterTempRamExit

+};

+

+EFI_STATUS

+EFIAPI

+TigerlakeURvpMultiBoardDetect (

+  VOID

+  )

+{

+  DEBUG ((DEBUG_INFO, " In TglUMultiBoardDetect \n"));

+

+  TigerlakeURvpBoardDetect ();

+

+  if (LibPcdGetSku () == SkuIdTglU) {

+    RegisterBoardPreMemInit (&mTigerlakeURvpBoardPreMemInitFunc);

+  } else {

+    DEBUG ((DEBUG_WARN,"Not a Valid TigerLake U Board\n"));

+  }

+  return EFI_SUCCESS;

+}

+

+EFI_STATUS

+EFIAPI

+PeiTigerlakeURvpMultiBoardInitPreMemLibConstructor (

+  VOID

+  )

+{

+  return RegisterBoardDetect (&mTigerlakeURvpBoardDetectFunc);

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
new file mode 100644
index 0000000000..b8f1cf8aee
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiMultiBoardInitPreMemLib.inf
@@ -0,0 +1,115 @@
+## @file

+#  Component information file for PEI TigerlakeURvp Board Init Pre-Mem Library

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010005

+  BASE_NAME                      = PeiTigerlakeURvpMultiBoardInitPreMemLib

+  FILE_GUID                      = EA05BD43-136F-45EE-BBBA-27D75817574F

+  MODULE_TYPE                    = BASE

+  VERSION_STRING                 = 1.0

+  LIBRARY_CLASS                  = NULL

+  CONSTRUCTOR                    = PeiTigerlakeURvpMultiBoardInitPreMemLibConstructor

+

+[LibraryClasses]

+  BaseLib

+  DebugLib

+  BaseMemoryLib

+  MemoryAllocationLib

+  PcdLib

+  PeiPlatformHookLib

+  MultiBoardInitSupportLib

+  PeiLib

+

+[Packages]

+  MinPlatformPkg/MinPlatformPkg.dec

+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec

+  MdePkg/MdePkg.dec

+  MdeModulePkg/MdeModulePkg.dec

+  IntelFsp2Pkg/IntelFsp2Pkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+

+[Sources]

+  PeiTigerlakeURvpInitPreMemLib.c

+  PeiMultiBoardInitPreMemLib.c

+  PeiTigerlakeURvpDetect.c

+  BoardSaInitPreMemLib.c

+  BoardPchInitPreMemLib.c

+  GpioTableTigerlakeUDdr4RvpPreMem.h

+

+[Ppis]

+  gEfiPeiReadOnlyVariable2PpiGuid

+  gEfiPeiMemoryDiscoveredPpiGuid                ## CONSUMES

+  gEfiPeiResetPpiGuid                           ## PRODUCES

+[Pcd]

+  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort

+

+  # SA Misc Config

+  gBoardModuleTokenSpaceGuid.PcdSaMiscUserBd

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdData

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdDataSize

+

+  # SPD Address Table

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable0

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable1

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable2

+  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable3

+

+  #===========================================================

+  # Board Init Table List

+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMem

+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMemSize

+

+  # Board Information

+  gBoardModuleTokenSpaceGuid.PcdCpuRatio

+  gBoardModuleTokenSpaceGuid.PcdBiosGuard

+

+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase              ## CONSUMES

+  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize              ## CONSUMES

+  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize           ## CONSUMES

+  gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize         ## CONSUMES

+

+  # SA USB Config

+  gBoardModuleTokenSpaceGuid.PcdCpuUsb30PortEnable

+

+  # PCIe Clock Info

+  gBoardModuleTokenSpaceGuid.PcdPcieClock0

+  gBoardModuleTokenSpaceGuid.PcdPcieClock1

+  gBoardModuleTokenSpaceGuid.PcdPcieClock2

+  gBoardModuleTokenSpaceGuid.PcdPcieClock3

+  gBoardModuleTokenSpaceGuid.PcdPcieClock4

+  gBoardModuleTokenSpaceGuid.PcdPcieClock5

+  gBoardModuleTokenSpaceGuid.PcdPcieClock6

+  gBoardModuleTokenSpaceGuid.PcdPcieClock7

+  gBoardModuleTokenSpaceGuid.PcdPcieClock8

+  gBoardModuleTokenSpaceGuid.PcdPcieClock9

+  gBoardModuleTokenSpaceGuid.PcdPcieClock10

+  gBoardModuleTokenSpaceGuid.PcdPcieClock11

+  gBoardModuleTokenSpaceGuid.PcdPcieClock12

+  gBoardModuleTokenSpaceGuid.PcdPcieClock13

+  gBoardModuleTokenSpaceGuid.PcdPcieClock14

+  gBoardModuleTokenSpaceGuid.PcdPcieClock15

+

+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress

+

+  gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength

+  gMinPlatformPkgTokenSpaceGuid.PcdLocalApicAddress

+  gMinPlatformPkgTokenSpaceGuid.PcdLocalApicMmioSize

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress

+  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize

+

+  gSiPkgTokenSpaceGuid.PcdMchBaseAddress

+  gSiPkgTokenSpaceGuid.PcdMchMmioSize

+

+  gBoardModuleTokenSpaceGuid.PcdDmiBaseAddress

+  gBoardModuleTokenSpaceGuid.PcdDmiMmioSize

+  gBoardModuleTokenSpaceGuid.PcdEpBaseAddress

+  gBoardModuleTokenSpaceGuid.PcdEpMmioSize

+

+[Guids]

+  gFspNonVolatileStorageHobGuid

+  gEfiMemoryOverwriteControlDataGuid

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpDetect.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpDetect.c
new file mode 100644
index 0000000000..a11724072f
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpDetect.c
@@ -0,0 +1,39 @@
+/** @file

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <Library/PcdLib.h>

+#include <Library/DebugLib.h>

+

+#include <PlatformBoardId.h>

+

+BOOLEAN

+TigerlakeURvp(

+  VOID

+  )

+{

+  return TRUE;

+}

+

+EFI_STATUS

+EFIAPI

+TigerlakeURvpBoardDetect (

+  VOID

+  )

+{

+  if (LibPcdGetSku () != 0) {

+    return EFI_SUCCESS;

+  }

+

+  DEBUG ((DEBUG_INFO, "TigerLakeU Board Detection Callback\n"));

+

+  if (TigerlakeURvp ()) {

+    LibPcdSetSku (SkuIdTglU);

+    DEBUG ((DEBUG_INFO, "SKU_ID: 0x%x\n", LibPcdGetSku()));

+    ASSERT (LibPcdGetSku() == SkuIdTglU);

+  }

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPostMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPostMemLib.c
new file mode 100644
index 0000000000..e775f83cce
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPostMemLib.c
@@ -0,0 +1,153 @@
+/** @file

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <Library/DebugLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/IoLib.h>

+#include <Library/HobLib.h>

+#include <Library/PcdLib.h>

+#include <Library/PchCycleDecodingLib.h>

+#include <Library/PciLib.h>

+#include <Library/BoardInitLib.h>

+#include <PeiPlatformHookLib.h>

+#include "TigerlakeURvpInit.h"

+#include "GpioTableTigerlakeUDdr4Rvp.h"

+#include <Library/ConfigBlockLib.h>

+

+/**

+  GPIO init function for PEI post memory phase.

+

+  @param[in]  BoardId       An unsigned integrer represent the board id.

+

+  @retval     EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+BoardGpioInit(

+  IN UINT16 BoardId

+  )

+{

+  //

+  // GPIO Table Init.

+  //

+  switch (BoardId) {

+

+    case BoardIdTglUDdr4:

+      PcdSet32S (PcdBoardGpioTable, (UINTN) mGpioTableTglUDdr4);

+      PcdSet16S (PcdBoardGpioTableSize, mGpioTableTglUDdr4Size);

+      break;

+

+    default:

+      break;

+  }

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Touch panel GPIO init function for PEI post memory phase.

+

+  @param[in]  BoardId       An unsigned integrer represent the board id.

+

+  @retval     EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+TouchPanelGpioInit (

+  IN UINT16 BoardId

+  )

+{

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Misc. init function for PEI post memory phase.

+

+  @param[in]  BoardId       An unsigned integrer represent the board id.

+

+  @retval     EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+BoardMiscInit (

+  IN UINT16 BoardId

+  )

+{

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Security GPIO init function for PEI post memory phase.

+

+  @param[in]  BoardId       An unsigned integrer represent the board id.

+

+  @retval     EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+BoardSecurityInit (

+  IN UINT16 BoardId

+  )

+{

+  return EFI_SUCCESS;

+}

+

+/**

+  Board configuration initialization in the post-memory boot phase.

+**/

+VOID

+BoardConfigInit (

+  VOID

+  )

+{

+  EFI_STATUS  Status;

+  UINT16      BoardId;

+

+  BoardId = BoardIdTglUDdr4;

+

+  Status = BoardGpioInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = TouchPanelGpioInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = BoardMiscInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = BoardSecurityInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+}

+

+

+/**

+  Configure GPIO and SIO

+

+  @retval  EFI_SUCCESS   Operation success.

+**/

+EFI_STATUS

+EFIAPI

+TigerlakeURvpBoardInitBeforeSiliconInit(

+  VOID

+  )

+{

+  EFI_STATUS      Status;

+

+  DEBUG ((DEBUG_INFO, "Board Init before Silicon Init\n"));

+

+  BoardConfigInit ();

+  //

+  // Configure GPIO and SIO

+  //

+  Status = BoardInit ();

+  ASSERT_EFI_ERROR (Status);

+

+  //

+  // Initializing Platform Specific Programming

+  //

+  Status = PlatformSpecificInit ();

+  ASSERT_EFI_ERROR(Status);

+

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c
new file mode 100644
index 0000000000..2ad229c1cd
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/PeiTigerlakeURvpInitPreMemLib.c
@@ -0,0 +1,445 @@
+/** @file

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <Library/DebugLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/IoLib.h>

+#include <Library/HobLib.h>

+#include <Library/PcdLib.h>

+#include <Library/PchCycleDecodingLib.h>

+#include <Library/PciLib.h>

+#include <Library/PcdLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/BoardInitLib.h>

+#include <Library/GpioNativeLib.h>

+#include <Library/GpioLib.h>

+#include <Library/PchPcrLib.h>

+#include <ConfigBlock.h>

+#include <Library/PeiServicesLib.h>

+#include <Library/PchPcrLib.h>

+#include <Register/PchRegsLpc.h>

+#include <Ppi/Reset.h>

+#include <PlatformBoardConfig.h>

+#include <Library/PmcLib.h>

+#include <Library/PciSegmentLib.h>

+#include <PeiPlatformHookLib.h>

+#include <PlatformBoardId.h>

+

+///

+/// Reset Generator I/O Port

+///

+#define RESET_GENERATOR_PORT           0xCF9

+

+typedef struct {

+  EFI_PHYSICAL_ADDRESS    BaseAddress;

+  UINT64                  Length;

+} MEMORY_MAP;

+

+GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_MAP MmioMap[] = {

+  { FixedPcdGet64 (PcdLocalApicAddress),  FixedPcdGet32 (PcdLocalApicMmioSize) },

+  { FixedPcdGet64 (PcdMchBaseAddress),    FixedPcdGet32 (PcdMchMmioSize) },

+  { FixedPcdGet64 (PcdDmiBaseAddress),    FixedPcdGet32 (PcdDmiMmioSize) },

+  { FixedPcdGet64 (PcdEpBaseAddress),     FixedPcdGet32 (PcdEpMmioSize) }

+};

+

+EFI_STATUS

+MrcConfigInit (

+  IN UINT16 BoardId

+  );

+

+EFI_STATUS

+SaGpioConfigInit (

+  IN UINT16 BoardId

+  );

+

+EFI_STATUS

+SaMiscConfigInit (

+  IN UINT16         BoardId

+  );

+

+EFI_STATUS

+RootPortClkInfoInit (

+  IN UINT16 BoardId

+  );

+

+EFI_STATUS

+UsbConfigInit (

+  IN UINT16 BoardId

+  );

+

+EFI_STATUS

+GpioGroupTierInit (

+  IN UINT16 BoardId

+  );

+

+EFI_STATUS

+GpioTablePreMemInit (

+  IN UINT16 BoardId

+  );

+

+EFI_STATUS

+PchPmConfigInit (

+  IN UINT16 BoardId

+  );

+

+EFI_STATUS

+SaDisplayConfigInit (

+  IN UINT16 BoardId

+  );

+

+EFI_STATUS

+EFIAPI

+PlatformInitPreMemCallBack (

+  IN CONST EFI_PEI_SERVICES      **PeiServices,

+  IN EFI_PEI_NOTIFY_DESCRIPTOR   *NotifyDescriptor,

+  IN VOID                        *Ppi

+  );

+

+EFI_STATUS

+EFIAPI

+MemoryDiscoveredPpiNotify (

+  IN CONST EFI_PEI_SERVICES      **PeiServices,

+  IN EFI_PEI_NOTIFY_DESCRIPTOR   *NotifyDescriptor,

+  IN VOID                        *Ppi

+  );

+

+EFI_STATUS

+EFIAPI

+PchReset (

+  IN CONST EFI_PEI_SERVICES    **PeiServices

+  );

+

+static EFI_PEI_RESET_PPI mResetPpi = {

+  PchReset

+};

+

+static EFI_PEI_PPI_DESCRIPTOR mPreMemPpiList[] = {

+  {

+    (EFI_PEI_PPI_DESCRIPTOR_PPI | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),

+    &gEfiPeiResetPpiGuid,

+    &mResetPpi

+  }

+};

+

+static EFI_PEI_NOTIFY_DESCRIPTOR mPreMemNotifyList = {

+  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),

+  &gEfiPeiReadOnlyVariable2PpiGuid,

+  (EFI_PEIM_NOTIFY_ENTRY_POINT)PlatformInitPreMemCallBack

+};

+

+static EFI_PEI_NOTIFY_DESCRIPTOR mMemDiscoveredNotifyList = {

+  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK | EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),

+  &gEfiPeiMemoryDiscoveredPpiGuid,

+  (EFI_PEIM_NOTIFY_ENTRY_POINT)MemoryDiscoveredPpiNotify

+};

+

+/**

+  Board misc init function for PEI pre-memory phase.

+

+  @param[in]  BoardId       An unsigned integer represent the board id.

+

+  @retval     EFI_SUCCESS   The function completed successfully.

+**/

+EFI_STATUS

+BoardMiscInitPreMem (

+  IN UINT16 BoardId

+  )

+{

+  return EFI_SUCCESS;

+}

+

+/**

+  Board configuration initialization in the pre-memory boot phase.

+**/

+VOID

+BoardConfigInitPreMem (

+  VOID

+  )

+{

+  EFI_STATUS Status;

+  UINT16 BoardId;

+

+  BoardId = BoardIdTglUDdr4;

+

+  Status = MrcConfigInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = SaGpioConfigInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = SaMiscConfigInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = RootPortClkInfoInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = UsbConfigInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = GpioGroupTierInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = GpioTablePreMemInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = PchPmConfigInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = BoardMiscInitPreMem (BoardId);

+  ASSERT_EFI_ERROR (Status);

+

+  Status = SaDisplayConfigInit (BoardId);

+  ASSERT_EFI_ERROR (Status);

+}

+

+/**

+  This function handles PlatformInit task after PeiReadOnlyVariable2 PPI produced

+

+  @param[in]  PeiServices   Pointer to PEI Services Table.

+  @param[in]  NotifyDesc    Pointer to the descriptor for the Notification event that

+                            caused this function to execute.

+  @param[in]  Ppi           Pointer to the PPI data associated with this function.

+

+  @retval     EFI_SUCCESS  The function completes successfully

+  @retval     others       Failure

+**/

+EFI_STATUS

+EFIAPI

+PlatformInitPreMemCallBack (

+  IN CONST EFI_PEI_SERVICES     **PeiServices,

+  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,

+  IN VOID                       *Ppi

+  )

+{

+  EFI_STATUS                        Status;

+

+  DEBUG ((DEBUG_INFO, "PlatformInitPreMemCallBack Start...\n"));

+  //

+  // Init Board Config Pcd.

+  //

+  BoardConfigInitPreMem ();

+

+  ///

+  /// Configure GPIO and SIO

+  ///

+  Status = BoardInitPreMem ();

+  ASSERT_EFI_ERROR (Status);

+

+  ///

+  /// Install Pre Memory PPIs

+  ///

+  Status = PeiServicesInstallPpi (&mPreMemPpiList[0]);

+  ASSERT_EFI_ERROR (Status);

+

+  DEBUG ((DEBUG_INFO, "PlatformInitPreMemCallBack End...\n"));

+

+  return Status;

+}

+

+/**

+  Provide hard reset PPI service.

+  To generate full hard reset, write 0x0E to PCH RESET_GENERATOR_PORT (0xCF9).

+

+  @param[in]  PeiServices       General purpose services available to every PEIM.

+

+  @retval     Not return        System reset occured.

+  @retval     EFI_DEVICE_ERROR  Device error, could not reset the system.

+**/

+EFI_STATUS

+EFIAPI

+PchReset (

+  IN CONST EFI_PEI_SERVICES    **PeiServices

+  )

+{

+  DEBUG ((DEBUG_INFO, "Perform Cold Reset\n"));

+  IoWrite8 (RESET_GENERATOR_PORT, 0x0E);

+

+  CpuDeadLoop ();

+

+  ///

+  /// System reset occured, should never reach at this line.

+  ///

+  ASSERT_EFI_ERROR (EFI_DEVICE_ERROR);

+  return EFI_DEVICE_ERROR;

+}

+

+/**

+  Install Firmware Volume Hob's once there is main memory

+

+  @param[in]  PeiServices       General purpose services available to every PEIM.

+  @param[in]  NotifyDescriptor  Notify that this module published.

+  @param[in]  Ppi               PPI that was installed.

+

+  @retval     EFI_SUCCESS       The function completed successfully.

+**/

+EFI_STATUS

+EFIAPI

+MemoryDiscoveredPpiNotify (

+  IN CONST EFI_PEI_SERVICES     **PeiServices,

+  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,

+  IN VOID                       *Ppi

+  )

+{

+  EFI_STATUS                    Status;

+  EFI_BOOT_MODE                 BootMode;

+  UINTN                         Index;

+  UINT8                         PhysicalAddressBits;

+  UINT32                        RegEax;

+  MEMORY_MAP                    PcieMmioMap;

+

+ DEBUG ((DEBUG_INFO, "MemoryDiscoveredPpiNotify Start!\n"));

+

+  Index = 0;

+

+  Status = PeiServicesGetBootMode (&BootMode);

+  ASSERT_EFI_ERROR (Status);

+

+  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);

+

+  ///

+  /// Build Memory Mapped IO Resource which is used to build E820 Table in LegacyBios.

+  ///

+  PcieMmioMap.BaseAddress = FixedPcdGet64 (PcdPciExpressBaseAddress);

+  PcieMmioMap.Length = PcdGet32 (PcdPciExpressRegionLength);

+

+  BuildResourceDescriptorHob (

+    EFI_RESOURCE_MEMORY_MAPPED_IO,

+     (EFI_RESOURCE_ATTRIBUTE_PRESENT      |

+      EFI_RESOURCE_ATTRIBUTE_INITIALIZED  |

+      EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),

+    PcieMmioMap.BaseAddress,

+    PcieMmioMap.Length

+    );

+  BuildMemoryAllocationHob (

+    PcieMmioMap.BaseAddress,

+    PcieMmioMap.Length,

+    EfiMemoryMappedIO

+    );

+  for (Index = 0; Index < sizeof(MmioMap) / (sizeof(MEMORY_MAP)); Index++) {

+    BuildResourceDescriptorHob (

+      EFI_RESOURCE_MEMORY_MAPPED_IO,

+       (EFI_RESOURCE_ATTRIBUTE_PRESENT      |

+        EFI_RESOURCE_ATTRIBUTE_INITIALIZED  |

+        EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),

+      MmioMap[Index].BaseAddress,

+      MmioMap[Index].Length

+      );

+    BuildMemoryAllocationHob (

+      MmioMap[Index].BaseAddress,

+      MmioMap[Index].Length,

+      EfiMemoryMappedIO

+      );

+  }

+

+  //

+  // Report resource HOB for flash FV

+  //

+  BuildResourceDescriptorHob (

+    EFI_RESOURCE_MEMORY_MAPPED_IO,

+     (EFI_RESOURCE_ATTRIBUTE_PRESENT      |

+      EFI_RESOURCE_ATTRIBUTE_INITIALIZED  |

+      EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),

+    (UINTN) FixedPcdGet32 (PcdFlashAreaBaseAddress),

+    (UINTN) FixedPcdGet32 (PcdFlashAreaSize)

+    );

+

+  BuildMemoryAllocationHob (

+    (UINTN) FixedPcdGet32 (PcdFlashAreaBaseAddress),

+    (UINTN) FixedPcdGet32 (PcdFlashAreaSize),

+    EfiMemoryMappedIO

+    );

+

+  BuildFvHob (

+    (UINTN)FixedPcdGet32 (PcdFlashAreaBaseAddress),

+    (UINTN)FixedPcdGet32 (PcdFlashAreaSize)

+    );

+

+ DEBUG ((DEBUG_INFO, "MemoryDiscoveredPpiNotify End!\n"));

+

+  return Status;

+}

+

+/**

+  Board configuration init function for PEI pre-memory phase.

+

+  @retval EFI_SUCCESS             The function completed successfully.

+  @retval EFI_INVALID_PARAMETER   The parameter is NULL.

+**/

+EFI_STATUS

+EFIAPI

+TigerlakeURvpInitPreMem (

+  VOID

+  )

+{

+  EFI_STATUS Status;

+  DEBUG ((DEBUG_INFO, "TigerlakeURvpInitPreMem Start!\n"));

+  ///

+  /// Performing PlatformInitPreMemCallBack after PeiReadOnlyVariable2 PPI produced

+  ///

+  Status = PeiServicesNotifyPpi (&mPreMemNotifyList);

+

+  ///

+  /// After code reorangized, memorycallback will run because the PPI is already

+  /// installed when code run to here, it is supposed that the InstallEfiMemory is

+  /// done before.

+  ///

+  Status = PeiServicesNotifyPpi (&mMemDiscoveredNotifyList);

+

+  DEBUG ((DEBUG_INFO, "TigerlakeURvpInitPreMem End!\n"));

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Configure GPIO and SIO before memory ready

+

+  @retval  EFI_SUCCESS   Operation success.

+**/

+EFI_STATUS

+EFIAPI

+TigerlakeURvpBoardInitBeforeMemoryInit(

+  VOID

+  )

+{

+

+  TigerlakeURvpInitPreMem();

+

+  return EFI_SUCCESS;

+}

+

+EFI_STATUS

+EFIAPI

+TigerlakeURvpBoardDebugInit(

+  VOID

+  )

+{

+  ///

+  /// Do Early PCH init

+  ///

+  return EFI_SUCCESS;

+}

+

+EFI_BOOT_MODE

+EFIAPI

+TigerlakeURvpBoardBootModeDetect(

+  VOID

+  )

+{

+  return BOOT_WITH_FULL_CONFIGURATION;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/TigerlakeURvpInit.h b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/TigerlakeURvpInit.h
new file mode 100644
index 0000000000..ccffcc6761
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/TigerlakeURvpInit.h
@@ -0,0 +1,23 @@
+/** @file

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#ifndef _TIGER_LAKE_U_RVP_INIT_H_

+#define _TIGER_LAKE_U_RVP_INIT_H_

+

+#include <Uefi.h>

+#include <PlatformBoardId.h>

+#include <Library/BaseLib.h>

+#include <Library/PcdLib.h>

+#include <Library/MemoryAllocationLib.h>

+#include <Library/DebugLib.h>

+#include <Ppi/SiPolicy.h>

+

+extern GPIO_INIT_CONFIG mGpioTableTglUDdr4[];

+extern UINT16 mGpioTableTglUDdr4Size;

+

+

+#endif // _TIGER_LAKE_U_RVP_INIT_H_

+

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.c b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.c
new file mode 100644
index 0000000000..6c2587391d
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.c
@@ -0,0 +1,212 @@
+/** @file

+  PEI Library Functions. Initialize GPIOs

+

+

+  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+  SPDX-License-Identifier: BSD-2-Clause-Patent

+**/

+

+#include <PiPei.h>

+#include <PeiPlatformHookLib.h>

+#include <Library/DebugLib.h>

+#include <Library/BaseMemoryLib.h>

+#include <Library/IoLib.h>

+#include <Library/HobLib.h>

+#include <Library/PcdLib.h>

+#include <Library/TimerLib.h>

+#include <Library/PchCycleDecodingLib.h>

+#include <Library/PciSegmentLib.h>

+#include <Library/PeiServicesLib.h>

+#include <Library/PmcLib.h>

+#include <Library/GpioNativeLib.h>

+#include <Library/GpioLib.h>

+#include <PlatformBoardConfig.h>

+#include <Library/PchPcrLib.h>

+#include <Library/GpioCheckConflictLib.h>

+

+#define SIO_RUNTIME_REG_BASE_ADDRESS                          0x0680

+

+#define RECOVERY_MODE_GPIO_PIN                    0                    // Platform specific @todo use PCD

+

+#define MANUFACTURE_MODE_GPIO_PIN                 0                    // Platform specific @todo use PCD

+

+/**

+  Configures GPIO

+

+  @param[in]  GpioTable       Point to Platform Gpio table

+  @param[in]  GpioTableCount  Number of Gpio table entries

+

+**/

+VOID

+ConfigureGpio (

+  IN GPIO_INIT_CONFIG                 *GpioDefinition,

+  IN UINT16                           GpioTableCount

+  )

+{

+  DEBUG ((DEBUG_INFO, "ConfigureGpio() Start\n"));

+

+

+  CreateGpioCheckConflictHob (GpioDefinition, GpioTableCount);

+

+

+  GpioConfigurePads (GpioTableCount, GpioDefinition);

+

+  DEBUG ((DEBUG_INFO, "ConfigureGpio() End\n"));

+}

+

+/**

+  Configure GPIO group GPE tier.

+

+  @retval     none.

+**/

+VOID

+GpioGroupTierInitHook(

+  VOID

+  )

+{

+  DEBUG ((DEBUG_INFO, "GpioGroupTierInitHook Start\n"));

+

+  DEBUG ((DEBUG_INFO, "GpioGroupTierInitHook End\n"));

+}

+

+/**

+  Configure single GPIO pad for touchpanel interrupt

+**/

+VOID

+TouchpanelGpioInit (

+  VOID

+  )

+{

+

+}

+

+/**

+  Configure GPIO Before Memory is not ready.

+

+**/

+VOID

+GpioInitPreMem (

+  VOID

+  )

+{

+  if (PcdGet32 (PcdBoardGpioTablePreMem) != 0 && PcdGet16 (PcdBoardGpioTablePreMemSize) != 0) {

+    DEBUG ((DEBUG_INFO, "Pre-mem Gpio Config\n"));

+    ConfigureGpio ((VOID *) (UINTN) PcdGet32 (PcdBoardGpioTablePreMem), (UINTN) PcdGet16 (PcdBoardGpioTablePreMemSize));

+  }

+}

+

+/**

+  Basic GPIO configuration before memory is ready

+

+**/

+VOID

+GpioInitEarlyPreMem (

+  VOID

+  )

+{

+

+}

+

+/**

+  Configure GPIO

+

+**/

+

+VOID

+GpioInit (

+  VOID

+  )

+{

+  DEBUG ((DEBUG_INFO, "Post-mem Gpio Config\n"));

+  ConfigureGpio ((VOID *) (UINTN) PcdGet32 (PcdBoardGpioTable), (UINTN) PcdGet16 (PcdBoardGpioTableSize));

+

+  TouchpanelGpioInit();

+

+  return;

+}

+

+/**

+  Configure Super IO

+

+**/

+VOID

+SioInit (

+  VOID

+  )

+{

+  //

+  // Program and Enable Default Super IO Configuration Port Addresses and range

+  //

+  PchLpcGenIoRangeSet (PcdGet16 (PcdLpcSioConfigDefaultPort) & (~0xF), 0x10);

+

+  PchLpcGenIoRangeSet (SIO_RUNTIME_REG_BASE_ADDRESS  & (~0x7F), 0x10);

+  return;

+}

+

+/**

+  Configure GPIO and SIO before memory ready

+

+  @retval  EFI_SUCCESS   Operation success.

+**/

+EFI_STATUS

+BoardInitPreMem (

+  VOID

+  )

+{

+  //

+  // Obtain Platform Info from HOB.

+  //

+  GpioInitPreMem ();

+  GpioGroupTierInitHook ();

+  SioInit ();

+

+  DEBUG ((DEBUG_INFO, "BoardInitPreMem Done\n"));

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Configure GPIO and SIO

+

+  @retval  EFI_SUCCESS   Operation success.

+**/

+EFI_STATUS

+BoardInit (

+  VOID

+  )

+{

+

+  GpioInit ();

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Do platform specific programming post-memory.

+

+  @retval  EFI_SUCCESS       The function completed successfully.

+**/

+

+EFI_STATUS

+PlatformSpecificInit (

+  VOID

+  )

+{

+

+  return EFI_SUCCESS;

+}

+

+/**

+  Early Board Configuration before memory is ready

+

+  @retval  EFI_SUCCESS  Operation success.

+**/

+EFI_STATUS

+BoardInitEarlyPreMem (

+  VOID

+  )

+{

+  GpioInitEarlyPreMem ();

+

+  return EFI_SUCCESS;

+}

diff --git a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf
new file mode 100644
index 0000000000..8e4ce47d5a
--- /dev/null
+++ b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHookLib/PeiPlatformHooklib.inf
@@ -0,0 +1,58 @@
+## @file

+#

+#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>

+#  SPDX-License-Identifier: BSD-2-Clause-Patent

+#

+##

+

+[Defines]

+  INF_VERSION                    = 0x00010017

+  BASE_NAME                      = PeiPlatformHookLib

+  FILE_GUID                      = AD901798-B0DA-4B20-B90C-283F886E76D0

+  VERSION_STRING                 = 1.0

+  MODULE_TYPE                    = PEIM

+  LIBRARY_CLASS                  = PeiPlatformHookLib|PEIM PEI_CORE SEC

+

+[LibraryClasses]

+  DebugLib

+  BaseMemoryLib

+  IoLib

+  HobLib

+  PcdLib

+  TimerLib

+  PchCycleDecodingLib

+  GpioLib

+  PeiServicesLib

+  ConfigBlockLib

+  PmcLib

+  PchPcrLib

+  PciSegmentLib

+  GpioCheckConflictLib

+

+[Packages]

+  MdePkg/MdePkg.dec

+  TigerlakeOpenBoardPkg/OpenBoardPkg.dec

+  TigerlakeSiliconPkg/SiPkg.dec

+  IntelSiliconPkg/IntelSiliconPkg.dec

+

+[Pcd]

+  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress                        ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort        ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdSioBaseAddress                 ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTable                 ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTableSize             ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMem           ## CONSUMES

+  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMemSize       ## CONSUMES

+

+[Sources]

+  PeiPlatformHooklib.c

+

+[Ppis]

+  gEfiPeiReadOnlyVariable2PpiGuid               ## CONSUMES

+  gSiPolicyPpiGuid                              ## CONSUMES

+

+[Guids]

+  gSaDataHobGuid                                ## CONSUMES

+  gEfiGlobalVariableGuid                        ## CONSUMES

+  gGpioCheckConflictHobGuid                     ## CONSUMES

+

-- 
2.24.0.windows.2


^ permalink raw reply related	[flat|nested] 18+ messages in thread

* Re: [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add library instances
  2021-02-10  0:38   ` Chaganty, Rangasai V
@ 2021-02-10  3:58     ` Heng Luo
  0 siblings, 0 replies; 18+ messages in thread
From: Heng Luo @ 2021-02-10  3:58 UTC (permalink / raw)
  To: Chaganty, Rangasai V, devel@edk2.groups.io; +Cc: Desimone, Nathaniel L

I will send Patch V3 to remove commented code in SiliconEnableAcpi() and associated comments.

> -----Original Message-----
> From: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>
> Sent: Wednesday, February 10, 2021 8:39 AM
> To: Luo, Heng <heng.luo@intel.com>; devel@edk2.groups.io
> Cc: Desimone, Nathaniel L <nathaniel.l.desimone@intel.com>
> Subject: RE: [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add library
> instances
> 
> Please remove commented code in SiliconEnableAcpi() and associated
> comments.
> 
> Thanks,
> Sai
> 
> -----Original Message-----
> From: Luo, Heng <heng.luo@intel.com>
> Sent: Tuesday, February 09, 2021 12:46 AM
> To: devel@edk2.groups.io
> Cc: Chaganty, Rangasai V <rangasai.v.chaganty@intel.com>; Desimone,
> Nathaniel L <nathaniel.l.desimone@intel.com>
> Subject: [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add library
> instances
> 
> REF: https://bugzilla.tianocore.org/show_bug.cgi?id=3175
> 
> Adds the following library instances:
>   * TigerlakeURvp/Library/BoardAcpiLib
>   * TigerlakeURvp/Library/BoardInitLib
>   * TigerlakeURvp/Library/PeiPlatformHookLib
> 
> Cc: Sai Chaganty <rangasai.v.chaganty@intel.com>
> Cc: Nate DeSimone <nathaniel.l.desimone@intel.com>
> Signed-off-by: Heng Luo <heng.luo@intel.com>
> ---
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/S
> mmMultiBoardAcpiSupportLib.c      |  88
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/S
> mmMultiBoardAcpiSupportLib.inf    |  43
> +++++++++++++++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/S
> mmSiliconAcpiEnableLib.c          | 160
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/S
> mmTigerlakeURvpAcpiEnableLib.c    |  51
> +++++++++++++++++++++++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Bo
> ardPchInitPreMemLib.c            | 160
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Bo
> ardSaInitPreMemLib.c             |  96
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Gpi
> oTableTigerlakeUDdr4Rvp.h       |  93
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Gpi
> oTableTigerlakeUDdr4RvpPreMem.h |  33
> +++++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Pei
> MultiBoardInitPostMemLib.c      |  41
> +++++++++++++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Pei
> MultiBoardInitPostMemLib.inf    |  49
> +++++++++++++++++++++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Pei
> MultiBoardInitPreMemLib.c       |  88
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Pei
> MultiBoardInitPreMemLib.inf     | 115
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> ++++++++++++++++++++++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Pei
> TigerlakeURvpDetect.c           |  39
> +++++++++++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Pei
> TigerlakeURvpInitPostMemLib.c   | 153
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Pei
> TigerlakeURvpInitPreMemLib.c    | 445
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/Tig
> erlakeURvpInit.h                |  23 +++++++++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHoo
> kLib/PeiPlatformHooklib.c         | 212
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> +++++++++++++++++
> 
> Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHoo
> kLib/PeiPlatformHooklib.inf       |  58
> ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
>  18 files changed, 1947 insertions(+)
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmMultiBoardAcpiSupportLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmMultiBoardAcpiSupportLib.c
> new file mode 100644
> index 0000000000..1436d9b79a
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmMultiBoardAcpiSupportLib.c
> @@ -0,0 +1,88 @@
> +/** @file
> 
> +  Tiger Lake U RVP SMM Multi-Board ACPI Support library
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include <Base.h>
> 
> +#include <Uefi.h>
> 
> +#include <PiDxe.h>
> 
> +#include <Library/BaseLib.h>
> 
> +#include <Library/IoLib.h>
> 
> +#include <Library/BoardAcpiEnableLib.h>
> 
> +#include <Library/MultiBoardAcpiSupportLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/DebugLib.h>
> 
> +
> 
> +#include <PlatformBoardId.h>
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TglBoardEnableAcpi (
> 
> +  IN BOOLEAN  EnableSci
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TglBoardDisableAcpi (
> 
> +  IN BOOLEAN  DisableSci
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +SiliconEnableAcpi (
> 
> +  IN BOOLEAN  EnableSci
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +SiliconDisableAcpi (
> 
> +  IN BOOLEAN  DisableSci
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +MultiBoardEnableAcpi (
> 
> +  IN BOOLEAN  EnableSci
> 
> +  )
> 
> +{
> 
> +  SiliconEnableAcpi (EnableSci);
> 
> +  return TglBoardEnableAcpi (EnableSci);
> 
> +}
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +MultiBoardDisableAcpi (
> 
> +  IN BOOLEAN  DisableSci
> 
> +  )
> 
> +{
> 
> +  SiliconDisableAcpi (DisableSci);
> 
> +  return TglBoardDisableAcpi (DisableSci);
> 
> +}
> 
> +
> 
> +BOARD_ACPI_ENABLE_FUNC  mBoardAcpiEnableFunc = {
> 
> +  MultiBoardEnableAcpi,
> 
> +  MultiBoardDisableAcpi,
> 
> +};
> 
> +
> 
> +/**
> 
> +  The constructor function to register mBoardAcpiEnableFunc function.
> 
> +
> 
> +  @param[in]  ImageHandle  The firmware allocated handle for the EFI image.
> 
> +  @param[in]  SystemTable  A pointer to the EFI System Table.
> 
> +
> 
> +  @retval     EFI_SUCCESS  This constructor always return EFI_SUCCESS.
> 
> +                           It will ASSERT on errors.
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +SmmMultiBoardAcpiSupportLibConstructor (
> 
> +  IN EFI_HANDLE        ImageHandle,
> 
> +  IN EFI_SYSTEM_TABLE  *SystemTable
> 
> +  )
> 
> +{
> 
> +  DEBUG ((DEBUG_INFO, "SKU_ID: 0x%x\n", LibPcdGetSku()));
> 
> +  return RegisterBoardAcpiEnableFunc (&mBoardAcpiEnableFunc);
> 
> +}
> 
> +
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmMultiBoardAcpiSupportLib.inf
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmMultiBoardAcpiSupportLib.inf
> new file mode 100644
> index 0000000000..6f6a9272f9
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmMultiBoardAcpiSupportLib.inf
> @@ -0,0 +1,43 @@
> +## @file
> 
> +#  Tiger Lake U RVP SMM Multi-Board ACPI Support library
> 
> +#
> 
> +#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +#
> 
> +##
> 
> +
> 
> +[Defines]
> 
> +  INF_VERSION                    = 0x00010017
> 
> +  BASE_NAME                      = SmmMultiBoardAcpiSupportLib
> 
> +  FILE_GUID                      = 8929A54E-7ED8-4AB3-BEBB-C0367BDBBFF5
> 
> +  VERSION_STRING                 = 1.0
> 
> +  MODULE_TYPE                    = DXE_SMM_DRIVER
> 
> +  LIBRARY_CLASS                  = NULL
> 
> +  CONSTRUCTOR                    = SmmMultiBoardAcpiSupportLibConstructor
> 
> +
> 
> +#
> 
> +# The following information is for reference only and not required by the build
> tools.
> 
> +#
> 
> +# VALID_ARCHITECTURES = IA32 X64 IPF EBC
> 
> +#
> 
> +
> 
> +[LibraryClasses]
> 
> +  BaseLib
> 
> +  IoLib
> 
> +  PciLib
> 
> +  MmPciLib
> 
> +  PchCycleDecodingLib
> 
> +  PchPciBdfLib
> 
> +  PmcLib
> 
> +
> 
> +[Packages]
> 
> +  MdePkg/MdePkg.dec
> 
> +  MdeModulePkg/MdeModulePkg.dec
> 
> +  MinPlatformPkg/MinPlatformPkg.dec
> 
> +  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
> 
> +  TigerlakeSiliconPkg/SiPkg.dec
> 
> +
> 
> +[Sources]
> 
> +  SmmTigerlakeURvpAcpiEnableLib.c
> 
> +  SmmSiliconAcpiEnableLib.c
> 
> +  SmmMultiBoardAcpiSupportLib.c
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmSiliconAcpiEnableLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmSiliconAcpiEnableLib.c
> new file mode 100644
> index 0000000000..32afeb405e
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmSiliconAcpiEnableLib.c
> @@ -0,0 +1,160 @@
> +/** @file
> 
> +  Tiger Lake U RVP SMM Silicon ACPI Enable library
> 
> +
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include <Base.h>
> 
> +#include <Uefi.h>
> 
> +#include <PiDxe.h>
> 
> +#include <Library/BaseLib.h>
> 
> +#include <Library/IoLib.h>
> 
> +#include <Library/PciSegmentLib.h>
> 
> +#include <Library/BoardAcpiEnableLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/DebugLib.h>
> 
> +#include <Library/MmPciLib.h>
> 
> +#include <Library/PmcLib.h>
> 
> +#include <Library/PchPciBdfLib.h>
> 
> +#include <Register/PchRegs.h>
> 
> +#include <Register/PchRegsLpc.h>
> 
> +#include <Register/PmcRegs.h>
> 
> +#include <Register/RtcRegs.h>
> 
> +
> 
> +/**
> 
> +  Clear Port 80h
> 
> +
> 
> +  SMI handler to enable ACPI mode
> 
> +
> 
> +  Dispatched on reads from APM port with value EFI_ACPI_ENABLE_SW_SMI
> 
> +
> 
> +  Disables the SW SMI Timer.
> 
> +  ACPI events are disabled and ACPI event status is cleared.
> 
> +  SCI mode is then enabled.
> 
> +
> 
> +  Clear SLP SMI status
> 
> +  Enable SLP SMI
> 
> +
> 
> +  Disable SW SMI Timer
> 
> +
> 
> +  Clear all ACPI event status and disable all ACPI events
> 
> +
> 
> +  Disable PM sources except power button
> 
> +  Clear status bits
> 
> +
> 
> +  Disable GPE0 sources
> 
> +  Clear status bits
> 
> +
> 
> +  Disable GPE1 sources
> 
> +  Clear status bits
> 
> +
> 
> +  Guarantee day-of-month alarm is invalid (ACPI 1.0 section 4.7.2.4)
> 
> +
> 
> +  Enable SCI
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +SiliconEnableAcpi (
> 
> +  IN BOOLEAN  EnableSci
> 
> +  )
> 
> +{
> 
> +
> 
> +  UINT32                              SmiEn;
> 
> +  UINT32                              SmiSts;
> 
> +  UINT32                              ULKMC;
> 
> +  UINTN                               LpcBaseAddress;
> 
> +  UINT16                              AcpiBaseAddr;
> 
> +  UINT32                              Pm1Cnt;
> 
> +
> 
> +  LpcBaseAddress = LpcPciCfgBase ();
> 
> +
> 
> +  //
> 
> +  // Get the ACPI Base Address
> 
> +  //
> 
> +  AcpiBaseAddr = PmcGetAcpiBase();
> 
> +  //
> 
> +  // BIOS must also ensure that CF9GR is cleared and locked before handing
> control to the
> 
> +  // OS in order to prevent the host from issuing global resets and resetting ME
> 
> +  //
> 
> +  // EDK2: To match PCCG current BIOS behavior, do not lock CF9 Global Reset
> 
> +  // MmioWrite32 (
> 
> +  //     PmcBaseAddress + R_PCH_PMC_ETR3),
> 
> +  //     PmInit);
> 
> +
> 
> +  //
> 
> +  // Clear Port 80h
> 
> +  //
> 
> +  IoWrite8 (0x80, 0);
> 
> +
> 
> +  //
> 
> +  // Disable SW SMI Timer and clean the status
> 
> +  //
> 
> +  SmiEn = IoRead32 (AcpiBaseAddr + R_ACPI_IO_SMI_EN);
> 
> +  SmiEn &= ~(B_ACPI_IO_SMI_EN_LEGACY_USB2 |
> B_ACPI_IO_SMI_EN_SWSMI_TMR | B_ACPI_IO_SMI_EN_LEGACY_USB);
> 
> +  IoWrite32 (AcpiBaseAddr + R_ACPI_IO_SMI_EN, SmiEn);
> 
> +
> 
> +  SmiSts = IoRead32 (AcpiBaseAddr + R_ACPI_IO_SMI_STS);
> 
> +  SmiSts |= B_ACPI_IO_SMI_EN_LEGACY_USB2 |
> B_ACPI_IO_SMI_EN_SWSMI_TMR | B_ACPI_IO_SMI_EN_LEGACY_USB;
> 
> +  IoWrite32 (AcpiBaseAddr + R_ACPI_IO_SMI_STS, SmiSts);
> 
> +
> 
> +  //
> 
> +  // Disable port 60/64 SMI trap if they are enabled
> 
> +  //
> 
> +  ULKMC = MmioRead32 (LpcBaseAddress + R_LPC_CFG_ULKMC) &
> ~(B_LPC_CFG_ULKMC_60REN | B_LPC_CFG_ULKMC_60WEN |
> B_LPC_CFG_ULKMC_64REN | B_LPC_CFG_ULKMC_64WEN |
> B_LPC_CFG_ULKMC_A20PASSEN);
> 
> +  MmioWrite32 (LpcBaseAddress + R_LPC_CFG_ULKMC, ULKMC);
> 
> +
> 
> +  //
> 
> +  // Disable PM sources except power button
> 
> +  //
> 
> +  IoWrite16 (AcpiBaseAddr + R_ACPI_IO_PM1_EN,
> B_ACPI_IO_PM1_EN_PWRBTN);
> 
> +
> 
> +  //
> 
> +  // Clear PM status except Power Button status for RapidStart Resume
> 
> +  //
> 
> +  IoWrite16 (AcpiBaseAddr + R_ACPI_IO_PM1_STS, 0xFEFF);
> 
> +
> 
> +  //
> 
> +  // Guarantee day-of-month alarm is invalid (ACPI 1.0 section 4.7.2.4)
> 
> +  //
> 
> +  IoWrite8 (R_RTC_IO_INDEX_ALT, R_RTC_IO_REGD);
> 
> +  IoWrite8 (R_RTC_IO_TARGET_ALT, 0x0);
> 
> +
> 
> +  //
> 
> +  // Enable SCI
> 
> +  //
> 
> +  if (EnableSci) {
> 
> +    Pm1Cnt = IoRead32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT);
> 
> +    Pm1Cnt |= B_ACPI_IO_PM1_CNT_SCI_EN;
> 
> +    IoWrite32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT, Pm1Cnt);
> 
> +  }
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +SiliconDisableAcpi (
> 
> +  IN BOOLEAN  DisableSci
> 
> +  )
> 
> +{
> 
> +
> 
> +  UINT16                              AcpiBaseAddr;
> 
> +  UINT32                              Pm1Cnt;
> 
> +
> 
> +  //
> 
> +  // Get the ACPI Base Address
> 
> +  //
> 
> +  AcpiBaseAddr = PmcGetAcpiBase();
> 
> +  //
> 
> +  // Disable SCI
> 
> +  //
> 
> +  if (DisableSci) {
> 
> +    Pm1Cnt = IoRead32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT);
> 
> +    Pm1Cnt &= ~B_ACPI_IO_PM1_CNT_SCI_EN;
> 
> +    IoWrite32 (AcpiBaseAddr + R_ACPI_IO_PM1_CNT, Pm1Cnt);
> 
> +  }
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmTigerlakeURvpAcpiEnableLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmTigerlakeURvpAcpiEnableLib.c
> new file mode 100644
> index 0000000000..3eb302c30d
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardAcpiLib/
> SmmTigerlakeURvpAcpiEnableLib.c
> @@ -0,0 +1,51 @@
> +/** @file
> 
> +  Tiger Lake U RVP SMM Board ACPI Enable library
> 
> +
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include <Base.h>
> 
> +#include <Uefi.h>
> 
> +#include <PiDxe.h>
> 
> +#include <Library/BaseLib.h>
> 
> +#include <Library/IoLib.h>
> 
> +#include <Library/BoardAcpiTableLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/DebugLib.h>
> 
> +#include <PlatformBoardId.h>
> 
> +
> 
> +/**
> 
> +  Enable Board Acpi
> 
> +
> 
> +  @param[in]  EnableSci     Enable SCI if EnableSci parameters is True.
> 
> +
> 
> +  @retval     EFI_SUCCESS   The function always return successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TglBoardEnableAcpi (
> 
> +  IN BOOLEAN  EnableSci
> 
> +  )
> 
> +{
> 
> +  // enable additional board register
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Disable Board Acpi
> 
> +
> 
> +  @param[in]  DisableSci    Disable SCI if DisableSci parameters is True.
> 
> +
> 
> +  @retval     EFI_SUCCESS   The function always return successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TglBoardDisableAcpi (
> 
> +  IN BOOLEAN  DisableSci
> 
> +  )
> 
> +{
> 
> +  // enable additional board register
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/B
> oardPchInitPreMemLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/B
> oardPchInitPreMemLib.c
> new file mode 100644
> index 0000000000..1c7e574f7d
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/B
> oardPchInitPreMemLib.c
> @@ -0,0 +1,160 @@
> +/** @file
> 
> +  Source code for the board PCH configuration Pcd init functions for Pre-
> Memory Init phase.
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include "TigerlakeURvpInit.h"
> 
> +#include "GpioTableTigerlakeUDdr4RvpPreMem.h"
> 
> +
> 
> +#include <PlatformBoardConfig.h>
> 
> +#include <Include/PlatformBoardId.h>
> 
> +
> 
> +#include <Library/GpioLib.h>
> 
> +
> 
> +/**
> 
> +  Board Root Port Clock Info configuration init function for PEI pre-memory
> phase.
> 
> +
> 
> +  @retval EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +RootPortClkInfoInit (
> 
> +  IN UINT16    BoardId
> 
> +  )
> 
> +{
> 
> +  PCD64_BLOB Clock[PCH_MAX_PCIE_CLOCKS];
> 
> +  UINT32 Index;
> 
> +
> 
> +  //
> 
> +  // The default clock assignment will be FREE_RUNNING, which corresponds to
> PchClockUsageUnspecified
> 
> +  // This is safe but power-consuming setting. If Platform code doesn't contain
> port-clock map for a given board,
> 
> +  // the clocks will keep on running anyway, allowing PCIe devices to operate.
> Downside is that clocks will
> 
> +  // continue to draw power. To prevent this, remember to provide port-clock
> map for every board.
> 
> +  //
> 
> +  for (Index = 0; Index < PCH_MAX_PCIE_CLOCKS; Index++) {
> 
> +    Clock[Index].PcieClock.ClkReqSupported = TRUE;
> 
> +    Clock[Index].PcieClock.ClockUsage = FREE_RUNNING;
> 
> +  }
> 
> +
> 
> +  ///
> 
> +  /// Assign ClkReq signal to root port. (Base 0)
> 
> +  /// For LP, Set 0 - 6
> 
> +  /// For H,  Set 0 - 15
> 
> +  /// Note that if GbE is enabled, ClkReq assigned to GbE will not be available
> for Root Port.
> 
> +  ///
> 
> +
> 
> +  switch (BoardId) {
> 
> +    // CLKREQ
> 
> +    case BoardIdTglUDdr4:
> 
> +      Clock[0].PcieClock.ClockUsage = PCIE_PEG;
> 
> +      Clock[1].PcieClock.ClockUsage = PCIE_PCH + 2;
> 
> +      Clock[2].PcieClock.ClockUsage = PCIE_PCH + 3;
> 
> +      Clock[3].PcieClock.ClockUsage = PCIE_PCH + 8;
> 
> +      Clock[4].PcieClock.ClockUsage = LAN_CLOCK;
> 
> +      Clock[5].PcieClock.ClockUsage = PCIE_PCH + 7;
> 
> +      Clock[6].PcieClock.ClockUsage = PCIE_PCH + 4;
> 
> +      break;
> 
> +    default:
> 
> +
> 
> +      break;
> 
> +  }
> 
> +
> 
> +  PcdSet64S (PcdPcieClock0,  Clock[ 0].Blob);
> 
> +  PcdSet64S (PcdPcieClock1,  Clock[ 1].Blob);
> 
> +  PcdSet64S (PcdPcieClock2,  Clock[ 2].Blob);
> 
> +  PcdSet64S (PcdPcieClock3,  Clock[ 3].Blob);
> 
> +  PcdSet64S (PcdPcieClock4,  Clock[ 4].Blob);
> 
> +  PcdSet64S (PcdPcieClock5,  Clock[ 5].Blob);
> 
> +  PcdSet64S (PcdPcieClock6,  Clock[ 6].Blob);
> 
> +  PcdSet64S (PcdPcieClock7,  Clock[ 7].Blob);
> 
> +  PcdSet64S (PcdPcieClock8,  Clock[ 8].Blob);
> 
> +  PcdSet64S (PcdPcieClock9,  Clock[ 9].Blob);
> 
> +  PcdSet64S (PcdPcieClock10, Clock[10].Blob);
> 
> +  PcdSet64S (PcdPcieClock11, Clock[11].Blob);
> 
> +  PcdSet64S (PcdPcieClock12, Clock[12].Blob);
> 
> +  PcdSet64S (PcdPcieClock13, Clock[13].Blob);
> 
> +  PcdSet64S (PcdPcieClock14, Clock[14].Blob);
> 
> +  PcdSet64S (PcdPcieClock15, Clock[15].Blob);
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Board USB related configuration init function for PEI pre-memory phase.
> 
> +
> 
> +  @param[in]  BoardId   An unsigned integrer represent the board id.
> 
> +
> 
> +  @retval EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +UsbConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +
> 
> +/**
> 
> +  Board GPIO Group Tier configuration init function for PEI pre-memory phase.
> 
> +
> 
> +  @param[in]  BoardId   An unsigned integrer represent the board id.
> 
> +
> 
> +  @retval EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +GpioGroupTierInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +
> 
> +/**
> 
> +  GPIO init function for PEI pre-memory phase.
> 
> +
> 
> +  @param[in]  BoardId   An unsigned integrer represent the board id.
> 
> +
> 
> +  @retval EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +GpioTablePreMemInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +
> 
> +  //
> 
> +  // GPIO Table Init.
> 
> +  //
> 
> +  switch (BoardId) {
> 
> +    case BoardIdTglUDdr4:
> 
> +      PcdSet32S (PcdBoardGpioTablePreMem, (UINTN)
> mGpioTablePreMemTglUDdr4);
> 
> +      PcdSet16S (PcdBoardGpioTablePreMemSize,
> mGpioTablePreMemTglUDdr4Size);
> 
> +      break;
> 
> +
> 
> +    default:
> 
> +      break;
> 
> +  }
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  PmConfig init function for PEI pre-memory phase.
> 
> +
> 
> +  @param[in]  BoardId   An unsigned integrer represent the board id.
> 
> +
> 
> +  @retval EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +PchPmConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/B
> oardSaInitPreMemLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/B
> oardSaInitPreMemLib.c
> new file mode 100644
> index 0000000000..b468e21ec9
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/B
> oardSaInitPreMemLib.c
> @@ -0,0 +1,96 @@
> +/** @file
> 
> + Source code for the board SA configuration Pcd init functions in Pre-Memory
> init phase.
> 
> +
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include "TigerlakeURvpInit.h"
> 
> +#include <Pins/GpioPinsVer2Lp.h>
> 
> +#include <PlatformBoardId.h>
> 
> +#include <PlatformBoardConfig.h>
> 
> +
> 
> +/**
> 
> +  MRC configuration init function for PEI pre-memory phase.
> 
> +
> 
> +  @param[in]  BoardId           An unsigned integer represent the board id.
> 
> +
> 
> +  @retval EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +SaMiscConfigInit (
> 
> +  IN UINT16         BoardId
> 
> +  )
> 
> +{
> 
> +  //
> 
> +  // UserBd
> 
> +  //
> 
> +  switch (BoardId) {
> 
> +    case BoardIdTglUDdr4:
> 
> +      //
> 
> +      // Assign UserBd to 5 which is assigned to MrcInputs->BoardType btUser4
> for ULT platforms.
> 
> +      // This is required to skip Memory voltage programming based on GPIO's in
> MRC
> 
> +      //
> 
> +      PcdSet8S (PcdSaMiscUserBd, 5); // MrcBoardType btUser4 for ULT platform
> 
> +      break;
> 
> +
> 
> +    default:
> 
> +      // MiscPeiPreMemConfig.UserBd = 0 by default.
> 
> +      break;
> 
> +  }
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Board Memory Init related configuration init function for PEI pre-memory
> phase.
> 
> +
> 
> +  @param[in]  BoardId   An unsigned integrer represent the board id.
> 
> +
> 
> +  @retval EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +MrcConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +
> 
> +  PcdSet8S (PcdMrcSpdAddressTable0, 0xA0);
> 
> +  PcdSet8S (PcdMrcSpdAddressTable1, 0xA2);
> 
> +  PcdSet8S (PcdMrcSpdAddressTable2, 0xA4);
> 
> +  PcdSet8S (PcdMrcSpdAddressTable3, 0xA6);
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Board SA related GPIO configuration init function for PEI pre-memory phase.
> 
> +
> 
> +  @param[in]  BoardId   An unsigned integer represent the board id.
> 
> +
> 
> +  @retval EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +SaGpioConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  SA Display DDI configuration init function for PEI pre-memory phase.
> 
> +
> 
> +  @param[in]  BoardId       An unsigned integer represent the board id.
> 
> +
> 
> +  @retval     EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +SaDisplayConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/G
> pioTableTigerlakeUDdr4Rvp.h
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/G
> pioTableTigerlakeUDdr4Rvp.h
> new file mode 100644
> index 0000000000..0b605698c0
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/G
> pioTableTigerlakeUDdr4Rvp.h
> @@ -0,0 +1,93 @@
> +/** @file
> 
> +  GPIO definition table for Tiger Lake U RVP
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#ifndef _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_H_
> 
> +#define _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_H_
> 
> +
> 
> +#include <Pins/GpioPinsVer2Lp.h>
> 
> +#include <Library/GpioLib.h>
> 
> +#include <Library/GpioConfig.h>
> 
> +
> 
> +GPIO_INIT_CONFIG mGpioTableTglUDdr4[] =
> 
> +{
> 
> +  // M.2 Key-E - WLAN/BT
> 
> +  {GPIO_VER2_LP_GPP_A13, {GpioPadModeGpio, GpioHostOwnDefault,
> GpioDirOut,   GpioOutHigh,    GpioIntDis,              GpioHostDeepReset,
> GpioTermNone, GpioPadConfigUnlock }}, // BT_RF_KILL_N
> 
> +  {GPIO_VER2_LP_GPP_B15, {GpioPadModeGpio, GpioHostOwnDefault,
> GpioDirOut,   GpioOutHigh,    GpioIntDis,              GpioHostDeepReset,
> GpioTermNone, GpioPadConfigUnlock }}, // WIFI_RF_KILL_N
> 
> +  {GPIO_VER2_LP_GPP_C22, {GpioPadModeGpio, GpioHostOwnDefault,
> GpioDirOut,   GpioOutHigh,    GpioIntDis,              GpioHostDeepReset,
> GpioTermNone, GpioPadConfigUnlock }}, // WLAN_RST_N
> 
> +  {GPIO_VER2_LP_GPP_C23, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirInInv, GpioOutDefault, GpioIntLevel|GpioIntSci, GpioHostDeepReset,
> GpioTermNone, GpioPadConfigUnlock }}, // WIFI_WAKE_N
> 
> +  {GPIO_VER2_LP_GPP_H19, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirInInv, GpioOutDefault, GpioIntLevel|GpioIntSci, GpioHostDeepReset,
> GpioTermNone, GpioPadConfigUnlock }}, // UART_BT_WAKE_N : Not default
> POR
> 
> +  {GPIO_VER2_LP_GPP_A10, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirIn,    GpioOutDefault, GpioIntDis,              GpioPlatformReset,
> GpioTermNone}},                       // M.2 BT
> 
> +
> 
> +  // X4 Pcie Slot for Gen3 and Gen 4
> 
> +  {GPIO_VER2_LP_GPP_A14, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutLow,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //ONBOARD_X4_PCIE_SLOT1_PWREN_N
> 
> +  {GPIO_VER2_LP_GPP_C13, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //ONBOARD_X4_PCIE_SLOT1_RESET_N
> 
> +  {GPIO_VER2_LP_GPP_F5,  {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntSci,GpioHostDeepReset,
> GpioTermNone,  GpioPadConfigUnlock  }},
> //ONBOARD_X4_PCIE_SLOT1_WAKE_N
> 
> +  {GPIO_VER2_LP_GPP_F20, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //ONBOARD_X4_PCIE_SLOT1_DGPU_SEL
> 
> +  {GPIO_VER2_LP_GPP_F21, {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirIn,
> GpioOutDefault,GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //ONBOARD_X4_PCIE_SLOT1_DGPU_PWROK
> 
> +
> 
> +  // TBT Re-Timers
> 
> +  {GPIO_VER2_LP_GPD7,    {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,
> GpioOutHigh,  GpioIntDis,GpioDswReset,  GpioTermNone}},
> //TCP_RETIMER_PERST_N
> 
> +
> 
> +  // Battery Charger Vmin to PCH PROCHOT, derived from ICL
> 
> +  {GPIO_VER2_LP_GPP_B2,  {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirInInv,  GpioOutDefault,GpioIntEdge|GpioIntSci,GpioPlatformReset,
> GpioTermNone,  GpioPadConfigUnlock  }},  //BC_PROCHOT_N
> 
> +
> 
> +  // SATA Direct Connect
> 
> +  {GPIO_VER2_LP_GPP_B4,  {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //SATA_DIRECT_PWREN
> 
> +
> 
> +  // FPS
> 
> +  {GPIO_VER2_LP_GPP_B14, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //FPS_RST_N
> 
> +  {GPIO_VER2_LP_GPP_E3,  {GpioPadModeGpio, GpioHostOwnGpio, GpioDirIn,
> GpioOutDefault,GpioIntLevel|GpioIntApic,GpioPlatformReset,  GpioTermNone,
> GpioPadConfigUnlock  }},  //FPS_INT
> 
> +
> 
> +  // PCH M.2 SSD
> 
> +  {GPIO_VER2_LP_GPP_B16, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //M2_PCH_SSD_PWREN
> 
> +  {GPIO_VER2_LP_GPP_H0,  {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //M2_SSD_RST_N
> 
> +
> 
> +
> 
> +  // Camera
> 
> +  {GPIO_VER2_LP_GPP_B23, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //CRD_CAM_PWREN - CAM1
> 
> +  {GPIO_VER2_LP_GPP_C15, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //WF_CAM_RST_N  - CAM1
> 
> +
> 
> +  {GPIO_VER2_LP_GPP_H12, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //CAM2_RST_N
> 
> +
> 
> +  {GPIO_VER2_LP_GPP_H15, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //CAM3_PWREN
> 
> +  {GPIO_VER2_LP_GPP_H13, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //CAM3_RST_N
> 
> +
> 
> +  // Camera Common GPIO's for all Camera, Rework Options
> 
> +  {GPIO_VER2_LP_GPP_B18, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutLow,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //CRD_CAM_STROBE_1
> 
> +  {GPIO_VER2_LP_GPP_C2,  {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //WF_CAM_CLK_EN
> 
> +
> 
> +  // Audio
> 
> +  {GPIO_VER2_LP_GPP_C5,  {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //SPKR_PD_N
> 
> +  {GPIO_VER2_LP_GPP_C12, {GpioPadModeGpio, GpioHostOwnGpio,
> GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntApic,GpioPlatformReset,
> GpioTermNone,  GpioPadConfigUnlock  }},  // CODEC_INT_N
> 
> +
> 
> +  // Touch Pad
> 
> +  // Touch Pad and Touch Panel 2 share the same Power Enable, default is
> Touch pad
> 
> +  {GPIO_VER2_LP_GPP_H1,  {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //TCH_PAD_LS_EN - PWR_En
> 
> +  {GPIO_VER2_LP_GPP_C8,  {GpioPadModeGpio, GpioHostOwnGpio,
> GpioDirInInv,  GpioOutDefault,GpioIntEdge|GpioIntApic,GpioPlatformReset,
> GpioTermNone,  GpioPadConfigUnlock  }},  //TCH_PAD_INT_N
> 
> +
> 
> +  // EC
> 
> +  {GPIO_VER2_LP_GPP_E7,  {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntSmi,GpioPlatformReset,
> GpioTermNone,  GpioPadConfigUnlock  }},  //EC_SMI_N
> 
> +  {GPIO_VER2_LP_GPP_E8,  {GpioPadModeGpio, GpioHostOwnAcpi, GpioDirOut,
> GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //EC_SLP_S0_CS_N
> 
> +
> 
> +  // SPI TPM, derived from ICL
> 
> +  {GPIO_VER2_LP_GPP_C14, {GpioPadModeGpio, GpioHostOwnGpio, GpioDirIn,
> GpioOutDefault,GpioIntLevel | GpioIntApic, GpioHostDeepReset,
> GpioTermWpu20K,  GpioPadConfigUnlock  }},  //SPI_TPM_INT_N
> 
> +
> 
> +  // TypeC BIAS : Not used by default in RVP, derived from ICL
> 
> +  {GPIO_VER2_LP_GPP_E22, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutLow,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //DISP_AUX_P_BIAS_GPIO
> 
> +  {GPIO_VER2_LP_GPP_E23, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //DISP_AUX_N_BIAS_GPIO
> 
> +
> 
> +  // LAN : Not used by Default in RVP
> 
> +
> 
> +  // X1 Pcie Slot
> 
> +  {GPIO_VER2_LP_GPP_F4,  {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirInInv,  GpioOutDefault,GpioIntLevel|GpioIntSci,GpioHostDeepReset,
> GpioTermNone,  GpioPadConfigUnlock  }},  //X1 Slot WAKE
> 
> +  {GPIO_VER2_LP_GPP_F10, {GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut,  GpioOutHigh,   GpioIntDis,GpioPlatformReset,  GpioTermNone}},
> //X1 Slot RESET
> 
> +};
> 
> +
> 
> +
> 
> +UINT16 mGpioTableTglUDdr4Size = sizeof (mGpioTableTglUDdr4) / sizeof
> (GPIO_INIT_CONFIG);
> 
> +
> 
> +#endif // _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_H_
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/G
> pioTableTigerlakeUDdr4RvpPreMem.h
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/G
> pioTableTigerlakeUDdr4RvpPreMem.h
> new file mode 100644
> index 0000000000..7b08676037
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/G
> pioTableTigerlakeUDdr4RvpPreMem.h
> @@ -0,0 +1,33 @@
> +/** @file
> 
> +  GPIO definition table for Tiger Lake U DDR4 RVP Pre-Memory
> 
> +
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#ifndef _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_PREMEM_H_
> 
> +#define _GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_PREMEM_H_
> 
> +
> 
> +#include <Pins/GpioPinsVer2Lp.h>
> 
> +#include <Library/GpioLib.h>
> 
> +#include <Library/GpioConfig.h>
> 
> +
> 
> +GPIO_INIT_CONFIG mGpioTablePreMemTglUDdr4[] =
> 
> +{
> 
> +  { GPIO_VER2_LP_GPP_A14, { GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut, GpioOutLow,  GpioIntDis, GpioPlatformReset, GpioTermNone } },
> //ONBOARD_X4_PCIE_SLOT1_PWREN_N
> 
> +  { GPIO_VER2_LP_GPP_C13, { GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },
> //ONBOARD_X4_PCIE_SLOT1_RESET_N
> 
> +  // CPU M.2 SSD
> 
> +  { GPIO_VER2_LP_GPP_D16, { GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },
> //CPU SSD PWREN
> 
> +  { GPIO_VER2_LP_GPP_A11, { GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },
> //CPU SSD RESET
> 
> +  // X1 Pcie Slot
> 
> +  { GPIO_VER2_LP_GPP_F9,  { GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },
> //X1 Slot PWREN
> 
> +  { GPIO_VER2_LP_GPP_A23, { GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut, GpioOutLow,  GpioIntDis, GpioPlatformReset, GpioTermNone } },
> //TC_RETIMER_FORCE_PWR
> 
> +  // Camera
> 
> +  { GPIO_VER2_LP_GPP_R6,  { GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut, GpioOutHigh, GpioIntDis, GpioPlatformReset, GpioTermNone } },
> //CAM2_PWREN/BIOS_REC
> 
> +  { GPIO_VER2_LP_GPP_R5,  { GpioPadModeGpio, GpioHostOwnAcpi,
> GpioDirOut, GpioOutLow,  GpioIntDis, GpioPlatformReset, GpioTermNone } },
> //CRD_CAM_PRIVACY_LED_1
> 
> +};
> 
> +
> 
> +UINT16 mGpioTablePreMemTglUDdr4Size = sizeof
> (mGpioTablePreMemTglUDdr4) / sizeof (GPIO_INIT_CONFIG);
> 
> +
> 
> +#endif  //_GPIO_TABLE_TIGER_LAKE_U_DDR4_RVP_PREMEM_H_
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPostMemLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPostMemLib.c
> new file mode 100644
> index 0000000000..f652dcf8e6
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPostMemLib.c
> @@ -0,0 +1,41 @@
> +/** @file
> 
> +  Tiger Lake U RVP Multi-Board Initialization Post-Memory library
> 
> +
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include <PiPei.h>
> 
> +#include <Library/BaseLib.h>
> 
> +#include <Library/IoLib.h>
> 
> +#include <Library/BoardInitLib.h>
> 
> +#include <Library/MultiBoardInitSupportLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/DebugLib.h>
> 
> +
> 
> +#include <PlatformBoardId.h>
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardInitBeforeSiliconInit(
> 
> +  VOID
> 
> +  );
> 
> +
> 
> +BOARD_POST_MEM_INIT_FUNC  mTigerlakeURvpBoardInitFunc = {
> 
> +  TigerlakeURvpBoardInitBeforeSiliconInit,
> 
> +  NULL, // BoardInitAfterSiliconInit
> 
> +};
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +PeiTigerlakeURvpMultiBoardInitLibConstructor (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  if (LibPcdGetSku () == SkuIdTglU) {
> 
> +    DEBUG ((DEBUG_INFO, "SKU_ID: 0x%x\n", LibPcdGetSku()));
> 
> +    return RegisterBoardPostMemInit (&mTigerlakeURvpBoardInitFunc);
> 
> +  }
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPostMemLib.inf
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPostMemLib.inf
> new file mode 100644
> index 0000000000..d00f350dfe
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPostMemLib.inf
> @@ -0,0 +1,49 @@
> +## @file
> 
> +#  Component information file for TigerlakeURvpInitLib in PEI post memory
> phase.
> 
> +#
> 
> +#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +#
> 
> +##
> 
> +
> 
> +[Defines]
> 
> +  INF_VERSION                    = 0x00010005
> 
> +  BASE_NAME                      = PeiTigerlakeURvpMultiBoardInitLib
> 
> +  FILE_GUID                      = C7D39F17-E5BA-41D9-8DFE-FF9017499280
> 
> +  MODULE_TYPE                    = BASE
> 
> +  VERSION_STRING                 = 1.0
> 
> +  LIBRARY_CLASS                  = NULL
> 
> +  CONSTRUCTOR                    = PeiTigerlakeURvpMultiBoardInitLibConstructor
> 
> +
> 
> +[LibraryClasses]
> 
> +  BaseLib
> 
> +  DebugLib
> 
> +  BaseMemoryLib
> 
> +  MemoryAllocationLib
> 
> +  PcdLib
> 
> +  MultiBoardInitSupportLib
> 
> +  PeiPlatformHookLib
> 
> +  PciSegmentLib
> 
> +
> 
> +[Packages]
> 
> +  MinPlatformPkg/MinPlatformPkg.dec
> 
> +  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
> 
> +  MdePkg/MdePkg.dec
> 
> +  MdeModulePkg/MdeModulePkg.dec
> 
> +  TigerlakeSiliconPkg/SiPkg.dec
> 
> +
> 
> +[Sources]
> 
> +  PeiTigerlakeURvpInitPostMemLib.c
> 
> +  PeiMultiBoardInitPostMemLib.c
> 
> +
> 
> +  GpioTableTigerlakeUDdr4Rvp.h
> 
> +
> 
> +[FixedPcd]
> 
> +
> 
> +[Pcd]
> 
> +  gBoardModuleTokenSpaceGuid.PcdBoardGpioTable
> 
> +  gBoardModuleTokenSpaceGuid.PcdBoardGpioTableSize
> 
> +
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashFvPostMemoryBase
> 
> +  gBoardModuleTokenSpaceGuid.PcdCpuUsb30PortEnable
> 
> +
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPreMemLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPreMemLib.c
> new file mode 100644
> index 0000000000..6200f3b86e
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPreMemLib.c
> @@ -0,0 +1,88 @@
> +/** @file
> 
> +  Tiger Lake U RVP Multi-Board Initialization Pre-Memory library
> 
> +
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include <PiPei.h>
> 
> +#include <Library/BaseLib.h>
> 
> +#include <Library/IoLib.h>
> 
> +#include <Library/BoardInitLib.h>
> 
> +#include <Library/MultiBoardInitSupportLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/DebugLib.h>
> 
> +
> 
> +#include <PlatformBoardId.h>
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardDetect (
> 
> +  VOID
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpMultiBoardDetect (
> 
> +  VOID
> 
> +  );
> 
> +
> 
> +EFI_BOOT_MODE
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardBootModeDetect (
> 
> +  VOID
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardDebugInit (
> 
> +  VOID
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardInitBeforeMemoryInit (
> 
> +  VOID
> 
> +  );
> 
> +
> 
> +
> 
> +BOARD_DETECT_FUNC  mTigerlakeURvpBoardDetectFunc = {
> 
> +  TigerlakeURvpMultiBoardDetect
> 
> +};
> 
> +
> 
> +BOARD_PRE_MEM_INIT_FUNC  mTigerlakeURvpBoardPreMemInitFunc = {
> 
> +  TigerlakeURvpBoardDebugInit,
> 
> +  TigerlakeURvpBoardBootModeDetect,
> 
> +  TigerlakeURvpBoardInitBeforeMemoryInit,
> 
> +  NULL, // BoardInitAfterMemoryInit
> 
> +  NULL, // BoardInitBeforeTempRamExit
> 
> +  NULL, // BoardInitAfterTempRamExit
> 
> +};
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpMultiBoardDetect (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  DEBUG ((DEBUG_INFO, " In TglUMultiBoardDetect \n"));
> 
> +
> 
> +  TigerlakeURvpBoardDetect ();
> 
> +
> 
> +  if (LibPcdGetSku () == SkuIdTglU) {
> 
> +    RegisterBoardPreMemInit (&mTigerlakeURvpBoardPreMemInitFunc);
> 
> +  } else {
> 
> +    DEBUG ((DEBUG_WARN,"Not a Valid TigerLake U Board\n"));
> 
> +  }
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +PeiTigerlakeURvpMultiBoardInitPreMemLibConstructor (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  return RegisterBoardDetect (&mTigerlakeURvpBoardDetectFunc);
> 
> +}
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPreMemLib.inf
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPreMemLib.inf
> new file mode 100644
> index 0000000000..b8f1cf8aee
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiMultiBoardInitPreMemLib.inf
> @@ -0,0 +1,115 @@
> +## @file
> 
> +#  Component information file for PEI TigerlakeURvp Board Init Pre-Mem
> Library
> 
> +#
> 
> +#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +#
> 
> +##
> 
> +
> 
> +[Defines]
> 
> +  INF_VERSION                    = 0x00010005
> 
> +  BASE_NAME                      = PeiTigerlakeURvpMultiBoardInitPreMemLib
> 
> +  FILE_GUID                      = EA05BD43-136F-45EE-BBBA-27D75817574F
> 
> +  MODULE_TYPE                    = BASE
> 
> +  VERSION_STRING                 = 1.0
> 
> +  LIBRARY_CLASS                  = NULL
> 
> +  CONSTRUCTOR                    =
> PeiTigerlakeURvpMultiBoardInitPreMemLibConstructor
> 
> +
> 
> +[LibraryClasses]
> 
> +  BaseLib
> 
> +  DebugLib
> 
> +  BaseMemoryLib
> 
> +  MemoryAllocationLib
> 
> +  PcdLib
> 
> +  PeiPlatformHookLib
> 
> +  MultiBoardInitSupportLib
> 
> +  PeiLib
> 
> +
> 
> +[Packages]
> 
> +  MinPlatformPkg/MinPlatformPkg.dec
> 
> +  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
> 
> +  MdePkg/MdePkg.dec
> 
> +  MdeModulePkg/MdeModulePkg.dec
> 
> +  IntelFsp2Pkg/IntelFsp2Pkg.dec
> 
> +  TigerlakeSiliconPkg/SiPkg.dec
> 
> +
> 
> +[Sources]
> 
> +  PeiTigerlakeURvpInitPreMemLib.c
> 
> +  PeiMultiBoardInitPreMemLib.c
> 
> +  PeiTigerlakeURvpDetect.c
> 
> +  BoardSaInitPreMemLib.c
> 
> +  BoardPchInitPreMemLib.c
> 
> +  GpioTableTigerlakeUDdr4RvpPreMem.h
> 
> +
> 
> +[Ppis]
> 
> +  gEfiPeiReadOnlyVariable2PpiGuid
> 
> +  gEfiPeiMemoryDiscoveredPpiGuid                ## CONSUMES
> 
> +  gEfiPeiResetPpiGuid                           ## PRODUCES
> 
> +[Pcd]
> 
> +  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort
> 
> +
> 
> +  # SA Misc Config
> 
> +  gBoardModuleTokenSpaceGuid.PcdSaMiscUserBd
> 
> +  gBoardModuleTokenSpaceGuid.PcdMrcSpdData
> 
> +  gBoardModuleTokenSpaceGuid.PcdMrcSpdDataSize
> 
> +
> 
> +  # SPD Address Table
> 
> +  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable0
> 
> +  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable1
> 
> +  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable2
> 
> +  gBoardModuleTokenSpaceGuid.PcdMrcSpdAddressTable3
> 
> +
> 
> +  #===========================================================
> 
> +  # Board Init Table List
> 
> +  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMem
> 
> +  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMemSize
> 
> +
> 
> +  # Board Information
> 
> +  gBoardModuleTokenSpaceGuid.PcdCpuRatio
> 
> +  gBoardModuleTokenSpaceGuid.PcdBiosGuard
> 
> +
> 
> +  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamBase              ## CONSUMES
> 
> +  gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize              ## CONSUMES
> 
> +  gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize           ## CONSUMES
> 
> +  gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize         ## CONSUMES
> 
> +
> 
> +  # SA USB Config
> 
> +  gBoardModuleTokenSpaceGuid.PcdCpuUsb30PortEnable
> 
> +
> 
> +  # PCIe Clock Info
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock0
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock1
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock2
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock3
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock4
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock5
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock6
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock7
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock8
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock9
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock10
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock11
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock12
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock13
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock14
> 
> +  gBoardModuleTokenSpaceGuid.PcdPcieClock15
> 
> +
> 
> +  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress
> 
> +
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdPciExpressRegionLength
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdLocalApicAddress
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdLocalApicMmioSize
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaBaseAddress
> 
> +  gMinPlatformPkgTokenSpaceGuid.PcdFlashAreaSize
> 
> +
> 
> +  gSiPkgTokenSpaceGuid.PcdMchBaseAddress
> 
> +  gSiPkgTokenSpaceGuid.PcdMchMmioSize
> 
> +
> 
> +  gBoardModuleTokenSpaceGuid.PcdDmiBaseAddress
> 
> +  gBoardModuleTokenSpaceGuid.PcdDmiMmioSize
> 
> +  gBoardModuleTokenSpaceGuid.PcdEpBaseAddress
> 
> +  gBoardModuleTokenSpaceGuid.PcdEpMmioSize
> 
> +
> 
> +[Guids]
> 
> +  gFspNonVolatileStorageHobGuid
> 
> +  gEfiMemoryOverwriteControlDataGuid
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiTigerlakeURvpDetect.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiTigerlakeURvpDetect.c
> new file mode 100644
> index 0000000000..a11724072f
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiTigerlakeURvpDetect.c
> @@ -0,0 +1,39 @@
> +/** @file
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include <PiPei.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/DebugLib.h>
> 
> +
> 
> +#include <PlatformBoardId.h>
> 
> +
> 
> +BOOLEAN
> 
> +TigerlakeURvp(
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  return TRUE;
> 
> +}
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardDetect (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  if (LibPcdGetSku () != 0) {
> 
> +    return EFI_SUCCESS;
> 
> +  }
> 
> +
> 
> +  DEBUG ((DEBUG_INFO, "TigerLakeU Board Detection Callback\n"));
> 
> +
> 
> +  if (TigerlakeURvp ()) {
> 
> +    LibPcdSetSku (SkuIdTglU);
> 
> +    DEBUG ((DEBUG_INFO, "SKU_ID: 0x%x\n", LibPcdGetSku()));
> 
> +    ASSERT (LibPcdGetSku() == SkuIdTglU);
> 
> +  }
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiTigerlakeURvpInitPostMemLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiTigerlakeURvpInitPostMemLib.c
> new file mode 100644
> index 0000000000..e775f83cce
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiTigerlakeURvpInitPostMemLib.c
> @@ -0,0 +1,153 @@
> +/** @file
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include <PiPei.h>
> 
> +#include <Library/DebugLib.h>
> 
> +#include <Library/BaseMemoryLib.h>
> 
> +#include <Library/IoLib.h>
> 
> +#include <Library/HobLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/PchCycleDecodingLib.h>
> 
> +#include <Library/PciLib.h>
> 
> +#include <Library/BoardInitLib.h>
> 
> +#include <PeiPlatformHookLib.h>
> 
> +#include "TigerlakeURvpInit.h"
> 
> +#include "GpioTableTigerlakeUDdr4Rvp.h"
> 
> +#include <Library/ConfigBlockLib.h>
> 
> +
> 
> +/**
> 
> +  GPIO init function for PEI post memory phase.
> 
> +
> 
> +  @param[in]  BoardId       An unsigned integrer represent the board id.
> 
> +
> 
> +  @retval     EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +BoardGpioInit(
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +  //
> 
> +  // GPIO Table Init.
> 
> +  //
> 
> +  switch (BoardId) {
> 
> +
> 
> +    case BoardIdTglUDdr4:
> 
> +      PcdSet32S (PcdBoardGpioTable, (UINTN) mGpioTableTglUDdr4);
> 
> +      PcdSet16S (PcdBoardGpioTableSize, mGpioTableTglUDdr4Size);
> 
> +      break;
> 
> +
> 
> +    default:
> 
> +      break;
> 
> +  }
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Touch panel GPIO init function for PEI post memory phase.
> 
> +
> 
> +  @param[in]  BoardId       An unsigned integrer represent the board id.
> 
> +
> 
> +  @retval     EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +TouchPanelGpioInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Misc. init function for PEI post memory phase.
> 
> +
> 
> +  @param[in]  BoardId       An unsigned integrer represent the board id.
> 
> +
> 
> +  @retval     EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +BoardMiscInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Security GPIO init function for PEI post memory phase.
> 
> +
> 
> +  @param[in]  BoardId       An unsigned integrer represent the board id.
> 
> +
> 
> +  @retval     EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +BoardSecurityInit (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Board configuration initialization in the post-memory boot phase.
> 
> +**/
> 
> +VOID
> 
> +BoardConfigInit (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  EFI_STATUS  Status;
> 
> +  UINT16      BoardId;
> 
> +
> 
> +  BoardId = BoardIdTglUDdr4;
> 
> +
> 
> +  Status = BoardGpioInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = TouchPanelGpioInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = BoardMiscInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = BoardSecurityInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +}
> 
> +
> 
> +
> 
> +/**
> 
> +  Configure GPIO and SIO
> 
> +
> 
> +  @retval  EFI_SUCCESS   Operation success.
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardInitBeforeSiliconInit(
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  EFI_STATUS      Status;
> 
> +
> 
> +  DEBUG ((DEBUG_INFO, "Board Init before Silicon Init\n"));
> 
> +
> 
> +  BoardConfigInit ();
> 
> +  //
> 
> +  // Configure GPIO and SIO
> 
> +  //
> 
> +  Status = BoardInit ();
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  //
> 
> +  // Initializing Platform Specific Programming
> 
> +  //
> 
> +  Status = PlatformSpecificInit ();
> 
> +  ASSERT_EFI_ERROR(Status);
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiTigerlakeURvpInitPreMemLib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiTigerlakeURvpInitPreMemLib.c
> new file mode 100644
> index 0000000000..2ad229c1cd
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/P
> eiTigerlakeURvpInitPreMemLib.c
> @@ -0,0 +1,445 @@
> +/** @file
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include <PiPei.h>
> 
> +#include <Library/DebugLib.h>
> 
> +#include <Library/BaseMemoryLib.h>
> 
> +#include <Library/IoLib.h>
> 
> +#include <Library/HobLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/PchCycleDecodingLib.h>
> 
> +#include <Library/PciLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/BaseMemoryLib.h>
> 
> +#include <Library/BoardInitLib.h>
> 
> +#include <Library/GpioNativeLib.h>
> 
> +#include <Library/GpioLib.h>
> 
> +#include <Library/PchPcrLib.h>
> 
> +#include <ConfigBlock.h>
> 
> +#include <Library/PeiServicesLib.h>
> 
> +#include <Library/PchPcrLib.h>
> 
> +#include <Register/PchRegsLpc.h>
> 
> +#include <Ppi/Reset.h>
> 
> +#include <PlatformBoardConfig.h>
> 
> +#include <Library/PmcLib.h>
> 
> +#include <Library/PciSegmentLib.h>
> 
> +#include <PeiPlatformHookLib.h>
> 
> +#include <PlatformBoardId.h>
> 
> +
> 
> +///
> 
> +/// Reset Generator I/O Port
> 
> +///
> 
> +#define RESET_GENERATOR_PORT           0xCF9
> 
> +
> 
> +typedef struct {
> 
> +  EFI_PHYSICAL_ADDRESS    BaseAddress;
> 
> +  UINT64                  Length;
> 
> +} MEMORY_MAP;
> 
> +
> 
> +GLOBAL_REMOVE_IF_UNREFERENCED MEMORY_MAP MmioMap[] = {
> 
> +  { FixedPcdGet64 (PcdLocalApicAddress),  FixedPcdGet32
> (PcdLocalApicMmioSize) },
> 
> +  { FixedPcdGet64 (PcdMchBaseAddress),    FixedPcdGet32 (PcdMchMmioSize) },
> 
> +  { FixedPcdGet64 (PcdDmiBaseAddress),    FixedPcdGet32 (PcdDmiMmioSize) },
> 
> +  { FixedPcdGet64 (PcdEpBaseAddress),     FixedPcdGet32 (PcdEpMmioSize) }
> 
> +};
> 
> +
> 
> +EFI_STATUS
> 
> +MrcConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +SaGpioConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +SaMiscConfigInit (
> 
> +  IN UINT16         BoardId
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +RootPortClkInfoInit (
> 
> +  IN UINT16 BoardId
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +UsbConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +GpioGroupTierInit (
> 
> +  IN UINT16 BoardId
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +GpioTablePreMemInit (
> 
> +  IN UINT16 BoardId
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +PchPmConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +SaDisplayConfigInit (
> 
> +  IN UINT16 BoardId
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +PlatformInitPreMemCallBack (
> 
> +  IN CONST EFI_PEI_SERVICES      **PeiServices,
> 
> +  IN EFI_PEI_NOTIFY_DESCRIPTOR   *NotifyDescriptor,
> 
> +  IN VOID                        *Ppi
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +MemoryDiscoveredPpiNotify (
> 
> +  IN CONST EFI_PEI_SERVICES      **PeiServices,
> 
> +  IN EFI_PEI_NOTIFY_DESCRIPTOR   *NotifyDescriptor,
> 
> +  IN VOID                        *Ppi
> 
> +  );
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +PchReset (
> 
> +  IN CONST EFI_PEI_SERVICES    **PeiServices
> 
> +  );
> 
> +
> 
> +static EFI_PEI_RESET_PPI mResetPpi = {
> 
> +  PchReset
> 
> +};
> 
> +
> 
> +static EFI_PEI_PPI_DESCRIPTOR mPreMemPpiList[] = {
> 
> +  {
> 
> +    (EFI_PEI_PPI_DESCRIPTOR_PPI |
> EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
> 
> +    &gEfiPeiResetPpiGuid,
> 
> +    &mResetPpi
> 
> +  }
> 
> +};
> 
> +
> 
> +static EFI_PEI_NOTIFY_DESCRIPTOR mPreMemNotifyList = {
> 
> +  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK |
> EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
> 
> +  &gEfiPeiReadOnlyVariable2PpiGuid,
> 
> +  (EFI_PEIM_NOTIFY_ENTRY_POINT)PlatformInitPreMemCallBack
> 
> +};
> 
> +
> 
> +static EFI_PEI_NOTIFY_DESCRIPTOR mMemDiscoveredNotifyList = {
> 
> +  (EFI_PEI_PPI_DESCRIPTOR_NOTIFY_CALLBACK |
> EFI_PEI_PPI_DESCRIPTOR_TERMINATE_LIST),
> 
> +  &gEfiPeiMemoryDiscoveredPpiGuid,
> 
> +  (EFI_PEIM_NOTIFY_ENTRY_POINT)MemoryDiscoveredPpiNotify
> 
> +};
> 
> +
> 
> +/**
> 
> +  Board misc init function for PEI pre-memory phase.
> 
> +
> 
> +  @param[in]  BoardId       An unsigned integer represent the board id.
> 
> +
> 
> +  @retval     EFI_SUCCESS   The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +BoardMiscInitPreMem (
> 
> +  IN UINT16 BoardId
> 
> +  )
> 
> +{
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Board configuration initialization in the pre-memory boot phase.
> 
> +**/
> 
> +VOID
> 
> +BoardConfigInitPreMem (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  EFI_STATUS Status;
> 
> +  UINT16 BoardId;
> 
> +
> 
> +  BoardId = BoardIdTglUDdr4;
> 
> +
> 
> +  Status = MrcConfigInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = SaGpioConfigInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = SaMiscConfigInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = RootPortClkInfoInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = UsbConfigInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = GpioGroupTierInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = GpioTablePreMemInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = PchPmConfigInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = BoardMiscInitPreMem (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  Status = SaDisplayConfigInit (BoardId);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +}
> 
> +
> 
> +/**
> 
> +  This function handles PlatformInit task after PeiReadOnlyVariable2 PPI
> produced
> 
> +
> 
> +  @param[in]  PeiServices   Pointer to PEI Services Table.
> 
> +  @param[in]  NotifyDesc    Pointer to the descriptor for the Notification event
> that
> 
> +                            caused this function to execute.
> 
> +  @param[in]  Ppi           Pointer to the PPI data associated with this function.
> 
> +
> 
> +  @retval     EFI_SUCCESS  The function completes successfully
> 
> +  @retval     others       Failure
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +PlatformInitPreMemCallBack (
> 
> +  IN CONST EFI_PEI_SERVICES     **PeiServices,
> 
> +  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,
> 
> +  IN VOID                       *Ppi
> 
> +  )
> 
> +{
> 
> +  EFI_STATUS                        Status;
> 
> +
> 
> +  DEBUG ((DEBUG_INFO, "PlatformInitPreMemCallBack Start...\n"));
> 
> +  //
> 
> +  // Init Board Config Pcd.
> 
> +  //
> 
> +  BoardConfigInitPreMem ();
> 
> +
> 
> +  ///
> 
> +  /// Configure GPIO and SIO
> 
> +  ///
> 
> +  Status = BoardInitPreMem ();
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  ///
> 
> +  /// Install Pre Memory PPIs
> 
> +  ///
> 
> +  Status = PeiServicesInstallPpi (&mPreMemPpiList[0]);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  DEBUG ((DEBUG_INFO, "PlatformInitPreMemCallBack End...\n"));
> 
> +
> 
> +  return Status;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Provide hard reset PPI service.
> 
> +  To generate full hard reset, write 0x0E to PCH RESET_GENERATOR_PORT
> (0xCF9).
> 
> +
> 
> +  @param[in]  PeiServices       General purpose services available to every PEIM.
> 
> +
> 
> +  @retval     Not return        System reset occured.
> 
> +  @retval     EFI_DEVICE_ERROR  Device error, could not reset the system.
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +PchReset (
> 
> +  IN CONST EFI_PEI_SERVICES    **PeiServices
> 
> +  )
> 
> +{
> 
> +  DEBUG ((DEBUG_INFO, "Perform Cold Reset\n"));
> 
> +  IoWrite8 (RESET_GENERATOR_PORT, 0x0E);
> 
> +
> 
> +  CpuDeadLoop ();
> 
> +
> 
> +  ///
> 
> +  /// System reset occured, should never reach at this line.
> 
> +  ///
> 
> +  ASSERT_EFI_ERROR (EFI_DEVICE_ERROR);
> 
> +  return EFI_DEVICE_ERROR;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Install Firmware Volume Hob's once there is main memory
> 
> +
> 
> +  @param[in]  PeiServices       General purpose services available to every PEIM.
> 
> +  @param[in]  NotifyDescriptor  Notify that this module published.
> 
> +  @param[in]  Ppi               PPI that was installed.
> 
> +
> 
> +  @retval     EFI_SUCCESS       The function completed successfully.
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +MemoryDiscoveredPpiNotify (
> 
> +  IN CONST EFI_PEI_SERVICES     **PeiServices,
> 
> +  IN EFI_PEI_NOTIFY_DESCRIPTOR  *NotifyDescriptor,
> 
> +  IN VOID                       *Ppi
> 
> +  )
> 
> +{
> 
> +  EFI_STATUS                    Status;
> 
> +  EFI_BOOT_MODE                 BootMode;
> 
> +  UINTN                         Index;
> 
> +  UINT8                         PhysicalAddressBits;
> 
> +  UINT32                        RegEax;
> 
> +  MEMORY_MAP                    PcieMmioMap;
> 
> +
> 
> + DEBUG ((DEBUG_INFO, "MemoryDiscoveredPpiNotify Start!\n"));
> 
> +
> 
> +  Index = 0;
> 
> +
> 
> +  Status = PeiServicesGetBootMode (&BootMode);
> 
> +  ASSERT_EFI_ERROR (Status);
> 
> +
> 
> +  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);
> 
> +
> 
> +  ///
> 
> +  /// Build Memory Mapped IO Resource which is used to build E820 Table in
> LegacyBios.
> 
> +  ///
> 
> +  PcieMmioMap.BaseAddress = FixedPcdGet64 (PcdPciExpressBaseAddress);
> 
> +  PcieMmioMap.Length = PcdGet32 (PcdPciExpressRegionLength);
> 
> +
> 
> +  BuildResourceDescriptorHob (
> 
> +    EFI_RESOURCE_MEMORY_MAPPED_IO,
> 
> +     (EFI_RESOURCE_ATTRIBUTE_PRESENT      |
> 
> +      EFI_RESOURCE_ATTRIBUTE_INITIALIZED  |
> 
> +      EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
> 
> +    PcieMmioMap.BaseAddress,
> 
> +    PcieMmioMap.Length
> 
> +    );
> 
> +  BuildMemoryAllocationHob (
> 
> +    PcieMmioMap.BaseAddress,
> 
> +    PcieMmioMap.Length,
> 
> +    EfiMemoryMappedIO
> 
> +    );
> 
> +  for (Index = 0; Index < sizeof(MmioMap) / (sizeof(MEMORY_MAP)); Index++) {
> 
> +    BuildResourceDescriptorHob (
> 
> +      EFI_RESOURCE_MEMORY_MAPPED_IO,
> 
> +       (EFI_RESOURCE_ATTRIBUTE_PRESENT      |
> 
> +        EFI_RESOURCE_ATTRIBUTE_INITIALIZED  |
> 
> +        EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
> 
> +      MmioMap[Index].BaseAddress,
> 
> +      MmioMap[Index].Length
> 
> +      );
> 
> +    BuildMemoryAllocationHob (
> 
> +      MmioMap[Index].BaseAddress,
> 
> +      MmioMap[Index].Length,
> 
> +      EfiMemoryMappedIO
> 
> +      );
> 
> +  }
> 
> +
> 
> +  //
> 
> +  // Report resource HOB for flash FV
> 
> +  //
> 
> +  BuildResourceDescriptorHob (
> 
> +    EFI_RESOURCE_MEMORY_MAPPED_IO,
> 
> +     (EFI_RESOURCE_ATTRIBUTE_PRESENT      |
> 
> +      EFI_RESOURCE_ATTRIBUTE_INITIALIZED  |
> 
> +      EFI_RESOURCE_ATTRIBUTE_UNCACHEABLE),
> 
> +    (UINTN) FixedPcdGet32 (PcdFlashAreaBaseAddress),
> 
> +    (UINTN) FixedPcdGet32 (PcdFlashAreaSize)
> 
> +    );
> 
> +
> 
> +  BuildMemoryAllocationHob (
> 
> +    (UINTN) FixedPcdGet32 (PcdFlashAreaBaseAddress),
> 
> +    (UINTN) FixedPcdGet32 (PcdFlashAreaSize),
> 
> +    EfiMemoryMappedIO
> 
> +    );
> 
> +
> 
> +  BuildFvHob (
> 
> +    (UINTN)FixedPcdGet32 (PcdFlashAreaBaseAddress),
> 
> +    (UINTN)FixedPcdGet32 (PcdFlashAreaSize)
> 
> +    );
> 
> +
> 
> + DEBUG ((DEBUG_INFO, "MemoryDiscoveredPpiNotify End!\n"));
> 
> +
> 
> +  return Status;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Board configuration init function for PEI pre-memory phase.
> 
> +
> 
> +  @retval EFI_SUCCESS             The function completed successfully.
> 
> +  @retval EFI_INVALID_PARAMETER   The parameter is NULL.
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpInitPreMem (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  EFI_STATUS Status;
> 
> +  DEBUG ((DEBUG_INFO, "TigerlakeURvpInitPreMem Start!\n"));
> 
> +  ///
> 
> +  /// Performing PlatformInitPreMemCallBack after PeiReadOnlyVariable2 PPI
> produced
> 
> +  ///
> 
> +  Status = PeiServicesNotifyPpi (&mPreMemNotifyList);
> 
> +
> 
> +  ///
> 
> +  /// After code reorangized, memorycallback will run because the PPI is already
> 
> +  /// installed when code run to here, it is supposed that the InstallEfiMemory is
> 
> +  /// done before.
> 
> +  ///
> 
> +  Status = PeiServicesNotifyPpi (&mMemDiscoveredNotifyList);
> 
> +
> 
> +  DEBUG ((DEBUG_INFO, "TigerlakeURvpInitPreMem End!\n"));
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Configure GPIO and SIO before memory ready
> 
> +
> 
> +  @retval  EFI_SUCCESS   Operation success.
> 
> +**/
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardInitBeforeMemoryInit(
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +
> 
> +  TigerlakeURvpInitPreMem();
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +EFI_STATUS
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardDebugInit(
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  ///
> 
> +  /// Do Early PCH init
> 
> +  ///
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +EFI_BOOT_MODE
> 
> +EFIAPI
> 
> +TigerlakeURvpBoardBootModeDetect(
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  return BOOT_WITH_FULL_CONFIGURATION;
> 
> +}
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/T
> igerlakeURvpInit.h
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/T
> igerlakeURvpInit.h
> new file mode 100644
> index 0000000000..ccffcc6761
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/BoardInitLib/T
> igerlakeURvpInit.h
> @@ -0,0 +1,23 @@
> +/** @file
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#ifndef _TIGER_LAKE_U_RVP_INIT_H_
> 
> +#define _TIGER_LAKE_U_RVP_INIT_H_
> 
> +
> 
> +#include <Uefi.h>
> 
> +#include <PlatformBoardId.h>
> 
> +#include <Library/BaseLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/MemoryAllocationLib.h>
> 
> +#include <Library/DebugLib.h>
> 
> +#include <Ppi/SiPolicy.h>
> 
> +
> 
> +extern GPIO_INIT_CONFIG mGpioTableTglUDdr4[];
> 
> +extern UINT16 mGpioTableTglUDdr4Size;
> 
> +
> 
> +
> 
> +#endif // _TIGER_LAKE_U_RVP_INIT_H_
> 
> +
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHo
> okLib/PeiPlatformHooklib.c
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHo
> okLib/PeiPlatformHooklib.c
> new file mode 100644
> index 0000000000..6c2587391d
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHo
> okLib/PeiPlatformHooklib.c
> @@ -0,0 +1,212 @@
> +/** @file
> 
> +  PEI Library Functions. Initialize GPIOs
> 
> +
> 
> +
> 
> +  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +**/
> 
> +
> 
> +#include <PiPei.h>
> 
> +#include <PeiPlatformHookLib.h>
> 
> +#include <Library/DebugLib.h>
> 
> +#include <Library/BaseMemoryLib.h>
> 
> +#include <Library/IoLib.h>
> 
> +#include <Library/HobLib.h>
> 
> +#include <Library/PcdLib.h>
> 
> +#include <Library/TimerLib.h>
> 
> +#include <Library/PchCycleDecodingLib.h>
> 
> +#include <Library/PciSegmentLib.h>
> 
> +#include <Library/PeiServicesLib.h>
> 
> +#include <Library/PmcLib.h>
> 
> +#include <Library/GpioNativeLib.h>
> 
> +#include <Library/GpioLib.h>
> 
> +#include <PlatformBoardConfig.h>
> 
> +#include <Library/PchPcrLib.h>
> 
> +#include <Library/GpioCheckConflictLib.h>
> 
> +
> 
> +#define SIO_RUNTIME_REG_BASE_ADDRESS                          0x0680
> 
> +
> 
> +#define RECOVERY_MODE_GPIO_PIN                    0                    // Platform
> specific @todo use PCD
> 
> +
> 
> +#define MANUFACTURE_MODE_GPIO_PIN                 0                    // Platform
> specific @todo use PCD
> 
> +
> 
> +/**
> 
> +  Configures GPIO
> 
> +
> 
> +  @param[in]  GpioTable       Point to Platform Gpio table
> 
> +  @param[in]  GpioTableCount  Number of Gpio table entries
> 
> +
> 
> +**/
> 
> +VOID
> 
> +ConfigureGpio (
> 
> +  IN GPIO_INIT_CONFIG                 *GpioDefinition,
> 
> +  IN UINT16                           GpioTableCount
> 
> +  )
> 
> +{
> 
> +  DEBUG ((DEBUG_INFO, "ConfigureGpio() Start\n"));
> 
> +
> 
> +
> 
> +  CreateGpioCheckConflictHob (GpioDefinition, GpioTableCount);
> 
> +
> 
> +
> 
> +  GpioConfigurePads (GpioTableCount, GpioDefinition);
> 
> +
> 
> +  DEBUG ((DEBUG_INFO, "ConfigureGpio() End\n"));
> 
> +}
> 
> +
> 
> +/**
> 
> +  Configure GPIO group GPE tier.
> 
> +
> 
> +  @retval     none.
> 
> +**/
> 
> +VOID
> 
> +GpioGroupTierInitHook(
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  DEBUG ((DEBUG_INFO, "GpioGroupTierInitHook Start\n"));
> 
> +
> 
> +  DEBUG ((DEBUG_INFO, "GpioGroupTierInitHook End\n"));
> 
> +}
> 
> +
> 
> +/**
> 
> +  Configure single GPIO pad for touchpanel interrupt
> 
> +**/
> 
> +VOID
> 
> +TouchpanelGpioInit (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +
> 
> +}
> 
> +
> 
> +/**
> 
> +  Configure GPIO Before Memory is not ready.
> 
> +
> 
> +**/
> 
> +VOID
> 
> +GpioInitPreMem (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  if (PcdGet32 (PcdBoardGpioTablePreMem) != 0 && PcdGet16
> (PcdBoardGpioTablePreMemSize) != 0) {
> 
> +    DEBUG ((DEBUG_INFO, "Pre-mem Gpio Config\n"));
> 
> +    ConfigureGpio ((VOID *) (UINTN) PcdGet32 (PcdBoardGpioTablePreMem),
> (UINTN) PcdGet16 (PcdBoardGpioTablePreMemSize));
> 
> +  }
> 
> +}
> 
> +
> 
> +/**
> 
> +  Basic GPIO configuration before memory is ready
> 
> +
> 
> +**/
> 
> +VOID
> 
> +GpioInitEarlyPreMem (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +
> 
> +}
> 
> +
> 
> +/**
> 
> +  Configure GPIO
> 
> +
> 
> +**/
> 
> +
> 
> +VOID
> 
> +GpioInit (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  DEBUG ((DEBUG_INFO, "Post-mem Gpio Config\n"));
> 
> +  ConfigureGpio ((VOID *) (UINTN) PcdGet32 (PcdBoardGpioTable), (UINTN)
> PcdGet16 (PcdBoardGpioTableSize));
> 
> +
> 
> +  TouchpanelGpioInit();
> 
> +
> 
> +  return;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Configure Super IO
> 
> +
> 
> +**/
> 
> +VOID
> 
> +SioInit (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  //
> 
> +  // Program and Enable Default Super IO Configuration Port Addresses and
> range
> 
> +  //
> 
> +  PchLpcGenIoRangeSet (PcdGet16 (PcdLpcSioConfigDefaultPort) & (~0xF),
> 0x10);
> 
> +
> 
> +  PchLpcGenIoRangeSet (SIO_RUNTIME_REG_BASE_ADDRESS  & (~0x7F), 0x10);
> 
> +  return;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Configure GPIO and SIO before memory ready
> 
> +
> 
> +  @retval  EFI_SUCCESS   Operation success.
> 
> +**/
> 
> +EFI_STATUS
> 
> +BoardInitPreMem (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  //
> 
> +  // Obtain Platform Info from HOB.
> 
> +  //
> 
> +  GpioInitPreMem ();
> 
> +  GpioGroupTierInitHook ();
> 
> +  SioInit ();
> 
> +
> 
> +  DEBUG ((DEBUG_INFO, "BoardInitPreMem Done\n"));
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Configure GPIO and SIO
> 
> +
> 
> +  @retval  EFI_SUCCESS   Operation success.
> 
> +**/
> 
> +EFI_STATUS
> 
> +BoardInit (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +
> 
> +  GpioInit ();
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Do platform specific programming post-memory.
> 
> +
> 
> +  @retval  EFI_SUCCESS       The function completed successfully.
> 
> +**/
> 
> +
> 
> +EFI_STATUS
> 
> +PlatformSpecificInit (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> +
> 
> +/**
> 
> +  Early Board Configuration before memory is ready
> 
> +
> 
> +  @retval  EFI_SUCCESS  Operation success.
> 
> +**/
> 
> +EFI_STATUS
> 
> +BoardInitEarlyPreMem (
> 
> +  VOID
> 
> +  )
> 
> +{
> 
> +  GpioInitEarlyPreMem ();
> 
> +
> 
> +  return EFI_SUCCESS;
> 
> +}
> 
> diff --git
> a/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHo
> okLib/PeiPlatformHooklib.inf
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHo
> okLib/PeiPlatformHooklib.inf
> new file mode 100644
> index 0000000000..8e4ce47d5a
> --- /dev/null
> +++
> b/Platform/Intel/TigerlakeOpenBoardPkg/TigerlakeURvp/Library/PeiPlatformHo
> okLib/PeiPlatformHooklib.inf
> @@ -0,0 +1,58 @@
> +## @file
> 
> +#
> 
> +#  Copyright (c) 2021, Intel Corporation. All rights reserved.<BR>
> 
> +#  SPDX-License-Identifier: BSD-2-Clause-Patent
> 
> +#
> 
> +##
> 
> +
> 
> +[Defines]
> 
> +  INF_VERSION                    = 0x00010017
> 
> +  BASE_NAME                      = PeiPlatformHookLib
> 
> +  FILE_GUID                      = AD901798-B0DA-4B20-B90C-283F886E76D0
> 
> +  VERSION_STRING                 = 1.0
> 
> +  MODULE_TYPE                    = PEIM
> 
> +  LIBRARY_CLASS                  = PeiPlatformHookLib|PEIM PEI_CORE SEC
> 
> +
> 
> +[LibraryClasses]
> 
> +  DebugLib
> 
> +  BaseMemoryLib
> 
> +  IoLib
> 
> +  HobLib
> 
> +  PcdLib
> 
> +  TimerLib
> 
> +  PchCycleDecodingLib
> 
> +  GpioLib
> 
> +  PeiServicesLib
> 
> +  ConfigBlockLib
> 
> +  PmcLib
> 
> +  PchPcrLib
> 
> +  PciSegmentLib
> 
> +  GpioCheckConflictLib
> 
> +
> 
> +[Packages]
> 
> +  MdePkg/MdePkg.dec
> 
> +  TigerlakeOpenBoardPkg/OpenBoardPkg.dec
> 
> +  TigerlakeSiliconPkg/SiPkg.dec
> 
> +  IntelSiliconPkg/IntelSiliconPkg.dec
> 
> +
> 
> +[Pcd]
> 
> +  gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress                        ##
> CONSUMES
> 
> +  gBoardModuleTokenSpaceGuid.PcdLpcSioConfigDefaultPort        ##
> CONSUMES
> 
> +  gBoardModuleTokenSpaceGuid.PcdSioBaseAddress                 ## CONSUMES
> 
> +  gBoardModuleTokenSpaceGuid.PcdBoardGpioTable                 ## CONSUMES
> 
> +  gBoardModuleTokenSpaceGuid.PcdBoardGpioTableSize             ## CONSUMES
> 
> +  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMem           ##
> CONSUMES
> 
> +  gBoardModuleTokenSpaceGuid.PcdBoardGpioTablePreMemSize       ##
> CONSUMES
> 
> +
> 
> +[Sources]
> 
> +  PeiPlatformHooklib.c
> 
> +
> 
> +[Ppis]
> 
> +  gEfiPeiReadOnlyVariable2PpiGuid               ## CONSUMES
> 
> +  gSiPolicyPpiGuid                              ## CONSUMES
> 
> +
> 
> +[Guids]
> 
> +  gSaDataHobGuid                                ## CONSUMES
> 
> +  gEfiGlobalVariableGuid                        ## CONSUMES
> 
> +  gGpioCheckConflictHobGuid                     ## CONSUMES
> 
> +
> 
> --
> 2.24.0.windows.2


^ permalink raw reply	[flat|nested] 18+ messages in thread

end of thread, other threads:[~2021-02-10  3:58 UTC | newest]

Thread overview: 18+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-02-09  8:45 [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Heng Luo
2021-02-09  8:45 ` [Patch V2 2/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add fdf and header file Heng Luo
2021-02-09 23:42   ` Chaganty, Rangasai V
2021-02-09  8:45 ` [Patch V2 3/8] TigerlakeOpenBoardPkg: Add library instances Heng Luo
2021-02-09 23:45   ` Chaganty, Rangasai V
2021-02-09  8:45 ` [Patch V2 4/8] TigerlakeOpenBoardPkg/TigerlakeURvp: " Heng Luo
2021-02-10  0:38   ` Chaganty, Rangasai V
2021-02-10  3:58     ` Heng Luo
2021-02-09  8:45 ` [Patch V2 5/8] TigerlakeOpenBoardPkg: Add modules Heng Luo
2021-02-10  0:22   ` Chaganty, Rangasai V
2021-02-10  0:27   ` Chaganty, Rangasai V
2021-02-09  8:45 ` [Patch V2 6/8] TigerlakeOpenBoardPkg/TigerlakeURvp: Add DSC and build files Heng Luo
2021-02-10  0:29   ` Chaganty, Rangasai V
2021-02-09  8:45 ` [Patch V2 7/8] Enable build for TigerlakeOpenBoardPkg Heng Luo
2021-02-10  0:30   ` Chaganty, Rangasai V
2021-02-09  8:45 ` [Patch V2 8/8] Update Maintainers.txt " Heng Luo
2021-02-10  0:31   ` Chaganty, Rangasai V
2021-02-09 23:41 ` [Patch V2 1/8] TigerlakeOpenBoardPkg: Add package and headers Chaganty, Rangasai V

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox