RTEMS 6.1-rc1
regs-edma.h
Go to the documentation of this file.
1
7/*
8 * Copyright (C) 2011, 2020 embedded brains GmbH & Co. KG
9 *
10 * Redistribution and use in source and binary forms, with or without
11 * modification, are permitted provided that the following conditions
12 * are met:
13 * 1. Redistributions of source code must retain the above copyright
14 * notice, this list of conditions and the following disclaimer.
15 * 2. Redistributions in binary form must reproduce the above copyright
16 * notice, this list of conditions and the following disclaimer in the
17 * documentation and/or other materials provided with the distribution.
18 *
19 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
20 * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
21 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
22 * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
23 * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
24 * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
25 * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
26 * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
27 * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
28 * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE
29 * POSSIBILITY OF SUCH DAMAGE.
30 */
31
32/*********************************************************************
33 *
34 * Copyright:
35 * Freescale Semiconductor, INC. All Rights Reserved.
36 * You are hereby granted a copyright license to use, modify, and
37 * distribute the SOFTWARE so long as this entire notice is
38 * retained without alteration in any modified and/or redistributed
39 * versions, and that such modified versions are clearly identified
40 * as such. No licenses are granted by implication, estoppel or
41 * otherwise under any patents or trademarks of Freescale
42 * Semiconductor, Inc. This software is provided on an "AS IS"
43 * basis and without warranty.
44 *
45 * To the maximum extent permitted by applicable law, Freescale
46 * Semiconductor DISCLAIMS ALL WARRANTIES WHETHER EXPRESS OR IMPLIED,
47 * INCLUDING IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A
48 * PARTICULAR PURPOSE AND ANY WARRANTY AGAINST INFRINGEMENT WITH
49 * REGARD TO THE SOFTWARE (INCLUDING ANY MODIFIED VERSIONS THEREOF)
50 * AND ANY ACCOMPANYING WRITTEN MATERIALS.
51 *
52 * To the maximum extent permitted by applicable law, IN NO EVENT
53 * SHALL Freescale Semiconductor BE LIABLE FOR ANY DAMAGES WHATSOEVER
54 * (INCLUDING WITHOUT LIMITATION, DAMAGES FOR LOSS OF BUSINESS PROFITS,
55 * BUSINESS INTERRUPTION, LOSS OF BUSINESS INFORMATION, OR OTHER
56 * PECUNIARY LOSS) ARISING OF THE USE OR INABILITY TO USE THE SOFTWARE.
57 *
58 * Freescale Semiconductor assumes no responsibility for the
59 * maintenance and support of this software
60 *
61 ********************************************************************/
62
63#ifndef LIBBSP_SHARED_FSL_REGS_EDMA_H
64#define LIBBSP_SHARED_FSL_REGS_EDMA_H
65
66#include <stdint.h>
67#include <bsp.h>
68#include <bspopts.h>
69
70#ifdef __cplusplus
71extern "C" {
72#endif
73
74#if (defined(MPC55XX_CHIP_FAMILY) && \
75 (MPC55XX_CHIP_FAMILY == 566 || MPC55XX_CHIP_FAMILY == 567))
76 #define EDMA_HAS_CR_EBW 1
77 #define EDMA_HAS_CR_CX_ECX 1
78 #define EDMA_HAS_CR_EMLM_CLM_HALT_HOE 1
79 #define EDMA_HAS_ESR_ECX 1
80 #define EDMA_HAS_HRS 1
81 #define EDMA_HAS_CPR_DPA 1
82#endif
83
84#if defined(LIBBSP_ARM_IMXRT_BSP_H)
85 #define EDMA_HAS_CR_CX_ECX 1
86 #define EDMA_HAS_CR_EMLM_CLM_HALT_HOE 1
87 #define EDMA_HAS_CR_ACTIVE 1
88 #define EDMA_HAS_CR_VERSION 1
89 #define EDMA_HAS_ESR_ECX 1
90 #define EDMA_HAS_HRS 1
91 #define EDMA_HAS_EARS 1
92 #define EDMA_HAS_CPR_DPA 1
93#endif
94
95struct fsl_edma {
96 uint32_t CR;
97#ifdef EDMA_HAS_CR_EBW
98 #define EDMA_CR_EBW (1 << 0)
99#endif
100#define EDMA_CR_EDBG (1 << 1)
101#define EDMA_CR_ERCA (1 << 2)
102#define EDMA_CR_ERGA (1 << 3)
103#ifdef EDMA_HAS_CR_EMLM_CLM_HALT_HOE
104 #define EDMA_CR_HOE (1 << 4)
105 #define EDMA_CR_HALT (1 << 5)
106 #define EDMA_CR_CLM (1 << 6)
107 #define EDMA_CR_EMLM (1 << 7)
108#endif
109#define EDMA_CR_GRPxPRI_SHIFT(x) (8 + (x) * 2)
110#define EDMA_CR_GRPxPRI_MASK(x) (0x3 << EDMA_CR_GRPxPRI_SHIFT(x))
111#define EDMA_CR_GRPxPRI(x,val) (((val) << EDMA_CR_GRPxPRI_SHIFT(x)) & EDMA_CR_GRPxPRI_MASK(x))
112#define EDMA_CR_GRPxPRI_GET(x,reg) (((reg) & EDMA_CR_GRPxPRI_MASK(x)) >> EDMA_CR_GRPxPRI_SHIFT(x))
113#ifdef EDMA_HAS_CR_CX_ECX
114 #define EDMA_CR_ECX (1 << 16)
115 #define EDMA_CR_CX (1 << 17)
116#endif
117#ifdef EDMA_HAS_CR_VERSION
118 #define EDMA_CR_VERSION_SHIFT (24)
119 #define EDMA_CR_VERSION_MASK (0x7F << EDMA_CR_VERSION_SHIFT)
120 #define EDMA_CR_VERSION(val) (((val) << EDMA_CR_VERSION_SHIFT) & EDMA_CR_VERSION_MASK)
121 #define EDMA_CR_VERSION_GET(reg) (((reg) & EDMA_CR_VERSION_MASK) >> EDMA_CR_VERSION_SHIFT)
122#endif
123#ifdef EDMA_HAS_CR_ACTIVE
124 #define EDMA_CR_ACTIVE (1 << 31)
125#endif
126
127 uint32_t ESR;
128#define EDMA_ESR_DBE (1 << 0)
129#define EDMA_ESR_SBE (1 << 1)
130#define EDMA_ESR_SGE (1 << 2)
131#define EDMA_ESR_NCE (1 << 3)
132#define EDMA_ESR_DOE (1 << 4)
133#define EDMA_ESR_DAE (1 << 5)
134#define EDMA_ESR_SOE (1 << 6)
135#define EDMA_ESR_SAE (1 << 7)
136#define EDMA_ESR_ERRCHN_SHIFT (8)
137#define EDMA_ESR_ERRCHN_MASK (0x3F << EDMA_ESR_ERRCHN_SHIFT)
138#define EDMA_ESR_ERRCHN(val) (((val) << EDMA_ESR_ERRCHN_SHIFT) & EDMA_ESR_ERRCHN_MASK)
139#define EDMA_ESR_ERRCHN_GET(reg) (((reg) & EDMA_ESR_ERRCHN_MASK) >> EDMA_ESR_ERRCHN_SHIFT)
140#define EDMA_ESR_CPE (1 << 14)
141#define EDMA_ESR_GPE (1 << 15)
142#ifdef EDMA_HAS_ESR_ECX
143 #define EDMA_ESR_ECX (1 << 16)
144#endif
145#define EDMA_ESR_VLD (1 << 31)
146
147 uint32_t ERRQH;
148#define EDMA_ERRQH_ERRQ(x) (1 << ((x) - 32))
149
150 uint32_t ERRQL;
151#define EDMA_ERRQL_ERRQ(x) (1 << (x))
152
153 uint32_t EEIH;
154#define EDMA_EEIH_EEI(x) (1 << ((x) - 32))
155
156 uint32_t EEIL;
157#define EDMA_EEIL_EEI(x) (1 << (x))
158
159#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
160 uint8_t SERQR;
161 uint8_t CERQR;
162 uint8_t SEEIR;
163 uint8_t CEEIR;
164#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
165 uint8_t CEEIR;
166 uint8_t SEEIR;
167 uint8_t CERQR;
168 uint8_t SERQR;
169#endif
170#define EDMA_SERQR_NOP (1 << 7)
171#define EDMA_SERQR_SAER (1 << 6)
172#define EDMA_SERQR_SERQ_SHIFT (0)
173#define EDMA_SERQR_SERQ_MASK (0x1F << EDMA_CIRQR_SERQ_SHIFT)
174#define EDMA_SERQR_SERQ(val) (((val) << EDMA_CIRQR_SERQ_SHIFT) & EDMA_CIRQR_SERQ_MASK)
175#define EDMA_SERQR_SERQ_GET(reg) (((reg) & EDMA_CIRQR_SERQ_MASK) >> EDMA_CIRQR_SERQ_SHIFT)
176#define EDMA_CERQR_NOP (1 << 7)
177#define EDMA_CERQR_CAER (1 << 6)
178#define EDMA_CERQR_CERQ_SHIFT (0)
179#define EDMA_CERQR_CERQ_MASK (0x1F << EDMA_CIRQR_CERQ_SHIFT)
180#define EDMA_CERQR_CERQ(val) (((val) << EDMA_CIRQR_CERQ_SHIFT) & EDMA_CIRQR_CERQ_MASK)
181#define EDMA_CERQR_CERQ_GET(reg) (((reg) & EDMA_CIRQR_CERQ_MASK) >> EDMA_CIRQR_CERQ_SHIFT)
182#define EDMA_SEEIR_NOP (1 << 7)
183#define EDMA_SEEIR_SAEE (1 << 6)
184#define EDMA_SEEIR_SEEI_SHIFT (0)
185#define EDMA_SEEIR_SEEI_MASK (0x1F << EDMA_CIRQR_SEEI_SHIFT)
186#define EDMA_SEEIR_SEEI(val) (((val) << EDMA_CIRQR_SEEI_SHIFT) & EDMA_CIRQR_SEEI_MASK)
187#define EDMA_SEEIR_SEEI_GET(reg) (((reg) & EDMA_CIRQR_SEEI_MASK) >> EDMA_CIRQR_SEEI_SHIFT)
188#define EDMA_CEEIR_NOP (1 << 7)
189#define EDMA_CEEIR_CAEE (1 << 6)
190#define EDMA_CEEIR_CEEI_SHIFT (0)
191#define EDMA_CEEIR_CEEI_MASK (0x1F << EDMA_CIRQR_CEEI_SHIFT)
192#define EDMA_CEEIR_CEEI(val) (((val) << EDMA_CIRQR_CEEI_SHIFT) & EDMA_CIRQR_CEEI_MASK)
193#define EDMA_CEEIR_CEEI_GET(reg) (((reg) & EDMA_CIRQR_CEEI_MASK) >> EDMA_CIRQR_CEEI_SHIFT)
194
195#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
196 uint8_t CIRQR;
197 uint8_t CER;
198 uint8_t SSBR;
199 uint8_t CDSBR;
200#elif __BYTE_ORDER__ == __ORDER_LITTLE_ENDIAN__
201 uint8_t CDSBR;
202 uint8_t SSBR;
203 uint8_t CER;
204 uint8_t CIRQR;
205#endif
206#define EDMA_CIRQR_NOP (1 << 7)
207#define EDMA_CIRQR_CAIR (1 << 6)
208#define EDMA_CIRQR_CINT_SHIFT (0)
209#define EDMA_CIRQR_CINT_MASK (0x1F << EDMA_CIRQR_CINT_SHIFT)
210#define EDMA_CIRQR_CINT(val) (((val) << EDMA_CIRQR_CINT_SHIFT) & EDMA_CIRQR_CINT_MASK)
211#define EDMA_CIRQR_CINT_GET(reg) (((reg) & EDMA_CIRQR_CINT_MASK) >> EDMA_CIRQR_CINT_SHIFT)
212#define EDMA_CER_NOP (1 << 7)
213#define EDMA_CER_CAEI (1 << 6)
214#define EDMA_CER_CERR_SHIFT (0)
215#define EDMA_CER_CERR_MASK (0x1F << EDMA_CIRQR_CERR_SHIFT)
216#define EDMA_CER_CERR(val) (((val) << EDMA_CIRQR_CERR_SHIFT) & EDMA_CIRQR_CERR_MASK)
217#define EDMA_CER_CERR_GET(reg) (((reg) & EDMA_CIRQR_CERR_MASK) >> EDMA_CIRQR_CERR_SHIFT)
218#define EDMA_SSBR_NOP (1 << 7)
219#define EDMA_SSBR_SAST (1 << 6)
220#define EDMA_SSBR_SSB_SHIFT (0)
221#define EDMA_SSBR_SSB_MASK (0x1F << EDMA_CIRQR_SSB_SHIFT)
222#define EDMA_SSBR_SSB(val) (((val) << EDMA_CIRQR_SSB_SHIFT) & EDMA_CIRQR_SSB_MASK)
223#define EDMA_SSBR_SSB_GET(reg) (((reg) & EDMA_CIRQR_SSB_MASK) >> EDMA_CIRQR_SSB_SHIFT)
224#define EDMA_CDSBR_NOP (1 << 7)
225#define EDMA_CDSBR_CADN (1 << 6)
226#define EDMA_CDSBR_CDSB_SHIFT (0)
227#define EDMA_CDSBR_CDSB_MASK (0x1F << EDMA_CIRQR_CDSB_SHIFT)
228#define EDMA_CDSBR_CDSB(val) (((val) << EDMA_CIRQR_CDSB_SHIFT) & EDMA_CIRQR_CDSB_MASK)
229#define EDMA_CDSBR_CDSB_GET(reg) (((reg) & EDMA_CIRQR_CDSB_MASK) >> EDMA_CIRQR_CDSB_SHIFT)
230
231 uint32_t IRQH;
232#define EDMA_IRQH_INT(x) (1 << ((x) - 32))
233
234 uint32_t IRQL;
235#define EDMA_IRQL_INT(x) (1 << ((x)))
236
237 uint32_t ERH;
238#define EDMA_ERH_ERR(x) (1 << ((x) - 32))
239
240 uint32_t ERL;
241#define EDMA_ERL_ERR(x) (1 << ((x)))
242
243#ifdef EDMA_HAS_HRS
244 uint32_t HRS;
245#define EDMA_HRSH_HRS(x) (1 << ((x) - 32))
246
247 uint32_t HRSL;
248#define EDMA_HRSL_HRS(x) (1 << ((x)))
249#else
250 uint32_t reserved0030[2];
251#endif
252
253 uint32_t reserved0038[(0x44-0x38)/4];
254
255#ifdef EDMA_HAS_EARS
256 uint32_t EARSL;
257#define EDMA_EARSL_EDREQ(x) (1 << ((x))) /* iMXRT only */
258#else
259 uint32_t reserved0044;
260#endif
261
262 uint32_t reserved0048[(0x100-0x48)/4];
263
264 uint8_t CPR[64];
265#define EDMA_CPR_CHPRI_SHIFT (0)
266#define EDMA_CPR_CHPRI_MASK (0xF << EDMA_CPR_CHPRI_SHIFT)
267#define EDMA_CPR_CHPRI(val) (((val) << EDMA_CPR_CHPRI_SHIFT) & EDMA_CPR_CHPRI_MASK)
268#define EDMA_CPR_CHPRI_GET(reg) (((reg) & EDMA_CPR_CHPRI_MASK) >> EDMA_CPR_CHPRI_SHIFT)
269#define EDMA_CPR_GRPPRI_SHIFT (0)
270#define EDMA_CPR_GRPPRI_MASK (0xF << EDMA_CPR_GRPPRI_SHIFT)
271#define EDMA_CPR_GRPPRI(val) (((val) << EDMA_CPR_GRPPRI_SHIFT) & EDMA_CPR_GRPPRI_MASK)
272#define EDMA_CPR_GRPPRI_GET(reg) (((reg) & EDMA_CPR_GRPPRI_MASK) >> EDMA_CPR_GRPPRI_SHIFT)
273#ifdef EDMA_HAS_CPR_DPA
274 #define EDMA_CPR_DPA (1 << 6)
275#endif
276#define EDMA_CPR_ECP (1 << 7)
277
278 uint32_t reserved0140[(0x1000-0x140)/4];
279
281 uint32_t SADDR;
282 uint32_t SDF;
283#define EDMA_TCD_SDF_SMOD_SHIFT (27)
284#define EDMA_TCD_SDF_SMOD_MASK (0x1F << EDMA_TCD_SDF_SMOD_SHIFT)
285#define EDMA_TCD_SDF_SMOD(val) (((val) << EDMA_TCD_SDF_SMOD_SHIFT) & EDMA_TCD_SDF_SMOD_MASK)
286#define EDMA_TCD_SDF_SMOD_GET(reg) (((reg) & EDMA_TCD_SDF_SMOD_MASK) >> EDMA_TCD_SDF_SMOD_SHIFT)
287#define EDMA_TCD_SDF_SSIZE_SHIFT (24)
288#define EDMA_TCD_SDF_SSIZE_MASK (0x7 << EDMA_TCD_SDF_SSIZE_SHIFT)
289#define EDMA_TCD_SDF_SSIZE(val) (((val) << EDMA_TCD_SDF_SSIZE_SHIFT) & EDMA_TCD_SDF_SSIZE_MASK)
290#define EDMA_TCD_SDF_SSIZE_GET(reg) (((reg) & EDMA_TCD_SDF_SSIZE_MASK) >> EDMA_TCD_SDF_SSIZE_SHIFT)
291#define EDMA_TCD_SDF_SSIZE_8BIT EDMA_TCD_SDF_SSIZE(0)
292#define EDMA_TCD_SDF_SSIZE_16BIT EDMA_TCD_SDF_SSIZE(1)
293#define EDMA_TCD_SDF_SSIZE_32BIT EDMA_TCD_SDF_SSIZE(2)
294#define EDMA_TCD_SDF_SSIZE_64BIT EDMA_TCD_SDF_SSIZE(3)
295#define EDMA_TCD_SDF_SSIZE_32BYTE EDMA_TCD_SDF_SSIZE(5)
296#define EDMA_TCD_SDF_DMOD_SHIFT (19)
297#define EDMA_TCD_SDF_DMOD_MASK (0x1F << EDMA_TCD_SDF_DMOD_SHIFT)
298#define EDMA_TCD_SDF_DMOD(val) (((val) << EDMA_TCD_SDF_DMOD_SHIFT) & EDMA_TCD_SDF_DMOD_MASK)
299#define EDMA_TCD_SDF_DMOD_GET(reg) (((reg) & EDMA_TCD_SDF_DMOD_MASK) >> EDMA_TCD_SDF_DMOD_SHIFT)
300#define EDMA_TCD_SDF_DSIZE_SHIFT (16)
301#define EDMA_TCD_SDF_DSIZE_MASK (0x7 << EDMA_TCD_SDF_DSIZE_SHIFT)
302#define EDMA_TCD_SDF_DSIZE(val) (((val) << EDMA_TCD_SDF_DSIZE_SHIFT) & EDMA_TCD_SDF_DSIZE_MASK)
303#define EDMA_TCD_SDF_DSIZE_GET(reg) (((reg) & EDMA_TCD_SDF_DSIZE_MASK) >> EDMA_TCD_SDF_DSIZE_SHIFT)
304#define EDMA_TCD_SDF_DSIZE_8BIT EDMA_TCD_SDF_DSIZE(0)
305#define EDMA_TCD_SDF_DSIZE_16BIT EDMA_TCD_SDF_DSIZE(1)
306#define EDMA_TCD_SDF_DSIZE_32BIT EDMA_TCD_SDF_DSIZE(2)
307#define EDMA_TCD_SDF_DSIZE_64BIT EDMA_TCD_SDF_DSIZE(3)
308#define EDMA_TCD_SDF_DSIZE_32BYTE EDMA_TCD_SDF_DSIZE(5)
309#define EDMA_TCD_SDF_SOFF_SHIFT (0)
310#define EDMA_TCD_SDF_SOFF_MASK (0xFFFF << EDMA_TCD_SDF_SOFF_SHIFT)
311#define EDMA_TCD_SDF_SOFF(val) (((val) << EDMA_TCD_SDF_SOFF_SHIFT) & EDMA_TCD_SDF_SOFF_MASK)
312#define EDMA_TCD_SDF_SOFF_GET(reg) (((reg) & EDMA_TCD_SDF_SOFF_MASK) >> EDMA_TCD_SDF_SOFF_SHIFT)
313
314 uint32_t NBYTES;
315#define EDMA_TCD_NBYTES_ALT_NBYTES_SHIFT (0)
316#define EDMA_TCD_NBYTES_ALT_NBYTES_MASK (0x3FF << EDMA_TCD_NBYTES_ALT_NBYTES_SHIFT)
317#define EDMA_TCD_NBYTES_ALT_NBYTES(val) (((val) << EDMA_TCD_NBYTES_ALT_NBYTES_SHIFT) & EDMA_TCD_NBYTES_ALT_NBYTES_MASK)
318#define EDMA_TCD_NBYTES_ALT_MLOFF_SHIFT (10)
319#define EDMA_TCD_NBYTES_ALT_MLOFF_MASK (0xFFFFF << EDMA_TCD_NBYTES_ALT_MLOFF_SHIFT)
320#define EDMA_TCD_NBYTES_ALT_MLOFF(val) (((val) << EDMA_TCD_NBYTES_ALT_MLOFF_SHIFT) & EDMA_TCD_NBYTES_ALT_MLOFF_MASK)
321#define EDMA_TCD_NBYTES_ALT_DMLOE (1 << 30)
322#define EDMA_TCD_NBYTES_ALT_SMLOE (1 << 31)
323 int32_t SLAST;
324 uint32_t DADDR;
325 uint32_t CDF;
326#define EDMA_TCD_CDF_CITERE_LINK (1 << 31)
327#define EDMA_TCD_CDF_CITER_SHIFT (16)
328#define EDMA_TCD_CDF_CITER_MASK (0x7FFF << EDMA_TCD_CDF_CITER_SHIFT)
329#define EDMA_TCD_CDF_CITER(val) (((val) << EDMA_TCD_CDF_CITER_SHIFT) & EDMA_TCD_CDF_CITER_MASK)
330#define EDMA_TCD_CDF_CITER_GET(reg) (((reg) & EDMA_TCD_CDF_CITER_MASK) >> EDMA_TCD_CDF_CITER_SHIFT)
331#define EDMA_TCD_CDF_DOFF_SHIFT (0)
332#define EDMA_TCD_CDF_DOFF_MASK (0xFFFF << EDMA_TCD_CDF_DOFF_SHIFT)
333#define EDMA_TCD_CDF_DOFF(val) (((val) << EDMA_TCD_CDF_DOFF_SHIFT) & EDMA_TCD_CDF_DOFF_MASK)
334#define EDMA_TCD_CDF_DOFF_GET(reg) (((reg) & EDMA_TCD_CDF_DOFF_MASK) >> EDMA_TCD_CDF_DOFF_SHIFT)
335
336#define EDMA_TCD_CDF_ALT_CITERLINKCH_SHIFT (25)
337#define EDMA_TCD_CDF_ALT_CITERLINKCH_MASK (0x3F << EDMA_TCD_CDF_ALT_CITERLINKCH_SHIFT)
338#define EDMA_TCD_CDF_ALT_CITERLINKCH(val) (((val) << EDMA_TCD_CDF_ALT_CITERLINKCH_SHIFT) & EDMA_TCD_CDF_ALT_CITERLINKCH_MASK)
339#define EDMA_TCD_CDF_ALT_CITERLINKCH_GET(reg) (((reg) & EDMA_TCD_CDF_ALT_CITERLINKCH_MASK) >> EDMA_TCD_CDF_ALT_CITERLINKCH_SHIFT)
340#define EDMA_TCD_CDF_ALT_CITER_SHIFT (16)
341#define EDMA_TCD_CDF_ALT_CITER_MASK (0x1FF << EDMA_TCD_CDF_ALT_CITER_SHIFT)
342#define EDMA_TCD_CDF_ALT_CITER(val) (((val) << EDMA_TCD_CDF_ALT_CITER_SHIFT) & EDMA_TCD_CDF_ALT_CITER_MASK)
343#define EDMA_TCD_CDF_ALT_CITER_GET(reg) (((reg) & EDMA_TCD_CDF_ALT_CITER_MASK) >> EDMA_TCD_CDF_ALT_CITER_SHIFT)
344
345#define EDMA_TCD_CDF_NOLINK_CITER_SHIFT (16)
346#define EDMA_TCD_CDF_NOLINK_CITER_MASK (0xFFFF << EDMA_TCD_CDF_NOLINK_CITER_SHIFT)
347#define EDMA_TCD_CDF_NOLINK_CITER(val) (((val) << EDMA_TCD_CDF_NOLINK_CITER_SHIFT) & EDMA_TCD_CDF_NOLINK_CITER_MASK)
348#define EDMA_TCD_CDF_NOLINK_CITER_GET(reg) (((reg) & EDMA_TCD_CDF_NOLINK_CITER_MASK) >> EDMA_TCD_CDF_NOLINK_CITER_SHIFT)
349
350 int32_t DLAST_SGA;
351 uint32_t BMF;
352#define EDMA_TCD_BMF_BITERE_LINK (1 << 31)
353#define EDMA_TCD_BMF_BITER_SHIFT (16)
354#define EDMA_TCD_BMF_BITER_MASK (0x7FFF << EDMA_TCD_BMF_BITER_SHIFT)
355#define EDMA_TCD_BMF_BITER(val) (((val) << EDMA_TCD_BMF_BITER_SHIFT) & EDMA_TCD_BMF_BITER_MASK)
356#define EDMA_TCD_BMF_BITER_GET(reg) (((reg) & EDMA_TCD_BMF_BITER_MASK) >> EDMA_TCD_BMF_BITER_SHIFT)
357#define EDMA_TCD_BMF_BWC_SHIFT (14)
358#define EDMA_TCD_BMF_BWC_MASK (0x3 << EDMA_TCD_BMF_BWC_SHIFT)
359#define EDMA_TCD_BMF_BWC(val) (((val) << EDMA_TCD_BMF_BWC_SHIFT) & EDMA_TCD_BMF_BWC_MASK)
360#define EDMA_TCD_BMF_BWC_GET(reg) (((reg) & EDMA_TCD_BMF_BWC_MASK) >> EDMA_TCD_BMF_BWC_SHIFT)
361#define EDMA_TCD_BMF_MAJORLINKCH_SHIFT (8)
362#define EDMA_TCD_BMF_MAJORLINKCH_MASK (0x3F << EDMA_TCD_BMF_MAJORLINKCH_SHIFT)
363#define EDMA_TCD_BMF_MAJORLINKCH(val) (((val) << EDMA_TCD_BMF_MAJORLINKCH_SHIFT) & EDMA_TCD_BMF_MAJORLINKCH_MASK)
364#define EDMA_TCD_BMF_MAJORLINKCH_GET(reg) (((reg) & EDMA_TCD_BMF_MAJORLINKCH_MASK) >> EDMA_TCD_BMF_MAJORLINKCH_SHIFT)
365#define EDMA_TCD_BMF_DONE (1 << 7)
366#define EDMA_TCD_BMF_ACTIVE (1 << 6)
367#define EDMA_TCD_BMF_MAJORE_LINK (1 << 5)
368#define EDMA_TCD_BMF_E_SG (1 << 4)
369#define EDMA_TCD_BMF_D_REQ (1 << 3)
370#define EDMA_TCD_BMF_INT_HALF (1 << 2)
371#define EDMA_TCD_BMF_INT_MAJ (1 << 1)
372#define EDMA_TCD_BMF_START (1 << 0)
373
374#define EDMA_TCD_BMF_ALT_BITERLINKCH_SHIFT (25)
375#define EDMA_TCD_BMF_ALT_BITERLINKCH_MASK (0x3F << EDMA_TCD_BMF_ALT_BITERLINKCH_SHIFT)
376#define EDMA_TCD_BMF_ALT_BITERLINKCH(val) (((val) << EDMA_TCD_BMF_ALT_BITERLINKCH_SHIFT) & EDMA_TCD_BMF_ALT_BITERLINKCH_MASK)
377#define EDMA_TCD_BMF_ALT_BITERLINKCH_GET(reg) (((reg) & EDMA_TCD_BMF_ALT_BITERLINKCH_MASK) >> EDMA_TCD_BMF_ALT_BITERLINKCH_SHIFT)
378#define EDMA_TCD_BMF_ALT_BITER_SHIFT (16)
379#define EDMA_TCD_BMF_ALT_BITER_MASK (0x1FF << EDMA_TCD_BMF_ALT_BITER_SHIFT)
380#define EDMA_TCD_BMF_ALT_BITER(val) (((val) << EDMA_TCD_BMF_ALT_BITER_SHIFT) & EDMA_TCD_BMF_ALT_BITER_MASK)
381#define EDMA_TCD_BMF_ALT_BITER_GET(reg) (((reg) & EDMA_TCD_BMF_ALT_BITER_MASK) >> EDMA_TCD_BMF_ALT_BITER_SHIFT)
382
383#define EDMA_TCD_BMF_NOLINK_BITER_SHIFT (16)
384#define EDMA_TCD_BMF_NOLINK_BITER_MASK (0xFFFF << EDMA_TCD_BMF_NOLINK_BITER_SHIFT)
385#define EDMA_TCD_BMF_NOLINK_BITER(val) (((val) << EDMA_TCD_BMF_NOLINK_BITER_SHIFT) & EDMA_TCD_BMF_NOLINK_BITER_MASK)
386#define EDMA_TCD_BMF_NOLINK_BITER_GET(reg) (((reg) & EDMA_TCD_BMF_NOLINK_BITER_MASK) >> EDMA_TCD_BMF_NOLINK_BITER_SHIFT)
387
388 } TCD[64];
389};
390
391#ifndef __cplusplus
392static const struct fsl_edma_tcd EDMA_TCD_DEFAULT = {
393 .SADDR = 0,
394 .SDF = 0,
395 .NBYTES = 0,
396 .SLAST = 0,
397 .DADDR = 0,
398 .CDF = 0,
399 .DLAST_SGA = 0,
400 .BMF = 0,
401};
402#endif /* __cplusplus */
403
404#define EDMA_TCD_BITER_MASK 0x7fff
405
406#define EDMA_TCD_BITER_SIZE (EDMA_TCD_BITER_MASK + 1)
407
408#define EDMA_TCD_BITER_LINKED_MASK 0x1ff
409
410#define EDMA_TCD_BITER_LINKED_SIZE (EDMA_TCD_BITER_LINKED_MASK + 1)
411
412#define EDMA_TCD_LINK_AND_BITER(link, biter) \
413 (((link) << 9) + ((biter) & EDMA_TCD_BITER_LINKED_MASK))
414
415#ifdef __cplusplus
416}
417#endif /* __cplusplus */
418
419#endif /* LIBBSP_SHARED_FSL_REGS_EDMA_H */
Definition: regs-edma.h:280
Definition: regs-edma.h:95