]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
PCI: mobiveil: Fix PCI base address in MEM/IO outbound windows
authorHou Zhiqiang <Zhiqiang.Hou@nxp.com>
Fri, 5 Jul 2019 09:56:31 +0000 (17:56 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 31 Jul 2019 05:24:47 +0000 (07:24 +0200)
[ Upstream commit f99536e9d2f55996038158a6559d4254a7cc1693 ]

The outbound memory windows PCI base addresses should be taken
from the 'ranges' property of DT node to setup MEM/IO outbound
windows decoding correctly instead of being hardcoded to zero.

Update the code to retrieve the PCI base address for each range
and use it to program the outbound windows address decoders

Fixes: 9af6bcb11e12 ("PCI: mobiveil: Add Mobiveil PCIe Host Bridge IP driver")
Signed-off-by: Hou Zhiqiang <Zhiqiang.Hou@nxp.com>
Signed-off-by: Lorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Reviewed-by: Minghuan Lian <Minghuan.Lian@nxp.com>
Reviewed-by: Subrahmanya Lingappa <l.subrahmanya@mobiveil.co.in>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/pci/controller/pcie-mobiveil.c

index 77052a0712d042ad4344244f954220ebd5e87f21..03d697b63e2aaefa29c99f96cf7c89ed02ba8599 100644 (file)
@@ -552,8 +552,9 @@ static int mobiveil_host_init(struct mobiveil_pcie *pcie)
                if (type) {
                        /* configure outbound translation window */
                        program_ob_windows(pcie, pcie->ob_wins_configured,
-                               win->res->start, 0, type,
-                               resource_size(win->res));
+                                          win->res->start,
+                                          win->res->start - win->offset,
+                                          type, resource_size(win->res));
                }
        }