summaryrefslogtreecommitdiffstats
path: root/ArmVirtPkg/Library
diff options
context:
space:
mode:
authorJiahui Cen via groups.io <cenjiahui=huawei.com@groups.io>2021-01-19 09:13:01 +0800
committermergify[bot] <37929162+mergify[bot]@users.noreply.github.com>2021-01-20 16:14:20 +0000
commitc4cbd864933a0646f4ca263abb8eb1dcd6cc4ac5 (patch)
tree7b9563f1f899128e2198b15c29995433c1315ea9 /ArmVirtPkg/Library
parentf4a257a355b7913bb956706a774168cdb6631dac (diff)
downloadedk2-c4cbd864933a0646f4ca263abb8eb1dcd6cc4ac5.tar.gz
edk2-c4cbd864933a0646f4ca263abb8eb1dcd6cc4ac5.tar.bz2
edk2-c4cbd864933a0646f4ca263abb8eb1dcd6cc4ac5.zip
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>
Diffstat (limited to 'ArmVirtPkg/Library')
-rw-r--r--ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c22
1 files changed, 4 insertions, 18 deletions
diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
index 3ec7992b63..0099b8e3c3 100644
--- a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
+++ b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
@@ -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);
}
/**