summaryrefslogtreecommitdiff
path: root/Platform/Intel/KabylakeOpenBoardPkg
diff options
context:
space:
mode:
authorJiewen Yao <jiewen.yao@intel.com>2017-08-28 09:37:45 +0800
committerJiewen Yao <jiewen.yao@intel.com>2017-09-04 09:36:22 +0800
commit60d20bd0764bb0c78f56b43979f7ed409bed3fa2 (patch)
treea65629aa060befb1f4c7441f4d88b8006861b04b /Platform/Intel/KabylakeOpenBoardPkg
parent1a434a6017ccae26a3eec032764bd06461a29ceb (diff)
downloadedk2-platforms-60d20bd0764bb0c78f56b43979f7ed409bed3fa2.tar.xz
new policy design for open board.
Cc: Michael A Kubacki <michael.a.kubacki@intel.com> Cc: Amy Chan <amy.chan@intel.com> Cc: Chasel Chiu <chasel.chiu@intel.com> Cc: Brett Wang <brett.wang@intel.com> Cc: Daocheng Bu <daocheng.bu@intel.com> Cc: Isaac W Oram <isaac.w.oram@intel.com> Cc: Rangasai V Chaganty <rangasai.v.chaganty@intel.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Jiewen Yao <jiewen.yao@intel.com> Reviewed-by: Michael A Kubacki <michael.a.kubacki@intel.com> Reviewed-by: Amy Chan <amy.chan@intel.com>
Diffstat (limited to 'Platform/Intel/KabylakeOpenBoardPkg')
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PcieDeviceTable.c (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PcieDeviceTable.c)0
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspMiscUpdUpdateLib.c)0
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspPolicyUpdateLib.c (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspPolicyUpdateLib.c)44
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiPchPolicyUpdate.c (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiPchPolicyUpdate.c)0
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiPchPolicyUpdate.h (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiPchPolicyUpdate.h)0
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiPchPolicyUpdatePreMem.c (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c)0
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiSaPolicyUpdate.c)0
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.h (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiSaPolicyUpdate.h)0
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdatePreMem.c (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiSaPolicyUpdatePreMem.c)0
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf (renamed from Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspPolicyUpdateLib.inf)4
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc9
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf2
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c (renamed from Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/GopPolicyInitDxe.c)2
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.h (renamed from Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/GopPolicyInitDxe.h)0
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.h (renamed from Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/SaPolicyInitDxe.h)14
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyUpdate.c (renamed from Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/DxeSaPolicyUpdate.c)2
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.c59
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf (renamed from Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.inf)49
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.c56
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.h46
-rw-r--r--Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/SaPolicyInitDxe.c73
21 files changed, 134 insertions, 226 deletions
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PcieDeviceTable.c b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PcieDeviceTable.c
index c03c51e8ca..c03c51e8ca 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PcieDeviceTable.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PcieDeviceTable.c
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspMiscUpdUpdateLib.c b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
index 0f7c6acb59..0f7c6acb59 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspMiscUpdUpdateLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspMiscUpdUpdateLib.c
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspPolicyUpdateLib.c b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspPolicyUpdateLib.c
index 3f29f736fb..f3c56419b5 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspPolicyUpdateLib.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiFspPolicyUpdateLib.c
@@ -18,7 +18,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#include <Library/BaseMemoryLib.h>
#include <Library/MemoryAllocationLib.h>
#include <Library/FspWrapperApiLib.h>
-#include <Library/FspPolicyUpdateLib.h>
+#include <Library/SiliconPolicyUpdateLib.h>
#include <FspEas.h>
#include <FspmUpd.h>
@@ -115,17 +115,28 @@ InternalPrintVariableData (
}
/**
- Performs FSPM UPD Policy update.
+ Performs silicon pre-mem policy update.
+ The meaning of Policy is defined by silicon code.
+ It could be the raw data, a handle, a PPI, etc.
+
+ The input Policy must be returned by SiliconPolicyDonePreMem().
+
+ 1) In FSP path, the input Policy should be FspmUpd.
A platform may use this API to update the FSPM UPD policy initialized
by the silicon module or the default UPD data.
The output of FSPM UPD data from this API is the final UPD data.
- @param[in, out] FspmUpd Pointer to FSPM UPD data.
+ 2) In 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
+VOID *
EFIAPI
-FspmPolicyUpdate (
+SiliconPolicyUpdatePreMem (
IN OUT VOID *FspmUpd
)
{
@@ -137,20 +148,33 @@ FspmPolicyUpdate (
PeiFspMiscUpdUpdatePreMem (FspmUpdDataPtr);
InternalPrintVariableData ((VOID *)FspmUpdDataPtr, sizeof(FSPM_UPD));
+
+ return FspmUpd;
}
/**
- Performs FSPS UPD Policy update.
+ Performs silicon post-mem policy update.
+ The meaning of Policy is defined by silicon code.
+ It could be the raw data, a handle, a PPI, etc.
+
+ The input Policy must be returned by SiliconPolicyDonePostMem().
+
+ 1) In FSP path, the input Policy should be FspsUpd.
A platform may use this API to update the FSPS UPD policy initialized
by the silicon module or the default UPD data.
The output of FSPS UPD data from this API is the final UPD data.
- @param[in, out] FspsUpd Pointer to FSPS UPD data.
+ 2) In 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
+VOID *
EFIAPI
-FspsPolicyUpdate (
+SiliconPolicyUpdatePostMem (
IN OUT VOID *FspsUpd
)
{
@@ -161,6 +185,8 @@ FspsPolicyUpdate (
PeiFspPchPolicyUpdate (FspsUpdDataPtr);
InternalPrintVariableData ((VOID *)FspsUpdDataPtr, sizeof(FSPS_UPD));
+
+ return FspsUpd;
}
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiPchPolicyUpdate.c b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiPchPolicyUpdate.c
index c1c8bf131d..c1c8bf131d 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiPchPolicyUpdate.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiPchPolicyUpdate.c
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiPchPolicyUpdate.h b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiPchPolicyUpdate.h
index a4e69f4e73..a4e69f4e73 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiPchPolicyUpdate.h
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiPchPolicyUpdate.h
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiPchPolicyUpdatePreMem.c
index fc27d67e69..fc27d67e69 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiPchPolicyUpdatePreMem.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiPchPolicyUpdatePreMem.c
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiSaPolicyUpdate.c b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c
index fd54c63a92..fd54c63a92 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiSaPolicyUpdate.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.c
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiSaPolicyUpdate.h b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.h
index da6f746772..da6f746772 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiSaPolicyUpdate.h
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdate.h
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiSaPolicyUpdatePreMem.c b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdatePreMem.c
index 94d5094855..94d5094855 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiSaPolicyUpdatePreMem.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSaPolicyUpdatePreMem.c
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspPolicyUpdateLib.inf b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
index a1e461525e..c91c17a499 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspPolicyUpdateLib.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
@@ -20,11 +20,11 @@
################################################################################
[Defines]
INF_VERSION = 0x00010005
- BASE_NAME = PeiFspPolicyUpdateLib
+ BASE_NAME = SiliconPolicyUpdateLibFsp
FILE_GUID = 4E83003B-49A9-459E-AAA6-1CA3C6D04FB2
MODULE_TYPE = PEIM
VERSION_STRING = 1.0
- LIBRARY_CLASS = FspPolicyUpdateLib
+ LIBRARY_CLASS = SiliconPolicyUpdateLib
#
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
index f82ceeaaac..99b0eb5d51 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.dsc
@@ -103,8 +103,8 @@
FspWrapperApiTestLib|IntelFsp2WrapperPkg/Library/PeiFspWrapperApiTestLib/PeiFspWrapperApiTestLib.inf
FspWrapperPlatformLib|$(PLATFORM_PACKAGE)/FspWrapper/Library/PeiFspWrapperPlatformLib/PeiFspWrapperPlatformLib.inf
- FspPolicyInitLib|$(PLATFORM_SI_PACKAGE)/Library/PeiFspPolicyInitLib/PeiFspPolicyInitLib.inf
- FspPolicyUpdateLib|$(PLATFORM_BOARD_PACKAGE)/FspWrapper/Library/PeiFspPolicyUpdateLib/PeiFspPolicyUpdateLib.inf
+ SiliconPolicyInitLib|$(PLATFORM_SI_PACKAGE)/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFsp.inf
+ SiliconPolicyUpdateLib|$(PLATFORM_BOARD_PACKAGE)/FspWrapper/Library/PeiSiliconPolicyUpdateLibFsp/PeiSiliconPolicyUpdateLibFsp.inf
ConfigBlockLib|$(PLATFORM_SI_PACKAGE)/Library/BaseConfigBlockLib/BaseConfigBlockLib.inf
SiliconInitLib|$(PLATFORM_SI_PACKAGE)/Library/SiliconInitLib/SiliconInitLib.inf
@@ -152,6 +152,9 @@
MultiBoardAcpiSupportLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf
BoardAcpiTableLib|$(PLATFORM_PACKAGE)/Acpi/Library/MultiBoardAcpiSupportLib/DxeMultiBoardAcpiSupportLib.inf
+ SiliconPolicyInitLib|$(PLATFORM_SI_PACKAGE)/Library/DxeSiliconPolicyInitLib/DxeSiliconPolicyInitLib.inf
+ SiliconPolicyUpdateLib|$(PLATFORM_BOARD_PACKAGE)/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf
+
#
# Silicon Init Package
#
@@ -214,7 +217,7 @@
#
!include $(PLATFORM_SI_PACKAGE)/SiPkgDxe.dsc
- $(PLATFORM_BOARD_PACKAGE)/Policy/PolicyInitDxe/PolicyInitDxe.inf
+ $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyDxe/SiliconPolicyDxe.inf
$(PLATFORM_PACKAGE)/PlatformInit/PlatformInitDxe/PlatformInitDxe.inf {
<LibraryClasses>
!if $(TARGET) == DEBUG
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
index 2ca305e005..230943d074 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/KabylakeRvp3/OpenBoardPkg.fdf
@@ -477,7 +477,7 @@ APRIORI DXE {
INF $(PLATFORM_PACKAGE)/PlatformInit/PlatformInitDxe/PlatformInitDxe.inf
!if gPlatformModuleTokenSpaceGuid.PcdBootToShellOnly == FALSE
-INF $(PLATFORM_BOARD_PACKAGE)/Policy/PolicyInitDxe/PolicyInitDxe.inf
+INF $(PLATFORM_PACKAGE)/PlatformInit/SiliconPolicyDxe/SiliconPolicyDxe.inf
$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/Pch/PchInit/Dxe/PchInitDxe.inf
$(SIPKG_DXE_SMM_BIN) $(PLATFORM_SI_PACKAGE)/SystemAgent/SaInit/Dxe/SaInitDxe.inf
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/GopPolicyInitDxe.c b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c
index ff7cb3660b..e455208f80 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/GopPolicyInitDxe.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.c
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include "GopPolicyInitDxe.h"
+#include "DxeGopPolicyInit.h"
#include <Protocol/GopPolicy.h>
GLOBAL_REMOVE_IF_UNREFERENCED GOP_POLICY_PROTOCOL mGOPPolicy;
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/GopPolicyInitDxe.h b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.h
index 3de117337f..3de117337f 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/GopPolicyInitDxe.h
+++ b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeGopPolicyInit.h
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/SaPolicyInitDxe.h b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.h
index ebc5023f7b..1a1536c299 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/SaPolicyInitDxe.h
+++ b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyInit.h
@@ -53,4 +53,18 @@ SaPolicyInitDxe (
IN EFI_HANDLE ImageHandle
);
+/**
+ Get data for platform policy from setup options.
+
+ @param[in] SaPolicy The pointer to get SA Policy protocol instance
+
+ @retval EFI_SUCCESS Operation success.
+
+**/
+EFI_STATUS
+EFIAPI
+UpdateDxeSaPolicy (
+ IN OUT SA_POLICY_PROTOCOL *SaPolicy
+ );
+
#endif
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/DxeSaPolicyUpdate.c b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyUpdate.c
index 384b94ba54..be3fe02aea 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/DxeSaPolicyUpdate.c
+++ b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSaPolicyUpdate.c
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
**/
-#include "SaPolicyInitDxe.h"
+#include "DxeSaPolicyInit.h"
#define SA_VTD_RMRR_USB_LENGTH 0x20000
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.c b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.c
new file mode 100644
index 0000000000..6a258e69d6
--- /dev/null
+++ b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.c
@@ -0,0 +1,59 @@
+/** @file
+
+Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
+This program and the accompanying materials are licensed and made available under
+the terms and conditions of the BSD License that accompanies this distribution.
+The full text of the license may be found at
+http://opensource.org/licenses/bsd-license.php.
+
+THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
+WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+
+**/
+
+#include <Library/SiliconPolicyUpdateLib.h>
+#include <Library/PcdLib.h>
+#include <Library/DebugLib.h>
+
+#include "DxeSaPolicyInit.h"
+#include "DxeGopPolicyInit.h"
+
+/**
+ 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 VOID *Policy
+ )
+{
+ SA_POLICY_PROTOCOL *SaPolicy;
+ EFI_STATUS Status;
+
+ SaPolicy = Policy;
+ UpdateDxeSaPolicy (SaPolicy);
+
+ if (PcdGetBool(PcdIntelGopEnable)) {
+ //
+ // GOP Dxe Policy Initialization
+ //
+ Status = GopPolicyInitDxe(gImageHandle);
+ DEBUG((DEBUG_INFO, "GOP Dxe Policy Initialization done\n"));
+ ASSERT_EFI_ERROR(Status);
+ }
+
+ return Policy;
+}
+
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.inf b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf
index 5f9ed1ee82..7a50563c84 100644
--- a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.inf
+++ b/Platform/Intel/KabylakeOpenBoardPkg/Policy/Library/DxeSiliconPolicyUpdateLib/DxeSiliconPolicyUpdateLib.inf
@@ -1,5 +1,5 @@
-### @file
-# Module Information file for the PolicyInit DXE driver.
+## @file
+# Component information file for Silicon Update Library
#
# Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
#
@@ -11,33 +11,20 @@
# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
# WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
#
-###
+##
[Defines]
- INF_VERSION = 0x00010017
- BASE_NAME = KabylakeRvp3PolicyInitDxe
- FILE_GUID = 490D0119-4448-440D-8F5C-F58FB53EE057
- VERSION_STRING = 1.0
+ INF_VERSION = 0x00010005
+ BASE_NAME = DxeSiliconUpdateLib
+ FILE_GUID = C523609D-E354-416B-B24F-33468D4BD21D
MODULE_TYPE = DXE_DRIVER
- ENTRY_POINT = PolicyInitDxeEntryPoint
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = SiliconUpdateLib
[LibraryClasses]
BaseLib
- BaseMemoryLib
- CpuPlatformLib
- DebugLib
- DxeServicesTableLib
- IoLib
- MemoryAllocationLib
- DxeSaPolicyLib
- MmPciLib
PcdLib
- PostCodeLib
- UefiBootServicesTableLib
- UefiDriverEntryPoint
- UefiLib
- UefiRuntimeServicesTableLib
- ConfigBlockLib
+ DebugLib
[Packages]
MdePkg/MdePkg.dec
@@ -45,18 +32,15 @@
MinPlatformPkg/MinPlatformPkg.dec
KabylakeOpenBoardPkg/OpenBoardPkg.dec
-[Pcd]
- gBoardModuleTokenSpaceGuid.PcdIntelGopEnable
-
[Sources]
- PolicyInitDxe.c
- PolicyInitDxe.h
- SaPolicyInitDxe.c
- SaPolicyInitDxe.h
- GopPolicyInitDxe.c
- GopPolicyInitDxe.h
+ DxeSiliconPolicyUpdateLib.c
+ DxeGopPolicyInit.c
DxeSaPolicyUpdate.c
+[Pcd]
+ gBoardModuleTokenSpaceGuid.PcdIntelGopEnable
+ gBoardModuleTokenSpaceGuid.PcdGraphicsVbtGuid
+
[Protocols]
gEfiFirmwareVolume2ProtocolGuid ## CONSUMES
gSaPolicyProtocolGuid ## CONSUMES
@@ -66,9 +50,6 @@
[Guids]
gMiscDxeConfigGuid
-[Pcd]
- gBoardModuleTokenSpaceGuid.PcdGraphicsVbtGuid
-
[Depex]
gEfiVariableArchProtocolGuid
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.c b/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.c
deleted file mode 100644
index 6faa9e0bd6..0000000000
--- a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.c
+++ /dev/null
@@ -1,56 +0,0 @@
-/** @file
- This file is a wrapper for Platform Policy driver. Get Setup
- Value to initialize Intel DXE Platform Policy.
-
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-
-#include "PolicyInitDxe.h"
-
-/**
- Initialize DXE Platform Policy
-
- @param[in] ImageHandle Image handle of this driver.
- @param[in] SystemTable Global system service table.
-
- @retval EFI_SUCCESS Initialization complete.
- @exception 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
-PolicyInitDxeEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-{
- EFI_STATUS Status;
-
- //
- // SystemAgent Dxe Platform Policy Initialization
- //
- Status = SaPolicyInitDxe (ImageHandle);
- DEBUG ((DEBUG_INFO, "SystemAgent Dxe Platform Policy Initialization done\n"));
- ASSERT_EFI_ERROR (Status);
-
- if (PcdGetBool(PcdIntelGopEnable)) {
- //
- // GOP Dxe Policy Initialization
- //
- Status = GopPolicyInitDxe(ImageHandle);
- DEBUG((DEBUG_INFO, "GOP Dxe Policy Initialization done\n"));
- ASSERT_EFI_ERROR(Status);
- }
-
- return Status;
-
-}
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.h b/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.h
deleted file mode 100644
index 3b57753112..0000000000
--- a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/PolicyInitDxe.h
+++ /dev/null
@@ -1,46 +0,0 @@
-/** @file
- Header file for the PolicyInitDxe Driver.
-
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-#ifndef _POLICY_INIT_DXE_H_
-#define _POLICY_INIT_DXE_H_
-
-
-#include <Library/BaseMemoryLib.h>
-#include <Library/UefiBootServicesTableLib.h>
-#include <Library/UefiRuntimeServicesTableLib.h>
-#include <Library/DebugLib.h>
-
-#include "SaPolicyInitDxe.h"
-#include "GopPolicyInitDxe.h"
-
-/**
- Initialize DXE Platform Policy
-
- @param[in] ImageHandle - Image handle of this driver.
- @param[in] SystemTable - Global system service table.
-
- @retval EFI_SUCCESS Initialization complete.
- @exception 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
-PolicyInitDxeEntryPoint (
- IN EFI_HANDLE ImageHandle,
- IN EFI_SYSTEM_TABLE *SystemTable
- )
-;
-
-#endif
diff --git a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/SaPolicyInitDxe.c b/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/SaPolicyInitDxe.c
deleted file mode 100644
index 09e084f9f6..0000000000
--- a/Platform/Intel/KabylakeOpenBoardPkg/Policy/PolicyInitDxe/SaPolicyInitDxe.c
+++ /dev/null
@@ -1,73 +0,0 @@
-/** @file
- This file is SampleCode for SA DXE Policy initialization.
-
-Copyright (c) 2017, Intel Corporation. All rights reserved.<BR>
-This program and the accompanying materials are licensed and made available under
-the terms and conditions of the BSD License that accompanies this distribution.
-The full text of the license may be found at
-http://opensource.org/licenses/bsd-license.php.
-
-THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
-WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
-
-**/
-#include "SaPolicyInitDxe.h"
-
-//
-// Function implementations
-//
-
-/**
- Get data for platform policy from setup options.
-
- @param[in] SaPolicy The pointer to get SA Policy protocol instance
-
- @retval EFI_SUCCESS Operation success.
-
-**/
-EFI_STATUS
-EFIAPI
-UpdateDxeSaPolicy (
- IN OUT SA_POLICY_PROTOCOL *SaPolicy
- );
-
-
-/**
- Initialize SA DXE Policy
-
- @param[in] ImageHandle Image handle of this driver.
-
- @retval EFI_SUCCESS Initialization complete.
- @exception 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;
- SA_POLICY_PROTOCOL *SaPolicy;
-
- //
- // Call CreateSaDxeConfigBlocks to create & initialize platform policy structure
- // and get all Intel default policy settings.
- //
- Status = CreateSaDxeConfigBlocks(&SaPolicy);
- DEBUG((DEBUG_INFO, "SaPolicy->TableHeader.NumberOfBlocks = 0x%x\n ", SaPolicy->TableHeader.NumberOfBlocks));
- ASSERT_EFI_ERROR(Status);
-
- UpdateDxeSaPolicy (SaPolicy);
-
- //
- // Install SaInstallPolicyProtocol.
- // While installed, RC assumes the Policy is ready and finalized. So please
- // update and override any setting before calling this function.
- //
- Status = SaInstallPolicyProtocol (ImageHandle, SaPolicy);
- ASSERT_EFI_ERROR (Status);
-
- return Status;
-}