From 1966ffb1c3058e3aa6a4cd86f15063ffc9f520b0 Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Fri, 15 May 2020 16:47:18 +0200 Subject: [PATCH 1/2] MdeModulePkg: Fix OptionROM scanning The Option ROM scanner can't work as enumeration was done by the first stage bootloader. Running it will disable the ability of the PCIPlatform code to scan for ROMs. Required for the following patch that enables custom Option ROM scanning using gPciPlatformProtocol. Signed-off-by: Patrick Rudolph --- MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c index db1b35f8ef48..5cf264dcfab2 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciEnumeratorSupport.c @@ -2551,10 +2551,12 @@ PciEnumeratorLight ( // RemoveRejectedPciDevices (RootBridgeDev->Handle, RootBridgeDev); - // - // Process option rom light - // - ProcessOptionRomLight (RootBridgeDev); + if (!PcdGetBool (PcdPciDisableBusEnumeration)) { + // + // Process option rom light + // + ProcessOptionRomLight (RootBridgeDev); + } // // Determine attributes for all devices under this root bridge From f6a483461cd9343d1b150c5ed5a22ecb81c3893a Mon Sep 17 00:00:00 2001 From: Patrick Rudolph Date: Thu, 21 May 2020 09:49:34 +0200 Subject: [PATCH 2/2] [HACK] Load OptionROMs immediately This will make sure the ConsoleInit is able to connect the driver installed by the VGA Option ROMs. Signed-off-by: Patrick Rudolph --- MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c index 6a5f4a3b9911..f325d77175bb 100644 --- a/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c +++ b/MdeModulePkg/Universal/SecurityStubDxe/Defer3rdPartyImageLoad.c @@ -25,7 +25,7 @@ typedef struct { } DEFERRED_3RD_PARTY_IMAGE_TABLE; BOOLEAN mImageLoadedAfterEndOfDxe = FALSE; -BOOLEAN mEndOfDxe = FALSE; +BOOLEAN mEndOfDxe = TRUE; DEFERRED_3RD_PARTY_IMAGE_TABLE mDeferred3rdPartyImage = { 0, // Deferred image count NULL // The deferred image info