[PATCH v2 2/9] pci: brcmstb: Fix PCIe bus numbers

Peter Robinson pbrobinson at gmail.com
Wed May 6 13:00:17 CEST 2026


On Tue, 28 Apr 2026 at 17:39, Torsten Duwe <duwe at lst.de> wrote:
>
> From: Andrea della Porta <andrea.porta at suse.com>
>
> 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 <andrea.porta at suse.com>
> Signed-off-by: Torsten Duwe <duwe at suse.de>
> Tested-by: Pedro Falcato <pfalcato at suse.de>
Reviewed-by: Peter Robinson <pbrobinson at gmail.com>
> ---
>  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
>


More information about the U-Boot mailing list