diff options
| author | Shradha Todi <[email protected]> | 2021-02-02 07:28:38 +0000 |
|---|---|---|
| committer | Bjorn Helgaas <[email protected]> | 2021-02-24 17:09:50 +0000 |
| commit | 5b4cf0f6532434537818e4a3c656b9f11c81729b (patch) | |
| tree | 53b583f09239609d67aac32febcde7b804056053 /drivers/pci/controller/dwc/pcie-designware.c | |
| parent | PCI: dwc: Change size to u64 for EP outbound iATU (diff) | |
| download | kernel-5b4cf0f6532434537818e4a3c656b9f11c81729b.tar.gz kernel-5b4cf0f6532434537818e4a3c656b9f11c81729b.zip | |
PCI: dwc: Add upper limit address for outbound iATU
The size parameter is unsigned long type which can accept size > 4GB. In
that case, the upper limit address must be programmed. Add support to
program the upper limit address and set INCREASE_REGION_SIZE in case size >
4GB.
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Shradha Todi <[email protected]>
Signed-off-by: Lorenzo Pieralisi <[email protected]>
Signed-off-by: Bjorn Helgaas <[email protected]>
Reviewed-by: Pankaj Dubey <[email protected]>
Reviewed-by: Rob Herring <[email protected]>
Diffstat (limited to 'drivers/pci/controller/dwc/pcie-designware.c')
| -rw-r--r-- | drivers/pci/controller/dwc/pcie-designware.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/drivers/pci/controller/dwc/pcie-designware.c b/drivers/pci/controller/dwc/pcie-designware.c index e7b9a7d7c9a2..fb637830bc71 100644 --- a/drivers/pci/controller/dwc/pcie-designware.c +++ b/drivers/pci/controller/dwc/pcie-designware.c @@ -333,11 +333,16 @@ static void __dw_pcie_prog_outbound_atu(struct dw_pcie *pci, u8 func_no, upper_32_bits(cpu_addr)); dw_pcie_writel_dbi(pci, PCIE_ATU_LIMIT, lower_32_bits(cpu_addr + size - 1)); + if (pci->version >= 0x460A) + dw_pcie_writel_dbi(pci, PCIE_ATU_UPPER_LIMIT, + upper_32_bits(cpu_addr + size - 1)); dw_pcie_writel_dbi(pci, PCIE_ATU_LOWER_TARGET, lower_32_bits(pci_addr)); dw_pcie_writel_dbi(pci, PCIE_ATU_UPPER_TARGET, upper_32_bits(pci_addr)); val = type | PCIE_ATU_FUNC_NUM(func_no); + val = ((upper_32_bits(size - 1)) && (pci->version >= 0x460A)) ? + val | PCIE_ATU_INCREASE_REGION_SIZE : val; if (pci->version == 0x490A) val = dw_pcie_enable_ecrc(val); dw_pcie_writel_dbi(pci, PCIE_ATU_CR1, val); |
