summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrea della Porta <[email protected]>2026-06-01 12:39:23 +0200
committerPeter Robinson <[email protected]>2026-06-04 10:50:04 +0100
commitb24c620e5e129277d50cceac2d758e8c5bf53293 (patch)
tree90ac0951070797a9a4a6b3d2cff84a45070de1a5
parentb20ce94bb9d06c0bffe6cf0b2795fb021f7c0052 (diff)
pci: brcmstb: Fix PCIe bus numbers
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 <[email protected]> Signed-off-by: Torsten Duwe <[email protected]> Tested-by: Pedro Falcato <[email protected]> Reviewed-by: Peter Robinson <[email protected]>
-rw-r--r--drivers/pci/pcie_brcmstb.c2
1 files changed, 1 insertions, 1 deletions
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;