PDK API Guide for J721E
csl_clec.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2017 Texas Instruments Incorporated.
3  *
4  * Redistribution and use in source and binary forms, with or without
5  * modification, are permitted provided that the following conditions
6  * are met:
7  *
8  * Redistributions of source code must retain the above copyright
9  * notice, this list of conditions and the following disclaimer.
10  *
11  * Redistributions in binary form must reproduce the above copyright
12  * notice, this list of conditions and the following disclaimer in the
13  * documentation and/or other materials provided with the
14  * distribution.
15  *
16  * Neither the name of Texas Instruments Incorporated nor the names of
17  * its contributors may be used to endorse or promote products derived
18  * from this software without specific prior written permission.
19  *
20  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
21  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
22  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
23  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
24  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
25  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
26  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
27  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
28  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
29  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
30  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
31  *
32  */
46 #ifndef CSL_CLEC_H_
47 #define CSL_CLEC_H_
48 
49 /* ========================================================================== */
50 /* Include Files */
51 /* ========================================================================== */
52 
53 #include <stdint.h>
54 #include <ti/csl/cslr_clec.h>
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /* ========================================================================== */
61 /* Macros */
62 /* ========================================================================== */
63 
69 #define CSL_CLEC_MAX_EVT_IN (2047U)
70 
73 #define CSL_CLEC_MAX_EXT_EVT_OUT (128U)
74 
78 #define CSL_CLEC_MAX_C7X_EVT_OUT (64U)
79 
92 #define CSL_CLEC_RTMAP_DISABLE ((uint32_t)((uint32_t) 0x0001U) << 0U)
93 
94 #define CSL_CLEC_RTMAP_SYS ((uint32_t)((uint32_t) 0x0001U) << 1U)
95 
96 #define CSL_CLEC_RTMAP_CPU_0 ((uint32_t)((uint32_t) 0x0000U) << 2U)
97 
98 #define CSL_CLEC_RTMAP_CPU_1 ((uint32_t)((uint32_t) 0x0001U) << 2U)
99 
100 #define CSL_CLEC_RTMAP_CPU_2 ((uint32_t)((uint32_t) 0x0002U) << 2U)
101 
102 #define CSL_CLEC_RTMAP_CPU_3 ((uint32_t)((uint32_t) 0x0003U) << 2U)
103 
104 #define CSL_CLEC_RTMAP_CPU_4 ((uint32_t)((uint32_t) 0x0004U) << 2U)
105 
106 #define CSL_CLEC_RTMAP_CPU_5 ((uint32_t)((uint32_t) 0x0005U) << 2U)
107 
108 #define CSL_CLEC_RTMAP_CPU_6 ((uint32_t)((uint32_t) 0x0006U) << 2U)
109 
110 #define CSL_CLEC_RTMAP_CPU_7 ((uint32_t)((uint32_t) 0x0007U) << 2U)
111 
112 #define CSL_CLEC_RTMAP_CPU_8 ((uint32_t)((uint32_t) 0x0008U) << 2U)
113 
114 #define CSL_CLEC_RTMAP_CPU_9 ((uint32_t)((uint32_t) 0x0009U) << 2U)
115 
116 #define CSL_CLEC_RTMAP_CPU_10 ((uint32_t)((uint32_t) 0x000AU) << 2U)
117 
118 #define CSL_CLEC_RTMAP_CPU_ALL ((uint32_t)((uint32_t) 0x000FU) << 2U)
119 /* @} */
120 
121 /* ========================================================================== */
122 /* Structures and Enums */
123 /* ========================================================================== */
124 
126 typedef struct
127 {
132  uint32_t evtSendEnable;
135  uint32_t rtMap;
137  uint32_t extEvtNum;
140  uint32_t c7xEvtNum;
144 
145 /* ========================================================================== */
146 /* Function Declarations */
147 /* ========================================================================== */
148 
158 int32_t CSL_clecConfigEvent(CSL_CLEC_EVTRegs *pRegs,
159  uint32_t evtNum,
160  const CSL_ClecEventConfig *evtCfg);
161 
172 int32_t CSL_clecSendEvent(CSL_CLEC_EVTRegs *pRegs, uint32_t evtNum);
173 
182 int32_t CSL_clecClearEvent(CSL_CLEC_EVTRegs *pRegs, uint32_t evtNum);
183 
184 
194 int32_t CSL_clecConfigEventLevel(CSL_CLEC_EVTRegs *pRegs,
195  uint32_t evtNum,
196  uint32_t is_level);
197 
198 /* ========================================================================== */
199 /* Static Function Definitions */
200 /* ========================================================================== */
201 
202 /* None */
203 
204 #ifdef __cplusplus
205 }
206 #endif
207 
208 #endif /* CSL_CLEC_H_ */
209 
This structure contains the parameters to setup a event.
Definition: csl_clec.h:126
int32_t CSL_clecConfigEvent(CSL_CLEC_EVTRegs *pRegs, uint32_t evtNum, const CSL_ClecEventConfig *evtCfg)
This API sets the event configuration.
uint32_t c7xEvtNum
Definition: csl_clec.h:140
uint32_t secureClaimEnable
Definition: csl_clec.h:128
uint32_t evtSendEnable
Definition: csl_clec.h:132
int32_t CSL_clecConfigEventLevel(CSL_CLEC_EVTRegs *pRegs, uint32_t evtNum, uint32_t is_level)
This API does a set or clear of the is_lvl field in CLEC.MRR register.
int32_t CSL_clecClearEvent(CSL_CLEC_EVTRegs *pRegs, uint32_t evtNum)
This API clear any level interrupt set for the event.
int32_t CSL_clecSendEvent(CSL_CLEC_EVTRegs *pRegs, uint32_t evtNum)
This API sends the event specified if the event send is enabled in the event configuration (evtSendEn...
uint32_t extEvtNum
Definition: csl_clec.h:137
uint32_t rtMap
Definition: csl_clec.h:135