linux-arm-kernel.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
* [RESEND PATCH next v2 0/2] soc: ti: k3: ringacc: add am65x sr2.0 support
@ 2020-09-09 19:43 Grygorii Strashko
  2020-09-09 19:43 ` [RESEND PATCH next v2 1/2] " Grygorii Strashko
  2020-09-09 19:43 ` [RESEND PATCH next v2 2/2] bindings: soc: ti: soc: ringacc: remove ti, dma-ring-reset-quirk Grygorii Strashko
  0 siblings, 2 replies; 3+ messages in thread
From: Grygorii Strashko @ 2020-09-09 19:43 UTC (permalink / raw)
  To: Tero Kristo, Nishanth Menon, Santosh Shilimkar, santosh.shilimkar
  Cc: Grygorii Strashko, Sekhar Nori, linux-kernel, Peter Ujfalusi,
	Rob Herring, linux-arm-kernel

soc: ti: k3: ringacc: add am65x sr2.0 support

Hi Santosh,

This is re-send of v2 with DT patch dropped.

---
This series adds support for the TI AM65x SR2.0 SoC Ringacc which has fixed
errata i2023 "RINGACC, UDMA: RINGACC and UDMA Ring State Interoperability
Issue after Channel Teardown". This errata also fixed for J271E SoC.
The SOC bus chipinfo data is used to identify the SoC and configure
i2023 errata W/A.

This changes made "ti,dma-ring-reset-quirk" DT property obsolete, so it's removed.

Changes in v2:
 - no functional changes
 - rebased on top of linux-next
 - added ask from Rob Herring

v2: https://lore.kernel.org/patchwork/cover/1297255/
v1: https://lore.kernel.org/patchwork/cover/1284233/

Grygorii Strashko (2):
  soc: ti: k3: ringacc: add am65x sr2.0 support
  bindings: soc: ti: soc: ringacc: remove ti,dma-ring-reset-quirk

 .../bindings/soc/ti/k3-ringacc.yaml           |  6 ----
 drivers/soc/ti/k3-ringacc.c                   | 33 +++++++++++++++++--
 2 files changed, 30 insertions(+), 9 deletions(-)

-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [RESEND PATCH next v2 1/2] soc: ti: k3: ringacc: add am65x sr2.0 support
  2020-09-09 19:43 [RESEND PATCH next v2 0/2] soc: ti: k3: ringacc: add am65x sr2.0 support Grygorii Strashko
@ 2020-09-09 19:43 ` Grygorii Strashko
  2020-09-09 19:43 ` [RESEND PATCH next v2 2/2] bindings: soc: ti: soc: ringacc: remove ti, dma-ring-reset-quirk Grygorii Strashko
  1 sibling, 0 replies; 3+ messages in thread
From: Grygorii Strashko @ 2020-09-09 19:43 UTC (permalink / raw)
  To: Tero Kristo, Nishanth Menon, Santosh Shilimkar, santosh.shilimkar
  Cc: Grygorii Strashko, Sekhar Nori, linux-kernel, Peter Ujfalusi,
	Rob Herring, linux-arm-kernel

The AM65x SR2.0 Ringacc has fixed errata i2023 "RINGACC, UDMA: RINGACC and
UDMA Ring State Interoperability Issue after Channel Teardown". This errata
also fixed for J271E SoC.

Use SOC bus data for K3 SoC identification and enable i2023 errate w/a only
for the AM65x SR1.0. This also makes obsolete "ti,dma-ring-reset-quirk" DT
property.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 drivers/soc/ti/k3-ringacc.c | 33 ++++++++++++++++++++++++++++++---
 1 file changed, 30 insertions(+), 3 deletions(-)

diff --git a/drivers/soc/ti/k3-ringacc.c b/drivers/soc/ti/k3-ringacc.c
index 6dcc21dde0cb..1147dc4c1d59 100644
--- a/drivers/soc/ti/k3-ringacc.c
+++ b/drivers/soc/ti/k3-ringacc.c
@@ -10,6 +10,7 @@
 #include <linux/init.h>
 #include <linux/of.h>
 #include <linux/platform_device.h>
+#include <linux/sys_soc.h>
 #include <linux/soc/ti/k3-ringacc.h>
 #include <linux/soc/ti/ti_sci_protocol.h>
 #include <linux/soc/ti/ti_sci_inta_msi.h>
@@ -208,6 +209,15 @@ struct k3_ringacc {
 	const struct k3_ringacc_ops *ops;
 };
 
+/**
+ * struct k3_ringacc - Rings accelerator SoC data
+ *
+ * @dma_ring_reset_quirk:  DMA reset w/a enable
+ */
+struct k3_ringacc_soc_data {
+	unsigned dma_ring_reset_quirk:1;
+};
+
 static long k3_ringacc_ring_get_fifo_pos(struct k3_ring *ring)
 {
 	return K3_RINGACC_FIFO_WINDOW_SIZE_BYTES -
@@ -1051,9 +1061,6 @@ static int k3_ringacc_probe_dt(struct k3_ringacc *ringacc)
 		return ret;
 	}
 
-	ringacc->dma_ring_reset_quirk =
-			of_property_read_bool(node, "ti,dma-ring-reset-quirk");
-
 	ringacc->tisci = ti_sci_get_by_phandle(node, "ti,sci");
 	if (IS_ERR(ringacc->tisci)) {
 		ret = PTR_ERR(ringacc->tisci);
@@ -1084,9 +1091,22 @@ static int k3_ringacc_probe_dt(struct k3_ringacc *ringacc)
 						 ringacc->rm_gp_range);
 }
 
+static const struct k3_ringacc_soc_data k3_ringacc_soc_data_sr1 = {
+	.dma_ring_reset_quirk = 1,
+};
+
+static const struct soc_device_attribute k3_ringacc_socinfo[] = {
+	{ .family = "AM65X",
+	  .revision = "SR1.0",
+	  .data = &k3_ringacc_soc_data_sr1
+	},
+	{/* sentinel */}
+};
+
 static int k3_ringacc_init(struct platform_device *pdev,
 			   struct k3_ringacc *ringacc)
 {
+	const struct soc_device_attribute *soc;
 	void __iomem *base_fifo, *base_rt;
 	struct device *dev = &pdev->dev;
 	struct resource *res;
@@ -1103,6 +1123,13 @@ static int k3_ringacc_init(struct platform_device *pdev,
 	if (ret)
 		return ret;
 
+	soc = soc_device_match(k3_ringacc_socinfo);
+	if (soc && soc->data) {
+		const struct k3_ringacc_soc_data *soc_data = soc->data;
+
+		ringacc->dma_ring_reset_quirk = soc_data->dma_ring_reset_quirk;
+	}
+
 	res = platform_get_resource_byname(pdev, IORESOURCE_MEM, "rt");
 	base_rt = devm_ioremap_resource(dev, res);
 	if (IS_ERR(base_rt))
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

* [RESEND PATCH next v2 2/2] bindings: soc: ti: soc: ringacc: remove ti, dma-ring-reset-quirk
  2020-09-09 19:43 [RESEND PATCH next v2 0/2] soc: ti: k3: ringacc: add am65x sr2.0 support Grygorii Strashko
  2020-09-09 19:43 ` [RESEND PATCH next v2 1/2] " Grygorii Strashko
@ 2020-09-09 19:43 ` Grygorii Strashko
  1 sibling, 0 replies; 3+ messages in thread
From: Grygorii Strashko @ 2020-09-09 19:43 UTC (permalink / raw)
  To: Tero Kristo, Nishanth Menon, Santosh Shilimkar, santosh.shilimkar
  Cc: Grygorii Strashko, Sekhar Nori, linux-kernel, Peter Ujfalusi,
	Rob Herring, linux-arm-kernel

Remove "ti,dma-ring-reset-quirk" DT property as proper w/a handling is
implemented now in Ringacc driver using SoC info.

Signed-off-by: Grygorii Strashko <grygorii.strashko@ti.com>
---
 Documentation/devicetree/bindings/soc/ti/k3-ringacc.yaml | 6 ------
 1 file changed, 6 deletions(-)

diff --git a/Documentation/devicetree/bindings/soc/ti/k3-ringacc.yaml b/Documentation/devicetree/bindings/soc/ti/k3-ringacc.yaml
index ae33fc957141..c3c595e235a8 100644
--- a/Documentation/devicetree/bindings/soc/ti/k3-ringacc.yaml
+++ b/Documentation/devicetree/bindings/soc/ti/k3-ringacc.yaml
@@ -62,11 +62,6 @@ properties:
     $ref: /schemas/types.yaml#/definitions/uint32
     description: TI-SCI device id of the ring accelerator
 
-  ti,dma-ring-reset-quirk:
-    $ref: /schemas/types.yaml#definitions/flag
-    description: |
-      enable ringacc/udma ring state interoperability issue software w/a
-
 required:
   - compatible
   - reg
@@ -94,7 +89,6 @@ examples:
             reg-names = "rt", "fifos", "proxy_gcfg", "proxy_target";
             ti,num-rings = <818>;
             ti,sci-rm-range-gp-rings = <0x2>; /* GP ring range */
-            ti,dma-ring-reset-quirk;
             ti,sci = <&dmsc>;
             ti,sci-dev-id = <187>;
             msi-parent = <&inta_main_udmass>;
-- 
2.17.1


_______________________________________________
linux-arm-kernel mailing list
linux-arm-kernel@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-arm-kernel

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

end of thread, other threads:[~2020-09-09 19:45 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-09-09 19:43 [RESEND PATCH next v2 0/2] soc: ti: k3: ringacc: add am65x sr2.0 support Grygorii Strashko
2020-09-09 19:43 ` [RESEND PATCH next v2 1/2] " Grygorii Strashko
2020-09-09 19:43 ` [RESEND PATCH next v2 2/2] bindings: soc: ti: soc: ringacc: remove ti, dma-ring-reset-quirk Grygorii Strashko

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).