]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
dma: ti: Add PSIL data for AM62x DMASS
authorVignesh Raghavendra <vigneshr@ti.com>
Wed, 25 May 2022 08:08:44 +0000 (13:38 +0530)
committerTom Rini <trini@konsulko.com>
Fri, 10 Jun 2022 17:37:32 +0000 (13:37 -0400)
Add PSIL data for AM62x SoC.

Signed-off-by: Vignesh Raghavendra <vigneshr@ti.com>
drivers/dma/ti/Makefile
drivers/dma/ti/k3-psil-am62.c [new file with mode: 0644]
drivers/dma/ti/k3-psil-priv.h
drivers/dma/ti/k3-psil.c

index 6a4f4f1365bda909a52887d29bf7441a4bee8e76..56f348700d4ef6c2151aa6853d8392317566673d 100644 (file)
@@ -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 (file)
index 0000000..9527da4
--- /dev/null
@@ -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),
+};
index 77acaf21393a9732c2fbc5bfd92a589d16125522..28078c6bd8d7d2fcc0b3463690a31a520bb462cb 100644 (file)
@@ -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_ */
index 8b2129d4f58d30eedaf215b5e4493bd3d45acd3a..f1330bf4b034bad94f01f7e8832207e46b3bbe87 100644 (file)
@@ -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) {