From: Apurva Nandan <a-nandan@ti.com>
To: Apurva Nandan <a-nandan@ti.com>, Hari Nagalla <hnagalla@ti.com>,
Lukasz Majewski <lukma@denx.de>,
Sean Anderson <seanga2@gmail.com>,
Jaehoon Chung <jh80.chung@samsung.com>,
Neha Malcom Francis <n-francis@ti.com>,
Simon Glass <sjg@chromium.org>, Andrew Davis <afd@ti.com>,
Kamlesh Gurudasani <kamlesh@ti.com>,
Dasnavis Sabiya <sabiya.d@ti.com>,
Manorit Chawdhry <m-chawdhry@ti.com>,
Aradhya Bhatia <a-bhatia1@ti.com>, Bryan Brattlof <bb@ti.com>,
Christian Gmeiner <christian.gmeiner@gmail.com>,
Nishanth Menon <nm@ti.com>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Marcel Ziswiler <marcel.ziswiler@toradex.com>,
Roger Quadros <rogerq@kernel.org>,
Jayesh Choudhary <j-choudhary@ti.com>,
Ralph Siemsen <ralph.siemsen@linaro.org>,
Yanhong Wang <yanhong.wang@starfivetech.com>,
Marek Vasut <marek.vasut+renesas@mailbox.org>,
Rasmus Villemoes <rasmus.villemoes@prevas.dk>,
<u-boot@lists.denx.de>,
Sinthu Raja M <sinthu.raja@mistralsolutions.com>,
Udit Kumar <u-kumar1@ti.com>
Subject: [PATCH v4 06/16] drivers: dma: Add support for J784S4 SoC
Date: Sun, 1 Oct 2023 22:25:35 +0530 [thread overview]
Message-ID: <20231001165545.494212-7-a-nandan@ti.com> (raw)
In-Reply-To: <20231001165545.494212-1-a-nandan@ti.com>
Add support for DMA in J784S4 SoC.
Signed-off-by: Jayesh Choudhary <j-choudhary@ti.com>
Signed-off-by: Hari Nagalla <hnagalla@ti.com>
Signed-off-by: Apurva Nandan <a-nandan@ti.com>
---
drivers/dma/ti/Makefile | 1 +
drivers/dma/ti/k3-psil-j784s4.c | 166 ++++++++++++++++++++++++++
drivers/dma/ti/k3-psil-priv.h | 1 +
drivers/dma/ti/k3-psil.c | 2 +
drivers/firmware/ti_sci_static_data.h | 34 ++++++
drivers/ram/Kconfig | 2 +-
6 files changed, 205 insertions(+), 1 deletion(-)
create mode 100644 drivers/dma/ti/k3-psil-j784s4.c
diff --git a/drivers/dma/ti/Makefile b/drivers/dma/ti/Makefile
index 6807eb8e8b..bd4ce68d9c 100644
--- a/drivers/dma/ti/Makefile
+++ b/drivers/dma/ti/Makefile
@@ -8,3 +8,4 @@ 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
+k3-psil-data-$(CONFIG_SOC_K3_J784S4) += k3-psil-j784s4.o
diff --git a/drivers/dma/ti/k3-psil-j784s4.c b/drivers/dma/ti/k3-psil-j784s4.c
new file mode 100644
index 0000000000..7f06a1f307
--- /dev/null
+++ b/drivers/dma/ti/k3-psil-j784s4.c
@@ -0,0 +1,166 @@
+// SPDX-License-Identifier: GPL-2.0-or-later
+/*
+ * Copyright (C) 2023 Texas Instruments Incorporated - https://www.ti.com
+ */
+#include <linux/kernel.h>
+
+#include "k3-psil-priv.h"
+
+#define PSIL_PDMA_XY_TR(x) \
+ { \
+ .thread_id = x, \
+ .ep_config = { \
+ .ep_type = PSIL_EP_PDMA_XY, \
+ }, \
+ }
+
+#define PSIL_PDMA_XY_PKT(x) \
+ { \
+ .thread_id = x, \
+ .ep_config = { \
+ .ep_type = PSIL_EP_PDMA_XY, \
+ .pkt_mode = 1, \
+ }, \
+ }
+
+#define PSIL_PDMA_MCASP(x) \
+ { \
+ .thread_id = x, \
+ .ep_config = { \
+ .ep_type = PSIL_EP_PDMA_XY, \
+ .pdma_acc32 = 1, \
+ .pdma_burst = 1, \
+ }, \
+ }
+
+#define PSIL_ETHERNET(x) \
+ { \
+ .thread_id = x, \
+ .ep_config = { \
+ .ep_type = PSIL_EP_NATIVE, \
+ .pkt_mode = 1, \
+ .needs_epib = 1, \
+ .psd_size = 16, \
+ }, \
+ }
+
+#define PSIL_SA2UL(x, tx) \
+ { \
+ .thread_id = x, \
+ .ep_config = { \
+ .ep_type = PSIL_EP_NATIVE, \
+ .pkt_mode = 1, \
+ .needs_epib = 1, \
+ .psd_size = 64, \
+ .notdpkt = tx, \
+ }, \
+ }
+
+/* PSI-L source thread IDs, used for RX (DMA_DEV_TO_MEM) */
+static struct psil_ep j784s4_src_ep_map[] = {
+ /* PDMA_MCASP - McASP0-4 */
+ PSIL_PDMA_MCASP(0x4400),
+ PSIL_PDMA_MCASP(0x4401),
+ PSIL_PDMA_MCASP(0x4402),
+ PSIL_PDMA_MCASP(0x4403),
+ PSIL_PDMA_MCASP(0x4404),
+ /* PDMA_SPI_G0 - SPI0-3 */
+ PSIL_PDMA_XY_PKT(0x4600),
+ PSIL_PDMA_XY_PKT(0x4601),
+ PSIL_PDMA_XY_PKT(0x4602),
+ PSIL_PDMA_XY_PKT(0x4603),
+ PSIL_PDMA_XY_PKT(0x4604),
+ PSIL_PDMA_XY_PKT(0x4605),
+ PSIL_PDMA_XY_PKT(0x4606),
+ PSIL_PDMA_XY_PKT(0x4607),
+ PSIL_PDMA_XY_PKT(0x4608),
+ PSIL_PDMA_XY_PKT(0x4609),
+ PSIL_PDMA_XY_PKT(0x460a),
+ PSIL_PDMA_XY_PKT(0x460b),
+ PSIL_PDMA_XY_PKT(0x460c),
+ PSIL_PDMA_XY_PKT(0x460d),
+ PSIL_PDMA_XY_PKT(0x460e),
+ PSIL_PDMA_XY_PKT(0x460f),
+ /* PDMA_SPI_G1 - SPI4-7 */
+ PSIL_PDMA_XY_PKT(0x4610),
+ PSIL_PDMA_XY_PKT(0x4611),
+ PSIL_PDMA_XY_PKT(0x4612),
+ PSIL_PDMA_XY_PKT(0x4613),
+ PSIL_PDMA_XY_PKT(0x4614),
+ PSIL_PDMA_XY_PKT(0x4615),
+ PSIL_PDMA_XY_PKT(0x4616),
+ PSIL_PDMA_XY_PKT(0x4617),
+ PSIL_PDMA_XY_PKT(0x4618),
+ PSIL_PDMA_XY_PKT(0x4619),
+ PSIL_PDMA_XY_PKT(0x461a),
+ PSIL_PDMA_XY_PKT(0x461b),
+ PSIL_PDMA_XY_PKT(0x461c),
+ PSIL_PDMA_XY_PKT(0x461d),
+ PSIL_PDMA_XY_PKT(0x461e),
+ PSIL_PDMA_XY_PKT(0x461f),
+ /* PDMA_USART_G0 - UART0-1 */
+ PSIL_PDMA_XY_PKT(0x4700),
+ PSIL_PDMA_XY_PKT(0x4701),
+ /* PDMA_USART_G1 - UART2-3 */
+ PSIL_PDMA_XY_PKT(0x4702),
+ PSIL_PDMA_XY_PKT(0x4703),
+ /* PDMA_USART_G2 - UART4-9 */
+ PSIL_PDMA_XY_PKT(0x4704),
+ PSIL_PDMA_XY_PKT(0x4705),
+ PSIL_PDMA_XY_PKT(0x4706),
+ PSIL_PDMA_XY_PKT(0x4707),
+ PSIL_PDMA_XY_PKT(0x4708),
+ PSIL_PDMA_XY_PKT(0x4709),
+ /* CPSW0 */
+ PSIL_ETHERNET(0x7000),
+ /* MCU_PDMA0 (MCU_PDMA_MISC_G0) - SPI0 */
+ PSIL_PDMA_XY_PKT(0x7100),
+ PSIL_PDMA_XY_PKT(0x7101),
+ PSIL_PDMA_XY_PKT(0x7102),
+ PSIL_PDMA_XY_PKT(0x7103),
+ /* MCU_PDMA1 (MCU_PDMA_MISC_G1) - SPI1-2 */
+ PSIL_PDMA_XY_PKT(0x7200),
+ PSIL_PDMA_XY_PKT(0x7201),
+ PSIL_PDMA_XY_PKT(0x7202),
+ PSIL_PDMA_XY_PKT(0x7203),
+ PSIL_PDMA_XY_PKT(0x7204),
+ PSIL_PDMA_XY_PKT(0x7205),
+ PSIL_PDMA_XY_PKT(0x7206),
+ PSIL_PDMA_XY_PKT(0x7207),
+ /* MCU_PDMA2 (MCU_PDMA_MISC_G2) - UART0 */
+ PSIL_PDMA_XY_PKT(0x7300),
+ /* MCU_PDMA_ADC - ADC0-1 */
+ PSIL_PDMA_XY_TR(0x7400),
+ PSIL_PDMA_XY_TR(0x7401),
+ PSIL_PDMA_XY_TR(0x7402),
+ PSIL_PDMA_XY_TR(0x7403),
+ /* SA2UL */
+ PSIL_SA2UL(0x7500, 0),
+ PSIL_SA2UL(0x7501, 0),
+ PSIL_SA2UL(0x7502, 0),
+ PSIL_SA2UL(0x7503, 0),
+};
+
+/* PSI-L destination thread IDs, used for TX (DMA_MEM_TO_DEV) */
+static struct psil_ep j784s4_dst_ep_map[] = {
+ /* CPSW0 */
+ PSIL_ETHERNET(0xf000),
+ PSIL_ETHERNET(0xf001),
+ PSIL_ETHERNET(0xf002),
+ PSIL_ETHERNET(0xf003),
+ PSIL_ETHERNET(0xf004),
+ PSIL_ETHERNET(0xf005),
+ PSIL_ETHERNET(0xf006),
+ PSIL_ETHERNET(0xf007),
+ /* SA2UL */
+ PSIL_SA2UL(0xf500, 1),
+ PSIL_SA2UL(0xf501, 1),
+};
+
+struct psil_ep_map j784s4_ep_map = {
+ .name = "j784s4",
+ .src = j784s4_src_ep_map,
+ .src_count = ARRAY_SIZE(j784s4_src_ep_map),
+ .dst = j784s4_dst_ep_map,
+ .dst_count = ARRAY_SIZE(j784s4_dst_ep_map),
+};
diff --git a/drivers/dma/ti/k3-psil-priv.h b/drivers/dma/ti/k3-psil-priv.h
index 28078c6bd8..634bf2ca19 100644
--- a/drivers/dma/ti/k3-psil-priv.h
+++ b/drivers/dma/ti/k3-psil-priv.h
@@ -42,5 +42,6 @@ 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;
+extern struct psil_ep_map j784s4_ep_map;
#endif /* K3_PSIL_PRIV_H_ */
diff --git a/drivers/dma/ti/k3-psil.c b/drivers/dma/ti/k3-psil.c
index f23c8ca2b7..10383b4abf 100644
--- a/drivers/dma/ti/k3-psil.c
+++ b/drivers/dma/ti/k3-psil.c
@@ -26,6 +26,8 @@ struct psil_endpoint_config *psil_get_ep_config(u32 thread_id)
soc_ep_map = &am64_ep_map;
else if (IS_ENABLED(CONFIG_SOC_K3_AM625))
soc_ep_map = &am62_ep_map;
+ else if (IS_ENABLED(CONFIG_SOC_K3_J784S4))
+ soc_ep_map = &j784s4_ep_map;
}
if (thread_id & K3_PSIL_DST_THREAD_ID_OFFSET && soc_ep_map->dst) {
diff --git a/drivers/firmware/ti_sci_static_data.h b/drivers/firmware/ti_sci_static_data.h
index 1a461fab61..0b95412551 100644
--- a/drivers/firmware/ti_sci_static_data.h
+++ b/drivers/firmware/ti_sci_static_data.h
@@ -97,6 +97,40 @@ static struct ti_sci_resource_static_data rm_static_data[] = {
};
#endif /* CONFIG_SOC_K3_AM625 || CONFIG_SOC_K3_AM62A7 */
+#if IS_ENABLED(CONFIG_SOC_K3_J784S4)
+static struct ti_sci_resource_static_data rm_static_data[] = {
+ /* Free rings */
+ {
+ .dev_id = 328,
+ .subtype = 1,
+ .range_start = 208,
+ .range_num = 32,
+ },
+ /* TX channels */
+ {
+ .dev_id = 329,
+ .subtype = 13,
+ .range_start = 40,
+ .range_num = 3,
+ },
+ /* RX channels */
+ {
+ .dev_id = 329,
+ .subtype = 10,
+ .range_start = 40,
+ .range_num = 3,
+ },
+ /* RX Free flows */
+ {
+ .dev_id = 329,
+ .subtype = 0,
+ .range_start = 84,
+ .range_num = 8,
+ },
+ { },
+};
+#endif /* CONFIG_SOC_K3_J784S4 */
+
#else
static struct ti_sci_resource_static_data rm_static_data[] = {
{ },
diff --git a/drivers/ram/Kconfig b/drivers/ram/Kconfig
index bf99964577..c7d5d0c680 100644
--- a/drivers/ram/Kconfig
+++ b/drivers/ram/Kconfig
@@ -62,7 +62,7 @@ choice
depends on K3_DDRSS
prompt "K3 DDRSS Arch Support"
- default K3_J721E_DDRSS if SOC_K3_J721E || SOC_K3_J721S2
+ default K3_J721E_DDRSS if SOC_K3_J721E || SOC_K3_J721S2 || SOC_K3_J784S4
default K3_AM64_DDRSS if SOC_K3_AM642
default K3_AM64_DDRSS if SOC_K3_AM625
default K3_AM62A_DDRSS if SOC_K3_AM62A7
--
2.34.1
next prev parent reply other threads:[~2023-10-01 16:57 UTC|newest]
Thread overview: 47+ messages / expand[flat|nested] mbox.gz Atom feed top
2023-10-01 16:55 [PATCH v4 00/16] Introduce initial TI's J784S4 and AM69 support Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 01/16] arm: dts: Introduce j784s4 dts from linux kernel Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 02/16] arm: mach-k3: Add basic support for J784S4 SoC definition Apurva Nandan
2023-10-02 16:01 ` Nishanth Menon
2023-10-04 5:13 ` Manorit Chawdhry
2023-10-04 12:24 ` Nishanth Menon
2023-10-05 4:59 ` Manorit Chawdhry
2023-10-05 11:26 ` Nishanth Menon
2023-10-06 4:16 ` Manorit Chawdhry
2023-10-06 11:13 ` Nishanth Menon
2023-10-09 5:08 ` Manorit Chawdhry
2023-10-04 17:52 ` Apurva Nandan
2023-10-04 18:06 ` Nishanth Menon
2023-11-22 15:15 ` Andrew Davis
2023-10-04 17:57 ` Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 03/16] arm: mach-k3: Sort SoC JTAG_ID entries Apurva Nandan
2023-10-02 15:54 ` Nishanth Menon
2023-10-01 16:55 ` [PATCH v4 04/16] soc: ti: k3-socinfo: Add entry for J784S4 SoC Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 05/16] arm: mach-k3: j784s4: Add clk and power support Apurva Nandan
2023-10-01 16:55 ` Apurva Nandan [this message]
2023-10-01 16:55 ` [PATCH v4 07/16] remoteproc: k3-r5: Extend support for R5F clusters on J784S4 SoCs Apurva Nandan
2023-10-02 15:52 ` Nishanth Menon
2023-10-01 16:55 ` [PATCH v4 08/16] remoteproc: k3-dsp: Extend support for C71x DSPs " Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 09/16] board: ti: j784s4: Add board support for J784S4 EVM Apurva Nandan
2023-10-02 15:51 ` Nishanth Menon
2023-10-04 18:01 ` Apurva Nandan
2023-10-04 18:05 ` Nishanth Menon
2023-10-12 17:55 ` Tom Rini
2023-10-01 16:55 ` [PATCH v4 10/16] arm: dts: Introduce j784s4 u-boot dts files Apurva Nandan
2023-10-02 14:04 ` Jerome Forissier
2023-10-04 18:02 ` Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 11/16] arm: dts: Introduce am69-sk dts from linux kernel Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 12/16] board: ti: j784s4: Update env to use am69-sk dtb Apurva Nandan
2023-10-02 15:39 ` Nishanth Menon
2023-10-01 16:55 ` [PATCH v4 13/16] arm: dts: Introduce am69-sk u-boot dts files Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 14/16] configs: j784s4_evm: Add defconfig for j784s4 evm board Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 15/16] configs: Add am69_sk_* defconfig fragments Apurva Nandan
2023-10-01 16:55 ` [PATCH v4 16/16] doc: board: ti: k3: Add J784S4 EVM and AM69 SK documentation Apurva Nandan
2023-10-02 15:26 ` Nishanth Menon
2023-10-02 16:58 ` Bryan Brattlof
2023-10-02 22:55 ` Heinrich Schuchardt
2023-10-04 18:03 ` Apurva Nandan
2023-10-02 15:33 ` [PATCH v4 00/16] Introduce initial TI's J784S4 and AM69 support Nishanth Menon
2023-11-15 13:53 ` Maxime Ripard
2023-11-16 22:56 ` Enric Balletbo i Serra
2023-11-17 4:02 ` Kumar, Udit
2023-11-17 12:49 ` Bryan Brattlof
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=20231001165545.494212-7-a-nandan@ti.com \
--to=a-nandan@ti.com \
--cc=a-bhatia1@ti.com \
--cc=afd@ti.com \
--cc=bb@ti.com \
--cc=christian.gmeiner@gmail.com \
--cc=hnagalla@ti.com \
--cc=j-choudhary@ti.com \
--cc=jh80.chung@samsung.com \
--cc=kamlesh@ti.com \
--cc=lukma@denx.de \
--cc=m-chawdhry@ti.com \
--cc=marcel.ziswiler@toradex.com \
--cc=marek.vasut+renesas@mailbox.org \
--cc=n-francis@ti.com \
--cc=nm@ti.com \
--cc=ralph.siemsen@linaro.org \
--cc=rasmus.villemoes@prevas.dk \
--cc=rogerq@kernel.org \
--cc=sabiya.d@ti.com \
--cc=seanga2@gmail.com \
--cc=sinthu.raja@mistralsolutions.com \
--cc=sjg@chromium.org \
--cc=u-boot@lists.denx.de \
--cc=u-kumar1@ti.com \
--cc=xypron.glpk@gmx.de \
--cc=yanhong.wang@starfivetech.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.