diff options
author | Bjorn Helgaas <bhelgaas@google.com> | 2019-11-28 17:54:44 +0300 |
---|---|---|
committer | Bjorn Helgaas <bhelgaas@google.com> | 2019-11-28 17:54:44 +0300 |
commit | 132c4a6b544a37cc8cd91f166c9bebe80c4abcee (patch) | |
tree | 3c19cae6a0c416f5e408af7d3997f0b5ff1f5867 /drivers/pci/controller | |
parent | 4eb87ddf390e5fdbaa973a981d0f1f7887b7f65a (diff) | |
parent | 9415743e4c8a029bfa46654e3a0a681a8db473f8 (diff) | |
download | linux-132c4a6b544a37cc8cd91f166c9bebe80c4abcee.tar.xz |
Merge branch 'remotes/lorenzo/pci/iproc'
- Invalidate iProc PAXB address mapping before programming it (Abhishek
Shah)
* remotes/lorenzo/pci/iproc:
PCI: iproc: Invalidate PAXB address mapping before programming it
Diffstat (limited to 'drivers/pci/controller')
-rw-r--r-- | drivers/pci/controller/pcie-iproc.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/drivers/pci/controller/pcie-iproc.c b/drivers/pci/controller/pcie-iproc.c index 2d457bfdaf66..9a5c35225944 100644 --- a/drivers/pci/controller/pcie-iproc.c +++ b/drivers/pci/controller/pcie-iproc.c @@ -1245,6 +1245,32 @@ out: return ret; } +static void iproc_pcie_invalidate_mapping(struct iproc_pcie *pcie) +{ + struct iproc_pcie_ib *ib = &pcie->ib; + struct iproc_pcie_ob *ob = &pcie->ob; + int idx; + + if (pcie->ep_is_internal) + return; + + if (pcie->need_ob_cfg) { + /* iterate through all OARR mapping regions */ + for (idx = ob->nr_windows - 1; idx >= 0; idx--) { + iproc_pcie_write_reg(pcie, + MAP_REG(IPROC_PCIE_OARR0, idx), 0); + } + } + + if (pcie->need_ib_cfg) { + /* iterate through all IARR mapping regions */ + for (idx = 0; idx < ib->nr_regions; idx++) { + iproc_pcie_write_reg(pcie, + MAP_REG(IPROC_PCIE_IARR0, idx), 0); + } + } +} + static int iproce_pcie_get_msi(struct iproc_pcie *pcie, struct device_node *msi_node, u64 *msi_addr) @@ -1517,6 +1543,8 @@ int iproc_pcie_setup(struct iproc_pcie *pcie, struct list_head *res) iproc_pcie_perst_ctrl(pcie, true); iproc_pcie_perst_ctrl(pcie, false); + iproc_pcie_invalidate_mapping(pcie); + if (pcie->need_ob_cfg) { ret = iproc_pcie_map_ranges(pcie, res); if (ret) { |