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 <ler...@redhat.com> > Cc: Ard Biesheuvel <ard.biesheu...@arm.com> > Cc: Leif Lindholm <l...@nuviainc.com> > Signed-off-by: Jiahui Cen <cenjia...@huawei.com> > Signed-off-by: Yubo Miao <miaoy...@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 <ler...@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/21656 Group Owner: devel+ow...@edk2.groups.io Unsubscribe: https://edk2.groups.io/g/devel/unsub [arch...@mail-archive.com] -=-=-=-=-=-=-=-=-=-=-=-