summaryrefslogtreecommitdiffstats
path: root/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
diff options
context:
space:
mode:
authorLaszlo Ersek <lersek@redhat.com>2016-06-30 20:16:06 +0200
committerLaszlo Ersek <lersek@redhat.com>2016-07-13 08:39:50 +0200
commit8aba40b79267df761bd24d6874ae87f47a7bd3de (patch)
tree1c5fd12f31f120d157b4d07ac09e66ab7e636a96 /OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
parentffdd337630cc0df4bf9f7ef853bc56bc9105fd43 (diff)
downloadedk2-8aba40b79267df761bd24d6874ae87f47a7bd3de.tar.gz
edk2-8aba40b79267df761bd24d6874ae87f47a7bd3de.tar.bz2
edk2-8aba40b79267df761bd24d6874ae87f47a7bd3de.zip
OvmfPkg: add PciHotPlugInitDxe
After IncompatiblePciDeviceSupportDxe, this is another small driver / protocol implementation that tweaks the behavior of the PCI bus driver in edk2. The protocol is specified in the Platform Init Spec v1.4a, Volume 5, Chapter 12.6 "PCI Hot Plug PCI Initialization Protocol". This implementation steers the PCI bus driver to reserve the following resources ("padding") for each PCI bus, in addition to the BARs of the devices on that PCI bus: - 2MB of 64-bit non-prefetchable MMIO aperture, - 512B of IO port space. The goal is to reserve room for devices hot-plugged at runtime even if the bridge receiving the device is empty at boot time. The 2MB MMIO size is inspired by SeaBIOS. The 512B IO port size is actually only 1/8th of the PCI spec mandated reservation, but the specified size of 4096 has proved wasteful (given the limited size of our IO port space -- see commit bba734ab4c7c). Especially on Q35, where every PCIe root port and downstream port qualifies as a separate bridge (capable of accepting a single device). Test results for this patch: - regardless of our request for 64-bit MMIO reservation, it is downgraded to 32-bit, - although we request 512B alignment for the IO port space reservation, the next upstream bridge rounds it up to 4096B. Cc: "Johnson, Brian J." <bjohnson@sgi.com> Cc: Alex Williamson <alex.williamson@redhat.com> Cc: Andrew Fish <afish@apple.com> Cc: Feng Tian <feng.tian@intel.com> Cc: Jordan Justen <jordan.l.justen@intel.com> Cc: Marcel Apfelbaum <marcel@redhat.com> Cc: Michael Kinney <michael.d.kinney@intel.com> Cc: Ruiyu Ni <ruiyu.ni@intel.com> Cc: Star Zeng <star.zeng@intel.com> Suggested-by: Andrew Fish <afish@apple.com> Contributed-under: TianoCore Contribution Agreement 1.0 Signed-off-by: Laszlo Ersek <lersek@redhat.com> Acked-by: Jordan Justen <jordan.l.justen@intel.com> Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
Diffstat (limited to 'OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf')
-rw-r--r--OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf42
1 files changed, 42 insertions, 0 deletions
diff --git a/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
new file mode 100644
index 0000000000..641ee2cad9
--- /dev/null
+++ b/OvmfPkg/PciHotPlugInitDxe/PciHotPlugInit.inf
@@ -0,0 +1,42 @@
+## @file
+# This driver implements EFI_PCI_HOT_PLUG_INIT_PROTOCOL, providing the PCI bus
+# driver with resource padding information, for PCIe hotplug purposes.
+#
+# Copyright (C) 2016, Red Hat, Inc.
+#
+# 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
+# http://opensource.org/licenses/bsd-license.php
+#
+# THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS, WITHOUT
+# WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
+##
+
+[Defines]
+ INF_VERSION = 0x00010005
+ BASE_NAME = PciHotPlugInitDxe
+ FILE_GUID = 11A6EDF6-A9BE-426D-A6CC-B22FE51D9224
+ MODULE_TYPE = DXE_DRIVER
+ VERSION_STRING = 1.0
+ ENTRY_POINT = DriverInitialize
+
+[Sources]
+ PciHotPlugInit.c
+
+[Packages]
+ MdeModulePkg/MdeModulePkg.dec
+ MdePkg/MdePkg.dec
+
+[LibraryClasses]
+ DebugLib
+ DevicePathLib
+ MemoryAllocationLib
+ UefiBootServicesTableLib
+ UefiDriverEntryPoint
+
+[Protocols]
+ gEfiPciHotPlugInitProtocolGuid ## SOMETIMES_PRODUCES
+
+[Depex]
+ TRUE