1 /*************************************************************************/ /*!
3 @Title Header for Services script routines used at initialisation time
4 @Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description Defines the connections between the various parts of the
7 @License Dual MIT/GPLv2
9 The contents of this file are subject to the MIT license as set out below.
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:
18 The above copyright notice and this permission notice shall be included in
19 all copies or substantial portions of the Software.
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.
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.
33 This License is also included in this distribution in the file called
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 #ifndef __RGXSRVINIT_SCRIPT_H__
45 #define __RGXSRVINIT_SCRIPT_H__
47 #if defined (__cplusplus)
52 #include "rgxscript.h"
53 #include "rgx_firmware_processor.h"
54 #include "rgxdefs_km.h"
57 typedef struct _RGX_SCRIPT_BUILD
59 IMG_UINT32 ui32MaxLen;
60 IMG_UINT32 ui32CurrComm;
62 RGX_INIT_COMMAND *psCommands;
67 *******************************************************************************
69 @Function ScriptWriteRGXReg
71 @Description Sets up a script entry for register write
79 ******************************************************************************/
81 IMG_BOOL ScriptWriteRGXReg(RGX_SCRIPT_BUILD *psScript,
82 IMG_UINT32 ui32Offset,
83 IMG_UINT32 ui32Value);
86 *******************************************************************************
88 @Function ScriptPoll64RGXReg
90 @Description Sets up a script entry for register poll
99 ******************************************************************************/
101 IMG_BOOL ScriptPoll64RGXReg(RGX_SCRIPT_BUILD *psScript,
102 IMG_UINT32 ui32Offset,
103 IMG_UINT64 ui64Value,
104 IMG_UINT64 ui64PollMask);
107 *******************************************************************************
109 @Function ScriptPollRGXReg
111 @Description Sets up a script entry for register poll
120 ******************************************************************************/
122 IMG_BOOL ScriptPollRGXReg(RGX_SCRIPT_BUILD *psScript,
123 IMG_UINT32 ui32Offset,
124 IMG_UINT32 ui32Value,
125 IMG_UINT32 ui32PollMask);
128 *******************************************************************************
130 @Function ScriptDBGReadRGXReg
132 @Description Sets up a script entry for register setup
141 ******************************************************************************/
143 IMG_BOOL ScriptDBGReadRGXReg(RGX_SCRIPT_BUILD *psScript,
144 RGX_INIT_OPERATION eOp,
145 IMG_UINT32 ui32Offset,
149 *******************************************************************************
151 @Function ScriptDBGCalc
153 @Description Sets up a script for calculation
163 ******************************************************************************/
165 IMG_BOOL ScriptDBGCalc(RGX_SCRIPT_BUILD *psScript,
166 RGX_INIT_OPERATION eOp,
167 IMG_UINT32 ui32Offset1,
168 IMG_UINT32 ui32Offset2,
169 IMG_UINT32 ui32Offset3,
173 #if defined(RGX_FEATURE_META) || defined(SUPPORT_KERNEL_SRVINIT)
175 *******************************************************************************
177 @Function ScriptWriteRGXReg
179 @Description Sets up a script entry for register setup
187 ******************************************************************************/
189 IMG_BOOL ScriptWriteRGXRegPDUMPOnly(RGX_SCRIPT_BUILD *psScript,
190 IMG_UINT32 ui32Offset,
191 IMG_UINT32 ui32Value);
194 *******************************************************************************
196 @Function ScriptDBGReadMetaRegThroughSP
198 @Description Add script entries for reading a reg through Meta slave port
206 ******************************************************************************/
208 IMG_BOOL ScriptDBGReadMetaRegThroughSP(RGX_SCRIPT_BUILD *psScript,
209 IMG_UINT32 ui32RegAddr,
213 *******************************************************************************
215 @Function ScriptDBGReadMetaRegThroughSP
217 @Description Add script entries for polling a reg through Meta slave port
225 ******************************************************************************/
227 IMG_BOOL ScriptMetaRegCondPollRGXReg(RGX_SCRIPT_BUILD *psScript,
228 IMG_UINT32 ui32MetaRegAddr,
229 IMG_UINT32 ui32MetaRegValue,
230 IMG_UINT32 ui32MetaRegMask,
231 IMG_UINT32 ui32RegAddr,
232 IMG_UINT32 ui32RegValue,
233 IMG_UINT32 ui32RegMask);
236 *******************************************************************************
238 @Function ScriptWriteMetaRegThroughSP
240 @Description Add script entries for writing a reg through Meta slave port
248 ******************************************************************************/
250 IMG_BOOL ScriptWriteMetaRegThroughSP(RGX_SCRIPT_BUILD *psScript,
251 IMG_UINT32 ui32RegAddr,
252 IMG_UINT32 ui32RegValue);
255 *******************************************************************************
257 @Function ScriptPollMetaRegThroughSP
259 @Description Polls a Core Garten register through the slave port
265 ******************************************************************************/
267 IMG_BOOL ScriptPollMetaRegThroughSP(RGX_SCRIPT_BUILD *psScript,
268 IMG_UINT32 ui32Offset,
269 IMG_UINT32 ui32PollValue,
270 IMG_UINT32 ui32PollMask);
273 *******************************************************************************
275 @Function ScriptDBGReadMetaRegThroughSP
277 @Description Adds script entries reading a reg through Meta slave port
285 ******************************************************************************/
287 IMG_BOOL ScriptDBGReadMetaCoreReg(RGX_SCRIPT_BUILD *psScript,
288 IMG_UINT32 ui32RegAddr,
290 #endif /* RGX_FEATURE_META */
294 *******************************************************************************
296 @Function ScriptDBGString
298 @Description Adds a debug print to the script
305 ******************************************************************************/
308 IMG_BOOL ScriptDBGString(RGX_SCRIPT_BUILD *psScript,
309 const IMG_CHAR *aszString);
313 *******************************************************************************
317 @Description Add a cmd to finish the script
321 @Return IMG_BOOL True if it runs out of cmds when building the script
323 ******************************************************************************/
325 IMG_BOOL ScriptHalt(RGX_SCRIPT_BUILD *psScript);
328 #if defined (__cplusplus)
332 #endif /* __RGXSRVINIT_SCRIPT_H__ */