PDK API Guide for J721E
csitx_soc.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2020-2022
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions
7  * are met:
8  *
9  * Redistributions of source code must retain the above copyright
10  * notice, this list of conditions and the following disclaimer.
11  *
12  * Redistributions in binary form must reproduce the above copyright
13  * notice, this list of conditions and the following disclaimer in the
14  * documentation and/or other materials provided with the
15  * distribution.
16  *
17  * Neither the name of Texas Instruments Incorporated nor the names of
18  * its contributors may be used to endorse or promote products derived
19  * from this software without specific prior written permission.
20  *
21  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
22  * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
23  * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
24  * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
25  * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
26  * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
27  * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
28  * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
29  * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
30  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
31  * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
32  */
33 
48 #ifndef CSITX_SOC_H_
49 #define CSITX_SOC_H_
50 
51 /* ========================================================================== */
52 /* Include Files */
53 /* ========================================================================== */
54 
55 /* None */
56 
57 #ifdef __cplusplus
58 extern "C" {
59 #endif
60 
61 /* ========================================================================== */
62 /* Macros & Typedefs */
63 /* ========================================================================== */
72 #define CSITX_INSTANCE_ID_0 ((uint32_t) 0x0U)
73 #if defined (SOC_J721S2) || defined (SOC_J784S4)
74 #define CSITX_INSTANCE_ID_1 ((uint32_t) 0x1U)
75 #endif
76 
78 #if defined (SOC_J721S2) || defined (SOC_J784S4)
79 #define CSITX_INSTANCE_ID_MAX ((uint32_t)CSITX_INSTANCE_ID_1 + 1U)
80 #else
81 #define CSITX_INSTANCE_ID_MAX ((uint32_t)CSITX_INSTANCE_ID_0 + 1U)
82 #endif
83 /* @} */
84 
94 #define CSITX_NUM_STRMS_TX ((uint32_t) 1U)
95 
97 #define CSITX_NUM_STRMS_COLORBAR ((uint32_t) 1U)
98 
99 #if defined (SOC_J721E)
100 #define CSITX_NUM_STRMS_LPBK ((uint32_t) 2U)
101 #elif defined (SOC_J721S2) || defined (SOC_J784S4)
102 #define CSITX_NUM_STRMS_LPBK ((uint32_t) 1U)
103 #endif
104 
105 #define CSITX_NUM_CH_TX ((uint32_t) 32U)
106 
107 #define CSITX_NUM_CH_LPBK ((uint32_t) 4U)
108 
109 #define CSITX_NUM_CH_TX_MAX ((uint32_t) (CSITX_NUM_CH_TX *\
110  CSITX_INSTANCE_ID_MAX))
111 
112 #define CSITX_NUM_CH_COLORBAR_MAX ((uint32_t) 1U)
113 
117 #define CSITX_NUM_CH_LPBK_MAX ((uint32_t) (CSITX_NUM_CH_LPBK * \
118  CSITX_NUM_STRMS_LPBK))
119 
122 #define CSITX_NUM_CH_MAX ((uint32_t) (CSITX_NUM_CH_TX +\
123  CSITX_NUM_CH_COLORBAR_MAX +\
124  CSITX_NUM_CH_LPBK_MAX))
125 
127 #define CSITX_TX_DATA_LANES_MAX ((uint32_t)4U)
128 
130 #define CSITX_TX_CLK_LANES_MAX ((uint32_t)1U)
131 
132 #define CSITX_TX_VC_CFG_MAX ((uint32_t)16U)
133 
134 #define CSITX_TX_DT_CFG_MAX ((uint32_t)16U)
135 
136 #define CSITX_TX_STRM_NUM_MAX ((uint32_t)4U)
137 
139 #define CSITX_TX_STRM_FIFO_FILL_LVL ((uint32_t)720U)
140 
141 #define CSITX_NUM_STRMS_TX_ID ((uint32_t) 0U)
142 
143 #define CSITX_NUM_STRMS_TX_COLORBAR ((uint32_t) 1U)
144 
145 #define CSITX_NUM_STRMS_TX_RETRANS_0 ((uint32_t) 2U)
146 
147 #define CSITX_NUM_STRMS_TX_RETRANS_1 ((uint32_t) 3U)
148 /* @} */
149 
150 #if defined (SOC_J721S2) || defined (SOC_J784S4)
151 #define CSI_TX_IF0_VBUS2APBCSI2TX_BASE (CSL_CSI_TX_IF_V2_0_VBUS2APB_WRAP_VBUSP_APB_CSI2TX_V2_BASE)
152 #define CSI_TX_IF0_TX_SHIM_CSI2TXIF_BASE (CSL_CSI_TX_IF_V2_0_TX_SHIM_VBUSP_MMR_CSI2TXIF_V2_BASE)
153 #define CSI_TX_IF1_VBUS2APBCSI2TX_BASE (CSL_CSI_TX_IF_V2_1_VBUS2APB_WRAP_VBUSP_APB_CSI2TX_V2_BASE)
154 #define CSI_TX_IF1_TX_SHIM_CSI2TXIF_BASE (CSL_CSI_TX_IF_V2_1_TX_SHIM_VBUSP_MMR_CSI2TXIF_V2_BASE)
155 #else
156 #define CSI_TX_IF0_VBUS2APBCSI2TX_BASE (CSL_CSI_TX_IF0_VBUS2APB_WRAP_VBUSP_APB_CSI2TX_BASE)
157 #define CSI_TX_IF0_TX_SHIM_CSI2TXIF_BASE (CSL_CSI_TX_IF0_TX_SHIM_VBUSP_MMR_CSI2TXIF_BASE)
158 #endif
159 
168 #define CSITX_LANE_BAND_SPEED_80_TO_100_MBPS ((uint32_t) 0x00U)
169 
170 #define CSITX_LANE_BAND_SPEED_100_TO_120_MBPS ((uint32_t) 0x01U)
171 
172 #define CSITX_LANE_BAND_SPEED_120_TO_160_MBPS ((uint32_t) 0x02U)
173 
174 #define CSITX_LANE_BAND_SPEED_160_TO_200_MBPS ((uint32_t) 0x03U)
175 
176 #define CSITX_LANE_BAND_SPEED_200_TO_240_MBPS ((uint32_t) 0x04U)
177 
178 #define CSITX_LANE_BAND_SPEED_240_TO_320_MBPS ((uint32_t) 0x05U)
179 
180 #define CSITX_LANE_BAND_SPEED_320_TO_390_MBPS ((uint32_t) 0x06U)
181 
182 #define CSITX_LANE_BAND_SPEED_390_TO_450_MBPS ((uint32_t) 0x07U)
183 
184 #define CSITX_LANE_BAND_SPEED_450_TO_510_MBPS ((uint32_t) 0x08U)
185 
186 #define CSITX_LANE_BAND_SPEED_510_TO_560_MBPS ((uint32_t) 0x09U)
187 
188 #define CSITX_LANE_BAND_SPEED_560_TO_640_MBPS ((uint32_t) 0x0AU)
189 
190 #define CSITX_LANE_BAND_SPEED_640_TO_690_MBPS ((uint32_t) 0x0BU)
191 
192 #define CSITX_LANE_BAND_SPEED_690_TO_770_MBPS ((uint32_t) 0x0CU)
193 
194 #define CSITX_LANE_BAND_SPEED_770_TO_870_MBPS ((uint32_t) 0x0DU)
195 
196 #define CSITX_LANE_BAND_SPEED_870_TO_950_MBPS ((uint32_t) 0x0EU)
197 
198 #define CSITX_LANE_BAND_SPEED_950_TO_1000_MBPS ((uint32_t) 0x0FU)
199 
200 #define CSITX_LANE_BAND_SPEED_1000_TO_1200_MBPS ((uint32_t) 0x10U)
201 
202 #define CSITX_LANE_BAND_SPEED_1200_TO_1400_MBPS ((uint32_t) 0x11U)
203 
204 #define CSITX_LANE_BAND_SPEED_1400_TO_1600_MBPS ((uint32_t) 0x12U)
205 
206 #define CSITX_LANE_BAND_SPEED_1600_TO_1800_MBPS ((uint32_t) 0x13U)
207 
208 #define CSITX_LANE_BAND_SPEED_1800_TO_2000_MBPS ((uint32_t) 0x14U)
209 
210 #define CSITX_LANE_BAND_SPEED_2000_TO_2200_MBPS ((uint32_t) 0x15U)
211 
212 #define CSITX_LANE_BAND_SPEED_2200_TO_2500_MBPS ((uint32_t) 0x16U)
213 
214 #define CSITX_LANE_BAND_SPEED_RESERVED ((uint32_t) 0x17U)
215 /* @} */
216 
225 #define CSITX_CLK_MODE_CONTINUOUS ((uint32_t) 0x0U)
226 
227 #define CSITX_CLK_MODE_NON_CONTINUOUS ((uint32_t) 0x1U)
228 /* @} */
229 
238 #define CSITX_DPHY_MODE_ULP ((uint32_t) 0x0U)
239 
240 #define CSITX_DPHY_MODE_HIGH_SPEED ((uint32_t) 0x1U)
241 
242 #define CSITX_DPHY_MODE_LOW_POWER ((uint32_t) 0x2U)
243 /* @} */
244 
246 #define CSITX_NUM_STREAM (1U)
247 
256 #if defined (SOC_J721S2) || defined (SOC_J784S4)
257 
258 #if defined (BUILD_MCU2_0)
259 
260 #define CSITX_CORE_INTR_NUM_MOD_0_TX_INTR (CSLR_R5FSS0_CORE0_INTR_CSI_TX_IF_V2_0_CSI_INTERRUPT_0)
261 
262 #define CSITX_CORE_INTR_NUM_MOD_0_LVL_INTR (CSLR_R5FSS0_CORE0_INTR_CSI_TX_IF_V2_0_CSI_LEVEL_0)
263 
264 #define CSITX_CORE_INTR_NUM_MOD_1_TX_INTR (CSLR_R5FSS0_CORE0_INTR_CSI_TX_IF_V2_1_CSI_INTERRUPT_0)
265 
266 #define CSITX_CORE_INTR_NUM_MOD_1_LVL_INTR (CSLR_R5FSS0_CORE0_INTR_CSI_TX_IF_V2_1_CSI_LEVEL_0)
267 #elif defined (BUILD_MCU2_1)
268 
269 #define CSITX_CORE_INTR_NUM_MOD_0_TX_INTR (CSLR_R5FSS0_CORE1_INTR_CSI_TX_IF_V2_0_CSI_INTERRUPT_0)
270 
271 #define CSITX_CORE_INTR_NUM_MOD_0_LVL_INTR (CSLR_R5FSS0_CORE1_INTR_CSI_TX_IF_V2_0_CSI_LEVEL_0)
272 
273 #define CSITX_CORE_INTR_NUM_MOD_1_TX_INTR (CSLR_R5FSS0_CORE1_INTR_CSI_TX_IF_V2_1_CSI_INTERRUPT_0)
274 
275 #define CSITX_CORE_INTR_NUM_MOD_1_LVL_INTR (CSLR_R5FSS0_CORE1_INTR_CSI_TX_IF_V2_1_CSI_LEVEL_0)
276 #elif defined (BUILD_MPU1_0)
277 // TODO: Need to figure these out.
279 #define CSITX_CORE_INTR_NUM_MOD_0_TX_INTR (CSLR_COMPUTE_CLUSTER0_CLEC_SOC_EVENTS_IN_CSI_TX_IF_V2_0_CSI_INTERRUPT_0)
280 
281 #define CSITX_CORE_INTR_NUM_MOD_0_LVL_INTR (CSLR_COMPUTE_CLUSTER0_CLEC_SOC_EVENTS_IN_CSI_TX_IF_V2_0_CSI_LEVEL_0)
282 
283 #define CSITX_CORE_INTR_NUM_MOD_1_TX_INTR (CSLR_COMPUTE_CLUSTER0_CLEC_SOC_EVENTS_IN_CSI_TX_IF_V2_1_CSI_INTERRUPT_0)
284 
285 #define CSITX_CORE_INTR_NUM_MOD_1_LVL_INTR (CSLR_COMPUTE_CLUSTER0_CLEC_SOC_EVENTS_IN_CSI_TX_IF_V2_1_CSI_LEVEL_0)
286 #endif /* BUILD_MCU2_0 */
287 
288 #else
289 #if defined (BUILD_MCU2_0) || defined (BUILD_MCU2_1)
290 
291 #define CSITX_CORE_INTR_NUM_MOD_0_TX_INTR (267U)
292 
293 #define CSITX_CORE_INTR_NUM_MOD_0_LVL_INTR (268U)
294 #endif
295 #if defined (BUILD_MPU1_0)
296 
297 #define CSITX_CORE_INTR_NUM_MOD_0_TX_INTR (180U)
298 
299 #define CSITX_CORE_INTR_NUM_MOD_0_LVL_INTR (181U)
300 #endif /* (BUILD_MCU2_0) || defined (BUILD_MCU2_1) */
301 #endif /* SOC_J721S2 || SOC_J784S4 */
302 
303 
304 /* @} */
305 
317 #define CSITX_STREAM_ID_INST_0_STRM_0 ((uint32_t) 0x0U)
318 
319 #define CSITX_STREAM_ID_INST_0_STRM_1 ((uint32_t) 0x1U)
320 
321 #define CSITX_STREAM_ID_INST_0_STRM_2 ((uint32_t) 0x2U)
322 
323 #define CSITX_STREAM_ID_INST_0_STRM_3 ((uint32_t) 0x3U)
324 
325 #define CSITX_STREAM_ID_INST_1_STRM_0 ((uint32_t) 0x4U)
326 
327 #define CSITX_STREAM_ID_INST_1_STRM_1 ((uint32_t) 0x5U)
328 
329 #define CSITX_STREAM_ID_INST_1_STRM_2 ((uint32_t) 0x6U)
330 
331 #define CSITX_STREAM_ID_INST_1_STRM_3 ((uint32_t) 0x7U)
332 
333 /* @} */
334 /* ========================================================================== */
335 /* Structure Declarations */
336 /* ========================================================================== */
340 typedef struct
341 {
342  uint32_t inst;
345  uint32_t psmClkFreqDiv;
348  uint32_t pllByteClkDiv;
358  uint32_t pwmCtrlDivLow;
361  uint32_t pwmCtrlDivHigh;
367  uint32_t pllLockStart;
370  uint32_t pllIpDiv;
373  uint32_t pllOpDiv;
376  uint32_t pllFbDiv;
379  uint32_t pllPd;
382  uint32_t laneBandSpeed;
388  uint32_t waitBurstTime;
392  uint32_t txClkExitTime;
396  uint32_t dlWkupTime;
399  uint32_t clWkupTime;
402  uint32_t clkMode;
405  uint32_t dphyMode;
410  uint32_t clSlewRateCtrl;
419  uint32_t dlSlewRateCtrl;
428  uint32_t laneSpeedMbps;
437 } Csitx_DPhyCfg;
438 
439 /* ========================================================================== */
440 /* Global Variables */
441 /* ========================================================================== */
442 
443 /* None */
444 
445 /* ========================================================================== */
446 /* Function Declarations */
447 /* ========================================================================== */
464 /* ========================================================================== */
465 /* Static Function Definitions */
466 /* ========================================================================== */
467 
468 /* None */
469 
470 #ifdef __cplusplus
471 }
472 #endif
473 
474 #endif /* #ifndef CSITX_SOC_H_ */
475 
476 /* @} */
uint32_t pwmCtrlDivLow
Definition: csitx_soc.h:358
uint32_t txClkExitTime
Definition: csitx_soc.h:392
uint32_t pllLockStart
Definition: csitx_soc.h:367
uint32_t dlSlewRateCtrl
Definition: csitx_soc.h:419
uint32_t psmClkFreqDiv
Definition: csitx_soc.h:345
void Csitx_initDPhyCfgParams(Csitx_DPhyCfg *dphyCfg)
Csitx_DPhyCfg structure init function.
uint32_t pllLockThreshold
Definition: csitx_soc.h:364
uint32_t dphyMode
Definition: csitx_soc.h:405
uint32_t waitBurstTime
Definition: csitx_soc.h:388
uint32_t pllFbDiv
Definition: csitx_soc.h:376
uint32_t clkMode
Definition: csitx_soc.h:402
uint32_t pllOpDiv
Definition: csitx_soc.h:373
uint32_t pllPd
Definition: csitx_soc.h:379
uint32_t laneSpeedMbps
Definition: csitx_soc.h:428
uint32_t pwmCtrlDivHigh
Definition: csitx_soc.h:361
D-PHY configuration structure.
Definition: csitx_soc.h:340
uint32_t pllIpDiv
Definition: csitx_soc.h:370
uint32_t clSlewRateCtrl
Definition: csitx_soc.h:410
uint32_t laneBandSpeed
Definition: csitx_soc.h:382
uint32_t inst
Definition: csitx_soc.h:342
uint32_t pllByteClkDiv
Definition: csitx_soc.h:348
uint32_t dlWkupTime
Definition: csitx_soc.h:396
uint32_t clWkupTime
Definition: csitx_soc.h:399