Skip to content

Commit a057414

Browse files
michaelescueardbiesheuvel
authored andcommitted
MdeModulePkg/PciHostBridgeDxe: Ignore unsupported I/O BARs.
Bootup fails when an endpoint requests I/O space BARs and the Root Bridge does not support I/O space causing a resource conflict during bus enumeration. 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]> Reviewed-by: Joseph Oresko <[email protected]>
1 parent 48c5926 commit a057414

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciHostBridge.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1569,6 +1569,14 @@ SubmitResources (
15691569
RootBridge->ResAllocNode[Type].Length = Descriptor->AddrLen;
15701570
RootBridge->ResAllocNode[Type].Alignment = Descriptor->AddrRangeMax;
15711571
RootBridge->ResAllocNode[Type].Status = ResSubmitted;
1572+
//
1573+
// If the PCI root bridge does not support IO space, do not submit requested resources
1574+
// for allocation.
1575+
//
1576+
if ((Type == TypeIo) && (RootBridge->Io.Base > RootBridge->Io.Limit)) {
1577+
DEBUG ((DEBUG_INFO, " I/O: Resource not submitted. Unsupported aperture.\n"));
1578+
RootBridge->ResAllocNode[Type].Status = ResNone;
1579+
}
15721580
}
15731581

15741582
RootBridge->ResourceSubmitted = TRUE;

0 commit comments

Comments
 (0)