From 5624a27ddebc154ac467b86225a2cab913567dc7 Mon Sep 17 00:00:00 2001 From: Wei Liu Date: Sun, 8 Dec 2013 01:35:32 +0000 Subject: [PATCH] MdeModulePkg: introduce PcdPciDisableBusEnumeration Platforms such as Xen already enumerates PCI bridges and devices. Use this PCD to control EDK2 behavior. PcdPciDisableBusEnumeration is placed under [PcdsFixedAtBuild, PcdsPatchableInModule, PcdsDynamic, PcdsDynamicEx], so that it is possible to alter it during runtime. The default setting of this PCD is false (allow full PCI enumeration) to preserve the same behavior before this change. Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Wei Liu Reviewed-by: Jordan Justen Reviewed-by: Michael Kinney git-svn-id: https://svn.code.sf.net/p/edk2/code/trunk/edk2@14940 6f19259b-4bc3-4df7-8a09-765794883524 --- MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c | 6 +++++- MdeModulePkg/Bus/Pci/PciBusDxe/PciBusDxe.inf | 1 + MdeModulePkg/MdeModulePkg.dec | 3 +++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c index 5afbb82298..2252235bce 100644 --- a/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c +++ b/MdeModulePkg/Bus/Pci/PciBusDxe/PciBus.c @@ -284,7 +284,11 @@ PciBusDriverBindingStart ( ); } - gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE)); + if (PcdGetBool (PcdPciDisableBusEnumeration)) { + gFullEnumeration = FALSE; + } else { + gFullEnumeration = (BOOLEAN) ((SearchHostBridgeHandle (Controller) ? FALSE : TRUE)); + } // // 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 34eb672df1..917889ca0a 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.PcdPciDisableBusEnumeration # [Event] # ## diff --git a/MdeModulePkg/MdeModulePkg.dec b/MdeModulePkg/MdeModulePkg.dec index b627eb101c..51984510d6 100644 --- a/MdeModulePkg/MdeModulePkg.dec +++ b/MdeModulePkg/MdeModulePkg.dec @@ -878,6 +878,9 @@ ## This PCD specified whether the S.M.A.R.T feature of attached ATA hard disks are enabled. gEfiMdeModulePkgTokenSpaceGuid.PcdAtaSmartEnable|TRUE|BOOLEAN|0x00010065 + ## This PCD specifies whether full PCI enumeration is disabled. + gEfiMdeModulePkgTokenSpaceGuid.PcdPciDisableBusEnumeration|FALSE|BOOLEAN|0x10000048 + [PcdsPatchableInModule] ## Specify memory size with page number for PEI code when # the feature of Loading Module at Fixed Address is enabled -- 2.39.2