On 3/13/2020 12:04 PM, Vladimir Oltean wrote:
From: Vladimir Oltean <[email protected]>

The pci-host-ecam-generic code assumes that the ECAM is the first PCI
bus in the system to be probed. Therefore, the system-wide bus number
allocated by U-Boot in sequence for it is going to be zero, which
corresponds to the memory-mapped config spaces found within it.

Reuse the logic from other PCI bus drivers, and assume that U-Boot will
allocate bus numbers in sequence for all buses within the current ECAM.
So the base number of the bus needs to be subtracted when indexing the
correct config space.

Fixes: 3675cb044e68 ("PCI: Add driver for a 'pci-host-ecam-generic' host 
controller")
Signed-off-by: Vladimir Oltean <[email protected]>
---
  drivers/pci/pcie_ecam_generic.c | 36 +++++++++++++++++++++++++++++----
  1 file changed, 32 insertions(+), 4 deletions(-)


Reviewed-by: Alex Marginean <[email protected]>

Reply via email to