[edk2-devel] [PATCH 1/2] KabylakeSiliconPkg: Support DynamicExPCD from FSP.
From: "Chasel, Chiu" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1864 FSP Dispatch mode can consume DynamicEx PCD from boot loader so it must include those PCD in PCD database for FSP to consume. PeiPostMemSiliconPolicyInitLib.inf (this is for FSP Dispatch mode) has all PCDs included to ensure they can be built into PCD database. Also cleaned up unused PciExpress related PCD from INFs. Cc: Michael A Kubacki Cc: Sai Chaganty Cc: Nate DeSimone Signed-off-by: Chasel Chiu --- Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.c | 8 ++-- Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformLib/PeiDxeSmmCpuPlatformLib.inf | 7 +-- Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc | 6 +- Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.inf | 5 +++-- Silicon/Intel/KabylakeSiliconPkg/Library/SiliconInitLib/SiliconInitLib.inf | 3 +-- Silicon/Intel/KabylakeSiliconPkg/SiPkg.dec | 8 ++-- Silicon/Intel/KabylakeSiliconPkg/SystemAgent/Library/PeiDxeSmmSaPlatformLib/PeiDxeSmmSaPlatformLib.inf | 7 +-- Silicon/Intel/KabylakeSiliconPkg/SystemAgent/Library/PeiSaPolicyLib/PeiSaPolicyLib.inf | 3 +-- Silicon/Intel/KabylakeSiliconPkg/SystemAgent/SaInit/Dxe/SaInitDxe.inf | 3 +-- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.c b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.c index 51a06528e0..d99ee8e644 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.c +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.c @@ -1,7 +1,7 @@ /** @file This file contains routines that get PCI Express Address -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -27,5 +27,9 @@ MmPciBase ( { ASSERT ((Bus <= 0xFF) && (Device <= 0x1F) && (Function <= 0x7)); - return ((UINTN) PcdGet64 (PcdPciExpressBaseAddress) + (UINTN) (Bus << 20) + (UINTN) (Device << 15) + (UINTN) (Function << 12)); +#ifdef FSP_FLAG + return ((UINTN) PcdGet64 (PcdSiPciExpressBaseAddress) + (UINTN) (Bus << 20) + (UINTN) (Device << 15) + (UINTN) (Function << 12)); +#else + return ((UINTN) PcdGet64 (PcdPciExpressBaseAddress) + (UINTN) (Bus << 20) + (UINTN) (Device << 15) + (UINTN) (Function << 12)); +#endif } diff --git a/Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformLib/PeiDxeSmmCpuPlatformLib.inf b/Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformLib/PeiDxeSmmCpuPlatformLib.inf index 21d441a577..d2e813fea3 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformLib/PeiDxeSmmCpuPlatformLib.inf +++ b/Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformLib/PeiDxeSmmCpuPlatformLib.inf @@ -1,7 +1,7 @@ ## @file # Component description file for CPU Platform Lib # -# Copyright (c) 2017, Intel Corporation. All rights reserved. +# Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -34,11 +34,6 @@ MdePkg/MdePkg.dec UefiCpuPkg/UefiCpuPkg.dec KabylakeSiliconPkg/SiPkg.dec - -[Pcd] -gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress - - [Sources] CpuPlatformLibrary.h CpuPlatformLibrary.c diff --git a/Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc b/Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc index 5b114ae99e..aa481d0307 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc +++ b/Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc @@ -47,7 +47,11 @@ gSiPkgTokenSpaceGuid.PcdSiCatalogDebugEnable |FALSE [PcdsFixedAtBuild.common] gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000 -gSiPkgTokenSpaceGuid.PcdPciExpressRegionLength |0x1000 +gSiPkgTokenSpaceGuid.PcdSiPciExpressRegionLength |0x1000 +# +# This DSC mainly for GreenH Silicon code build so PciExpressBaseAddress can be FixedAtBuild +# +gSiPkgTokenSpaceGuid.PcdSiPciExpressBaseAddress|gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress [Defines] PLATFORM_NAME = KabylakeSiliconPkg diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.inf b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.inf index 8ae40a0c9e..02495953a7 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.inf +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.inf @@ -1,7 +1,7 @@ ## @file # Component d
Re: [edk2-devel] [PATCH 1/2] KabylakeSiliconPkg: Support DynamicExPCD from FSP.
Reviewed-by: Nate DeSimone -Original Message- From: Chiu, Chasel Sent: Friday, May 31, 2019 4:42 AM To: devel@edk2.groups.io Cc: Chiu, Chasel ; Kubacki, Michael A ; Chaganty, Rangasai V ; Desimone, Nathaniel L Subject: [PATCH 1/2] KabylakeSiliconPkg: Support DynamicExPCD from FSP. From: "Chasel, Chiu" REF: https://bugzilla.tianocore.org/show_bug.cgi?id=1864 FSP Dispatch mode can consume DynamicEx PCD from boot loader so it must include those PCD in PCD database for FSP to consume. PeiPostMemSiliconPolicyInitLib.inf (this is for FSP Dispatch mode) has all PCDs included to ensure they can be built into PCD database. Also cleaned up unused PciExpress related PCD from INFs. Cc: Michael A Kubacki Cc: Sai Chaganty Cc: Nate DeSimone Signed-off-by: Chasel Chiu --- Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.c | 8 ++-- Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformLib/PeiDxeSmmCpuPlatformLib.inf | 7 +-- Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc | 6 +- Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.inf | 5 +++-- Silicon/Intel/KabylakeSiliconPkg/Library/SiliconInitLib/SiliconInitLib.inf | 3 +-- Silicon/Intel/KabylakeSiliconPkg/SiPkg.dec | 8 ++-- Silicon/Intel/KabylakeSiliconPkg/SystemAgent/Library/PeiDxeSmmSaPlatformLib/PeiDxeSmmSaPlatformLib.inf | 7 +-- Silicon/Intel/KabylakeSiliconPkg/SystemAgent/Library/PeiSaPolicyLib/PeiSaPolicyLib.inf | 3 +-- Silicon/Intel/KabylakeSiliconPkg/SystemAgent/SaInit/Dxe/SaInitDxe.inf | 3 +-- 9 files changed, 25 insertions(+), 25 deletions(-) diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.c b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.c index 51a06528e0..d99ee8e644 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.c +++ b/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeS +++ mmMmPciLib.c @@ -1,7 +1,7 @@ /** @file This file contains routines that get PCI Express Address -Copyright (c) 2017, Intel Corporation. All rights reserved. +Copyright (c) 2017 - 2019, Intel Corporation. All rights reserved. SPDX-License-Identifier: BSD-2-Clause-Patent **/ @@ -27,5 +27,9 @@ MmPciBase ( { ASSERT ((Bus <= 0xFF) && (Device <= 0x1F) && (Function <= 0x7)); - return ((UINTN) PcdGet64 (PcdPciExpressBaseAddress) + (UINTN) (Bus << 20) + (UINTN) (Device << 15) + (UINTN) (Function << 12)); +#ifdef FSP_FLAG + return ((UINTN) PcdGet64 (PcdSiPciExpressBaseAddress) + (UINTN) (Bus +<< 20) + (UINTN) (Device << 15) + (UINTN) (Function << 12)); #else + return ((UINTN) PcdGet64 (PcdPciExpressBaseAddress) + (UINTN) (Bus << 20) + (UINTN) (Device << 15) + (UINTN) (Function << 12)); +#endif } diff --git a/Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformLib/PeiDxeSmmCpuPlatformLib.inf b/Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformLib/PeiDxeSmmCpuPlatformLib.inf index 21d441a577..d2e813fea3 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformLib/PeiDxeSmmCpuPlatformLib.inf +++ b/Silicon/Intel/KabylakeSiliconPkg/Cpu/Library/PeiDxeSmmCpuPlatformL +++ ib/PeiDxeSmmCpuPlatformLib.inf @@ -1,7 +1,7 @@ ## @file # Component description file for CPU Platform Lib # -# Copyright (c) 2017, Intel Corporation. All rights reserved. +# Copyright (c) 2017 - 2019, Intel Corporation. All rights +reserved. # # SPDX-License-Identifier: BSD-2-Clause-Patent # @@ -34,11 +34,6 @@ MdePkg/MdePkg.dec UefiCpuPkg/UefiCpuPkg.dec KabylakeSiliconPkg/SiPkg.dec - -[Pcd] -gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress - - [Sources] CpuPlatformLibrary.h CpuPlatformLibrary.c diff --git a/Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc b/Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc index 5b114ae99e..aa481d0307 100644 --- a/Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc +++ b/Silicon/Intel/KabylakeSiliconPkg/KabylakeSiliconPkg.dsc @@ -47,7 +47,11 @@ gSiPkgTokenSpaceGuid.PcdSiCatalogDebugEnable |FALSE [PcdsFixedAtBuild.common] gEfiMdePkgTokenSpaceGuid.PcdPciExpressBaseAddress|0xE000 -gSiPkgTokenSpaceGuid.PcdPciExpressRegionLength |0x1000 +gSiPkgTokenSpaceGuid.PcdSiPciExpressRegionLength |0x1000 +# +# This DSC mainly for GreenH Silicon code build so +PciExpressBaseAddress can be FixedAtBuild # +gSiPkgTokenSpaceGuid.PcdSiPciExpressBaseAddress|gEfiMdePkgTokenSpaceGui +d.PcdPciExpressBaseAddress [Defines] PLATFORM_NAME = KabylakeSiliconPkg diff --git a/Silicon/Intel/KabylakeSiliconPkg/Library/PeiDxeSmmMmPciLib/PeiDxeSmmMmPciLib.inf b/Silicon/Intel/Kaby