mirror of https://github.com/acidanthera/audk.git
ArmVirtPkg/FdtPciHostBridgeLib: Add extra pci root buses support
In order to take advantages of extra pci root buses in ArmVirtPkg, it is necessary to scan extra root buses when getting root briges. And now PciHostBridgeUtilityLib already provides a set of utility functions that support for extra pci root buses, like PciHostBridgeUtilityGetRootBridges() / PciHostBridgeUtilityFreeRootBridges(). So let's rebase ArmVirtPkg/FdtPciHostBridgeLib to PciHostBridgeUtilityGetRootBridges() / PciHostBridgeUtilityFreeRootBridges() to extend ArmVirtPkg with extra pci root buses support. BZ: https://bugzilla.tianocore.org/show_bug.cgi?id=3059 Cc: Laszlo Ersek <lersek@redhat.com> Cc: Ard Biesheuvel <ard.biesheuvel@arm.com> Cc: Leif Lindholm <leif@nuviainc.com> Signed-off-by: Jiahui Cen <cenjiahui@huawei.com> Signed-off-by: Yubo Miao <miaoyubo@huawei.com> Message-Id: <20210119011302.10908-11-cenjiahui@huawei.com> Reviewed-by: Laszlo Ersek <lersek@redhat.com>
This commit is contained in:
parent
f4a257a355
commit
c4cbd86493
|
@ -272,8 +272,6 @@ ProcessPciHost (
|
|||
return Status;
|
||||
}
|
||||
|
||||
STATIC PCI_ROOT_BRIDGE mRootBridge;
|
||||
|
||||
/**
|
||||
Return all the root bridge instances in an array.
|
||||
|
||||
|
@ -361,8 +359,8 @@ PciHostBridgeGetRootBridges (
|
|||
PMemAbove4G.Base = MAX_UINT64;
|
||||
PMemAbove4G.Limit = 0;
|
||||
|
||||
Status = PciHostBridgeUtilityInitRootBridge (
|
||||
Attributes,
|
||||
return PciHostBridgeUtilityGetRootBridges (
|
||||
Count,
|
||||
Attributes,
|
||||
AllocationAttributes,
|
||||
TRUE,
|
||||
|
@ -373,19 +371,8 @@ PciHostBridgeGetRootBridges (
|
|||
&Mem,
|
||||
&MemAbove4G,
|
||||
&PMem,
|
||||
&PMemAbove4G,
|
||||
&mRootBridge
|
||||
&PMemAbove4G
|
||||
);
|
||||
if (EFI_ERROR (Status)) {
|
||||
DEBUG ((DEBUG_ERROR, "%a: failed to initialize PCI host bridge: %r\n",
|
||||
__FUNCTION__, Status));
|
||||
*Count = 0;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
*Count = 1;
|
||||
|
||||
return &mRootBridge;
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -402,8 +389,7 @@ PciHostBridgeFreeRootBridges (
|
|||
UINTN Count
|
||||
)
|
||||
{
|
||||
ASSERT (Count == 1);
|
||||
PciHostBridgeUtilityUninitRootBridge (Bridges);
|
||||
PciHostBridgeUtilityFreeRootBridges (Bridges, Count);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
Loading…
Reference in New Issue