From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-io0-x231.google.com (mail-io0-x231.google.com [IPv6:2607:f8b0:4001:c06::231]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by ml01.01.org (Postfix) with ESMTPS id D59B421A0BA9C for ; Tue, 23 May 2017 09:42:27 -0700 (PDT) Received: by mail-io0-x231.google.com with SMTP id k91so101301056ioi.1 for ; Tue, 23 May 2017 09:42:27 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc; bh=zKwettSGWKj2x4NqhuP+A4P1rtEWdUJDTEG6ZX65Zz8=; b=FkgDZIEnJ942yefkMRFAaZRJZihzM4helUPQCcrEbtZ8N3mi6edaQU3ltTPyZrSAMp 922gmw7zgM4Vy98r9Xchva5ZTGv6d6Ori5G0u2d7K7pz36vvE/pdMj53/vZV+p0srsM4 NvSdryprkqYxkgzju/Q/Mx5cPpHFiR/2fMn/Q= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:in-reply-to:references:from:date :message-id:subject:to:cc; bh=zKwettSGWKj2x4NqhuP+A4P1rtEWdUJDTEG6ZX65Zz8=; b=YF7x573DAx/G4yrtygGg452/Fs948SWeemDB+XDOJv+oswIHo5hYbgDr4X603HWN6O Bcg0tXbCsdmmOGXbHU+rejbCCglHviZxK004cWjqKovuCIBVrFu+IZx+xg/IFDX1qt0k idZYZFoC4Xs9MAnNf5c9+4HGY+xVBsyVE2BSd0uQFfJp85RHb4HcnRhn2NxH9UvTC2Or EWVyX3BatCgbY67HI2vyTWO5rafl3SWreP/gHkz5gUd+X/sq/4BXENGIPBb9RHUNwe9j u8rn0bkH6Mn+TqPmFP9y+qEUz6CttTGhjS7TYZTXZU4uFoZuNgajqbURKF6RMEucAs7n cioA== X-Gm-Message-State: AODbwcBqcqt18f6XRSSR1wzmwaOOdwViJkVgKretptZNZxntMF2oGWdO 6DSGuYP2Uj7IAMWamF5wiwUaHH0zLUyl X-Received: by 10.107.180.130 with SMTP id d124mr27147494iof.47.1495557747108; Tue, 23 May 2017 09:42:27 -0700 (PDT) MIME-Version: 1.0 Received: by 10.107.164.24 with HTTP; Tue, 23 May 2017 09:42:26 -0700 (PDT) In-Reply-To: <1495556147-6883-1-git-send-email-stelford@cadence.com> References: <1495556147-6883-1-git-send-email-stelford@cadence.com> From: Ard Biesheuvel Date: Tue, 23 May 2017 09:42:26 -0700 Message-ID: To: Scott Telford Cc: "edk2-devel@lists.01.org" , "Tian, Feng" , "Zeng, Star" Subject: Re: [PATCH] Copy bus scanning workaround from ARM Juno PCIe driver. X-BeenThere: edk2-devel@lists.01.org X-Mailman-Version: 2.1.22 Precedence: list List-Id: EDK II Development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 23 May 2017 16:42:28 -0000 Content-Type: text/plain; charset="UTF-8" On 23 May 2017 at 09:15, Scott Telford 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 > --- > 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 > edk2-devel@lists.01.org > https://lists.01.org/mailman/listinfo/edk2-devel