public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Vignesh Raghavendra <vigneshr@ti.com>
To: Tom Rini <trini@konsulko.com>, Dave Gerlach <d-gerlach@ti.com>,
	Lukasz Majewski <lukma@denx.de>,
	Sean Anderson <seanga2@gmail.com>, Peng Fan <peng.fan@nxp.com>,
	Jaehoon Chung <jh80.chung@samsung.com>
Cc: Simon Glass <sjg@chromium.org>,
	Vignesh Raghavendra <vigneshr@ti.com>, Suman Anna <s-anna@ti.com>,
	Nishanth Menon <nm@ti.com>,
	Aswath Govindraju <a-govindraju@ti.com>,
	Bryan Brattlof <bb@ti.com>, <u-boot@lists.denx.de>,
	Georgi Vlaev <g-vlaev@ti.com>
Subject: [PATCH 06/11] dma: ti: Add PSIL data for AM62x DMASS
Date: Fri, 15 Apr 2022 19:39:26 +0530	[thread overview]
Message-ID: <20220415140931.490047-7-vigneshr@ti.com> (raw)
In-Reply-To: <20220415140931.490047-1-vigneshr@ti.com>

Add PSIL data for AM62x SoC

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
---
 drivers/dma/ti/Makefile       |  1 +
 drivers/dma/ti/k3-psil-am62.c | 50 +++++++++++++++++++++++++++++++++++
 drivers/dma/ti/k3-psil-priv.h |  1 +
 drivers/dma/ti/k3-psil.c      |  2 ++
 4 files changed, 54 insertions(+)
 create mode 100644 drivers/dma/ti/k3-psil-am62.c

diff --git a/drivers/dma/ti/Makefile b/drivers/dma/ti/Makefile
index 6a4f4f1365..56f348700d 100644
--- a/drivers/dma/ti/Makefile
+++ b/drivers/dma/ti/Makefile
@@ -7,3 +7,4 @@ k3-psil-data-$(CONFIG_SOC_K3_AM6) += k3-psil-am654.o
 k3-psil-data-$(CONFIG_SOC_K3_J721E) += k3-psil-j721e.o
 k3-psil-data-$(CONFIG_SOC_K3_J721S2) += k3-psil-j721s2.o
 k3-psil-data-$(CONFIG_SOC_K3_AM642) += k3-psil-am64.o
+k3-psil-data-$(CONFIG_SOC_K3_AM625) += k3-psil-am62.o
diff --git a/drivers/dma/ti/k3-psil-am62.c b/drivers/dma/ti/k3-psil-am62.c
new file mode 100644
index 0000000000..9527da4cac
--- /dev/null
+++ b/drivers/dma/ti/k3-psil-am62.c
@@ -0,0 +1,50 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ *  Copyright (C) 2022 Texas Instruments Incorporated - https://www.ti.com
+ */
+
+#include <linux/kernel.h>
+
+#include "k3-psil-priv.h"
+
+#define PSIL_ETHERNET(x, ch, flow_base, flow_cnt)		\
+	{							\
+		.thread_id = x,					\
+		.ep_config = {					\
+			.ep_type = PSIL_EP_NATIVE,		\
+			.pkt_mode = 1,				\
+			.needs_epib = 1,			\
+			.psd_size = 16,				\
+			.mapped_channel_id = ch,		\
+			.flow_start = flow_base,		\
+			.flow_num = flow_cnt,			\
+			.default_flow_id = flow_base,		\
+		},						\
+	}
+
+/* PSI-L source thread IDs, used for RX (DMA_DEV_TO_MEM) */
+static struct psil_ep am62_src_ep_map[] = {
+	/* CPSW3G */
+	PSIL_ETHERNET(0x4600, 19, 19, 16),
+};
+
+/* PSI-L destination thread IDs, used for TX (DMA_MEM_TO_DEV) */
+static struct psil_ep am62_dst_ep_map[] = {
+	/* CPSW3G */
+	PSIL_ETHERNET(0xc600, 19, 19, 8),
+	PSIL_ETHERNET(0xc601, 20, 27, 8),
+	PSIL_ETHERNET(0xc602, 21, 35, 8),
+	PSIL_ETHERNET(0xc603, 22, 43, 8),
+	PSIL_ETHERNET(0xc604, 23, 51, 8),
+	PSIL_ETHERNET(0xc605, 24, 59, 8),
+	PSIL_ETHERNET(0xc606, 25, 67, 8),
+	PSIL_ETHERNET(0xc607, 26, 75, 8),
+};
+
+struct psil_ep_map am62_ep_map = {
+	.name = "am62",
+	.src = am62_src_ep_map,
+	.src_count = ARRAY_SIZE(am62_src_ep_map),
+	.dst = am62_dst_ep_map,
+	.dst_count = ARRAY_SIZE(am62_dst_ep_map),
+};
diff --git a/drivers/dma/ti/k3-psil-priv.h b/drivers/dma/ti/k3-psil-priv.h
index 77acaf2139..28078c6bd8 100644
--- a/drivers/dma/ti/k3-psil-priv.h
+++ b/drivers/dma/ti/k3-psil-priv.h
@@ -41,5 +41,6 @@ extern struct psil_ep_map am654_ep_map;
 extern struct psil_ep_map j721e_ep_map;
 extern struct psil_ep_map j721s2_ep_map;
 extern struct psil_ep_map am64_ep_map;
+extern struct psil_ep_map am62_ep_map;
 
 #endif /* K3_PSIL_PRIV_H_ */
diff --git a/drivers/dma/ti/k3-psil.c b/drivers/dma/ti/k3-psil.c
index 8b2129d4f5..f1330bf4b0 100644
--- a/drivers/dma/ti/k3-psil.c
+++ b/drivers/dma/ti/k3-psil.c
@@ -24,6 +24,8 @@ struct psil_endpoint_config *psil_get_ep_config(u32 thread_id)
 			soc_ep_map = &j721s2_ep_map;
 		else if (IS_ENABLED(CONFIG_SOC_K3_AM642))
 			soc_ep_map = &am64_ep_map;
+		else if (IS_ENABLED(CONFIG_SOC_K3_AM625))
+			soc_ep_map = &am62_ep_map;
 	}
 
 	if (thread_id & K3_PSIL_DST_THREAD_ID_OFFSET && soc_ep_map->dst) {
-- 
2.35.3


  parent reply	other threads:[~2022-04-15 14:11 UTC|newest]

Thread overview: 24+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-04-15 14:09 [PATCH 00/11] TI: Add support for AM62 SoC Vignesh Raghavendra
2022-04-15 14:09 ` [PATCH 01/11] drivers: mmc: am654_sdhci: Add new compatible " Vignesh Raghavendra
2022-04-15 14:09 ` [PATCH 02/11] dt-bindings: pinctrl: k3: Introduce pinmux definitions for AM62 Vignesh Raghavendra
2022-04-15 16:27   ` Tom Rini
2022-04-15 16:36     ` Vignesh Raghavendra
2022-04-15 14:09 ` [PATCH 03/11] soc: ti: k3-socinfo: Add entry for AM62X SoC family Vignesh Raghavendra
2022-04-15 21:00   ` Bryan Brattlof
2022-04-15 14:09 ` [PATCH 04/11] arm: mach-k3: Introduce the basic files to support AM62 Vignesh Raghavendra
2022-04-15 16:27   ` Tom Rini
2022-04-15 16:38     ` Vignesh Raghavendra
2022-04-15 17:41       ` Tom Rini
2022-04-16  6:47         ` Vignesh Raghavendra
2022-04-15 14:09 ` [PATCH 05/11] arm: mach-k3: am62: Introduce autogenerated SoC data Vignesh Raghavendra
2022-04-15 14:09 ` Vignesh Raghavendra [this message]
2022-04-15 14:09 ` [PATCH 07/11] arm: dts: Introduce base AM62 SoC dtsi files Vignesh Raghavendra
2022-04-15 16:28   ` Tom Rini
2022-04-15 16:40     ` Vignesh Raghavendra
2022-04-15 14:09 ` [PATCH 08/11] board: ti: Introduce the basic files to support AM62 SK board Vignesh Raghavendra
2022-04-15 14:09 ` [PATCH 09/11] arm: dts: Add support for AM62-SK Vignesh Raghavendra
2022-04-15 14:09 ` [PATCH 10/11] configs: Add configs for AM62x SK Vignesh Raghavendra
2022-04-15 14:09 ` [PATCH 11/11] doc: ti: Add readme " Vignesh Raghavendra
2022-04-15 20:15   ` Bryan Brattlof
2022-04-18 14:56   ` Andrew Davis
2022-04-18 18:49     ` Vignesh Raghavendra

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220415140931.490047-7-vigneshr@ti.com \
    --to=vigneshr@ti.com \
    --cc=a-govindraju@ti.com \
    --cc=bb@ti.com \
    --cc=d-gerlach@ti.com \
    --cc=g-vlaev@ti.com \
    --cc=jh80.chung@samsung.com \
    --cc=lukma@denx.de \
    --cc=nm@ti.com \
    --cc=peng.fan@nxp.com \
    --cc=s-anna@ti.com \
    --cc=seanga2@gmail.com \
    --cc=sjg@chromium.org \
    --cc=trini@konsulko.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox