]> git.proxmox.com Git - mirror_edk2.git/blobdiff - IntelFsp2WrapperPkg/FspWrapperNotifyDxe/FspWrapperNotifyDxe.c
IntelFsp2WrapperPkg: Revert 90c5bc08
[mirror_edk2.git] / IntelFsp2WrapperPkg / FspWrapperNotifyDxe / FspWrapperNotifyDxe.c
index a69263278db1c7511d9f3661312d5b2bf6ab241d..a2fe18c2da106fd01d3930da5a91644dcbaf2f40 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