Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 30F6CFF8868 for ; Tue, 28 Apr 2026 16:43:39 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 027E384669; Tue, 28 Apr 2026 18:43:24 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=lst.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id A0642845D8; Tue, 28 Apr 2026 18:39:29 +0200 (CEST) Received: from verein.lst.de (verein.lst.de [213.95.11.211]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 3B7B4842C7 for ; Tue, 28 Apr 2026 18:39:25 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=lst.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=duwe@lst.de Received: by verein.lst.de (Postfix, from userid 2005) id 977E668CFE; Tue, 28 Apr 2026 18:39:22 +0200 (CEST) Subject: [PATCH v2 2/9] pci: brcmstb: Fix PCIe bus numbers To: Peter Robinson , Matthias Brugger Cc: Tom Rini ,"Jan Čermák" ,Andrea della Porta ,"Ivan T. Ivanov" , Stanimir Varbanov , Oleksii Moisieiev , Volodymyr Babchuk , Marek Vasut ,Paul Barker ,Patrice Chotard ,Christian Marangi ,Patrick Delaunay ,Huan Zhou ,Gabriel Fernandez ,Kever Yang ,Jonas Karlman ,Joseph Chen ,Elaine Zhang , Pedro Falcato ,u-boot@lists.denx.de In-Reply-To: <20260428162319.99B4268B05@verein.lst.de> Message-Id: <20260428163922.977E668CFE@verein.lst.de> Date: Tue, 28 Apr 2026 18:39:22 +0200 (CEST) From: duwe@lst.de (Torsten Duwe) X-Mailman-Approved-At: Tue, 28 Apr 2026 18:43:21 +0200 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.8 at phobos.denx.de X-Virus-Status: Clean From: Andrea della Porta The linux kernel assigns a new domain for every Root Complex where bus numbering starts from 0 for each domain. U-Boot does not have domains and uses a flattened bus numbering scheme instead. This means that any device or bridge on the second enumerated RC will receive a bus number equal to the last assigned one +1. This bus number contributes to the address written into the index register, which will select the configuration space to be read. Compensate for this contribution by subtracting the base bus number. Signed-off-by: Andrea della Porta Signed-off-by: Torsten Duwe Tested-by: Pedro Falcato --- drivers/pci/pcie_brcmstb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/pci/pcie_brcmstb.c b/drivers/pci/pcie_brcmstb.c index f089c48f028..47c0802df23 100644 --- a/drivers/pci/pcie_brcmstb.c +++ b/drivers/pci/pcie_brcmstb.c @@ -125,7 +125,7 @@ static int brcm_pcie_config_address(const struct udevice *dev, pci_dev_t bdf, uint offset, void **paddress) { struct brcm_pcie *pcie = dev_get_priv(dev); - unsigned int pci_bus = PCI_BUS(bdf); + unsigned int pci_bus = PCI_BUS(bdf) - dev_seq(dev); unsigned int pci_dev = PCI_DEV(bdf); unsigned int pci_func = PCI_FUNC(bdf); int idx; -- 2.54.0