Re: [edk2-devel] [PATCH 1/2] KabylakeSiliconPkg: Add FSP Dispatch switch.

2019-05-28 Thread Nate DeSimone
Reviewed-by: Nate DeSimone 

-Original Message-
From: devel@edk2.groups.io  On Behalf Of Chiu, Chasel
Sent: Wednesday, May 22, 2019 1:35 AM
To: devel@edk2.groups.io
Cc: Chiu, Chasel ; Desimone, Nathaniel L 
; Kubacki, Michael A 

Subject: [edk2-devel] [PATCH 1/2] KabylakeSiliconPkg: Add FSP Dispatch switch.

From: "Chasel, Chiu" 

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

PcdFspModeSelection is used as switch for boot loader to consume FSP in API 
mode or Dispatch mode. For backward compatibility, if boot loader running in 
FSP API mode the KabylakeFspBinPkg will be used which does not have FSP 2.1 
changes. For FSP Dispatch mode AmberLakeFspBinPkg will be used with FSP 2.1 
support.
One INF was duplicate to include different DEC file in each build type.

Test: Booted Kabylake RVP3 to Windows successfully.

Cc: Nate DeSimone 
Cc: Michael Kubacki 
Signed-off-by: Chasel Chiu 
---
 
Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
 | 146 
++
 1 file changed, 146 insertions(+)

diff --git 
a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
 
b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
new file mode 100644
index 00..aebd3583bc
--- /dev/null
+++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFs
+++ p/PeiSiliconPolicyInitLibFspAml.inf
@@ -0,0 +1,146 @@
+### @file
+# Library functions for Fsp Policy Initialization Library.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved. # # 
+SPDX-License-Identifier: BSD-2-Clause-Patent # ##
+
+###
+#
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+###
+#
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PeiSiliconPolicyInitLibFspAml
+  FILE_GUID  = 930816C4-D182-4A23-BF21-9AED635AF06C
+  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
+  PeiFspSiPolicyInitLib.c
+  PeiFspPchPolicyInitLib.c
+  PeiFspCpuPolicyInitLib.c
+  PeiFspMePolicyInitLib.c
+  PeiFspSaPolicyInitLib.c
+  PeiFspMiscUpdInitLib.c
+
+  PeiPolicyInitPreMem.c
+  PeiPolicyInit.c
+  PeiPolicyInit.h
+
+###
+#
+#
+# Package Dependency Section - list of Package files that are required for
+#  this module.
+#
+###
+#
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  IntelFsp2Pkg/IntelFsp2Pkg.dec
+  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+  KabylakeSiliconPkg/SiPkg.dec
+  AmberLakeFspBinPkg/AmberLakeFspBinPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IoLib
+  PeiServicesLib
+  PcdLib
+  SmbusLib
+  MmPciLib
+  ConfigBlockLib
+  MemoryAllocationLib
+  DebugPrintErrorLevelLib
+  FspWrapperApiLib
+
+[Pcd]
+  gSiPkgTokenSpaceGuid.PcdTsegSize## CONSUMES
+  gSiPkgTokenSpaceGuid.PcdSmbusBaseAddress## 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
+
+[Ppis]
+  gSiPolicyPpiGuid  ## CONSUMES
+  gSiPreMemPolicyPpiGuid## CONSUMES
+
+[Guids]
+  gTraceHubPreMemConfigGuid ## CONSUMES
+  gSmbusPreMemConfigGuid## CONSUMES
+  gDciPreMemConfigGuid  ## CONSUMES
+  gHpetPreMemConfigGuid ## CONSUMES
+  gHsioPciePreMemConfigGuid ## CONSUMES
+  gHsioSataPreMemConfigGuid #

[edk2-devel] [PATCH 1/2] KabylakeSiliconPkg: Add FSP Dispatch switch.

2019-05-22 Thread Chiu, Chasel
From: "Chasel, Chiu" 

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

PcdFspModeSelection is used as switch for boot loader to
consume FSP in API mode or Dispatch mode. For backward
compatibility, if boot loader running in FSP API mode the
KabylakeFspBinPkg will be used which does not have FSP 2.1
changes. For FSP Dispatch mode AmberLakeFspBinPkg will be
used with FSP 2.1 support.
One INF was duplicate to include different DEC file in
each build type.

Test: Booted Kabylake RVP3 to Windows successfully.

Cc: Nate DeSimone 
Cc: Michael Kubacki 
Signed-off-by: Chasel Chiu 
---
 
Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
 | 146 
++
 1 file changed, 146 insertions(+)

diff --git 
a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
 
b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
new file mode 100644
index 00..aebd3583bc
--- /dev/null
+++ 
b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiSiliconPolicyInitLibFsp/PeiSiliconPolicyInitLibFspAml.inf
@@ -0,0 +1,146 @@
+### @file
+# Library functions for Fsp Policy Initialization Library.
+#
+# Copyright (c) 2019, Intel Corporation. All rights reserved.
+#
+# SPDX-License-Identifier: BSD-2-Clause-Patent
+#
+##
+
+
+#
+# Defines Section - statements that will be processed to create a Makefile.
+#
+
+[Defines]
+  INF_VERSION= 0x00010005
+  BASE_NAME  = PeiSiliconPolicyInitLibFspAml
+  FILE_GUID  = 930816C4-D182-4A23-BF21-9AED635AF06C
+  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
+  PeiFspSiPolicyInitLib.c
+  PeiFspPchPolicyInitLib.c
+  PeiFspCpuPolicyInitLib.c
+  PeiFspMePolicyInitLib.c
+  PeiFspSaPolicyInitLib.c
+  PeiFspMiscUpdInitLib.c
+
+  PeiPolicyInitPreMem.c
+  PeiPolicyInit.c
+  PeiPolicyInit.h
+
+
+#
+# Package Dependency Section - list of Package files that are required for
+#  this module.
+#
+
+
+[Packages]
+  MdePkg/MdePkg.dec
+  MdeModulePkg/MdeModulePkg.dec
+  IntelFsp2Pkg/IntelFsp2Pkg.dec
+  IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec
+  KabylakeSiliconPkg/SiPkg.dec
+  AmberLakeFspBinPkg/AmberLakeFspBinPkg.dec
+
+[LibraryClasses]
+  BaseMemoryLib
+  DebugLib
+  IoLib
+  PeiServicesLib
+  PcdLib
+  SmbusLib
+  MmPciLib
+  ConfigBlockLib
+  MemoryAllocationLib
+  DebugPrintErrorLevelLib
+  FspWrapperApiLib
+
+[Pcd]
+  gSiPkgTokenSpaceGuid.PcdTsegSize## CONSUMES
+  gSiPkgTokenSpaceGuid.PcdSmbusBaseAddress## 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
+
+[Ppis]
+  gSiPolicyPpiGuid  ## CONSUMES
+  gSiPreMemPolicyPpiGuid## CONSUMES
+
+[Guids]
+  gTraceHubPreMemConfigGuid ## CONSUMES
+  gSmbusPreMemConfigGuid## CONSUMES
+  gDciPreMemConfigGuid  ## CONSUMES
+  gHpetPreMemConfigGuid ## CONSUMES
+  gHsioPciePreMemConfigGuid ## CONSUMES
+  gHsioSataPreMemConfigGuid ## CONSUMES
+  gHsioPreMemConfigGuid ## CONSUMES
+  gPcieRpPreMemConfigGuid   ## CONSUMES
+  gLpcPreMemConfigGuid  ## CONSUMES
+  gPchGeneralPreMemConfigGuid   ## CONSUMES
+  gWatchDogPreMemConfigGuid ## CONSUMES
+  gLanConfigGuid