RK3368 GPU: Rogue N Init.
[firefly-linux-kernel-4.4.55.git] / drivers / staging / imgtec / rogue / generated / rgxinit_bridge / common_rgxinit_bridge.h
1 /*************************************************************************/ /*!
2 @File
3 @Title          Common bridge header for rgxinit
4 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description    Declares common defines and structures used by both the client
6                 and server side of the bridge for rgxinit
7 @License        Dual MIT/GPLv2
8
9 The contents of this file are subject to the MIT license as set out below.
10
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13 in the Software without restriction, including without limitation the rights
14 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom the Software is
16 furnished to do so, subject to the following conditions:
17
18 The above copyright notice and this permission notice shall be included in
19 all copies or substantial portions of the Software.
20
21 Alternatively, the contents of this file may be used under the terms of
22 the GNU General Public License Version 2 ("GPL") in which case the provisions
23 of GPL are applicable instead of those above.
24
25 If you wish to allow use of your version of this file only under the terms of
26 GPL, and not to allow others to use your version of this file under the terms
27 of the MIT license, indicate your decision by deleting the provisions above
28 and replace them with the notice and other provisions required by GPL as set
29 out in the file called "GPL-COPYING" included in this distribution. If you do
30 not delete the provisions above, a recipient may use your version of this file
31 under the terms of either the MIT license or GPL.
32
33 This License is also included in this distribution in the file called
34 "MIT-COPYING".
35
36 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
37 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
38 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
39 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
40 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
41 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
42 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43 */ /**************************************************************************/
44
45 #ifndef COMMON_RGXINIT_BRIDGE_H
46 #define COMMON_RGXINIT_BRIDGE_H
47
48 #include <powervr/mem_types.h>
49
50 #include "img_types.h"
51 #include "pvrsrv_error.h"
52
53 #include "rgx_bridge.h"
54 #include "rgxscript.h"
55 #include "devicemem_typedefs.h"
56 #include "rgx_fwif.h"
57
58
59 #define PVRSRV_BRIDGE_RGXINIT_CMD_FIRST                 0
60 #define PVRSRV_BRIDGE_RGXINIT_RGXINITALLOCFWIMGMEM                      PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+0
61 #define PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWARE                   PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+1
62 #define PVRSRV_BRIDGE_RGXINIT_RGXINITFINALISEFWIMAGE                    PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+2
63 #define PVRSRV_BRIDGE_RGXINIT_RGXINITDEVPART2                   PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+3
64 #define PVRSRV_BRIDGE_RGXINIT_GPUVIRTPOPULATELMASUBARENAS                       PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+4
65 #define PVRSRV_BRIDGE_RGXINIT_RGXINITGUEST                      PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+5
66 #define PVRSRV_BRIDGE_RGXINIT_RGXINITFIRMWAREEXTENDED                   PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+6
67 #define PVRSRV_BRIDGE_RGXINIT_CMD_LAST                  (PVRSRV_BRIDGE_RGXINIT_CMD_FIRST+6)
68
69
70 /*******************************************
71             RGXInitAllocFWImgMem          
72  *******************************************/
73
74 /* Bridge in structure for RGXInitAllocFWImgMem */
75 typedef struct PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM_TAG
76 {
77         IMG_DEVMEM_SIZE_T uiFWCodeLen;
78         IMG_DEVMEM_SIZE_T uiFWDataLen;
79         IMG_DEVMEM_SIZE_T uiFWCoremem;
80 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITALLOCFWIMGMEM;
81
82 /* Bridge out structure for RGXInitAllocFWImgMem */
83 typedef struct PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM_TAG
84 {
85         IMG_HANDLE hFWCodePMR;
86         IMG_DEV_VIRTADDR sFWCodeDevVAddrBase;
87         IMG_HANDLE hFWDataPMR;
88         IMG_DEV_VIRTADDR sFWDataDevVAddrBase;
89         IMG_HANDLE hFWCorememPMR;
90         IMG_DEV_VIRTADDR sFWCorememDevVAddrBase;
91         RGXFWIF_DEV_VIRTADDR sFWCorememMetaVAddrBase;
92         PVRSRV_ERROR eError;
93 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITALLOCFWIMGMEM;
94
95
96 /*******************************************
97             RGXInitFirmware          
98  *******************************************/
99
100 /* Bridge in structure for RGXInitFirmware */
101 typedef struct PVRSRV_BRIDGE_IN_RGXINITFIRMWARE_TAG
102 {
103         IMG_BOOL bEnableSignatureChecks;
104         IMG_UINT32 ui32SignatureChecksBufSize;
105         IMG_UINT32 ui32HWPerfFWBufSizeKB;
106         IMG_UINT64 ui64HWPerfFilter;
107         IMG_UINT32 ui32RGXFWAlignChecksArrLength;
108         IMG_UINT32 * pui32RGXFWAlignChecks;
109         IMG_UINT32 ui32ConfigFlags;
110         IMG_UINT32 ui32LogType;
111         IMG_UINT32 ui32FilterFlags;
112         IMG_UINT32 ui32JonesDisableMask;
113         IMG_UINT32 ui32ui32HWRDebugDumpLimit;
114         RGXFWIF_COMPCHECKS_BVNC sClientBVNC;
115         IMG_UINT32 ui32HWPerfCountersDataSize;
116         RGX_RD_POWER_ISLAND_CONF eRGXRDPowerIslandConf;
117         FW_PERF_CONF eFirmwarePerf;
118 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITFIRMWARE;
119
120 /* Bridge out structure for RGXInitFirmware */
121 typedef struct PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE_TAG
122 {
123         RGXFWIF_DEV_VIRTADDR spsRGXFwInit;
124         IMG_HANDLE hHWPerfPMR;
125         PVRSRV_ERROR eError;
126 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITFIRMWARE;
127
128
129 /*******************************************
130             RGXInitFinaliseFWImage          
131  *******************************************/
132
133 /* Bridge in structure for RGXInitFinaliseFWImage */
134 typedef struct PVRSRV_BRIDGE_IN_RGXINITFINALISEFWIMAGE_TAG
135 {
136          IMG_UINT32 ui32EmptyStructPlaceholder;
137 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITFINALISEFWIMAGE;
138
139 /* Bridge out structure for RGXInitFinaliseFWImage */
140 typedef struct PVRSRV_BRIDGE_OUT_RGXINITFINALISEFWIMAGE_TAG
141 {
142         PVRSRV_ERROR eError;
143 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITFINALISEFWIMAGE;
144
145
146 /*******************************************
147             RGXInitDevPart2          
148  *******************************************/
149
150 /* Bridge in structure for RGXInitDevPart2 */
151 typedef struct PVRSRV_BRIDGE_IN_RGXINITDEVPART2_TAG
152 {
153         RGX_INIT_COMMAND * psDbgScript;
154         IMG_UINT32 ui32DeviceFlags;
155         IMG_UINT32 ui32HWPerfHostBufSize;
156         IMG_UINT32 ui32HWPerfHostFilter;
157         IMG_UINT32 ui32RGXActivePMConf;
158         IMG_HANDLE hFWCodePMR;
159         IMG_HANDLE hFWDataPMR;
160         IMG_HANDLE hFWCorememPMR;
161         IMG_HANDLE hHWPerfPMR;
162 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITDEVPART2;
163
164 /* Bridge out structure for RGXInitDevPart2 */
165 typedef struct PVRSRV_BRIDGE_OUT_RGXINITDEVPART2_TAG
166 {
167         PVRSRV_ERROR eError;
168 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITDEVPART2;
169
170
171 /*******************************************
172             GPUVIRTPopulateLMASubArenas          
173  *******************************************/
174
175 /* Bridge in structure for GPUVIRTPopulateLMASubArenas */
176 typedef struct PVRSRV_BRIDGE_IN_GPUVIRTPOPULATELMASUBARENAS_TAG
177 {
178         IMG_UINT32 ui32NumElements;
179         IMG_UINT32 * pui32Elements;
180         IMG_BOOL bEnableTrustedDeviceAceConfig;
181 } __attribute__((packed)) PVRSRV_BRIDGE_IN_GPUVIRTPOPULATELMASUBARENAS;
182
183 /* Bridge out structure for GPUVIRTPopulateLMASubArenas */
184 typedef struct PVRSRV_BRIDGE_OUT_GPUVIRTPOPULATELMASUBARENAS_TAG
185 {
186         PVRSRV_ERROR eError;
187 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_GPUVIRTPOPULATELMASUBARENAS;
188
189
190 /*******************************************
191             RGXInitGuest          
192  *******************************************/
193
194 /* Bridge in structure for RGXInitGuest */
195 typedef struct PVRSRV_BRIDGE_IN_RGXINITGUEST_TAG
196 {
197         IMG_BOOL bEnableSignatureChecks;
198         IMG_UINT32 ui32SignatureChecksBufSize;
199         IMG_UINT32 ui32RGXFWAlignChecksArrLength;
200         IMG_UINT32 * pui32RGXFWAlignChecks;
201         IMG_UINT32 ui32DeviceFlags;
202         RGXFWIF_COMPCHECKS_BVNC sClientBVNC;
203 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITGUEST;
204
205 /* Bridge out structure for RGXInitGuest */
206 typedef struct PVRSRV_BRIDGE_OUT_RGXINITGUEST_TAG
207 {
208         PVRSRV_ERROR eError;
209 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITGUEST;
210
211
212 /*******************************************
213             RGXInitFirmwareExtended          
214  *******************************************/
215
216 /* Bridge in structure for RGXInitFirmwareExtended */
217 typedef struct PVRSRV_BRIDGE_IN_RGXINITFIRMWAREEXTENDED_TAG
218 {
219         IMG_UINT32 ui32RGXFWAlignChecksArrLength;
220         IMG_UINT32 * pui32RGXFWAlignChecks;
221         RGX_FW_INIT_IN_PARAMS spsInParams;
222 } __attribute__((packed)) PVRSRV_BRIDGE_IN_RGXINITFIRMWAREEXTENDED;
223
224 /* Bridge out structure for RGXInitFirmwareExtended */
225 typedef struct PVRSRV_BRIDGE_OUT_RGXINITFIRMWAREEXTENDED_TAG
226 {
227         RGXFWIF_DEV_VIRTADDR spsRGXFwInit;
228         IMG_HANDLE hHWPerfPMR2;
229         PVRSRV_ERROR eError;
230 } __attribute__((packed)) PVRSRV_BRIDGE_OUT_RGXINITFIRMWAREEXTENDED;
231
232
233 #endif /* COMMON_RGXINIT_BRIDGE_H */