linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v5 0/2] pci-dra7xx: Enable errata i870 workaround for RC mode
@ 2018-09-25  8:30 Vignesh R
  2018-09-25  8:30 ` [PATCH v5 1/2] dt-bindings: PCI: dra7xx: Add bindings for unaligned access in host mode Vignesh R
                   ` (2 more replies)
  0 siblings, 3 replies; 4+ messages in thread
From: Vignesh R @ 2018-09-25  8:30 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Kishon Vijay Abraham I, Bjorn Helgaas, Rob Herring, linux-omap,
	linux-pci, devicetree, linux-kernel, Vignesh R

Make workaround for errata i870 applicable in Host mode as
well(previously it was enabled only for EP mode) as per errata
documentation: http://www.ti.com/lit/er/sprz450/sprz450.pdf
Driver will continue to work with w/o applying errata in host mode when
using older DT, to maintain backward compatibility.

Tested on DRA72 EVM

Changes since v4:
Fail driver probe if DT binding is absent for EP(as it is in current
code)

Changes since v3:
Rebase onto latest next
Drop DT patches from this series. They will be sent separately once
driver changes in this series is merged.

Changes since v2:
Reorder patch 2 to appear at the last.
Collect all the ACKs

Changes since v1:
Drop IRQ handling rework (will be sent out separately)


Vignesh R (2):
  dt-bindings: PCI: dra7xx: Add bindings for unaligned access in host
    mode
  pci: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode

 Documentation/devicetree/bindings/pci/ti-pci.txt |  5 +++++
 drivers/pci/controller/dwc/pci-dra7xx.c          | 11 ++++++++---
 2 files changed, 13 insertions(+), 3 deletions(-)

-- 
2.19.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* [PATCH v5 1/2] dt-bindings: PCI: dra7xx: Add bindings for unaligned access in host mode
  2018-09-25  8:30 [PATCH v5 0/2] pci-dra7xx: Enable errata i870 workaround for RC mode Vignesh R
@ 2018-09-25  8:30 ` Vignesh R
  2018-09-25  8:30 ` [PATCH v5 2/2] pci: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode Vignesh R
  2018-09-25  9:59 ` [PATCH v5 0/2] pci-dra7xx: Enable errata i870 workaround for " Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Vignesh R @ 2018-09-25  8:30 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Kishon Vijay Abraham I, Bjorn Helgaas, Rob Herring, linux-omap,
	linux-pci, devicetree, linux-kernel, Vignesh R

Update device tree binding documentation of TI's dra7xx PCI controller
for enabling unaligned mem access as applicable not just in EP mode but
in host mode as well.

Signed-off-by: Vignesh R <vigneshr@ti.com>
Reviewed-by: Rob Herring <robh@kernel.org>
---
 Documentation/devicetree/bindings/pci/ti-pci.txt | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/Documentation/devicetree/bindings/pci/ti-pci.txt b/Documentation/devicetree/bindings/pci/ti-pci.txt
index 7f7af3044016..452fe48c4fdd 100644
--- a/Documentation/devicetree/bindings/pci/ti-pci.txt
+++ b/Documentation/devicetree/bindings/pci/ti-pci.txt
@@ -26,6 +26,11 @@ HOST MODE
    ranges,
    interrupt-map-mask,
    interrupt-map : as specified in ../designware-pcie.txt
+ - ti,syscon-unaligned-access: phandle to the syscon DT node. The 1st argument
+			       should contain the register offset within syscon
+			       and the 2nd argument should contain the bit field
+			       for setting the bit to enable unaligned
+			       access.
 
 DEVICE MODE
 ===========
-- 
2.19.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [PATCH v5 2/2] pci: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode
  2018-09-25  8:30 [PATCH v5 0/2] pci-dra7xx: Enable errata i870 workaround for RC mode Vignesh R
  2018-09-25  8:30 ` [PATCH v5 1/2] dt-bindings: PCI: dra7xx: Add bindings for unaligned access in host mode Vignesh R
@ 2018-09-25  8:30 ` Vignesh R
  2018-09-25  9:59 ` [PATCH v5 0/2] pci-dra7xx: Enable errata i870 workaround for " Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Vignesh R @ 2018-09-25  8:30 UTC (permalink / raw)
  To: Lorenzo Pieralisi
  Cc: Kishon Vijay Abraham I, Bjorn Helgaas, Rob Herring, linux-omap,
	linux-pci, devicetree, linux-kernel, Vignesh R

Errata i870 is applicable in both EP and RC mode. Therefore rename
function dra7xx_pcie_ep_unaligned_memaccess(), that implements errata
workaround, to dra7xx_pcie_unaligned_memaccess() and call it for both RC
and EP. Make sure driver probe does not fail in case workaround is not
applied for RC mode so as to maintain DT backward compatibility.

Reported-by: Chris Welch <Chris.Welch@viavisolutions.com>
Signed-off-by: Vignesh R <vigneshr@ti.com>
Acked-by: Kishon Vijay Abraham I <kishon@ti.com>
---
 drivers/pci/controller/dwc/pci-dra7xx.c | 11 ++++++++---
 1 file changed, 8 insertions(+), 3 deletions(-)

diff --git a/drivers/pci/controller/dwc/pci-dra7xx.c b/drivers/pci/controller/dwc/pci-dra7xx.c
index ce9224a36f62..a32d6dde7a57 100644
--- a/drivers/pci/controller/dwc/pci-dra7xx.c
+++ b/drivers/pci/controller/dwc/pci-dra7xx.c
@@ -542,7 +542,7 @@ static const struct of_device_id of_dra7xx_pcie_match[] = {
 };
 
 /*
- * dra7xx_pcie_ep_unaligned_memaccess: workaround for AM572x/AM571x Errata i870
+ * dra7xx_pcie_unaligned_memaccess: workaround for AM572x/AM571x Errata i870
  * @dra7xx: the dra7xx device where the workaround should be applied
  *
  * Access to the PCIe slave port that are not 32-bit aligned will result
@@ -552,7 +552,7 @@ static const struct of_device_id of_dra7xx_pcie_match[] = {
  *
  * To avoid this issue set PCIE_SS1_AXI2OCP_LEGACY_MODE_ENABLE to 1.
  */
-static int dra7xx_pcie_ep_unaligned_memaccess(struct device *dev)
+static int dra7xx_pcie_unaligned_memaccess(struct device *dev)
 {
 	int ret;
 	struct device_node *np = dev->of_node;
@@ -704,6 +704,11 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
 
 		dra7xx_pcie_writel(dra7xx, PCIECTRL_TI_CONF_DEVICE_TYPE,
 				   DEVICE_TYPE_RC);
+
+		ret = dra7xx_pcie_unaligned_memaccess(dev);
+		if (ret)
+			dev_err(dev, "WA for Errata i870 not applied\n");
+
 		ret = dra7xx_add_pcie_port(dra7xx, pdev);
 		if (ret < 0)
 			goto err_gpio;
@@ -717,7 +722,7 @@ static int __init dra7xx_pcie_probe(struct platform_device *pdev)
 		dra7xx_pcie_writel(dra7xx, PCIECTRL_TI_CONF_DEVICE_TYPE,
 				   DEVICE_TYPE_EP);
 
-		ret = dra7xx_pcie_ep_unaligned_memaccess(dev);
+		ret = dra7xx_pcie_unaligned_memaccess(dev);
 		if (ret)
 			goto err_gpio;
 
-- 
2.19.0


^ permalink raw reply related	[flat|nested] 4+ messages in thread

* Re: [PATCH v5 0/2] pci-dra7xx: Enable errata i870 workaround for RC mode
  2018-09-25  8:30 [PATCH v5 0/2] pci-dra7xx: Enable errata i870 workaround for RC mode Vignesh R
  2018-09-25  8:30 ` [PATCH v5 1/2] dt-bindings: PCI: dra7xx: Add bindings for unaligned access in host mode Vignesh R
  2018-09-25  8:30 ` [PATCH v5 2/2] pci: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode Vignesh R
@ 2018-09-25  9:59 ` Lorenzo Pieralisi
  2 siblings, 0 replies; 4+ messages in thread
From: Lorenzo Pieralisi @ 2018-09-25  9:59 UTC (permalink / raw)
  To: Vignesh R
  Cc: Kishon Vijay Abraham I, Bjorn Helgaas, Rob Herring, linux-omap,
	linux-pci, devicetree, linux-kernel

On Tue, Sep 25, 2018 at 02:00:22PM +0530, Vignesh R wrote:
> Make workaround for errata i870 applicable in Host mode as
> well(previously it was enabled only for EP mode) as per errata
> documentation: http://www.ti.com/lit/er/sprz450/sprz450.pdf
> Driver will continue to work with w/o applying errata in host mode when
> using older DT, to maintain backward compatibility.
> 
> Tested on DRA72 EVM
> 
> Changes since v4:
> Fail driver probe if DT binding is absent for EP(as it is in current
> code)
> 
> Changes since v3:
> Rebase onto latest next
> Drop DT patches from this series. They will be sent separately once
> driver changes in this series is merged.
> 
> Changes since v2:
> Reorder patch 2 to appear at the last.
> Collect all the ACKs
> 
> Changes since v1:
> Drop IRQ handling rework (will be sent out separately)
> 
> 
> Vignesh R (2):
>   dt-bindings: PCI: dra7xx: Add bindings for unaligned access in host
>     mode
>   pci: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode
> 
>  Documentation/devicetree/bindings/pci/ti-pci.txt |  5 +++++
>  drivers/pci/controller/dwc/pci-dra7xx.c          | 11 ++++++++---
>  2 files changed, 13 insertions(+), 3 deletions(-)

Applied to pci/dwc for v4.20, thanks.

Lorenzo

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2018-09-25  9:58 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-09-25  8:30 [PATCH v5 0/2] pci-dra7xx: Enable errata i870 workaround for RC mode Vignesh R
2018-09-25  8:30 ` [PATCH v5 1/2] dt-bindings: PCI: dra7xx: Add bindings for unaligned access in host mode Vignesh R
2018-09-25  8:30 ` [PATCH v5 2/2] pci: dwc: pci-dra7xx: Enable errata i870 for both EP and RC mode Vignesh R
2018-09-25  9:59 ` [PATCH v5 0/2] pci-dra7xx: Enable errata i870 workaround for " Lorenzo Pieralisi

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).