IntelFsp2WrapperPkg: Add a PCD to control if signaling PciEnumerationComplete.
authorDong, Guo <guo.dong@intel.com>
Tue, 25 Oct 2016 23:53:37 +0000 (07:53 +0800)
committerJiewen Yao <jiewen.yao@intel.com>
Thu, 27 Oct 2016 23:46:42 +0000 (07:46 +0800)
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>
IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.inf
IntelFsp2WrapperPkg/IntelFsp2WrapperPkg.dec

index a692632..a2fe18c 100644 (file)
@@ -27,6 +27,8 @@
 #include <Library/HobLib.h>\r
 #include <FspStatusCode.h>\r
 \r
+#define   FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION     BIT16\r
+\r
 typedef\r
 EFI_STATUS\r
 (EFIAPI * ADD_PERFORMANCE_RECORDS)(\r
@@ -236,6 +238,7 @@ FspWrapperNotifyDxeEntryPoint (
   EFI_EVENT  ReadyToBootEvent;\r
   VOID       *Registration;\r
   EFI_EVENT  ProtocolNotifyEvent;\r
+  UINT32     FspApiMask;\r
 \r
   //\r
   // Load this driver's image to memory\r
@@ -245,14 +248,17 @@ FspWrapperNotifyDxeEntryPoint (
     return EFI_SUCCESS;\r
   }\r
 \r
-  ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (\r
-                          &gEfiPciEnumerationCompleteProtocolGuid,\r
-                          TPL_CALLBACK,\r
-                          OnPciEnumerationComplete,\r
-                          NULL,\r
-                          &Registration\r
-                          );\r
-  ASSERT (ProtocolNotifyEvent != NULL);\r
+  FspApiMask = PcdGet32 (PcdSkipFspApi);\r
+  if ((FspApiMask & FSP_API_NOTIFY_PHASE_AFTER_PCI_ENUMERATION) == 0) {\r
+    ProtocolNotifyEvent = EfiCreateProtocolNotifyEvent (\r
+                            &gEfiPciEnumerationCompleteProtocolGuid,\r
+                            TPL_CALLBACK,\r
+                            OnPciEnumerationComplete,\r
+                            NULL,\r
+                            &Registration\r
+                            );\r
+    ASSERT (ProtocolNotifyEvent != NULL);\r
+  }\r
 \r
   Status = EfiCreateEventReadyToBootEx (\r
              TPL_CALLBACK,\r
index f851f68..54c2cbf 100644 (file)
@@ -62,6 +62,7 @@
 \r
 [Pcd]\r
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress  ## CONSUMES\r
+  gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi       ## CONSUMES\r
 \r
 [Depex]\r
   TRUE\r
index d9d2d80..c088185 100644 (file)
   gIntelFsp2WrapperTokenSpaceGuid.PcdFsptBaseAddress|0x00000000|UINT32|0x00000300\r
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspmBaseAddress|0x00000000|UINT32|0x00000301\r
 \r
+  ## This PCD indicates if FSP APIs are skipped from FSP wrapper.<BR><BR>\r
+  #  If a bit is set, that means this FSP API is skipped.<BR>\r
+  #  If a bit is clear, that means this FSP API is NOT skipped.<BR>\r
+  #  NOTE: Only NotifyPhase Post PCI enumeration (BIT16) is implemented.<BR>\r
+  #  BIT[15:0] is for function:<BR>\r
+  #    BIT0    - Skip TempRamInit<BR>\r
+  #    BIT1    - Skip MemoryInit<BR>\r
+  #    BIT2    - Skip TempRamExit<BR>\r
+  #    BIT3    - Skip SiliconInit<BR>\r
+  #    BIT4    - Skip NotifyPhase<BR>\r
+  #  BIT[32:16] is for sub-function:<BR>\r
+  #    BIT16   - Skip NotifyPhase (AfterPciEnumeration)<BR>\r
+  #    BIT17   - Skip NotifyPhase (ReadyToBoot)<BR>\r
+  #    BIT18   - Skip NotifyPhase (EndOfFirmware)<BR>\r
+  #  Any undefined BITs are reserved for future use.<BR>\r
+  # @Prompt Skip FSP API from FSP wrapper.\r
+  gIntelFsp2WrapperTokenSpaceGuid.PcdSkipFspApi|0x00000000|UINT32|0x40000009\r
+\r
 [PcdsFixedAtBuild, PcdsPatchableInModule,PcdsDynamic,PcdsDynamicEx]\r
   gIntelFsp2WrapperTokenSpaceGuid.PcdFspsBaseAddress|0x00000000|UINT32|0x00001001\r
   
\ No newline at end of file