PCI: keystone: Fix outbound region mapping
authorYurii Monakov <monakov.y@gmail.com>
Fri, 4 Oct 2019 15:48:11 +0000 (18:48 +0300)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Fri, 10 Jan 2020 17:25:47 +0000 (17:25 +0000)
The Keystone outbound Address Translation Unit (ATU) maps PCI MMIO space in
8 MB windows.  When programming the ATU windows, we previously incremented
the starting address by 8, not 8 MB, so all the windows were mapped to the
first 8 MB.  Therefore, only 8 MB of MMIO space was accessible.

Update the loop so it increments the starting address by 8 MB, not 8, so
more MMIO space is accessible.

Fixes: e75043ad9792 ("PCI: keystone: Cleanup outbound window configuration")
Link: https://lore.kernel.org/r/20191004154811.GA31397@monakov-y.office.kontur-niirs.ru
Signed-off-by: Yurii Monakov <monakov.y@gmail.com>
[bhelgaas: commit log]
Signed-off-by: Bjorn Helgaas <bhelgaas@google.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Acked-by: Andrew Murray <andrew.murray@arm.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
Cc: stable@vger.kernel.org # v4.20+
drivers/pci/controller/dwc/pci-keystone.c

index d4de4f6cff8b907b972f30cd45fb18d1fbfd0db4..ea8e7ebd8c4f8b4d8b64e2de790891881f981502 100644 (file)
@@ -422,7 +422,7 @@ static void ks_pcie_setup_rc_app_regs(struct keystone_pcie *ks_pcie)
                                   lower_32_bits(start) | OB_ENABLEN);
                ks_pcie_app_writel(ks_pcie, OB_OFFSET_HI(i),
                                   upper_32_bits(start));
-               start += OB_WIN_SIZE;
+               start += OB_WIN_SIZE * SZ_1M;
        }
 
        val = ks_pcie_app_readl(ks_pcie, CMD_STATUS);