PDK API Guide for J721E
dss_soc.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 
48 #ifndef DSS_SOC_H_
49 #define DSS_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 /* ========================================================================== */
64 
73 typedef void (*Dss_DctrlDpHpdCbFxn)(uint32_t hpdState, void *appData);
74 
75 /*
76  * Macros for different driver instance numbers to be passed as instance ID
77  * at the time of driver create.
78  * Note: These are read only macros. Don't modify the value of these macros.
79  */
80 
88 #define DSS_DCTRL_INST_0 (0U)
89 
91 #define DSS_DCTRL_INST_MAX (1U)
92 /* @} */
93 
101 #define DSS_DISP_INST_VID1 (CSL_DSS_VID_PIPE_ID_VID1)
102 
104 #define DSS_DISP_INST_VIDL1 (CSL_DSS_VID_PIPE_ID_VIDL1)
105 
107 #define DSS_DISP_INST_VID2 (CSL_DSS_VID_PIPE_ID_VID2)
108 
110 #define DSS_DISP_INST_VIDL2 (CSL_DSS_VID_PIPE_ID_VIDL2)
111 
113 #define DSS_DISP_INST_MAX (CSL_DSS_VID_PIPE_ID_MAX)
114 /* @} */
115 
125 #define DSS_DCTRL_NODE_TYPE_INVALID ((uint32_t) 0x0U)
126 #define DSS_DCTRL_NODE_TYPE_PIPE ((uint32_t) 0x1U)
127 #define DSS_DCTRL_NODE_TYPE_OVERLAY ((uint32_t) 0x2U)
128 #define DSS_DCTRL_NODE_TYPE_VP ((uint32_t) 0x3U)
129 #define DSS_DCTRL_NODE_TYPE_OUTPUT ((uint32_t) 0x4U)
130 /* @} */
131 
141 #define DSS_DCTRL_NODE_INVALID (0x0U)
142 #define DSS_DCTRL_NODE_VID1 (0x1U)
143 #define DSS_DCTRL_NODE_VIDL1 (0x2U)
144 #define DSS_DCTRL_NODE_VID2 (0x3U)
145 #define DSS_DCTRL_NODE_VIDL2 (0x4U)
146 #define DSS_DCTRL_NODE_OVERLAY1 (0x5U)
147 #define DSS_DCTRL_NODE_OVERLAY2 (0x6U)
148 #define DSS_DCTRL_NODE_OVERLAY3 (0x7U)
149 #define DSS_DCTRL_NODE_OVERLAY4 (0x8U)
150 #define DSS_DCTRL_NODE_VP1 (0x9U)
151 #define DSS_DCTRL_NODE_VP2 (0xAU)
152 #define DSS_DCTRL_NODE_VP3 (0xBU)
153 #define DSS_DCTRL_NODE_VP4 (0xCU)
154 #define DSS_DCTRL_NODE_DPI_DPI0 (0xDU)
155 #define DSS_DCTRL_NODE_DPI_DPI1 (0xEU)
156 #define DSS_DCTRL_NODE_EDP_DPI0 (0xFU)
157 #define DSS_DCTRL_NODE_EDP_DPI1 (0x10U)
158 #define DSS_DCTRL_NODE_EDP_DPI2 (0x11U)
159 #define DSS_DCTRL_NODE_EDP_DPI3 (0x12U)
160 #define DSS_DCTRL_NODE_DSI_DPI2 (0x13U)
161 #define DSS_DCTRL_NODE_DISCSYNC0 (0x14U)
162 #define DSS_DCTRL_NODE_DISCSYNC1 (0x15U)
163 #define DSS_DCTRL_NODE_WB (0x16U)
164 /* @} */
165 
168 #define DSS_DCTRL_MAX_NODES (23U)
169 
173 #define DSS_DCTRL_MAX_EDGES (37U)
174 
176 #define DSS_FUNC_IRQ_DEFAULT_NUM (52U)
177 
179 #define DSS_SAFE_IRQ_DEFAULT_NUM (54U)
180 
182 #define DSS_SECURE_IRQ_DEFAULT_NUM (56U)
183 
191 #define DSS_EVT_MGR_INST_ID_FUNC ((uint32_t) 0x00U)
192 
193 #define DSS_EVT_MGR_INST_ID_SAFETY ((uint32_t) 0x01U)
194 
195 #define DSS_EVT_MGR_INST_ID_SECURITY ((uint32_t) 0x02U)
196 
197 #define DSS_EVT_MGR_INST_ID_MAX ((uint32_t) 0x03U)
198 
199 #define DSS_EVT_MGR_INST_ID_INVALID ((uint32_t) 0xFFU)
200 /* @} */
201 
203 #define DSS_M2M_WB_PIPELINE_ID_0 (CSL_DSS_WB_PIPE_ID_1)
204 #define DSS_M2M_WB_PIPELINE_ID_MAX (CSL_DSS_WB_PIPE_ID_MAX)
205 #define DSSM2M_NUM_WB_PIPELINE (CSL_DSS_WB_PIPE_ID_MAX)
206 
208 #define DSSM2M_NUM_PIPELINE_TO_USE_IN_M2M_MODE (1U)
209 
211 #define DSSM2M_NUM_VIRTUAL_CONTEXT (8U)
212 
222 #define DSS_DSI_CONNECTION_DSI2DP_BRIDGE (0U)
223 
224 #define DSS_DSI_CONNECTION_FPD (1U)
225 
226 #define DSS_DSI_CONNECTION_MAX (2U)
227 /* @} */
228 
229 /*
230  * SOC specific IOCTLs.
231  */
232 
250 #define IOCTL_DSS_DCTRL_PROCESS_DP_HPD (DSS_DCTRL_SOC_IOCTL_BASE + 0x01U)
251 
266 #define IOCTL_DSS_DCTRL_REGISTER_DP_HPD_CB (DSS_DCTRL_SOC_IOCTL_BASE + 0x02U)
267 /* @} */
268 
269 /* ========================================================================== */
270 /* Structure Declarations */
271 /* ========================================================================== */
272 
277 typedef struct
278 {
286  uint32_t numValidIrq;
290  uint32_t irqNum[DSS_EVT_MGR_INST_ID_MAX];
299 } Dss_IrqParams;
300 
305 typedef struct
306 {
307  uint32_t isCommRegAvailable[CSL_DSS_COMM_REG_ID_MAX];
309  uint32_t isPipeAvailable[CSL_DSS_VID_PIPE_ID_MAX];
311  uint32_t isOverlayAvailable[CSL_DSS_OVERLAY_ID_MAX];
313  uint32_t isPortAvailable[CSL_DSS_VP_ID_MAX];
315  uint32_t isWbPipeAvailable[CSL_DSS_WB_PIPE_ID_MAX];
317 } Dss_RmInfo;
318 
322 typedef struct
323 {
324  uint32_t isAvailable;
326  uint32_t isHpdSupported;
331 
335 typedef struct
336 {
337  uint32_t isAvailable;
339  uint32_t isConnectedTo;
342 
346 typedef struct
347 {
356 } Dss_SocParams;
357 
361 typedef struct
362 {
365  void *appData;
368 
369 /* ========================================================================== */
370 /* Internal/Private Function Declarations */
371 /* ========================================================================== */
372 
380 static inline uint32_t Dss_dispIsVidInst(uint32_t instId);
381 
389 static inline uint32_t Dss_dispIsVidLInst(uint32_t instId);
390 
398 static inline void Dss_irqParamsInit(Dss_IrqParams *irqParams);
399 
407 static inline void Dss_rmInfoInit(Dss_RmInfo *rmInfo);
408 
416 static inline void Dss_dpInitParamsInit(Dss_DpInitParams *dpInitParams);
417 
425 static inline void Dss_socParamsInit(Dss_SocParams *socParams);
426 
434 static inline void Dss_dctrlDpHpdCbParamsInit(Dss_DctrlDpHpdCbParams *cbParams);
435 
436 /* ========================================================================== */
437 /* Function Declarations */
438 /* ========================================================================== */
439 
440 /* None */
441 
442 /* ========================================================================== */
443 /* Static Function Definitions */
444 /* ========================================================================== */
445 
446 static inline uint32_t Dss_dispIsVidInst(uint32_t instId)
447 {
448  uint32_t isVidInst = FALSE;
449 
450  if((DSS_DISP_INST_VID1 == instId) ||
451  (DSS_DISP_INST_VID2 == instId))
452  {
453  isVidInst = TRUE;
454  }
455 
456  return (isVidInst);
457 }
458 
459 static inline uint32_t Dss_dispIsVidLInst(uint32_t instId)
460 {
461  uint32_t isVidLInst = FALSE;
462 
463  if((DSS_DISP_INST_VIDL1 == instId) ||
464  (DSS_DISP_INST_VIDL2 == instId))
465  {
466  isVidLInst = TRUE;
467  }
468 
469  return (isVidLInst);
470 }
471 
472 static inline void Dss_irqParamsInit(Dss_IrqParams *irqParams)
473 {
474  if(NULL != irqParams)
475  {
479  irqParams->irqNum[DSS_EVT_MGR_INST_ID_SAFETY] =
483  }
484 }
485 
486 static inline void Dss_rmInfoInit(Dss_RmInfo *rmInfo)
487 {
488  uint32_t i = 0U;
489  if(NULL != rmInfo)
490  {
492  {
493  rmInfo->isCommRegAvailable[i] = TRUE;
494  }
496  {
497  rmInfo->isPipeAvailable[i] = TRUE;
498  }
500  {
501  rmInfo->isOverlayAvailable[i] = TRUE;
502  }
503  for(i=CSL_DSS_VP_ID_1; i<CSL_DSS_VP_ID_MAX; i++)
504  {
505  rmInfo->isPortAvailable[i] = TRUE;
506  }
508  {
509  rmInfo->isWbPipeAvailable[i] = TRUE;
510  }
511  }
512 }
513 
514 static inline void Dss_dpInitParamsInit(Dss_DpInitParams *dpInitParams)
515 {
516  if(NULL != dpInitParams)
517  {
518  dpInitParams->isAvailable = TRUE;
519  dpInitParams->isHpdSupported = TRUE;
520  }
521 }
522 
523 static inline void Dss_dsiInitParamsInit(Dss_DsiInitParams *dsiInitParams)
524 {
525  if(NULL != dsiInitParams)
526  {
527  dsiInitParams->isAvailable = TRUE;
528  dsiInitParams->isConnectedTo = DSS_DSI_CONNECTION_FPD;
529  }
530 }
531 
532 static inline void Dss_socParamsInit(Dss_SocParams *socParams)
533 {
534  if(NULL != socParams)
535  {
536  Dss_irqParamsInit(&(socParams->irqParams));
537  Dss_rmInfoInit(&(socParams->rmInfo));
538  Dss_dpInitParamsInit(&(socParams->dpInitParams));
539  Dss_dsiInitParamsInit(&(socParams->dsiInitParams));
540  }
541 }
542 
544 {
545  if(NULL != cbParams)
546  {
547  cbParams->hpdCbFxn = NULL;
548  cbParams->appData = NULL;
549  }
550 }
551 
552 #ifdef __cplusplus
553 }
554 #endif
555 
556 #endif /* #ifndef DSS_SOC_V1_H_ */
557 
558 /* @} */
#define DSS_DISP_INST_VIDL2
Video Lite 2 Pipeline display driver instance number.
Definition: dss_soc.h:110
#define CSL_DSS_COMM_REG_ID_0
Common Region 0 i.e. M region.
Definition: csl_dssTop.h:107
#define TRUE
Definition: csl_types.h:54
#define CSL_DSS_VID_PIPE_ID_MAX
Video Pipeline Max Id.
Definition: csl_dssTop.h:134
#define CSL_DSS_COMM_REG_ID_MAX
Common Region Max Id.
Definition: csl_dssTop.h:115
#define FALSE
Definition: csl_types.h:55
uint32_t isAvailable
Definition: dss_soc.h:324
#define DSS_EVT_MGR_INST_ID_MAX
Invalid Instance Id.
Definition: dss_soc.h:197
void(* Dss_DctrlDpHpdCbFxn)(uint32_t hpdState, void *appData)
DP HPD callback function prototype.
Definition: dss_soc.h:73
static void Dss_dctrlDpHpdCbParamsInit(Dss_DctrlDpHpdCbParams *cbParams)
Dss_DctrlDpHpdCbParams structure init function.
Definition: dss_soc.h:543
Structure containing resources manager information. This enables display sharing between two differen...
Definition: dss_soc.h:305
Dss_DpInitParams dpInitParams
Definition: dss_soc.h:352
#define DSS_SAFE_IRQ_DEFAULT_NUM
DSS Functional Interrupt Number for R5.
Definition: dss_soc.h:179
uint32_t isCommRegAvailable[CSL_DSS_COMM_REG_ID_MAX]
Definition: dss_soc.h:307
#define DSS_EVT_MGR_INST_ID_SAFETY
Instance Id for security interrupts.
Definition: dss_soc.h:193
Structure containing DSS interrupt information. Events should be enabled only for available Video Por...
Definition: dss_soc.h:277
#define CSL_DSS_VP_ID_1
Video Port 1.
Definition: csl_dssTop.h:164
static void Dss_socParamsInit(Dss_SocParams *socParams)
Dss_SocParams structure init function.
Definition: dss_soc.h:532
static uint32_t Dss_dispIsVidLInst(uint32_t instId)
Check if the display driver instance is of type Video lite pipeline.
Definition: dss_soc.h:459
#define CSL_DSS_VP_ID_MAX
Video Port Max Id.
Definition: csl_dssTop.h:172
static void Dss_dsiInitParamsInit(Dss_DsiInitParams *dsiInitParams)
Definition: dss_soc.h:523
Dss_DctrlDpHpdCbFxn hpdCbFxn
Definition: dss_soc.h:363
uint32_t isAvailable
Definition: dss_soc.h:337
#define CSL_DSS_VID_PIPE_ID_VID1
Video Pipeline 1.
Definition: csl_dssTop.h:126
Dss_IrqParams irqParams
Definition: dss_soc.h:348
uint32_t isPortAvailable[CSL_DSS_VP_ID_MAX]
Definition: dss_soc.h:313
#define DSS_DISP_INST_VIDL1
Video Lite 1 Pipeline display driver instance number.
Definition: dss_soc.h:104
#define DSS_EVT_MGR_INST_ID_SECURITY
Max Instance Id.
Definition: dss_soc.h:195
void * appData
Definition: dss_soc.h:365
#define NULL
Define NULL if not defined.
Definition: csl_types.h:107
#define DSS_DISP_INST_VID1
Video 1 Pipeline display driver instance number.
Definition: dss_soc.h:101
static void Dss_irqParamsInit(Dss_IrqParams *irqParams)
Dss_IrqParams structure init function.
Definition: dss_soc.h:472
static uint32_t Dss_dispIsVidInst(uint32_t instId)
Check if the display driver instance is of type Video pipeline.
Definition: dss_soc.h:446
uint32_t dssCommonRegionId
Definition: dss_soc.h:279
uint32_t numValidIrq
Definition: dss_soc.h:286
uint32_t isConnectedTo
Definition: dss_soc.h:339
static void Dss_rmInfoInit(Dss_RmInfo *rmInfo)
Dss_RmInfo structure init function.
Definition: dss_soc.h:486
#define DSS_EVT_MGR_INST_ID_FUNC
Instance Id for functional interrupts.
Definition: dss_soc.h:191
#define DSS_DISP_INST_VID2
Video 2 Pipeline display driver instance number.
Definition: dss_soc.h:107
uint32_t isOverlayAvailable[CSL_DSS_OVERLAY_ID_MAX]
Definition: dss_soc.h:311
uint32_t isWbPipeAvailable[CSL_DSS_WB_PIPE_ID_MAX]
Definition: dss_soc.h:315
DSS SOC parameters.
Definition: dss_soc.h:346
Structure containing DSI init parameters.
Definition: dss_soc.h:335
#define DSS_SECURE_IRQ_DEFAULT_NUM
Definition: dss_soc.h:182
Dss_RmInfo rmInfo
Definition: dss_soc.h:350
#define CSL_DSS_OVERLAY_ID_MAX
Overlay Max Id.
Definition: csl_dssTop.h:153
uint32_t irqNum[DSS_EVT_MGR_INST_ID_MAX]
Definition: dss_soc.h:290
DSS DP HPD Callback parameters.
Definition: dss_soc.h:361
#define CSL_DSS_WB_PIPE_ID_1
Write Back Pipe Id 1.
Definition: csl_dssTop.h:200
static void Dss_dpInitParamsInit(Dss_DpInitParams *dpInitParams)
Dss_DpInitParams structure init function.
Definition: dss_soc.h:514
uint32_t isHpdSupported
Definition: dss_soc.h:326
#define CSL_DSS_WB_PIPE_ID_MAX
Write Back Pipe Max Id.
Definition: csl_dssTop.h:202
Dss_DsiInitParams dsiInitParams
Definition: dss_soc.h:354
#define DSS_DSI_CONNECTION_FPD
DSI connection terminated at the FPD connector.
Definition: dss_soc.h:224
#define DSS_FUNC_IRQ_DEFAULT_NUM
DSS Safety Interrupt Number for R5.
Definition: dss_soc.h:176
uint32_t isPipeAvailable[CSL_DSS_VID_PIPE_ID_MAX]
Definition: dss_soc.h:309
#define CSL_DSS_OVERLAY_ID_1
Overlay 1.
Definition: csl_dssTop.h:145
Structure containing Display Port init parameters.
Definition: dss_soc.h:322