On 23 May 2017 at 09:15, Scott Telford <[email protected]> wrote:
> Copy workaround previously in
> ArmPlatformPkg/ArmJunoPkg/Drivers/PciHostBridgeDxe/PciRootBridge.c:PciRbPciRead()
> to RootBridgeIoPciAccess(), to avoid spurious multiple detections when
> scanning buses.
>
> Contributed-under: TianoCore Contribution Agreement 1.0
> Signed-off-by: Scott Telford <[email protected]>
> ---
>  MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c | 13 +++++++++++++

This does not belong in the generic driver.

Could you please explain in more detail what the issue is? In any
case, we will need to put this workaround in a Juno specific
implementation of PciExpressLib

>  1 file changed, 13 insertions(+)
>
> diff --git a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c 
> b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
> index a0e7e5b..3cca3c1 100644
> --- a/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
> +++ b/MdeModulePkg/Bus/Pci/PciHostBridgeDxe/PciRootBridgeIo.c
> @@ -945,6 +945,19 @@ RootBridgeIoPciAccess (
>      PciAddress.ExtendedRegister = PciAddress.Register;
>    }
>
> +  // The UEFI PCI enumerator scans for devices at all possible addresses,
> +  // and ignores some PCI rules - this results in some hardware being
> +  // detected multiple times. We work around this by faking absent
> +  // devices
> +  if ((PciAddress.Bus == 0) && ((PciAddress.Device != 0) || 
> (PciAddress.Function != 0))) {
> +    *((UINT32 *)Buffer) = 0xffffffff;
> +    return EFI_SUCCESS;
> +  }
> +  if ((PciAddress.Bus == 1) && ((PciAddress.Device != 0) || 
> (PciAddress.Function != 0))) {
> +    *((UINT32 *)Buffer) = 0xffffffff;
> +    return EFI_SUCCESS;
> +  }
> +
>    Address = PCI_SEGMENT_LIB_ADDRESS (
>                RootBridge->RootBridgeIo.SegmentNumber,
>                PciAddress.Bus,
> --
> 2.2.2
>
> _______________________________________________
> edk2-devel mailing list
> [email protected]
> https://lists.01.org/mailman/listinfo/edk2-devel
_______________________________________________
edk2-devel mailing list
[email protected]
https://lists.01.org/mailman/listinfo/edk2-devel

Reply via email to