Wei Liu
2013-Nov-19 20:38 UTC
[PATCH RFC v2 1/7] MdeModulePkg: introduce PcdPciAllowFullEnumeration
Platforms such as Xen already enumerates PCI bridges and devices. Use this PCD to control EDK2 behavior. The default behavior is to allow full PCI enumeration. This is the same behavior as before this change. Signed-off-by: Wei Liu <wei.liu2@citrix.com> Cc: Gerd Hoffmann <kraxel@redhat.com> Cc: Laszlo Ersek <lersek@redhat.com> --- MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 5 ++++- MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf | 1 + MdeModulePkg/MdeModulePkg.dec | 3 +++ 3 files changed, 8 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c index 5afbb82..49c204c 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c @@ -284,7 +284,10 @@ PciBusDriverBindingStart ( ); } - gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE)); + if (PcdGetBool (PcdPciAllowFullEnumeration)) + gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE)); + else + gFullEnumeration = FALSE; // // Open Device Path Protocol for PCI root bridge diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf index 34eb672..626ae99 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf @@ -108,6 +108,7 @@ gEfiMdeModulePkgTokenSpaceGuid.PcdSrIovSupport gEfiMdeModulePkgTokenSpaceGuid.PcdAriSupport gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport + gEfiMdeModulePkgTokenSpaceGuid.PcdPciAllowFullEnumeration # [Event] # ## diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index b627eb1..274d2e5 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -737,6 +737,9 @@ ## This PCD specifies whether the Multi Root I/O virtualization support. gEfiMdeModulePkgTokenSpaceGuid.PcdMrIovSupport|FALSE|BOOLEAN|0x10000046 + ## This PCD specifies whether full PCI enumeration is allowed. + gEfiMdeModulePkgTokenSpaceGuid.PcdPciAllowFullEnumeration|TRUE|BOOLEAN|0x10000048 + [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx] ## Single root I/O virtualization virtual function memory BAR alignment # BITN set indicates 2 of n+12 power -- 1.7.10.4