summaryrefslogtreecommitdiff
path: root/drivers/mxc/vpu-malone/Malone_Firmware/DecKLib/Incl/DecKernelLib.h
blob: b924aa44f50f8ed3b1373a30cb067b98b40dcdd2 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
/////////////////////////////////////////////////////////////////////////////////
/// @author    Copyright (c) 2015 Amphion Semiconductor Ltd
/////////////////////////////////////////////////////////////////////////////////
// The code contained herein is licensed under the GNU General Public
// License. You may obtain a copy of the GNU General Public License
// Version 2 or later at the following locations:
//
// http://www.opensource.org/licenses/gpl-license.html
// http://www.gnu.org/copyleft/gpl.html
////////////////////////////////////////////////////////////////////////////////
//
/// @file      DecLib.h
/// @brief     Main DecLib public header file
/// @ingroup   DecLib
/// @defgroup  DecLib DecLib API
/// @{
///            Decoder Library API level - Exported header file
///            called by the Player level and passing data back
///            via registered callbacks
/// @}
//
/////////////////////////////////////////////////////////////////////////////////
// $Id:
/////////////////////////////////////////////////////////////////////////////////

/////////////////////////////////////////////////////////////////////////////////
//  Header files
/////////////////////////////////////////////////////////////////////////////////

#include "basetype.h"
#include "mediaip_fw_types.h"
#include "pal.h"
#include "DecKernelLibCfg.h"

#ifndef _DECODER_KLIB_H_
#define _DECODER_KLIB_H_

/////////////////////////////////////////////////////////////////////////////////
//  Global Macros
/////////////////////////////////////////////////////////////////////////////////

#define DECLIB_FSID_INVALID         0xbad

#define DECLIB_DBG_SESSION_STATE    0x1
#define DECLIB_DBG_DECODER_STATE    0x2
#define DECLIB_DBG_SYNTAX_ELEMENT   0x4
#define DECLIB_DBG_REG_ACCESS       0x8
#define DECLIB_DBG_CQ_FIFO          0x10

#define DECLIB_DBG_REG_HIF          0x1
#define DECLIB_DBG_REG_SIF          0x2
#define DECLIB_DBG_REG_CTX          0x4
#define DECLIB_DBG_REG_RPR          0x8
#define DECLIB_DBG_REG_SPP          0x10
#define DECLIB_DBG_REG_DEC          0x20
#define DECLIB_DBG_REG_CQ           0x40
#define DECLIB_DBG_REG_RSB          0x80
#define DECLIB_DBG_REG_DFE          0x80

#ifdef MVD_DIAG_LOG_REG_ACCESS
#define DECLIB_DBG_MASK             0x1F
#define DECLIB_DBG_REG_MASK         0x1FF
#else
#define DECLIB_DBG_MASK             0x7
#define DECLIB_DBG_REG_MASK         0x0
#endif

/////////////////////////////////////////////////////////////////////////////////
//  Global Types
/////////////////////////////////////////////////////////////////////////////////

typedef struct
{
  u_int32 uMalIdx;
  u_int32 uIrqStatus[0x3];

} DECODER_KERNEL_LIB_ISR_EVENT_DATA;

/////////////////////////////////////////////////////////////////////////////////
//  Global Function definitions
/////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////
/// Decoder Event info callback

typedef void ( * DecKernelLib_Isr_Callback_t )( DECODER_KERNEL_LIB_ISR_EVENT_DATA *ptEventData );

/////////////////////////////////////////////////////////////////////////////////
//  Global Configuration Type
/////////////////////////////////////////////////////////////////////////////////

//////////////////////////////////////////////////////////////
/// DecoderLib Configuration structure

typedef struct
{
  /* Malone hardware details */
  u_int32                         uNumMalones;
  u_int32                         uMaloneHifOffset[DECODERLIB_MAX_MALONES];
  uint_addr                       uMaloneBaseAddr[DECODERLIB_MAX_MALONES];
  u_int32                         uMaloneIrqPin[DECODERLIB_MAX_MALONES][0x2];
  u_int32                         uNumDPVUnits;        /* 0 or 1 - could infer this from base address but for clarity */
  uint_addr                       uDPVBaseAddr;
  u_int32                         uDPVIrqPin;
} DECODERLIB_KERNEL_CFG, * pDECODERLIB_KERNEL_CFG;

/////////////////////////////////////////////////////////////////////////////////
//  Global Function Prototypes
/////////////////////////////////////////////////////////////////////////////////

MEDIAIP_FW_STATUS decoder_kernel_lib_init ( DECODERLIB_KERNEL_CFG * pCfg );

MEDIAIP_FW_STATUS decoder_kernel_lib_term ( void );

MEDIAIP_FW_STATUS decoder_kernel_lib_register_isr_callback ( u_int32 uMalIdx,
                                                             DecKernelLib_Isr_Callback_t pfCallback );


#endif /* _DECODER_KLIB_H_ */

/* End of File */