From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mga06.intel.com (mga06.intel.com [134.134.136.31]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id 4EF271A1E29 for ; Mon, 24 Oct 2016 10:03:07 -0700 (PDT) Received: from orsmga003.jf.intel.com ([10.7.209.27]) by orsmga104.jf.intel.com with ESMTP; 24 Oct 2016 10:03:07 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.31,542,1473145200"; d="scan'208";a="893396873" Received: from gdong1-mobl4.ccr.corp.intel.com ([10.34.84.100]) by orsmga003.jf.intel.com with ESMTP; 24 Oct 2016 10:03:06 -0700 From: gdong1 To: edk2-devel@lists.01.org Cc: jiewen.yao@intel.com, giri.p.mudusuru@intel.com, maurice.ma@intel.com, guo.dong@intel.com Date: Mon, 24 Oct 2016 10:02:40 -0700 Message-Id: X-Mailer: git-send-email 2.7.0.windows.1 Subject: [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 24 Oct 2016 17:03:07 -0000 PciEnumerationComplete might be signaled to FSP in Coreboot. So FSP wrapper driver don't need send it again. Add a PCD to control if a FSP API could be skipped from FspWrapperNotifyDxe driver. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Guo Dong Reviewed-by: Maurice Ma Reviewed-by: Jiewen Yao Reviewed-by: Giri P Mudusuru --- .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.c | 22 ++++++++++++++-------- .../FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf | 1 + IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec | 8 ++++++++ 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c index 0797f44..969debc 100644 --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c +++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c @@ -26,6 +26,8 @@ #include #include +#define PCI_ENUMERATION_COMPLETE_API BIT16 + typedef EFI_STATUS (EFIAPI * ADD_PERFORMANCE_RECORDS)( @@ -237,6 +239,7 @@ FspWrapperNotifyDxeEntryPoint ( EFI_EVENT ReadyToBootEvent; VOID *Registration; EFI_EVENT ProtocolNotifyEvent; + UINT32 FspApiMask; // // Load this driver's image to memory @@ -246,14 +249,17 @@ FspWrapperNotifyDxeEntryPoint ( return EFI_SUCCESS; } - ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent ( - &gEfiPciEnumerationCompleteProtocolGuid, - TPL_CALLBACK, - OnPciEnumerationComplete, - NULL, - &Registration - ); - ASSERT (ProtocolNotifyEvent != NULL); + FspApiMask = PcdGet32 (PcdFspApiSkipMask); + if ((FspApiMask & PCI_ENUMERATION_COMPLETE_API) == 0) { + ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent ( + &gEfiPciEnumerationCompleteProtocolGuid, + TPL_CALLBACK, + OnPciEnumerationComplete, + NULL, + &Registration + ); + ASSERT (ProtocolNotifyEvent != NULL); + } Status = EfiCreateEventReadyToBootEx ( TPL_CALLBACK, diff --git a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf index f851f68..9ef81ff 100644 --- a/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf +++ b/IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf @@ -62,6 +62,7 @@ [Pcd] gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress ## CONSUMES + gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask ## CONSUMES [Depex] TRUE diff --git a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec index d9d2d80..534f482 100644 --- a/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec +++ b/IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec @@ -75,6 +75,14 @@ gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x00000000|UINT32|0x00000300 gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT32|0x00000301 + ## This PCD indicates if FSP APIs are skipped from FSP wrapper.

+ # If a bit is set, that means this FSP API is skipped.
+ # If a bit is clear, that means this FSP API is NOT skipped.
+ # BIT16 - Mask NotifyPhase (AfterPciEnumeration).
+ # Any undefined BITs are reserved for future use.
+ # @Prompt FSP API skip mask from FSP wrapper. + gIntelFsp2WrapperTokenSpaceGuid.PcdFspApiSkipMask|0x00000000|UINT32|0x40000009 + [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx] gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT32|0x00001001 \ No newline at end of file -- 2.7.0.windows.1