Commit 8c53e8ed authored by Phil Edworthy's avatar Phil Edworthy Committed by Bjorn Helgaas

PCI: rcar: Fix I/O offset for multiple host bridges

Fix I/O offset for multiple host bridges.
Signed-off-by: default avatarPhil Edworthy <phil.edworthy@renesas.com>
Signed-off-by: default avatarBjorn Helgaas <bhelgaas@google.com>
Acked-by: default avatarSimon Horman <horms+renesas@verge.net.au>
parent 42175a35
...@@ -108,6 +108,8 @@ ...@@ -108,6 +108,8 @@
#define RCAR_PCI_MAX_RESOURCES 4 #define RCAR_PCI_MAX_RESOURCES 4
#define MAX_NR_INBOUND_MAPS 6 #define MAX_NR_INBOUND_MAPS 6
static unsigned long global_io_offset;
struct rcar_msi { struct rcar_msi {
DECLARE_BITMAP(used, INT_PCI_MSI_NR); DECLARE_BITMAP(used, INT_PCI_MSI_NR);
struct irq_domain *domain; struct irq_domain *domain;
...@@ -357,7 +359,7 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie) ...@@ -357,7 +359,7 @@ static void rcar_pcie_setup_window(int win, struct rcar_pcie *pcie)
rcar_pci_write_reg(pcie, mask, PCIEPTCTLR(win)); rcar_pci_write_reg(pcie, mask, PCIEPTCTLR(win));
} }
static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie *pcie) static int rcar_pcie_setup(struct list_head *resource, struct rcar_pcie *pcie)
{ {
struct resource *res; struct resource *res;
int i; int i;
...@@ -375,7 +377,8 @@ static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie ...@@ -375,7 +377,8 @@ static int rcar_pcie_setup(int nr, struct list_head *resource, struct rcar_pcie
if (res->flags & IORESOURCE_IO) { if (res->flags & IORESOURCE_IO) {
phys_addr_t io_start = pci_pio_to_address(res->start); phys_addr_t io_start = pci_pio_to_address(res->start);
pci_ioremap_io(nr * SZ_64K, io_start); pci_ioremap_io(global_io_offset, io_start);
global_io_offset += SZ_64K;
} }
pci_add_resource(resource, res); pci_add_resource(resource, res);
...@@ -390,7 +393,7 @@ static int rcar_pcie_enable(struct rcar_pcie *pcie) ...@@ -390,7 +393,7 @@ static int rcar_pcie_enable(struct rcar_pcie *pcie)
struct pci_bus *bus, *child; struct pci_bus *bus, *child;
LIST_HEAD(res); LIST_HEAD(res);
rcar_pcie_setup(1, &res, pcie); rcar_pcie_setup(&res, pcie);
/* Do not reassign resources if probe only */ /* Do not reassign resources if probe only */
if (!pci_has_flag(PCI_PROBE_ONLY)) if (!pci_has_flag(PCI_PROBE_ONLY))
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment