aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/pci/controller/dwc/pcie-designware.h
diff options
context:
space:
mode:
authorRob Herring <[email protected]>2020-11-05 21:11:59 +0000
committerLorenzo Pieralisi <[email protected]>2020-11-19 10:51:41 +0000
commit281f1f99cf3a761b45f611943721dfb1895c68a3 (patch)
treea5333f35268b2673d19f73ba5fbf5025abf56b22 /drivers/pci/controller/dwc/pcie-designware.h
parentPCI: dwc: Move inbound and outbound windows to common struct (diff)
downloadkernel-281f1f99cf3a761b45f611943721dfb1895c68a3.tar.gz
kernel-281f1f99cf3a761b45f611943721dfb1895c68a3.zip
PCI: dwc: Detect number of iATU windows
Currently the number of inbound and outbound iATU windows are determined from DT properties. Unfortunately, there's 'num-viewport' for RC mode and 'num-ib-windows' and 'num-ob-windows' for EP mode, yet the number of windows is not mode dependent. Also, 'num-viewport' is not clear whether that's inbound, outbound or both. We can probably assume it's outbound windows as that's all RC mode uses. However, using DT properties isn't really needed as the number of regions can be detected at runtime by poking the iATU registers. The basic algorithm is just writing a target address and reading back what we wrote. In the unrolled ATU case, we have to take care not to go past the mapped region. With this, we can drop num_viewport in favor of num_ob_windows instead. Link: https://lore.kernel.org/r/[email protected] Tested-by: Marek Szyprowski <[email protected]> Signed-off-by: Rob Herring <[email protected]> Signed-off-by: Lorenzo Pieralisi <[email protected]> Cc: Jingoo Han <[email protected]> Cc: Gustavo Pimentel <[email protected]> Cc: Lorenzo Pieralisi <[email protected]> Cc: Bjorn Helgaas <[email protected]> Cc: Thierry Reding <[email protected]> Cc: Jonathan Hunter <[email protected]> Cc: [email protected]
Diffstat (limited to 'drivers/pci/controller/dwc/pcie-designware.h')
-rw-r--r--drivers/pci/controller/dwc/pcie-designware.h2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware.h b/drivers/pci/controller/dwc/pcie-designware.h
index ed90eaf36f0f..0207840756c4 100644
--- a/drivers/pci/controller/dwc/pcie-designware.h
+++ b/drivers/pci/controller/dwc/pcie-designware.h
@@ -261,7 +261,7 @@ struct dw_pcie {
void __iomem *dbi_base2;
/* Used when iatu_unroll_enabled is true */
void __iomem *atu_base;
- u32 num_viewport;
+ size_t atu_size;
u32 num_ib_windows;
u32 num_ob_windows;
struct pcie_port pp;