diff options
Diffstat (limited to 'Silicon')
5 files changed, 192 insertions, 10 deletions
diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibDependency/PeiPostMemSiliconPolicyInitLibDependency.inf b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibDependency/PeiPostMemSiliconPolicyInitLibDependency.inf new file mode 100644 index 0000000000..243a70f30d --- /dev/null +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibDependency/PeiPostMemSiliconPolicyInitLibDependency.inf @@ -0,0 +1,37 @@ +## @file
+# Component information file for Silicon Policy Init Library
+# This library implements NULL functions and the purpose is to add Silicon Policy PPI
+# dependency to the PEIM.
+#
+# 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 which 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.
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = PeiPostMemSiliconPolicyInitLibDependency
+ FILE_GUID = 22D1F7FB-9299-4BB3-A11F-D63A92DF715A
+ MODULE_TYPE = PEIM
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = SiliconPolicyInitLib
+
+[LibraryClasses]
+ BaseLib
+
+[Packages]
+ MdePkg/MdePkg.dec
+ KabylakeSiliconPkg/SiPkg.dec
+
+[Sources]
+ PeiSiliconPolicyInitLibDependency.c
+
+[Depex]
+ gSiPolicyPpiGuid
diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibDependency/PeiPreMemSiliconPolicyInitLibDependency.inf b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibDependency/PeiPreMemSiliconPolicyInitLibDependency.inf new file mode 100644 index 0000000000..fd54b0bf7d --- /dev/null +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibDependency/PeiPreMemSiliconPolicyInitLibDependency.inf @@ -0,0 +1,37 @@ +## @file
+# Component information file for Silicon Policy Init Library
+# This library implements NULL functions and the purpose is to add Silicon Policy PPI
+# dependency to the PEIM.
+#
+# 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 which 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.
+#
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = PeiPreMemSiliconPolicyInitLibDependency
+ FILE_GUID = EE6573D8-2F04-4F03-A997-DC962FE770C1
+ MODULE_TYPE = PEIM
+ VERSION_STRING = 1.0
+ LIBRARY_CLASS = SiliconPolicyInitLib
+
+[LibraryClasses]
+ BaseLib
+
+[Packages]
+ MdePkg/MdePkg.dec
+ KabylakeSiliconPkg/SiPkg.dec
+
+[Sources]
+ PeiSiliconPolicyInitLibDependency.c
+
+[Depex]
+ gSiPreMemPolicyPpiGuid
diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibDependency/PeiSiliconPolicyInitLibDependency.c b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibDependency/PeiSiliconPolicyInitLibDependency.c new file mode 100644 index 0000000000..1db1582ff2 --- /dev/null +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibDependency/PeiSiliconPolicyInitLibDependency.c @@ -0,0 +1,48 @@ +/** @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.
+
+**/
+
+VOID *
+EFIAPI
+SiliconPolicyInitPreMem (
+ IN VOID *Policy
+ )
+{
+ return Policy;
+}
+
+RETURN_STATUS
+EFIAPI
+SiliconPolicyDonePreMem (
+ IN VOID *Policy
+ )
+{
+ return RETURN_SUCCESS;
+}
+
+VOID *
+EFIAPI
+SiliconPolicyInitPostMem (
+ IN VOID *Policy
+ )
+{
+ return Policy;
+}
+
+RETURN_STATUS
+EFIAPI
+SiliconPolicyDonePostMem (
+ IN VOID *Policy
+ )
+{
+ return RETURN_SUCCESS;
+}
\ No newline at end of file diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiFspPolicyInitLib.c b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiFspPolicyInitLib.c index d15e3f9083..4e82a0cc31 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiFspPolicyInitLib.c +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiFspPolicyInitLib.c @@ -13,7 +13,9 @@ WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED. **/
#include <PeiFspPolicyInitLib.h>
-
+#include <Library/FspWrapperApiLib.h>
+#include <Library/BaseMemoryLib.h>
+#include <Library/MemoryAllocationLib.h>
/**
Performs silicon pre-mem policy initialization.
@@ -43,9 +45,35 @@ SiliconPolicyInitPreMem ( {
FSPM_UPD *FspmUpdDataPtr;
EFI_STATUS Status;
-
- FspmUpdDataPtr = FspmUpd;
-
+ UINTN *SourceData;
+ FSP_INFO_HEADER *FspmHeaderPtr;
+
+ if (FspmUpd == NULL) {
+ //
+ // Allocate and initialize UPD buffer, copy default FSP-M UPD data
+ //
+ FspmHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 (PcdFspmBaseAddress));
+ ASSERT (FspmHeaderPtr != NULL);
+ if (FspmHeaderPtr != NULL) {
+ DEBUG ((DEBUG_INFO, "FspmHeaderPtr - 0x%x\n", FspmHeaderPtr));
+ FspmUpdDataPtr = (FSPM_UPD *) AllocateZeroPool ((UINTN) FspmHeaderPtr->CfgRegionSize);
+ ASSERT (FspmUpdDataPtr != NULL);
+ if (FspmUpdDataPtr != NULL) {
+ SourceData = (UINTN *) ((UINTN) FspmHeaderPtr->ImageBase + (UINTN) FspmHeaderPtr->CfgRegionOffset);
+ CopyMem (FspmUpdDataPtr, SourceData, (UINTN) FspmHeaderPtr->CfgRegionSize);
+ PcdSet32S (PcdFspmUpdDataAddress, (UINT32) FspmUpdDataPtr);
+ }
+ }
+ } else {
+ FspmUpdDataPtr = FspmUpd;
+ }
+ //
+ // Return NULL pointer as error occurried and do not continue rest of the steps.
+ //
+ if (FspmUpdDataPtr == NULL) {
+ return NULL;
+ }
+ DEBUG ((DEBUG_INFO, "FspmUpdDataPtr - 0x%x\n", FspmUpdDataPtr));
//
// Initialize Intel PEI Platform Policy
//
@@ -97,7 +125,7 @@ SiliconPolicyInitPreMem ( //
Status = PeiFspMiscUpdInitPreMem (FspmUpdDataPtr);
- return FspmUpd;
+ return FspmUpdDataPtr;
}
/*
@@ -148,9 +176,35 @@ SiliconPolicyInitPostMem ( {
FSPS_UPD *FspsUpdDataPtr;
EFI_STATUS Status;
-
- FspsUpdDataPtr = FspsUpd;
-
+ FSP_INFO_HEADER *FspsHeaderPtr;
+ UINTN *SourceData;
+
+ if (FspsUpd == NULL) {
+ //
+ // Allocate and initialize UPD buffer, copy default FSP-S UPD data
+ //
+ FspsHeaderPtr = (FSP_INFO_HEADER *) FspFindFspHeader (PcdGet32 (PcdFspsBaseAddress));
+ ASSERT (FspsHeaderPtr != NULL);
+ if (FspsHeaderPtr != NULL) {
+ DEBUG ((DEBUG_INFO, "FspsHeaderPtr - 0x%x\n", FspsHeaderPtr));
+ FspsUpdDataPtr = (FSPS_UPD *) AllocateZeroPool ((UINTN) FspsHeaderPtr->CfgRegionSize);
+ ASSERT (FspsUpdDataPtr != NULL);
+ if (FspsUpdDataPtr != NULL) {
+ SourceData = (UINTN *) ((UINTN) FspsHeaderPtr->ImageBase + (UINTN) FspsHeaderPtr->CfgRegionOffset);
+ CopyMem (FspsUpdDataPtr, SourceData, (UINTN) FspsHeaderPtr->CfgRegionSize);
+ PcdSet32S (PcdFspsUpdDataAddress, (UINT32) FspsUpdDataPtr);
+ }
+ }
+ } else {
+ FspsUpdDataPtr = FspsUpd;
+ }
+ //
+ // Return NULL pointer as error occurried and do not continue rest of the steps.
+ //
+ if (FspsUpdDataPtr == NULL) {
+ return NULL;
+ }
+ DEBUG ((DEBUG_INFO, "FspsUpdDataPtr - 0x%x\n", FspsUpdDataPtr));
//
// Initialize Intel PEI Platform Policy
//
@@ -189,7 +243,7 @@ SiliconPolicyInitPostMem ( DEBUG ((DEBUG_WARN, "ERROR - CPU Pei Fsp Policy Initialization fail, Status = %r\n", Status));
}
- return FspsUpd;
+ return FspsUpdDataPtr;
}
/*
diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFsp.inf b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFsp.inf index 7b91ac3fab..7f0d7a5dec 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFsp.inf +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFsp.inf @@ -62,6 +62,7 @@ MdePkg/MdePkg.dec
MdeModulePkg/MdeModulePkg.dec
IntelFsp2Pkg/IntelFsp2Pkg.dec
+ IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
KabylakeSiliconPkg/SiPkg.dec
KabylakeFspBinPkg/KabylakeFspBinPkg.dec
@@ -76,6 +77,7 @@ ConfigBlockLib
MemoryAllocationLib
DebugPrintErrorLevelLib
+ FspWrapperApiLib
[Pcd]
gSiPkgTokenSpaceGuid.PcdTsegSize ## CONSUMES
@@ -84,7 +86,11 @@ gIntelFsp2PkgTokenSpaceGuid.PcdTemporaryRamSize ## CONSUMES
gIntelFsp2PkgTokenSpaceGuid.PcdFspTemporaryRamSize ## CONSUMES
gIntelFsp2PkgTokenSpaceGuid.PcdFspReservedBufferSize ## CONSUMES
-
+ gIntelFsp2WrapperTokenSpaceGuid.PcdFspmUpdDataAddress ## CONSUMES
+ gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress ## CONSUMES
+ gIntelFsp2WrapperTokenSpaceGuid.PcdFspsUpdDataAddress ## CONSUMES
+ gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CONSUMES
+
[Ppis]
gSiPolicyPpiGuid ## CONSUMES
gSiPreMemPolicyPpiGuid ## CONSUMES
|