RK3368 GPU version Rogue M 1.28
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / rogue_m / include / rgxscript.h
1 /*************************************************************************/ /*!
2 @File
3 @Title          rgx kernel services structues/functions
4 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description    RGX initialisation script definitions.
6 @License        Dual MIT/GPLv2
7
8 The contents of this file are subject to the MIT license as set out below.
9
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 Alternatively, the contents of this file may be used under the terms of
21 the GNU General Public License Version 2 ("GPL") in which case the provisions
22 of GPL are applicable instead of those above.
23
24 If you wish to allow use of your version of this file only under the terms of
25 GPL, and not to allow others to use your version of this file under the terms
26 of the MIT license, indicate your decision by deleting the provisions above
27 and replace them with the notice and other provisions required by GPL as set
28 out in the file called "GPL-COPYING" included in this distribution. If you do
29 not delete the provisions above, a recipient may use your version of this file
30 under the terms of either the MIT license or GPL.
31
32 This License is also included in this distribution in the file called
33 "MIT-COPYING".
34
35 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 */ /**************************************************************************/
43
44 #ifndef __RGXSCRIPT_H__
45 #define __RGXSCRIPT_H__
46
47 #if defined (__cplusplus)
48 extern "C" {
49 #endif
50
51 #define RGX_MAX_INIT_COMMANDS   (256)
52 #define RGX_MAX_DEBUG_COMMANDS  (320)
53 #define RGX_MAX_DBGBUS_COMMANDS (4096)
54 #define RGX_MAX_DEINIT_COMMANDS (32)
55 #define RGX_DBG_CMD_NAME_SIZE   (40)
56
57 typedef enum _RGX_INIT_OPERATION
58 {
59         RGX_INIT_OP_ILLEGAL = 0,
60         RGX_INIT_OP_WRITE_HW_REG,
61         RGX_INIT_OP_POLL_64_HW_REG,
62         RGX_INIT_OP_POLL_HW_REG,
63         RGX_INIT_OP_COND_POLL_HW_REG,
64         RGX_INIT_OP_LOOP_POINT,
65         RGX_INIT_OP_COND_BRANCH,
66         RGX_INIT_OP_HALT,
67         RGX_INIT_OP_DBG_READ32_HW_REG,
68         RGX_INIT_OP_DBG_READ64_HW_REG,
69         RGX_INIT_OP_DBG_CALC,
70         RGX_INIT_OP_DBG_WAIT,
71         RGX_INIT_OP_DBG_STRING,
72         RGX_INIT_OP_PDUMP_HW_REG,
73 } RGX_INIT_OPERATION;
74
75 typedef union _RGX_INIT_COMMAND_
76 {
77         RGX_INIT_OPERATION eOp;
78         
79         struct {
80                 RGX_INIT_OPERATION eOp;
81                 IMG_UINT32 ui32Offset;
82                 IMG_UINT32 ui32Value;
83         } sWriteHWReg;
84
85         struct {
86                 RGX_INIT_OPERATION eOp;
87                 IMG_UINT32 ui32Offset;
88                 IMG_UINT32 ui32Value;
89         } sPDumpHWReg;
90         
91         struct 
92         {
93                 RGX_INIT_OPERATION eOp;
94                 IMG_UINT32 ui32Offset;
95                 IMG_UINT64 ui64Value;
96                 IMG_UINT64 ui64Mask;            
97         } sPoll64HWReg;
98
99         struct 
100         {
101                 RGX_INIT_OPERATION eOp;
102                 IMG_UINT32 ui32Offset;
103                 IMG_UINT32 ui32Value;
104                 IMG_UINT32 ui32Mask;            
105         } sPollHWReg;
106         
107         struct 
108         {
109                 RGX_INIT_OPERATION eOp;
110                 IMG_UINT32 ui32CondOffset;
111                 IMG_UINT32 ui32CondValue;
112                 IMG_UINT32 ui32CondMask;                
113                 IMG_UINT32 ui32Offset;
114                 IMG_UINT32 ui32Value;
115                 IMG_UINT32 ui32Mask;            
116         } sCondPollHWReg;
117         
118         struct
119         {
120                 RGX_INIT_OPERATION eOp;
121         } sLoopPoint;
122
123         struct
124         {
125                 RGX_INIT_OPERATION eOp;
126                 IMG_UINT32 ui32Offset;
127                 IMG_UINT32 ui32Value;
128                 IMG_UINT32 ui32Mask;
129
130         } sConditionalBranchPoint;
131
132         struct 
133         {
134                 RGX_INIT_OPERATION eOp;
135                 IMG_UINT32 ui32Offset;
136                 IMG_CHAR aszName[RGX_DBG_CMD_NAME_SIZE];
137         } sDBGReadHWReg;
138
139         struct
140         {
141                 RGX_INIT_OPERATION eOp;
142                 IMG_UINT32 ui32Offset1;
143                 IMG_UINT32 ui32Offset2;
144                 IMG_UINT32 ui32Offset3;
145                 IMG_CHAR aszName[RGX_DBG_CMD_NAME_SIZE];
146         } sDBGCalc;
147
148         struct
149         {
150                 RGX_INIT_OPERATION eOp;
151                 IMG_UINT32 ui32WaitInUs;
152         } sDBGWait;
153
154         struct
155         {
156                 RGX_INIT_OPERATION eOp;
157                 IMG_CHAR aszString[RGX_DBG_CMD_NAME_SIZE];
158         } sDBGString;
159
160 } RGX_INIT_COMMAND;
161
162 typedef struct _RGX_INIT_SCRIPTS_
163 {
164         RGX_INIT_COMMAND asInitCommands[RGX_MAX_INIT_COMMANDS];
165         RGX_INIT_COMMAND asDbgCommands[RGX_MAX_DEBUG_COMMANDS];
166         RGX_INIT_COMMAND asDbgBusCommands[RGX_MAX_DBGBUS_COMMANDS];
167         RGX_INIT_COMMAND asDeinitCommands[RGX_MAX_DEINIT_COMMANDS];
168 } RGX_SCRIPTS;
169
170 #if defined(__cplusplus)
171 }
172 #endif
173
174 #endif /* __RGXSCRIPT_H__ */
175
176 /*****************************************************************************
177  End of file (rgxscript.h)
178 *****************************************************************************/
179