1 // SPDX-License-Identifier: GPL-2.0
3 * Copyright (C) 2021 Texas Instruments Incorporated - https://www.ti.com
6 #include <linux/kernel.h>
8 #include "k3-psil-priv.h"
10 #define PSIL_PDMA_XY_TR(x) \
14 .ep_type = PSIL_EP_PDMA_XY, \
18 #define PSIL_PDMA_XY_PKT(x) \
22 .ep_type = PSIL_EP_PDMA_XY, \
27 #define PSIL_PDMA_MCASP(x) \
31 .ep_type = PSIL_EP_PDMA_XY, \
37 #define PSIL_ETHERNET(x) \
41 .ep_type = PSIL_EP_NATIVE, \
48 #define PSIL_SA2UL(x, tx) \
52 .ep_type = PSIL_EP_NATIVE, \
60 #define PSIL_CSI2RX(x) \
64 .ep_type = PSIL_EP_NATIVE, \
68 /* PSI-L source thread IDs, used for RX (DMA_DEV_TO_MEM) */
69 static struct psil_ep j721s2_src_ep_map
[] = {
70 /* PDMA_MCASP - McASP0-4 */
71 PSIL_PDMA_MCASP(0x4400),
72 PSIL_PDMA_MCASP(0x4401),
73 PSIL_PDMA_MCASP(0x4402),
74 PSIL_PDMA_MCASP(0x4403),
75 PSIL_PDMA_MCASP(0x4404),
76 /* PDMA_SPI_G0 - SPI0-3 */
77 PSIL_PDMA_XY_PKT(0x4600),
78 PSIL_PDMA_XY_PKT(0x4601),
79 PSIL_PDMA_XY_PKT(0x4602),
80 PSIL_PDMA_XY_PKT(0x4603),
81 PSIL_PDMA_XY_PKT(0x4604),
82 PSIL_PDMA_XY_PKT(0x4605),
83 PSIL_PDMA_XY_PKT(0x4606),
84 PSIL_PDMA_XY_PKT(0x4607),
85 PSIL_PDMA_XY_PKT(0x4608),
86 PSIL_PDMA_XY_PKT(0x4609),
87 PSIL_PDMA_XY_PKT(0x460a),
88 PSIL_PDMA_XY_PKT(0x460b),
89 PSIL_PDMA_XY_PKT(0x460c),
90 PSIL_PDMA_XY_PKT(0x460d),
91 PSIL_PDMA_XY_PKT(0x460e),
92 PSIL_PDMA_XY_PKT(0x460f),
93 /* PDMA_SPI_G1 - SPI4-7 */
94 PSIL_PDMA_XY_PKT(0x4610),
95 PSIL_PDMA_XY_PKT(0x4611),
96 PSIL_PDMA_XY_PKT(0x4612),
97 PSIL_PDMA_XY_PKT(0x4613),
98 PSIL_PDMA_XY_PKT(0x4614),
99 PSIL_PDMA_XY_PKT(0x4615),
100 PSIL_PDMA_XY_PKT(0x4616),
101 PSIL_PDMA_XY_PKT(0x4617),
102 PSIL_PDMA_XY_PKT(0x4618),
103 PSIL_PDMA_XY_PKT(0x4619),
104 PSIL_PDMA_XY_PKT(0x461a),
105 PSIL_PDMA_XY_PKT(0x461b),
106 PSIL_PDMA_XY_PKT(0x461c),
107 PSIL_PDMA_XY_PKT(0x461d),
108 PSIL_PDMA_XY_PKT(0x461e),
109 PSIL_PDMA_XY_PKT(0x461f),
111 PSIL_ETHERNET(0x4640),
112 /* PDMA_USART_G0 - UART0-1 */
113 PSIL_PDMA_XY_PKT(0x4700),
114 PSIL_PDMA_XY_PKT(0x4701),
115 /* PDMA_USART_G1 - UART2-3 */
116 PSIL_PDMA_XY_PKT(0x4702),
117 PSIL_PDMA_XY_PKT(0x4703),
118 /* PDMA_USART_G2 - UART4-9 */
119 PSIL_PDMA_XY_PKT(0x4704),
120 PSIL_PDMA_XY_PKT(0x4705),
121 PSIL_PDMA_XY_PKT(0x4706),
122 PSIL_PDMA_XY_PKT(0x4707),
123 PSIL_PDMA_XY_PKT(0x4708),
124 PSIL_PDMA_XY_PKT(0x4709),
191 PSIL_SA2UL(0x4a40, 0),
192 PSIL_SA2UL(0x4a41, 0),
193 PSIL_SA2UL(0x4a42, 0),
194 PSIL_SA2UL(0x4a43, 0),
196 PSIL_ETHERNET(0x7000),
197 /* MCU_PDMA0 (MCU_PDMA_MISC_G0) - SPI0 */
198 PSIL_PDMA_XY_PKT(0x7100),
199 PSIL_PDMA_XY_PKT(0x7101),
200 PSIL_PDMA_XY_PKT(0x7102),
201 PSIL_PDMA_XY_PKT(0x7103),
202 /* MCU_PDMA1 (MCU_PDMA_MISC_G1) - SPI1-2 */
203 PSIL_PDMA_XY_PKT(0x7200),
204 PSIL_PDMA_XY_PKT(0x7201),
205 PSIL_PDMA_XY_PKT(0x7202),
206 PSIL_PDMA_XY_PKT(0x7203),
207 PSIL_PDMA_XY_PKT(0x7204),
208 PSIL_PDMA_XY_PKT(0x7205),
209 PSIL_PDMA_XY_PKT(0x7206),
210 PSIL_PDMA_XY_PKT(0x7207),
211 /* MCU_PDMA2 (MCU_PDMA_MISC_G2) - UART0 */
212 PSIL_PDMA_XY_PKT(0x7300),
213 /* MCU_PDMA_ADC - ADC0-1 */
214 PSIL_PDMA_XY_TR(0x7400),
215 PSIL_PDMA_XY_TR(0x7401),
216 PSIL_PDMA_XY_TR(0x7402),
217 PSIL_PDMA_XY_TR(0x7403),
219 PSIL_SA2UL(0x7500, 0),
220 PSIL_SA2UL(0x7501, 0),
221 PSIL_SA2UL(0x7502, 0),
222 PSIL_SA2UL(0x7503, 0),
225 /* PSI-L destination thread IDs, used for TX (DMA_MEM_TO_DEV) */
226 static struct psil_ep j721s2_dst_ep_map
[] = {
228 PSIL_SA2UL(0xca40, 1),
229 PSIL_SA2UL(0xca41, 1),
231 PSIL_ETHERNET(0xf000),
232 PSIL_ETHERNET(0xf001),
233 PSIL_ETHERNET(0xf002),
234 PSIL_ETHERNET(0xf003),
235 PSIL_ETHERNET(0xf004),
236 PSIL_ETHERNET(0xf005),
237 PSIL_ETHERNET(0xf006),
238 PSIL_ETHERNET(0xf007),
240 PSIL_ETHERNET(0xc640),
241 PSIL_ETHERNET(0xc641),
242 PSIL_ETHERNET(0xc642),
243 PSIL_ETHERNET(0xc643),
244 PSIL_ETHERNET(0xc644),
245 PSIL_ETHERNET(0xc645),
246 PSIL_ETHERNET(0xc646),
247 PSIL_ETHERNET(0xc647),
249 PSIL_SA2UL(0xf500, 1),
250 PSIL_SA2UL(0xf501, 1),
253 struct psil_ep_map j721s2_ep_map
= {
255 .src
= j721s2_src_ep_map
,
256 .src_count
= ARRAY_SIZE(j721s2_src_ep_map
),
257 .dst
= j721s2_dst_ep_map
,
258 .dst_count
= ARRAY_SIZE(j721s2_dst_ep_map
),