From: gdong1 <guo.dong@intel.com>
To: edk2-devel@lists.01.org
Cc: jiewen.yao@intel.com, giri.p.mudusuru@intel.com,
maurice.ma@intel.com, guo.dong@intel.com
Subject: [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.
Date: Mon, 24 Oct 2016 10:02:40 -0700 [thread overview]
Message-ID: <cefa15a6a87076d6af066737a06217f1d47cb0f1.1477328472.git.guo.dong@intel.com> (raw)
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 <guo.dong@intel.com>
Reviewed-by: Maurice Ma <maurice.ma@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Reviewed-by: Giri P Mudusuru <giri.p.mudusuru@intel.com>
---
.../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 <Library/PerformanceLib.h>
#include <Library/HobLib.h>
+#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.<BR><BR>
+ # If a bit is set, that means this FSP API is skipped.<BR>
+ # If a bit is clear, that means this FSP API is NOT skipped.<BR>
+ # BIT16 - Mask NotifyPhase (AfterPciEnumeration).<BR>
+ # Any undefined BITs are reserved for future use.<BR>
+ # @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
next reply other threads:[~2016-10-24 17:03 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2016-10-24 17:02 gdong1 [this message]
2016-10-24 23:17 ` [PATCH v2] IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete Yao, Jiewen
2016-10-25 3:43 ` Mudusuru, Giri P
2016-10-25 4:54 ` Yao, Jiewen
2016-10-25 15:38 ` Dong, Guo
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-list from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=cefa15a6a87076d6af066737a06217f1d47cb0f1.1477328472.git.guo.dong@intel.com \
--to=devel@edk2.groups.io \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox