From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 ARC-Seal: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=pass; t=1795520764; b=k5c/Jd2yhG9+6wL7J7paY1RVjLuQFeFtKCFOtnruAUG2+LTFH/52grcpdL3fX32F+XHp s7z9CfE6ApACUdIy0Ba14J1ZJsZk1y4+6QNS2XEnftRSxa1UGUpN2LSh33tHswB6sJ76V eVhqDo74jQiF/HwiP40FtBZ9V0Xa2jdRAcjiGefWGnUUefjO5w94PfloU04hvqmP1Q+WI KjOsKMk6cdwgvOMKSd84P07VPuc97TWBx8nghIcs0uLBI5A9COgCFnUGc8CCH30pwDX05 tMcbvlM1qsefZKHBBs8y+VqI837+s+HwqIvpc7ORX10GGSXVPaFS5q49lcy6RlKJuVA== ARC-Message-Signature: i=2; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1795520764; h=Received:DKIM-Signature:Received:From:Date:Subject:MIME-Version: Content-Type:Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=ctESXlsj/tQw78qKccyyw41rHk8mwJdvFvJzwqXjKrE=; b=G9b0wvMWHPMStue6jFIp82eJENP5vx+wd5CUsfiso60rupy6dRPx6he2nJDp710fwd8N P25RZb9vhPCN7UgroS6I8FzpCsZO3wExioY8PhEkBempdw9K4WzCzFT8BLfcfW3QxDstI k9cV+NUnqPYORiqbenhclUJmLrKDB+84m56YiAlDTNxLGSvjZiVSyDyGMxOh4zsQuNCZQ IM6SMC8C1Bu2eEVWOoBRjd5mtvFT1IjkNI2CSLS0D6bP55Lf1hBHnJf6M51g2B/55wCaZ bOw7kY+w997Oj6CDXRk2ZvDWkwO6+xvPfs2krCBTnvk+JYNLw9MHqIX+q9I+4mbJ5PA== ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b="lFnFI/f4"; arc=pass header.oldest-pass=0 smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 4D3D7606A69C; Tue, 24 Nov 2026 11:46:04 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=lFnFI/f4 Authentication-Results: smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 ARC-Seal: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; cv=none; t=1795520763; b=ZzBUmKydJIIC2TtVxvAyU6jzLRpeS7t/qUumDxj3EaLOdodIyzvX5oYKj/Ijox0MH0SA hFzl4ptVm/lheWDIEqRrKWl1NRs33j0Rc9OwogOYcrWVpYijc3lVoDj/lnwurJwDTKI9c VF/QxWcu1SmCeDxOkxBCS6esrh1oh+7jYF+jQa43kTCeXLhPlR34oBLY1ke2ckpU9IdPp 9lC+BxrafevgtnQQQPm0IsOLHVX9k5mt6P6o4SL/sTQi49OL/1K8tMR2c/1rZCCJ5LoDx 0opTmTBNBX4rfnSN+/Qugah3hnNWwUeASE648TOxjadaatvz+V3OYOueRrYsyOhV3BA== ARC-Message-Signature: i=1; d=kernel.org; s=arc20260519; a=rsa-sha256; c=relaxed/relaxed; t=1795520763; h=DKIM-Signature:Received:From:Date:Subject:MIME-Version:Content-Type: Message-Id:References:In-Reply-To:To:Cc:X-Mailer: X-Developer-Signature:X-Developer-Key:X-Endpoint-Received: X-Original-From:Reply-To:Content-Transfer-Encoding; bh=ctESXlsj/tQw78qKccyyw41rHk8mwJdvFvJzwqXjKrE=; b=3bTsBMurO3ZsTWSah0PzrAHHBEySeu5Zt5q2S+ZD10TGKDY67IjBU7XpjRIwZmVVEdW/ 2oY5OSxMxsuQE/X0KjKs+LOkmDsTMQkq8MdsvAz2n10+V8y3BuANP7U2/wAxeCe65NtkR k3K1MI5OH6NBdzC7LWmlwU/VXaS30nHoJW8fzB4u8lAGSSkUZCGW0sdRNOhtfdCf/PV3S OacmVbQGITN2mwSDWdOpmxzCuf8r6HRccp66ScQgXv1MYInRdDMxb5xmxZ2Ya975EqsRl 5BImWCaqiVUGLy14Tvd5BIWh1AU7ENEOBym3K87rheAvE9ZD8O1qiYy4ll7gnBFAl4w== ARC-Authentication-Results: i=1; smtp.kernel.org; arc=none smtp.remote-ip=100.80.115.77 Received: from lkml.kernel.org (nexus.subspace.kernel.org [100.80.115.77]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1) server-digest SHA256) (No client certificate requested) by smtp.kernel.org (Postfix) with ESMTPS id 55F421F00ADE; Tue, 24 Nov 2026 11:45:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1795520763; bh=ctESXlsj/tQw78qKccyyw41rHk8mwJdvFvJzwqXjKrE=; h=From:Date:Subject:References:In-Reply-To:To:Cc:Reply-To; b=lFnFI/f4uKiKl+AVsL4Iz391DBjrLVnFaq6k+AZ8HiXQlzLtAqI19AEVLonVxFx9P mH9cuEB3FoTkO6b44fNEA17t3ImpvkTdhFyNHlR4bSJhhoLOYeeWkL72b5MYQ40VGI ySZltxQFcaihX7Kbn96/S1ozwqkocCxWiHFmccyJQnv70ysFQ/8GupdI3ZiU4dyPJC VpQ2/BWtrTjv+Q3j02p68F5F2CLjeJZYJa6Luz71XjwO7wXUjExdW6G828Xj7Cv0ry Rxgf81JlrjCByLE22OOmSFUt6dU7JX7jiE4PSSlpPbHTm2Ht9vHhjok3mBh2y/Lpc+ PCpEwIlt9KR8g== Received: from nexus.subspace.kernel.org (localhost [IPv6:::1]) by lkml.kernel.org (Postfix) with ESMTP id 9A97F4CA27; Tue, 24 Nov 2026 11:45:28 +0000 (UTC) From: Sai Sree Kartheek Adivi via B4 Relay Date: Tue, 24 Nov 2026 17:15:18 +0530 Subject: [PATCH v13 16/20] dmaengine: ti: k3-psil-am62l: Add AM62Lx PSIL and PDMA data X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Message-Id: <20261124-dma-upstream-v13-v13-16-bd4251fdc6d4@ti.com> References: <20261124-dma-upstream-v13-v13-0-bd4251fdc6d4@ti.com> In-Reply-To: <20261124-dma-upstream-v13-v13-0-bd4251fdc6d4@ti.com> To: Vignesh Raghavendra , Vinod Koul , Frank Li , Peter Ujfalusi , Nishanth Menon , Santosh Shilimkar , Rob Herring , Krzysztof Kozlowski , Conor Dooley Cc: dmaengine@vger.kernel.org, linux-kernel@vger.kernel.org, linux-arm-kernel@lists.infradead.org, devicetree@vger.kernel.org, sebin.francis@ti.com, Sai Sree Kartheek Adivi X-Mailer: b4 0.15.2 X-Developer-Signature: v=1; a=ed25519-sha256; t=1795520724; l=11940; i=s-adivi@ti.com; s=20261124; h=from:subject:message-id; bh=VyGrMmqCqqj/ee2mdMD1vovMjeoRhnoVUUNwnIxNK/E=; b=6cHF+0aBGaaBh092EmL4SLdh8BoXwinVti8SQGja+FB/tyXa7SNtwqzJn0yzwZOuDL0LnnQph p8s9FmTvt+EDgv52kWjIn0cvBL+X2JGmGyUcjHM/Cplcx3o1Gom+UcA X-Developer-Key: i=s-adivi@ti.com; a=ed25519; pk=EtOwVxmXDuYMgw3DqFtPDBpf8ZvbO89w1fJm4w5yPI8= X-Endpoint-Received: by B4 Relay for s-adivi@ti.com/20261124 with auth_id=1627 X-Original-From: Sai Sree Kartheek Adivi Reply-To: s-adivi@ti.com Content-Transfer-Encoding: 7bit From: Sai Sree Kartheek Adivi Add PSIL and PDMA data for AM62Lx SoC. Introduce new PSIL_EP_PDMA_XYMF type for channels that have multiple selectable fifos. Also add a new fifo_id field to psil_endpoint_config to specify the selectable fifo_id. Reviewed-by: Vignesh Raghavendra Signed-off-by: Sai Sree Kartheek Adivi --- drivers/dma/ti/Makefile | 3 +- drivers/dma/ti/k3-psil-am62l.c | 169 +++++++++++++++++++++++++++++++++++++++++ drivers/dma/ti/k3-psil-priv.h | 5 ++ drivers/dma/ti/k3-psil.c | 106 ++++++++++++++++++++++++-- include/linux/dma/k3-psil.h | 3 + 5 files changed, 279 insertions(+), 7 deletions(-) diff --git a/drivers/dma/ti/Makefile b/drivers/dma/ti/Makefile index 3b91c02e55eaf..41bfba944dc6c 100644 --- a/drivers/dma/ti/Makefile +++ b/drivers/dma/ti/Makefile @@ -14,6 +14,7 @@ k3-psil-lib-objs := k3-psil.o \ k3-psil-am62.o \ k3-psil-am62a.o \ k3-psil-j784s4.o \ - k3-psil-am62p.o + k3-psil-am62p.o \ + k3-psil-am62l.o obj-$(CONFIG_TI_K3_PSIL) += k3-psil-lib.o obj-$(CONFIG_TI_DMA_CROSSBAR) += dma-crossbar.o diff --git a/drivers/dma/ti/k3-psil-am62l.c b/drivers/dma/ti/k3-psil-am62l.c new file mode 100644 index 0000000000000..ee77fae3787a4 --- /dev/null +++ b/drivers/dma/ti/k3-psil-am62l.c @@ -0,0 +1,169 @@ +// SPDX-License-Identifier: GPL-2.0 +/* + * Copyright (C) 2024-2025 Texas Instruments Incorporated - https://www.ti.com + */ + +#include + +#include "k3-psil-priv.h" + +#define PSIL_PDMA_XY_TR(x, ch) \ + { \ + .thread_id = x, \ + .ep_config = { \ + .ep_type = PSIL_EP_PDMA_XY, \ + .mapped_channel_id = ch, \ + .default_flow_id = -1, \ + }, \ + } + +#define PSIL_PDMA_XYMF_TR(x, ch, fifo) \ + { \ + .thread_id = x, \ + .ep_config = { \ + .ep_type = PSIL_EP_PDMA_XYMF, \ + .mapped_channel_id = ch, \ + .default_flow_id = -1, \ + .fifo_id = fifo, \ + }, \ + } + +#define PSIL_PDMA_XY_PKT(x, ch) \ + { \ + .thread_id = x, \ + .ep_config = { \ + .ep_type = PSIL_EP_PDMA_XY, \ + .mapped_channel_id = ch, \ + .pkt_mode = 1, \ + .default_flow_id = -1 \ + }, \ + } + +#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, \ + }, \ + } + +#define PSIL_PDMA_MCASP(x, ch) \ + { \ + .thread_id = x, \ + .ep_config = { \ + .ep_type = PSIL_EP_PDMA_XY, \ + .pdma_acc32 = 1, \ + .pdma_burst = 1, \ + .mapped_channel_id = ch, \ + .default_flow_id = -1 \ + }, \ + } + +/* PSI-L source thread IDs, used for RX (DMA_DEV_TO_MEM) */ +static struct psil_ep am62l_src_ep_map[] = { + /* PDMA_MAIN1 - UART0-6 */ + PSIL_PDMA_XY_PKT(0x4400, 0), + PSIL_PDMA_XY_PKT(0x4401, 2), + PSIL_PDMA_XY_PKT(0x4402, 4), + PSIL_PDMA_XY_PKT(0x4403, 6), + PSIL_PDMA_XY_PKT(0x4404, 8), + PSIL_PDMA_XY_PKT(0x4405, 10), + PSIL_PDMA_XY_PKT(0x4406, 12), + /* PDMA_MAIN0 - SPI0 - CH0-3 */ + PSIL_PDMA_XYMF_TR(0x4300, 16, 0), + PSIL_PDMA_XYMF_TR(0x4300, 18, 1), + PSIL_PDMA_XYMF_TR(0x4300, 20, 2), + PSIL_PDMA_XYMF_TR(0x4300, 22, 3), + /* PDMA_MAIN0 - SPI1 - CH0-3 */ + PSIL_PDMA_XYMF_TR(0x4301, 24, 0), + PSIL_PDMA_XYMF_TR(0x4301, 26, 1), + PSIL_PDMA_XYMF_TR(0x4301, 28, 2), + PSIL_PDMA_XYMF_TR(0x4301, 30, 3), + /* PDMA_MAIN0 - SPI2 - CH0-3 */ + PSIL_PDMA_XYMF_TR(0x4302, 32, 0), + PSIL_PDMA_XYMF_TR(0x4302, 34, 1), + PSIL_PDMA_XYMF_TR(0x4302, 36, 2), + PSIL_PDMA_XYMF_TR(0x4302, 38, 3), + /* PDMA_MAIN0 - SPI3 - CH0-3 */ + PSIL_PDMA_XYMF_TR(0x4303, 40, 0), + PSIL_PDMA_XYMF_TR(0x4303, 42, 1), + PSIL_PDMA_XYMF_TR(0x4303, 44, 2), + PSIL_PDMA_XYMF_TR(0x4303, 46, 3), + /* PDMA_MAIN2 - MCASP0-2 */ + PSIL_PDMA_MCASP(0x4500, 48), + PSIL_PDMA_MCASP(0x4501, 50), + PSIL_PDMA_MCASP(0x4502, 52), + /* PDMA_MAIN0 - AES */ + PSIL_PDMA_XY_TR(0x4700, 65), + /* PDMA_MAIN0 - ADC */ + PSIL_PDMA_XY_TR(0x4503, 80), + PSIL_PDMA_XY_TR(0x4504, 81), + PSIL_ETHERNET(0x4600, 96, 96, 16), +}; + +/* PSI-L destination thread IDs, used for TX (DMA_MEM_TO_DEV) */ +static struct psil_ep am62l_dst_ep_map[] = { + /* PDMA_MAIN1 - UART0-6 */ + PSIL_PDMA_XY_PKT(0xC400, 1), + PSIL_PDMA_XY_PKT(0xC401, 3), + PSIL_PDMA_XY_PKT(0xC402, 5), + PSIL_PDMA_XY_PKT(0xC403, 7), + PSIL_PDMA_XY_PKT(0xC404, 9), + PSIL_PDMA_XY_PKT(0xC405, 11), + PSIL_PDMA_XY_PKT(0xC406, 13), + /* PDMA_MAIN0 - SPI0 - CH0-3 */ + PSIL_PDMA_XYMF_TR(0xC300, 17, 0), + PSIL_PDMA_XYMF_TR(0xC300, 19, 1), + PSIL_PDMA_XYMF_TR(0xC300, 21, 2), + PSIL_PDMA_XYMF_TR(0xC300, 23, 3), + /* PDMA_MAIN0 - SPI1 - CH0-3 */ + PSIL_PDMA_XYMF_TR(0xC301, 25, 0), + PSIL_PDMA_XYMF_TR(0xC301, 27, 1), + PSIL_PDMA_XYMF_TR(0xC301, 29, 2), + PSIL_PDMA_XYMF_TR(0xC301, 31, 3), + /* PDMA_MAIN0 - SPI2 - CH0-3 */ + PSIL_PDMA_XYMF_TR(0xC302, 33, 0), + PSIL_PDMA_XYMF_TR(0xC302, 35, 1), + PSIL_PDMA_XYMF_TR(0xC302, 37, 2), + PSIL_PDMA_XYMF_TR(0xC302, 39, 3), + /* PDMA_MAIN0 - SPI3 - CH0-3 */ + PSIL_PDMA_XYMF_TR(0xC303, 41, 0), + PSIL_PDMA_XYMF_TR(0xC303, 43, 1), + PSIL_PDMA_XYMF_TR(0xC303, 45, 2), + PSIL_PDMA_XYMF_TR(0xC303, 47, 3), + /* PDMA_MAIN2 - MCASP0-2 */ + PSIL_PDMA_MCASP(0xC500, 49), + PSIL_PDMA_MCASP(0xC501, 51), + PSIL_PDMA_MCASP(0xC502, 53), + /* PDMA_MAIN0 - SHA */ + PSIL_PDMA_XY_TR(0xC700, 64), + /* PDMA_MAIN0 - AES */ + PSIL_PDMA_XY_TR(0xC701, 66), + /* PDMA_MAIN0 - CRC32 - CH0-1 */ + PSIL_PDMA_XYMF_TR(0xC702, 67, 0), + PSIL_PDMA_XYMF_TR(0xC702, 68, 1), + /* CPSW3G */ + PSIL_ETHERNET(0xc600, 64, 64, 2), + PSIL_ETHERNET(0xc601, 66, 66, 2), + PSIL_ETHERNET(0xc602, 68, 68, 2), + PSIL_ETHERNET(0xc603, 70, 70, 2), + PSIL_ETHERNET(0xc604, 72, 72, 2), + PSIL_ETHERNET(0xc605, 74, 74, 2), + PSIL_ETHERNET(0xc606, 76, 76, 2), + PSIL_ETHERNET(0xc607, 78, 78, 2), +}; + +struct psil_ep_map am62l_ep_map = { + .name = "am62l", + .src = am62l_src_ep_map, + .src_count = ARRAY_SIZE(am62l_src_ep_map), + .dst = am62l_dst_ep_map, + .dst_count = ARRAY_SIZE(am62l_dst_ep_map), +}; diff --git a/drivers/dma/ti/k3-psil-priv.h b/drivers/dma/ti/k3-psil-priv.h index a577be97e3447..970afd46a79e6 100644 --- a/drivers/dma/ti/k3-psil-priv.h +++ b/drivers/dma/ti/k3-psil-priv.h @@ -35,6 +35,10 @@ struct psil_ep_map { }; struct psil_endpoint_config *psil_get_ep_config(u32 thread_id); +struct psil_endpoint_config *psil_get_ep_config_by_id(u32 channel_id, + bool is_pktdma, + u32 *thread_id, + bool *dev_to_mem); /* SoC PSI-L endpoint maps */ extern struct psil_ep_map am654_ep_map; @@ -46,5 +50,6 @@ extern struct psil_ep_map am62_ep_map; extern struct psil_ep_map am62a_ep_map; extern struct psil_ep_map j784s4_ep_map; extern struct psil_ep_map am62p_ep_map; +extern struct psil_ep_map am62l_ep_map; #endif /* K3_PSIL_PRIV_H_ */ diff --git a/drivers/dma/ti/k3-psil.c b/drivers/dma/ti/k3-psil.c index c4b6f0df46861..1c4ae124d172d 100644 --- a/drivers/dma/ti/k3-psil.c +++ b/drivers/dma/ti/k3-psil.c @@ -28,6 +28,7 @@ static const struct soc_device_attribute k3_soc_devices[] = { { .family = "J784S4", .data = &j784s4_ep_map }, { .family = "AM62PX", .data = &am62p_ep_map }, { .family = "J722S", .data = &am62p_ep_map }, + { .family = "AM62LX", .data = &am62l_ep_map }, { /* sentinel */ } }; @@ -71,12 +72,70 @@ struct psil_endpoint_config *psil_get_ep_config(u32 thread_id) } EXPORT_SYMBOL_GPL(psil_get_ep_config); +struct psil_endpoint_config *psil_get_ep_config_by_id(u32 channel_id, + bool is_pktdma, + u32 *thread_id, + bool *dev_to_mem) +{ + int i; + + mutex_lock(&ep_map_mutex); + if (!soc_ep_map) { + const struct soc_device_attribute *soc; + + soc = soc_device_match(k3_soc_devices); + if (soc) { + soc_ep_map = soc->data; + } else { + pr_err("PSIL: No compatible machine found for map\n"); + mutex_unlock(&ep_map_mutex); + return ERR_PTR(-ENOTSUPP); + } + } + + if (soc_ep_map->src) { + for (i = 0; i < soc_ep_map->src_count; i++) { + struct psil_ep *ep = &soc_ep_map->src[i]; + + if (ep->ep_config.mapped_channel_id != (s16)channel_id) + continue; + if ((bool)ep->ep_config.pkt_mode != is_pktdma) + continue; + *thread_id = ep->thread_id; + *dev_to_mem = true; + mutex_unlock(&ep_map_mutex); + return &ep->ep_config; + } + } + + if (soc_ep_map->dst) { + for (i = 0; i < soc_ep_map->dst_count; i++) { + struct psil_ep *ep = &soc_ep_map->dst[i]; + + if (ep->ep_config.mapped_channel_id != (s16)channel_id) + continue; + if ((bool)ep->ep_config.pkt_mode != is_pktdma) + continue; + *thread_id = ep->thread_id; + *dev_to_mem = false; + mutex_unlock(&ep_map_mutex); + return &ep->ep_config; + } + } + + mutex_unlock(&ep_map_mutex); + return ERR_PTR(-ENOENT); +} +EXPORT_SYMBOL_GPL(psil_get_ep_config_by_id); + int psil_set_new_ep_config(struct device *dev, const char *name, struct psil_endpoint_config *ep_config) { struct psil_endpoint_config *dst_ep_config; - struct of_phandle_args dma_spec; - u32 thread_id; + struct of_phandle_args dma_spec = { 0 }; + u32 thread_id = 0; + u32 channel_id = 0; + bool by_channel_id = false; int index; if (!dev || !dev->of_node) @@ -90,17 +149,52 @@ int psil_set_new_ep_config(struct device *dev, const char *name, index, &dma_spec)) return -ENOENT; - thread_id = dma_spec.args[0]; + if (of_device_is_compatible(dma_spec.np, "ti,am62l-dmss-pktdma")) { + bool dev_to_mem; - dst_ep_config = psil_get_ep_config(thread_id); + if (dma_spec.args_count < 1) { + of_node_put(dma_spec.np); + return -EINVAL; + } + + by_channel_id = true; + channel_id = dma_spec.args[0]; + thread_id = dma_spec.args[0]; + dst_ep_config = psil_get_ep_config_by_id(dma_spec.args[0], + true, + &thread_id, &dev_to_mem); + } else if (of_device_is_compatible(dma_spec.np, "ti,am62l-dmss-bcdma")) { + bool dev_to_mem; + + if (dma_spec.args_count < 3) { + of_node_put(dma_spec.np); + return -EINVAL; + } + + by_channel_id = true; + channel_id = dma_spec.args[2]; + thread_id = dma_spec.args[2]; + dst_ep_config = psil_get_ep_config_by_id(dma_spec.args[2], + false, + &thread_id, &dev_to_mem); + } else { + thread_id = dma_spec.args[0]; + dst_ep_config = psil_get_ep_config(thread_id); + } if (IS_ERR(dst_ep_config)) { - pr_err("PSIL: thread ID 0x%04x not defined in map\n", - thread_id); + if (by_channel_id) + pr_err("PSIL: channel ID 0x%04x not defined in map\n", + channel_id); + else + pr_err("PSIL: thread ID 0x%04x not defined in map\n", + thread_id); of_node_put(dma_spec.np); return PTR_ERR(dst_ep_config); } + mutex_lock(&ep_map_mutex); memcpy(dst_ep_config, ep_config, sizeof(*dst_ep_config)); + mutex_unlock(&ep_map_mutex); of_node_put(dma_spec.np); return 0; diff --git a/include/linux/dma/k3-psil.h b/include/linux/dma/k3-psil.h index 5f106d852f1cf..36e347311f8b2 100644 --- a/include/linux/dma/k3-psil.h +++ b/include/linux/dma/k3-psil.h @@ -35,6 +35,7 @@ enum udma_tp_level { enum psil_endpoint_type { PSIL_EP_NATIVE = 0, PSIL_EP_PDMA_XY, + PSIL_EP_PDMA_XYMF, PSIL_EP_PDMA_MCAN, PSIL_EP_PDMA_AASRC, }; @@ -78,6 +79,8 @@ struct psil_endpoint_config { u16 flow_start; u16 flow_num; s16 default_flow_id; + /* XYMF FIFO index (0-3 for CS0-CS3), Only for PSIL_EP_PDMA_XYMF */ + u8 fifo_id; }; int psil_set_new_ep_config(struct device *dev, const char *name, -- 2.55.0