PDK API Guide for J721E
csl_psilcfg.h
Go to the documentation of this file.
1 /* =============================================================================
2  * Copyright 2016-2020 (c) Texas Instruments, Inc.
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  */
33 
47 #ifndef CSL_PSILCFG_H_
48 #define CSL_PSILCFG_H_
49 
50 #ifdef __cplusplus
51 extern "C" {
52 #endif
53 
54 #include <stdint.h>
55 #include <stdbool.h>
56 #include <ti/csl/cslr_psilcfg.h>
57 
91 typedef uint32_t CSL_PsilCfgReg;
92 
94 #define CSL_PSILCFG_REG_PEER_THREAD_ID ((uint32_t) 0U)
95 
96 #define CSL_PSILCFG_REG_PEER_CREDIT ((uint32_t) 0x001U)
97 
98 #define CSL_PSILCFG_REG_ENABLE ((uint32_t) 0x002U)
99 
100 #define CSL_PSILCFG_REG_CAPABILITIES ((uint32_t) 0x040U)
101 
102 #define CSL_PSILCFG_REG_STATIC_TR ((uint32_t) 0x400U)
103 
104 #define CSL_PSILCFG_REG_STATIC_TR_Z ((uint32_t) 0x401U)
105 
106 #define CSL_PSILCFG_REG_BYTE_COUNT ((uint32_t) 0x404U)
107 
108 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG ((uint32_t) 0x405U)
109 
110 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0 ((uint32_t) 0x406U)
111 
112 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1 ((uint32_t) 0x407U)
113 
114 #define CSL_PSILCFG_REG_RT_ENABLE ((uint32_t) 0x408U)
115 
118 #define CSL_PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E(N) ((uint32_t)0x4000U + (uint32_t)(N))
119 /* @} */
120 
121 /* PSILCFG_REG_PEER_THREAD_ID */
122 #define CSL_PSILCFG_REG_PEER_THREAD_ID_THREAD_ID_SHIFT (0)
123 #define CSL_PSILCFG_REG_PEER_THREAD_ID_THREAD_ID_MASK ((uint32_t)0xFFFFU<<CSL_PSILCFG_REG_PEER_THREAD_ID_THREAD_ID_SHIFT)
124 #define CSL_PSILCFG_REG_PEER_THREAD_ID_THREAD_WIDTH_SHIFT (24U)
125 #define CSL_PSILCFG_REG_PEER_THREAD_ID_THREAD_WIDTH_MASK ((uint32_t)0x1FU<<CSL_PSILCFG_REG_PEER_THREAD_ID_THREAD_WIDTH_SHIFT)
126 #define CSL_PSILCFG_REG_PEER_THREAD_ID_THREAD_PRI_SHIFT (29U)
127 #define CSL_PSILCFG_REG_PEER_THREAD_ID_THREAD_PRI_MASK ((uint32_t)0x7U<<CSL_PSILCFG_REG_PEER_THREAD_ID_THREAD_PRI_SHIFT)
128 
129 /* PSILCFG_REG_PEER_CREDIT */
130 #define CSL_PSILCFG_REG_PEER_CREDIT_CNT_SHIFT (0)
131 #define CSL_PSILCFG_REG_PEER_CREDIT_CNT_MASK ((uint32_t)0xFFU<<CSL_PSILCFG_REG_PEER_CREDIT_CNT_SHIFT)
132 
133 /* PSILCFG_REG_ENABLE */
134 #define CSL_PSILCFG_REG_ENABLE_ENABLE_SHIFT (31U)
135 #define CSL_PSILCFG_REG_ENABLE_ENABLE_MASK ((uint32_t)0x01U<<CSL_PSILCFG_REG_ENABLE_ENABLE_SHIFT)
136 #define CSL_PSILCFG_REG_ENABLE_TEARDOWN_SHIFT (30U)
137 #define CSL_PSILCFG_REG_ENABLE_TEARDOWN_MASK ((uint32_t)0x01U<<CSL_PSILCFG_REG_ENABLE_TEARDOWN_SHIFT)
138 
139 /* PSILCFG_REG_CAPABILITIES */
140 #define CSL_PSILCFG_REG_CAPABILITIES_CREDIT_CNT_SHIFT (0)
141 #define CSL_PSILCFG_REG_CAPABILITIES_CREDIT_CNT_MASK ((uint32_t)0xFFU<<CSL_PSILCFG_REG_CAPABILITIES_CREDIT_CNT_SHIFT)
142 #define CSL_PSILCFG_REG_CAPABILITIES_THREAD_WIDTH_SHIFT (24U)
143 #define CSL_PSILCFG_REG_CAPABILITIES_THREAD_WIDTH_MASK ((uint32_t)0x1FU<<CSL_PSILCFG_REG_CAPABILITIES_THREAD_WIDTH_SHIFT)
144 
145 /* PSILCFG_REG_STATIC_TR */
146 #define CSL_PSILCFG_REG_STATIC_TR_X_SHIFT (24U)
147 #define CSL_PSILCFG_REG_STATIC_TR_X_MASK (((uint32_t)0x0007U) << CSL_PSILCFG_REG_STATIC_TR_X_SHIFT)
148 #define CSL_PSILCFG_REG_STATIC_TR_Y_SHIFT (0U)
149 #define CSL_PSILCFG_REG_STATIC_TR_Y_MASK (((uint32_t)0x0FFFU) << CSL_PSILCFG_REG_STATIC_TR_Y_SHIFT)
150 #define CSL_PSILCFG_REG_STATIC_TR_Z_SHIFT (0U)
151 #define CSL_PSILCFG_REG_STATIC_TR_Z_MASK (((uint32_t)0x0FFFU) << CSL_PSILCFG_REG_STATIC_TR_Z_SHIFT)
152 
153 /* PSILCFG_REG_RT_ENABLE */
154 #define CSL_PSILCFG_REG_RT_ENABLE_IDLE_SHIFT (1U)
155 #define CSL_PSILCFG_REG_RT_ENABLE_IDLE_MASK ((uint32_t)0x01U<<CSL_PSILCFG_REG_RT_ENABLE_IDLE_SHIFT)
156 #define CSL_PSILCFG_REG_RT_ENABLE_FLUSH_SHIFT (28U)
157 #define CSL_PSILCFG_REG_RT_ENABLE_FLUSH_MASK ((uint32_t)0x01U << CSL_PSILCFG_REG_RT_ENABLE_FLUSH_SHIFT)
158 #define CSL_PSILCFG_REG_RT_ENABLE_PAUSE_SHIFT (29U)
159 #define CSL_PSILCFG_REG_RT_ENABLE_PAUSE_MASK ((uint32_t)0x01U<<CSL_PSILCFG_REG_RT_ENABLE_PAUSE_SHIFT)
160 #define CSL_PSILCFG_REG_RT_ENABLE_TDOWN_SHIFT (30U)
161 #define CSL_PSILCFG_REG_RT_ENABLE_TDOWN_MASK ((uint32_t)0x01U<<CSL_PSILCFG_REG_RT_ENABLE_TDOWN_SHIFT)
162 #define CSL_PSILCFG_REG_RT_ENABLE_ENABLE_SHIFT (31U)
163 #define CSL_PSILCFG_REG_RT_ENABLE_ENABLE_MASK ((uint32_t)0x01U<<CSL_PSILCFG_REG_RT_ENABLE_ENABLE_SHIFT)
164 
165 /* PSILCFG_REG_AASRC_FIFO_CFG */
166 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_DMA_REQ_MASK_SHIFT (0U)
167 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_DMA_REQ_MASK_MASK ((uint32_t)0x0FFFFU<<CSL_PSILCFG_REG_AASRC_FIFO_CFG_DMA_REQ_MASK_SHIFT)
168 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_FIRST_SLOT_SHIFT (16U)
169 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_FIRST_SLOT_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_FIFO_CFG_FIRST_SLOT_SHIFT)
170 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_LAST_SLOT_SHIFT (20U)
171 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_LAST_SLOT_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_FIFO_CFG_LAST_SLOT_SHIFT)
172 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_DMA_REQ_RESET_SHIFT (30U)
173 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_DMA_REQ_RESET_MASK ((uint32_t)0x01U<<CSL_PSILCFG_REG_AASRC_FIFO_CFG_DMA_REQ_RESET_SHIFT)
174 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_GROUP_MODE_SHIFT (31U)
175 #define CSL_PSILCFG_REG_AASRC_FIFO_CFG_GROUP_MODE_MASK ((uint32_t)0x01U<<CSL_PSILCFG_REG_AASRC_FIFO_CFG_GROUP_MODE_SHIFT)
176 
177 /* PSILCFG_REG_AASRC_ORDER_TABLE0 */
178 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY0_SHIFT (0U)
179 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY0_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY0_SHIFT)
180 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY1_SHIFT (4U)
181 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY1_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY1_SHIFT)
182 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY2_SHIFT (8U)
183 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY2_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY2_SHIFT)
184 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY3_SHIFT (12U)
185 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY3_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY3_SHIFT)
186 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY4_SHIFT (16U)
187 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY4_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY4_SHIFT)
188 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY5_SHIFT (20U)
189 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY5_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY5_SHIFT)
190 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY6_SHIFT (24U)
191 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY6_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY6_SHIFT)
192 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY7_SHIFT (28U)
193 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY7_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE0_ENTRY7_SHIFT)
194 
195 /* PSILCFG_REG_AASRC_ORDER_TABLE1 */
196 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY8_SHIFT (0U)
197 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY8_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY8_SHIFT)
198 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY9_SHIFT (4U)
199 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY9_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY9_SHIFT)
200 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY10_SHIFT (8U)
201 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY10_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY10_SHIFT)
202 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY11_SHIFT (12U)
203 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY11_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY11_SHIFT)
204 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY12_SHIFT (16U)
205 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY12_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY12_SHIFT)
206 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY13_SHIFT (20U)
207 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY13_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY13_SHIFT)
208 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY14_SHIFT (24U)
209 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY14_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY14_SHIFT)
210 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY15_SHIFT (28U)
211 #define CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY15_MASK ((uint32_t)0x0FU<<CSL_PSILCFG_REG_AASRC_ORDER_TABLE1_ENTRY15_SHIFT)
212 
213 /* PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E */
214 #define CSL_PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E_INDEX_SHIFT (0U)
215 #define CSL_PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E_INDEX_MASK ((uint32_t)0xFFFFU<<CSL_PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E_INDEX_SHIFT)
216 #define CSL_PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E_TYPE_SHIFT (31U)
217 #define CSL_PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E_TYPE_MASK ((uint32_t)0x1U<<CSL_PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E_TYPE_SHIFT)
218 #define CSL_PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E_TYPE_PULSE ((uint32_t) 0U)
219 #define CSL_PSILCFG_REG_LOCAL_TO_GLOBAL_MAPPING_E_TYPE_RISING_EDGE ((uint32_t) 1U)
220 
221 /* @} */
222 
239 extern uint32_t CSL_psilcfgGetRevision( const CSL_psilcfgRegs *pRegs );
240 
264 extern bool CSL_psilcfgWrite( const CSL_psilcfgRegs *pRegs, uint32_t threadId, uint32_t regId, uint32_t data );
265 
289 extern bool CSL_psilcfgRead( const CSL_psilcfgRegs *pRegs, uint32_t threadId, uint32_t regId, uint32_t *pData );
290 
308 extern bool CSL_psilcfgSetThreadEnable( const CSL_psilcfgRegs *pRegs, uint32_t threadId, bool bEnable );
309 
328 extern bool CSL_psilcfgSetThreadRealtimeEnable( const CSL_psilcfgRegs *pRegs, uint32_t threadId, bool bEnable );
329 
364 extern bool CSL_psilcfgTeardownThread( const CSL_psilcfgRegs *pRegs, uint32_t threadId );
365 
383 extern bool CSL_psilcfgClrTeardown( const CSL_psilcfgRegs *pRegs, uint32_t threadId );
384 
407 extern bool CSL_psilcfgFlushThread( const CSL_psilcfgRegs *pRegs, uint32_t threadId );
408 
425 extern bool CSL_psilcfgSetThreadPause( const CSL_psilcfgRegs *pRegs, uint32_t threadId, bool bPause );
426 
451 extern bool CSL_psilcfgCreateRoute( const CSL_psilcfgRegs *pRegs, uint32_t srcThreadId, uint32_t dstThreadId );
452 
479 extern bool CSL_psilcfgCreateLink( const CSL_psilcfgRegs *pRegs, uint32_t srcThreadId, uint32_t dstThreadId );
480 
496 extern bool CSL_psilcfgIsThreadIdle( const CSL_psilcfgRegs *pRegs, uint32_t threadId );
497 
498 /* @} */
499 
500 #ifdef __cplusplus
501 }
502 #endif
503 
504 #endif
505 
bool CSL_psilcfgWrite(const CSL_psilcfgRegs *pRegs, uint32_t threadId, uint32_t regId, uint32_t data)
Write a value to a PSI-L periperal using the PSI-L configuration proxy.
bool CSL_psilcfgIsThreadIdle(const CSL_psilcfgRegs *pRegs, uint32_t threadId)
Determine if a disabled or paused thread is idle.
bool CSL_psilcfgSetThreadEnable(const CSL_psilcfgRegs *pRegs, uint32_t threadId, bool bEnable)
Enable or disable a thread.
uint32_t CSL_PsilCfgReg
Definition: csl_psilcfg.h:91
bool CSL_psilcfgSetThreadRealtimeEnable(const CSL_psilcfgRegs *pRegs, uint32_t threadId, bool bEnable)
Enable or disable a thread via the realtime register.
bool CSL_psilcfgSetThreadPause(const CSL_psilcfgRegs *pRegs, uint32_t threadId, bool bPause)
Pause or un-pause a thread.
bool CSL_psilcfgTeardownThread(const CSL_psilcfgRegs *pRegs, uint32_t threadId)
Teardown a thread.
bool CSL_psilcfgFlushThread(const CSL_psilcfgRegs *pRegs, uint32_t threadId)
Flush data from a destination thread.
uint32_t data[13]
Definition: csl_udmap_tr.h:625
uint32_t CSL_psilcfgGetRevision(const CSL_psilcfgRegs *pRegs)
Return revision of the PSILCFG module.
bool CSL_psilcfgCreateLink(const CSL_psilcfgRegs *pRegs, uint32_t srcThreadId, uint32_t dstThreadId)
Create a link through the PSI-L switch.
bool CSL_psilcfgClrTeardown(const CSL_psilcfgRegs *pRegs, uint32_t threadId)
Clear a thread's teardown and flush bits.
bool CSL_psilcfgCreateRoute(const CSL_psilcfgRegs *pRegs, uint32_t srcThreadId, uint32_t dstThreadId)
Create a route through the PSI-L switch.
bool CSL_psilcfgRead(const CSL_psilcfgRegs *pRegs, uint32_t threadId, uint32_t regId, uint32_t *pData)
Read a value from a PSI-L periperal using the PSI-L configuration proxy.