MdeModulePkg/PciBusDxe: Enable Bus Master on P2P bridges on demand

The patch dynamically enables Bus Master on P2P bridges only
when requested by a device driver through PciIo.Attribute() to enable
the Bus Master.

Signed-off-by: Sean Brogan <sean.brogan@microsoft.com>
Signed-off-by: Ruiyu Ni <ruiyu.ni@intel.com>
Reviewed-by: Jiewen Yao <jiewen.yao@intel.com>
Cc: Michael D Kinney <michael.d.kinney@intel.com>
This commit is contained in:
Ruiyu Ni
2017-08-16 10:26:49 -07:00
parent 265e5c82f5
commit 5db417ed25
3 changed files with 32 additions and 10 deletions

View File

@ -1348,7 +1348,8 @@ ModifyRootBridgeAttributes (
//
Attributes &= ~(UINT64)(EFI_PCI_IO_ATTRIBUTE_EMBEDDED_DEVICE |
EFI_PCI_IO_ATTRIBUTE_EMBEDDED_ROM |
EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE);
EFI_PCI_IO_ATTRIBUTE_DUAL_ADDRESS_CYCLE |
EFI_PCI_IO_ATTRIBUTE_BUS_MASTER);
//
// Record the new attribute of the Root Bridge
@ -1726,12 +1727,11 @@ PciIoAttributes (
}
//
// The upstream bridge should be also set to revelant attribute
// expect for IO, Mem and BusMaster
// expect for IO and Mem
//
UpStreamAttributes = Attributes &
(~(EFI_PCI_IO_ATTRIBUTE_IO |
EFI_PCI_IO_ATTRIBUTE_MEMORY |
EFI_PCI_IO_ATTRIBUTE_BUS_MASTER
EFI_PCI_IO_ATTRIBUTE_MEMORY
)
);
UpStreamBridge = PciIoDevice->Parent;