PDK API Guide for AM65xx
csl_dssCommon.h
Go to the documentation of this file.
1 /*
2  * Copyright (c) Texas Instruments Incorporated 2018
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 
47 #ifndef CSL_DSSCOMMON_H_
48 #define CSL_DSSCOMMON_H_
49 
50 /* ========================================================================== */
51 /* Include Files */
52 /* ========================================================================== */
53 
54 /* None */
55 
56 #ifdef __cplusplus
57 extern "C" {
58 #endif
59 
60 /* ========================================================================== */
61 /* Macros & Typedefs */
62 /* ========================================================================== */
63 
69 typedef CSL_dss_commonRegs CSL_dss_commRegs;
70 
78 #define CSL_DSS_DISPC_INTR_VIDL1_MASK ((uint32_t) 0x20U)
79 
80 #define CSL_DSS_DISPC_INTR_VID1_MASK ((uint32_t) 0x10U)
81 
82 #define CSL_DSS_DISPC_INTR_VP2_MASK ((uint32_t) 0x02U)
83 
84 #define CSL_DSS_DISPC_INTR_VP1_MASK ((uint32_t) 0x01U)
85 /* @} */
86 
94 #define CSL_DSS_VID_PIPE_INTR_SAFETYVIOLATION_MASK \
95  ((uint32_t) CSL_DSS_COMMON_VID_IRQENABLE_0_SAFETYREGION_EN_MASK)
96 
97 #define CSL_DSS_VID_PIPE_INTR_WINDOWEND_MASK \
98  ((uint32_t) CSL_DSS_COMMON_VID_IRQENABLE_0_VIDENDWINDOW_EN_MASK)
99 
100 #define CSL_DSS_VID_PIPE_INTR_BUFUNDERFLOW_MASK \
101  ((uint32_t) CSL_DSS_COMMON_VID_IRQENABLE_0_VIDBUFFERUNDERFLOW_EN_MASK)
102 
103 #define CSL_DSS_VID_PIPE_INTR_ALL_MASK \
104  (CSL_DSS_VID_PIPE_INTR_SAFETYVIOLATION_MASK | \
105  CSL_DSS_VID_PIPE_INTR_WINDOWEND_MASK | \
106  CSL_DSS_VID_PIPE_INTR_BUFUNDERFLOW_MASK)
107 /* @} */
108 
116 #define CSL_DSS_VP_INTR_FRAMEDONE_MASK \
117  ((uint32_t) CSL_DSS_COMMON_VP_IRQENABLE_0_VPFRAMEDONE_EN_MASK)
118 
119 #define CSL_DSS_VP_INTR_VSYNC_MASK \
120  ((uint32_t) CSL_DSS_COMMON_VP_IRQENABLE_0_VPVSYNC_EN_MASK)
121 
122 #define CSL_DSS_VP_INTR_ODDVSYNC_MASK \
123  ((uint32_t) CSL_DSS_COMMON_VP_IRQENABLE_0_VPVSYNC_ODD_EN_MASK)
124 
125 #define CSL_DSS_VP_INTR_PROGLINENUM_MASK \
126  ((uint32_t) CSL_DSS_COMMON_VP_IRQENABLE_0_VPPROGRAMMEDLINENUMBER_EN_MASK)
127 
128 #define CSL_DSS_VP_INTR_SYNCLOST_MASK \
129  ((uint32_t) CSL_DSS_COMMON_VP_IRQENABLE_0_VPSYNCLOST_EN_MASK)
130 
131 #define CSL_DSS_VP_INTR_ACBIASCOUNT_MASK \
132  ((uint32_t) CSL_DSS_COMMON_VP_IRQENABLE_0_ACBIASCOUNTSTATUS_EN_MASK)
133 
134 #define CSL_DSS_VP_INTR_SAFETYVIOLATION_REGION0_MASK \
135  ((uint32_t) 0x40U)
136 
137 #define CSL_DSS_VP_INTR_SAFETYVIOLATION_REGION1_MASK \
138  ((uint32_t) 0x80U)
139 
140 #define CSL_DSS_VP_INTR_SAFETYVIOLATION_REGION2_MASK \
141  ((uint32_t) 0x100U)
142 
143 #define CSL_DSS_VP_INTR_SAFETYVIOLATION_REGION3_MASK \
144  ((uint32_t) 0x200U)
145 
146 #define CSL_DSS_VP_INTR_SECURITYVIOLATION_MASK \
147  ((uint32_t) CSL_DSS_COMMON_VP_IRQENABLE_0_SECURITYVIOLATION_EN_MASK)
148 
149 #define CSL_DSS_VP_INTR_GOBITCLEAR_MASK \
150  ((uint32_t) CSL_DSS_COMMON_VP_IRQENABLE_0_VPSYNC_EN_MASK)
151 
152 #define CSL_DSS_VP_INTR_ALL_MASK \
153  (CSL_DSS_VP_INTR_FRAMEDONE_MASK | \
154  CSL_DSS_VP_INTR_VSYNC_MASK | \
155  CSL_DSS_VP_INTR_ODDVSYNC_MASK | \
156  CSL_DSS_VP_INTR_PROGLINENUM_MASK | \
157  CSL_DSS_VP_INTR_SYNCLOST_MASK | \
158  CSL_DSS_VP_INTR_ACBIASCOUNT_MASK | \
159  CSL_DSS_VP_INTR_SAFETYVIOLATION_REGION0_MASK | \
160  CSL_DSS_VP_INTR_SAFETYVIOLATION_REGION1_MASK | \
161  CSL_DSS_VP_INTR_SAFETYVIOLATION_REGION2_MASK | \
162  CSL_DSS_VP_INTR_SAFETYVIOLATION_REGION3_MASK | \
163  CSL_DSS_VP_INTR_SECURITYVIOLATION_MASK | \
164  CSL_DSS_VP_INTR_GOBITCLEAR_MASK)
165 /* @} */
166 
174 #define CSL_DSS_MFLAG_START_NORMAL \
175  ((uint32_t) CSL_DSS_COMMON_DISPC_GLOBAL_MFLAG_ATTRIBUTE_MFLAG_START_VAL_MFLAGNORMALSTARTMODE)
176 
177 #define CSL_DSS_MFLAG_START_FORCED \
178  ((uint32_t) CSL_DSS_COMMON_DISPC_GLOBAL_MFLAG_ATTRIBUTE_MFLAG_START_VAL_MFLAGFORCESTARTMODE)
179 /* @} */
180 
188 #define CSL_DSS_MFLAG_CTRL_DISABLED \
189  ((uint32_t) CSL_DSS_COMMON_DISPC_GLOBAL_MFLAG_ATTRIBUTE_MFLAG_CTRL_VAL_MFLAGDIS)
190 
191 #define CSL_DSS_MFLAG_CTRL_FORCE_ENABLE \
192  ((uint32_t) CSL_DSS_COMMON_DISPC_GLOBAL_MFLAG_ATTRIBUTE_MFLAG_CTRL_VAL_MFLAGFORCE)
193 
194 #define CSL_DSS_MFLAG_CTRL_DYNAMIC \
195  ((uint32_t) CSL_DSS_COMMON_DISPC_GLOBAL_MFLAG_ATTRIBUTE_MFLAG_CTRL_VAL_MFLAGEN)
196 /* @} */
197 
198 /* ========================================================================== */
199 /* Structure Declarations */
200 /* ========================================================================== */
201 
205 typedef struct
206 {
211  uint32_t globalMflagCtrl;
215 
219 typedef struct
220 {
221  uint32_t priHigh;
224  uint32_t priLow;
227 } CSL_DssCbaCfg;
228 
229 /* ========================================================================== */
230 /* Function Declarations */
231 /* ========================================================================== */
232 
242 void CSL_dssModuleReset(CSL_dss_commRegs *commRegs);
243 
252 uint32_t CSL_dssIsOldiResetDone(const CSL_dss_commRegs *commRegs);
253 
268  uint32_t intrMask,
269  uint32_t intrEnable);
270 
288  uint32_t vidPipeId,
289  uint32_t intrMask,
290  uint32_t intrEnable);
291 
309  uint32_t portId,
310  uint32_t intrMask,
311  uint32_t intrEnable);
312 
324  uint32_t intrMask);
325 
340  uint32_t vidPipeId,
341  uint32_t intrMask);
342 
356 void CSL_dssClearVpIntr(CSL_dss_commRegs *commRegs,
357  uint32_t portId,
358  uint32_t intrMask);
359 
368 uint32_t CSL_dssGetDispcIntrStatus(const CSL_dss_commRegs *commRegs);
369 
380 uint32_t CSL_dssGetPipeIntrStatus(const CSL_dss_commRegs *commRegs,
381  uint32_t vidPipeId);
382 
393 uint32_t CSL_dssGetVpIntrStatus(const CSL_dss_commRegs *commRegs,
394  uint32_t portId);
395 
407  const CSL_DssGlobalMFlagCfg *mflagCfg);
408 
425  uint32_t portIdMask,
426  uint32_t enable);
427 
441  uint32_t portIdMask);
442 
454  const CSL_DssCbaCfg *cbaCfg);
455 
456 /* ========================================================================== */
457 /* Static Function Declarations */
458 /* ========================================================================== */
459 
467 static inline void CSL_dssGlobalMFlagCfgInit(
468  CSL_DssGlobalMFlagCfg *mflagCfg);
469 
477 static inline void CSL_dssCbaCfgInit(
478  CSL_DssCbaCfg *cbaCfg);
479 
480 /* ========================================================================== */
481 /* Static Function Definitions */
482 /* ========================================================================== */
483 
484 static inline void CSL_dssGlobalMFlagCfgInit(
485  CSL_DssGlobalMFlagCfg *mflagCfg)
486 {
487  if(NULL != mflagCfg)
488  {
491  }
492 }
493 
494 static inline void CSL_dssCbaCfgInit(
495  CSL_DssCbaCfg *cbaCfg)
496 {
497  if(NULL != cbaCfg)
498  {
499  cbaCfg->priHigh = 0x1U;
500  cbaCfg->priLow = 0x4U;
501  }
502 }
503 
504 #ifdef __cplusplus
505 }
506 #endif
507 
508 #endif /* #ifndef CSL_DSSCOMMON_H_ */
509 
510 /* @} */
void CSL_dssSetGlobalMflagConfig(CSL_dss_commRegs *commRegs, const CSL_DssGlobalMFlagCfg *mflagCfg)
Set the global MFLAG configuration.
static void CSL_dssCbaCfgInit(CSL_DssCbaCfg *cbaCfg)
CSL_DssCbaCfg structure init function.
Definition: csl_dssCommon.h:494
DSS CBA Config parameters.
Definition: csl_dssCommon.h:219
void CSL_dssGlobalVpGoBitEnable(CSL_dss_commRegs *commRegs, uint32_t portIdMask)
Enable the global VP go bit. This allows setting multiple outputs synchronously. The 'OR' result of d...
#define CSL_DSS_MFLAG_CTRL_DISABLED
Mflag is disabled.
Definition: csl_dssCommon.h:188
void CSL_dssModuleReset(CSL_dss_commRegs *commRegs)
Reset the DSS Module. Application should make sure Video Ports are disabled before calling this API.
void CSL_dssClearPipeIntr(CSL_dss_commRegs *commRegs, uint32_t vidPipeId, uint32_t intrMask)
Clear the interrupts for Video Pipe.
uint32_t CSL_dssGetPipeIntrStatus(const CSL_dss_commRegs *commRegs, uint32_t vidPipeId)
Get the interrupt status of Video Pipe.
CSL_dss_commonRegs CSL_dss_commRegs
DSS Common Registers.
Definition: csl_dssCommon.h:69
uint32_t CSL_dssIsOldiResetDone(const CSL_dss_commRegs *commRegs)
Get OLDI reset status.
uint32_t priHigh
Definition: csl_dssCommon.h:221
void CSL_dssEnablePipeIntr(CSL_dss_commRegs *commRegs, uint32_t vidPipeId, uint32_t intrMask, uint32_t intrEnable)
Enable/disable the interrupts for Video Pipe.
static void CSL_dssGlobalMFlagCfgInit(CSL_DssGlobalMFlagCfg *mflagCfg)
CSL_DssGlobalMFlagCfg structure init function.
Definition: csl_dssCommon.h:484
uint32_t CSL_dssGetVpIntrStatus(const CSL_dss_commRegs *commRegs, uint32_t portId)
Get the interrupt status of Video Port.
void CSL_dssEnableVpIntr(CSL_dss_commRegs *commRegs, uint32_t portId, uint32_t intrMask, uint32_t intrEnable)
Enable/disable the interrupts for Video Port.
#define NULL
Define NULL if not defined.
Definition: csl_types.h:107
#define CSL_DSS_MFLAG_START_NORMAL
Mflag of each pipe is kept at 0 until preload is reached.
Definition: csl_dssCommon.h:174
void CSL_dssClearDispcIntr(CSL_dss_commRegs *commRegs, uint32_t intrMask)
Clear the interrupts at DSS top level.
DSS Global MFLAG Config parameters.
Definition: csl_dssCommon.h:205
uint32_t globalMflagCtrl
Definition: csl_dssCommon.h:211
uint32_t priLow
Definition: csl_dssCommon.h:224
uint32_t globalMflagStart
Definition: csl_dssCommon.h:207
void CSL_dssEnableDispcIntr(CSL_dss_commRegs *commRegs, uint32_t intrMask, uint32_t intrEnable)
Enable/disable the interrupts at DSS top level.
void CSL_dssGlobalVpEnable(CSL_dss_commRegs *commRegs, uint32_t portIdMask, uint32_t enable)
Enable the global VP enable bit. This allows setting multiple outputs synchronously....
uint32_t CSL_dssGetDispcIntrStatus(const CSL_dss_commRegs *commRegs)
Get the top level interrupt status of DSS.
void CSL_dssClearVpIntr(CSL_dss_commRegs *commRegs, uint32_t portId, uint32_t intrMask)
Clear the interrupts for Video Port.
void CSL_dssSetCbaConfig(CSL_dss_commRegs *commRegs, const CSL_DssCbaCfg *cbaCfg)
Set the CBA configuration.