Acidanthera UEFI Development Kit based on EDK II edk2-stable202311
Go to file
Laszlo Ersek ffdd337630 MdeModulePkg/PciBusDxe: recognize hotplug-capable PCIe ports
Section 7.8.2 of the PCI Express specification (r4.0 v0.3), entitled "PCI
Express Capabilities Register (Offset 02h)", and section 7.8.9 "Slot
Capabilities Register (Offset 14h)" of the same, describe the conditions
when a PCIe port should be considered "supporting hotplug":

- it should be a root complex port or a switch downstream port, and

- it should have the "Slot Implemented" bit set in the Express
  Capabilities Register, and

- it should have the "Hot-Plug Capable" bit set in the Slot Capabilities
  Register.

The first two sub-conditions are already implemented in at least two open
source projects I could find:

- in SeaBIOS by Marcel Apfelbaum: "hw/pci: reserve IO and mem for pci
  express downstream ports with no devices attached"
  <https://code.coreboot.org/p/seabios/source/commit/3aa31d7d6375>,

- in edk2 itself, in the implementation of the "PCI" UEFI Shell command:
  see the "PcieExplainTypeSlot" case label in function
  PciExplainPciExpress(), file
  "ShellPkg/Library/UefiShellDebug1CommandsLib/Pci.c".

PciBusDxe recognizes such PCIe ports as bridges, but it doesn't realize
they support hotplug. In turn PciBusDxe omits getting any resource padding
information from the platform's EFI_PCI_HOT_PLUG_INIT_PROTOCOL for these
bridges:

  GatherPpbInfo()                [PciEnumeratorSupport.c]
    GetResourcePaddingPpb()      [PciResourceSupport.c]
      GetResourcePaddingForHpb() [PciHotPlugSupport.c]
        IsPciHotPlugBus()        [PciHotPlugSupport.c]
          //
          // returns FALSE
          //
        //
        // the following is not reached:
        //
        gPciHotPlugInit->GetResourcePadding()

Implement a function called SupportsPcieHotplug() for identifying such
ports, and call it from IsPciHotPlugBus() (after the call to IsSHPC()).

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>
Contributed-under: TianoCore Contribution Agreement 1.0
Signed-off-by: Laszlo Ersek <lersek@redhat.com>
Reviewed-by: Ruiyu Ni <Ruiyu.ni@intel.com>
2016-07-13 08:39:29 +02:00
AppPkg AppPkg/.../Python: Clean up and document how to escape the -# option. 2016-01-06 01:00:19 +00:00
ArmPkg ArmPkg: Fix typos in comments 2016-07-11 10:29:44 +08:00
ArmPlatformPkg ArmPlatformPkg: Set Juno debug serial port defaults 2016-07-07 17:55:34 +01:00
ArmVirtPkg ArmVirtPkg: add name GUIDs to FvMain instances 2016-07-12 15:19:42 +02:00
BaseTools BaseTools/GenFds: unbreak Region.PadBuffer 2016-07-12 16:22:28 +02:00
BeagleBoardPkg BeagleBoardPkg: Convert to build FatPkg from source 2016-04-07 20:45:39 +02:00
Conf
CorebootModulePkg CorebootModulePkg: Remove unused PCI non-enumeration drivers 2016-05-27 14:26:16 -07:00
CorebootPayloadPkg CorebootModulePkg/PciHostBridgeLib: Fix PCI 64bit memory BAR size issue 2016-05-27 14:28:37 -07:00
CryptoPkg CryptoPkg BaseCryptLib: Init the content of struct 'CertCtx' before use 2016-07-12 08:53:19 +08:00
DuetPkg DuetPkg FSVariable: return error for empty str VariableName to GetVariable 2016-05-15 17:48:53 +08:00
EdkCompatibilityPkg EdkCompatibilityPkg: Fix typos in comments 2016-07-11 10:29:45 +08:00
EdkShellBinPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EdkShellPkg */Contributions.txt: Update example email address 2015-02-03 17:29:14 +00:00
EmbeddedPkg EmbeddedPkg/AcpiLib: add GICC table init macro for ACPI 6.0 2016-07-06 10:51:38 +02:00
EmulatorPkg EmulatorPkg/EmuGopDxe: Use correct FROM_THIS macro for TextInEx 2016-05-16 18:25:17 -07:00
FatBinPkg FatBinPkg: Change to 2-clause BSD license 2016-04-22 00:55:21 -07:00
FatPkg FatPkg: Add Contributions.txt 2016-04-22 00:55:21 -07:00
IntelFrameworkModulePkg IntelFrameworkModulePkg: Fix typos in comments 2016-07-11 10:29:48 +08:00
IntelFrameworkPkg IntelFrameworkPkg/FrameworkUefiLib: implement EfiEventGroupSignal 2016-03-23 12:05:45 +01:00
IntelFsp2Pkg IntelFsp2Pkg SecFspSecPlatformLibNull: Remove MASM/GAS files 2016-07-11 13:53:57 +08:00
IntelFsp2WrapperPkg IntelFsp2WrapperPkg SecFspWrapperPlatformSecLibSample: Remove MASM/GAS files 2016-07-11 13:53:48 +08:00
IntelFspPkg IntelFspPkg: Add NOOPT target in IntelFspPkg.dsc 2016-01-21 02:14:43 +00:00
IntelFspWrapperPkg IntelFspWrapperPkg: PeiFspHobProcessLibSample: remove set but unused variables 2016-03-25 10:52:21 +01:00
IntelSiliconPkg IntelSiliconPkg/IgdOpRegion: Add definition for Intel IGD 2016-06-16 08:42:44 +08:00
MdeModulePkg MdeModulePkg/PciBusDxe: recognize hotplug-capable PCIe ports 2016-07-13 08:39:29 +02:00
MdePkg MdePkg/IndustryStandard: introduce EFI_PCI_CAPABILITY_ID_SHPC 2016-07-13 08:38:41 +02:00
NetworkPkg NetworkPkg: Update PXE driver to follow edk2 coding standards. 2016-07-12 08:50:36 +08:00
Nt32Pkg Nt32Pkg: Fix typos in comments 2016-07-11 10:29:45 +08:00
Omap35xxPkg Omap35xxPkg: drop CpuExceptionHandlerLib library class resolution 2016-03-17 09:15:11 +01:00
OptionRomPkg OptionRomPkg: Fix typos in comments 2016-07-11 10:29:47 +08:00
OvmfPkg OvmfPkg/PlatformBootManagerLib: remove stale FvFile boot options 2016-07-13 01:04:37 +02:00
PcAtChipsetPkg PcAtChipsetPkg: Fix typos in comments 2016-07-11 10:29:47 +08:00
PerformancePkg PerformancePkg: Replace UnicodeStrToAsciiStr/AsciiStrToUnicodeStr 2016-06-21 12:46:25 +08:00
QuarkPlatformPkg QuarkPlatformPkg: fix ASSERT_EFI_ERROR() typos 2016-06-30 13:08:14 +02:00
QuarkSocPkg QuarkSocPkg/SmmCpuFeaturesLib: Add SMRR PhysBase/PhysMask fields check 2016-05-19 10:04:34 -07:00
SecurityPkg SecurityPkg OpalPasswordSmm: Remove useless code. 2016-07-11 10:38:20 +08:00
ShellBinPkg ShellBinPkg: Ia32/X64 Shell binary update. 2016-07-12 15:10:09 +08:00
ShellPkg Revert "ShellPkg: Make the USB mouse behavior in 'edit' consistent with 'hexedit'." 2016-07-08 14:54:30 +08:00
SourceLevelDebugPkg SourceLevelDebugPkg DebugAgentLib: Add nasm source file into LIB INF files. 2016-06-28 09:52:25 +08:00
StdLib StdLib: Series of patches to fix typos - availabe to available 2016-07-07 15:23:19 -07:00
StdLibPrivateInternalFiles StdLib: Clarify and improve comments. 2016-01-06 00:31:42 +00:00
UefiCpuPkg UefiCpuPkg CpuMpPei: Update INF to refer to NASM source file 2016-07-11 13:20:22 +08:00
UnixPkg
Vlv2DeviceRefCodePkg Vlv2DeviceRefCodePkg&Vlv2TbltDevicePkg:Add setup option of LPE Audio. 2016-06-21 11:20:54 +08:00
Vlv2TbltDevicePkg Vlv2TbltDevicePkg: fix ASSERT_EFI_ERROR() typos 2016-06-30 17:27:38 +02:00
.gitignore
BuildNotes2.txt BaseTools: Updated BuildNotes URLs 2016-03-25 09:46:44 +08:00
Edk2Setup.bat BaseTools: Update Edk2Setup.bat to support multiple workspaces 2015-10-08 09:29:36 +00:00
Maintainers.txt Change ShellPkg&ShellBinPkg maintainer 2016-07-06 08:05:21 -07:00
edksetup.bat Update edksetup.bat to check EDK_TOOLS_PATH before set it. 2016-04-11 16:20:28 +08:00
edksetup.sh BaseTools: Update edksetup.sh to support multiple workspaces 2015-10-08 09:29:56 +00:00