Skip to content

Commit 4f069fa

Browse files
committed
MdeModulePkg/PciHostBridgeDxe: Ignore unsupported I/O BARs.
PCIe enumeration fails if an endpoint requests I/O space BARs and the Root Bridge does not support I/O space. While I/O space is traditionally supported in x86_64, platforms using an Arm architecture may or may not support I/O space. This change adds logic allowing the platform to detect I/O space support for each Root Bridge and prevent submission of the required I/O resources for allocation when unsupported. Endpoints will not receive I/O resources, but they will continue to receive Memory BAR resources. Signed-off-by: Michael Escue <[email protected]>
1 parent 46548b1 commit 4f069fa

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1568,7 +1568,15 @@ SubmitResources (
15681568

15691569
RootBridge->ResAllocNode[Type].Length = Descriptor->AddrLen;
15701570
RootBridge->ResAllocNode[Type].Alignment = Descriptor->AddrRangeMax;
1571-
RootBridge->ResAllocNode[Type].Status = ResSubmitted;
1571+
//
1572+
// If the PCI root bridge does not suport IO Space, do not submit requested resources
1573+
// for allocation.
1574+
//
1575+
if ((Type == TypeIo) && (RootBridge->Io.Base > RootBridge->Io.Limit)) {
1576+
RootBridge->ResAllocNode[Type].Status = ResNone;
1577+
} else {
1578+
RootBridge->ResAllocNode[Type].Status = ResSubmitted;
1579+
}
15721580
}
15731581

15741582
RootBridge->ResourceSubmitted = TRUE;

0 commit comments

Comments
 (0)