[edk2-devel] [PATCH v6 10/11] ArmVirtPkg/FdtPciHostBridgeLib: Add extra pci root buses support
Laszlo Ersek
lersek at redhat.com
Wed Jan 20 14:06:41 UTC 2021
On 01/19/21 02:13, Jiahui Cen via groups.io wrote:
> 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 at redhat.com>
> Cc: Ard Biesheuvel <ard.biesheuvel at arm.com>
> Cc: Leif Lindholm <leif at nuviainc.com>
> Signed-off-by: Jiahui Cen <cenjiahui at huawei.com>
> Signed-off-by: Yubo Miao <miaoyubo at huawei.com>
> ---
> ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c | 22 ++++----------------
> 1 file changed, 4 insertions(+), 18 deletions(-)
>
> diff --git a/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c b/ArmVirtPkg/Library/FdtPciHostBridgeLib/FdtPciHostBridgeLib.c
> index 3ec7992b6331..0099b8e3c391 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);
> }
>
> /**
>
Reviewed-by: Laszlo Ersek <lersek at redhat.com>
-=-=-=-=-=-=-=-=-=-=-=-
Groups.io Links: You receive all messages sent to this group.
View/Reply Online (#70582): https://edk2.groups.io/g/devel/message/70582
Mute This Topic: https://groups.io/mt/79941630/1813853
Group Owner: devel+owner at edk2.groups.io
Unsubscribe: https://edk2.groups.io/g/devel/unsub [edk2-devel-archive at redhat.com]
-=-=-=-=-=-=-=-=-=-=-=-
More information about the edk2-devel-archive
mailing list