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)
committerLorenzo Pieralisi <lorenzo.pieralisi@arm.com>
Mon, 8 Jul 2019 10:23:13 +0000 (11:23 +0100)
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>
drivers/pci/controller/pcie-mobiveil.c

index e5819029ad8e6313cf91458c728443366a52982a..53df31700551f6f32c3a1f70d3128e4c1f7ee3d7 100644 (file)
@@ -621,8 +621,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));
                }
        }