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

@ -1,7 +1,7 @@
/** @file
Supporting functions implementaion for PCI devices management.
Copyright (c) 2006 - 2015, Intel Corporation. All rights reserved.<BR>
Copyright (c) 2006 - 2017, Intel Corporation. All rights reserved.<BR>
This program and the accompanying materials
are licensed and made available under the terms and conditions of the BSD License
which accompanies this distribution. The full text of the license may be found at
@ -711,7 +711,12 @@ StartPciDevicesOnBridge (
0,
&Supports
);
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
//
// By default every bridge's IO and MMIO spaces are enabled.
// Bridge's Bus Master will be enabled when any device behind it requests
// to enable Bus Master.
//
Supports &= (UINT64) (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY);
PciIoDevice->PciIo.Attributes (
&(PciIoDevice->PciIo),
EfiPciIoAttributeOperationEnable,
@ -763,7 +768,12 @@ StartPciDevicesOnBridge (
0,
&Supports
);
Supports &= (UINT64)EFI_PCI_DEVICE_ENABLE;
//
// By default every bridge's IO and MMIO spaces are enabled.
// Bridge's Bus Master will be enabled when any device behind it requests
// to enable Bus Master.
//
Supports &= (UINT64) (EFI_PCI_IO_ATTRIBUTE_IO | EFI_PCI_IO_ATTRIBUTE_MEMORY);
PciIoDevice->PciIo.Attributes (
&(PciIoDevice->PciIo),
EfiPciIoAttributeOperationEnable,