Merge tag 'lsk-v3.10-15.04-android'
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / rogue / 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_DBGBUS_COMMANDS (4096)
53 #define RGX_MAX_DEINIT_COMMANDS (32)
54 #define RGX_DBG_CMD_NAME_SIZE   (32)
55
56 typedef enum _RGX_INIT_OPERATION
57 {
58         RGX_INIT_OP_ILLEGAL = 0,
59         RGX_INIT_OP_WRITE_HW_REG,
60         RGX_INIT_OP_POLL_64_HW_REG,
61         RGX_INIT_OP_POLL_HW_REG,
62         RGX_INIT_OP_COND_POLL_HW_REG,
63         RGX_INIT_OP_LOOP_POINT,
64         RGX_INIT_OP_COND_BRANCH,
65         RGX_INIT_OP_HALT,
66         RGX_INIT_OP_DBG_READ32_HW_REG,
67         RGX_INIT_OP_DBG_READ64_HW_REG,
68         RGX_INIT_OP_DBG_CALC,
69         RGX_INIT_OP_DBG_WAIT,
70         RGX_INIT_OP_DBG_STRING,
71         RGX_INIT_OP_PDUMP_HW_REG,
72 } RGX_INIT_OPERATION;
73
74 typedef union _RGX_INIT_COMMAND_
75 {
76         RGX_INIT_OPERATION eOp;
77         
78         struct {
79                 RGX_INIT_OPERATION eOp;
80                 IMG_UINT32 ui32Offset;
81                 IMG_UINT32 ui32Value;
82         } sWriteHWReg;
83
84         struct {
85                 RGX_INIT_OPERATION eOp;
86                 IMG_UINT32 ui32Offset;
87                 IMG_UINT32 ui32Value;
88         } sPDumpHWReg;
89         
90         struct 
91         {
92                 RGX_INIT_OPERATION eOp;
93                 IMG_UINT32 ui32Offset;
94                 IMG_UINT64 ui64Value;
95                 IMG_UINT64 ui64Mask;            
96         } sPoll64HWReg;
97
98         struct 
99         {
100                 RGX_INIT_OPERATION eOp;
101                 IMG_UINT32 ui32Offset;
102                 IMG_UINT32 ui32Value;
103                 IMG_UINT32 ui32Mask;            
104         } sPollHWReg;
105         
106         struct 
107         {
108                 RGX_INIT_OPERATION eOp;
109                 IMG_UINT32 ui32CondOffset;
110                 IMG_UINT32 ui32CondValue;
111                 IMG_UINT32 ui32CondMask;                
112                 IMG_UINT32 ui32Offset;
113                 IMG_UINT32 ui32Value;
114                 IMG_UINT32 ui32Mask;            
115         } sCondPollHWReg;
116         
117         struct
118         {
119                 RGX_INIT_OPERATION eOp;
120         } sLoopPoint;
121
122         struct
123         {
124                 RGX_INIT_OPERATION eOp;
125                 IMG_UINT32 ui32Offset;
126                 IMG_UINT32 ui32Value;
127                 IMG_UINT32 ui32Mask;
128
129         } sConditionalBranchPoint;
130
131         struct 
132         {
133                 RGX_INIT_OPERATION eOp;
134                 IMG_UINT32 ui32Offset;
135                 IMG_CHAR aszName[RGX_DBG_CMD_NAME_SIZE];
136         } sDBGReadHWReg;
137
138         struct
139         {
140                 RGX_INIT_OPERATION eOp;
141                 IMG_UINT32 ui32Offset1;
142                 IMG_UINT32 ui32Offset2;
143                 IMG_UINT32 ui32Offset3;
144                 IMG_CHAR aszName[RGX_DBG_CMD_NAME_SIZE];
145         } sDBGCalc;
146
147         struct
148         {
149                 RGX_INIT_OPERATION eOp;
150                 IMG_UINT32 ui32WaitInUs;
151         } sDBGWait;
152
153         struct
154         {
155                 RGX_INIT_OPERATION eOp;
156                 IMG_CHAR aszString[RGX_DBG_CMD_NAME_SIZE];
157         } sDBGString;
158
159 } RGX_INIT_COMMAND;
160
161 typedef struct _RGX_INIT_SCRIPTS_
162 {
163         RGX_INIT_COMMAND asInitCommands[RGX_MAX_INIT_COMMANDS];
164         RGX_INIT_COMMAND asDbgCommands[RGX_MAX_INIT_COMMANDS];
165         RGX_INIT_COMMAND asDbgBusCommands[RGX_MAX_DBGBUS_COMMANDS];
166         RGX_INIT_COMMAND asDeinitCommands[RGX_MAX_DEINIT_COMMANDS];
167 } RGX_SCRIPTS;
168
169 #if defined(__cplusplus)
170 }
171 #endif
172
173 #endif /* __RGXSCRIPT_H__ */
174
175 /*****************************************************************************
176  End of file (rgxscript.h)
177 *****************************************************************************/
178