1 /*----------------------------------------------------------------------------
3 *The confidential and proprietary information contained in this file may
4 *only be used by a person authorised under and to the extent permitted
5 *by a subsisting licensing agreement from ARM Limited.
7 * (C) COPYRIGHT 2010-2013 ARM Limited.
10 *This entire notice must be reproduced on all copies of this file
11 *and copies of this file may only be made by a person if such person is
12 *permitted to do so under the terms of a subsisting license agreement
14 *Modified : $Date: 2013-08-01 18:15:13 +0100 (Thu, 01 Aug 2013) $
15 *Revision : $Revision: 66689 $
17 *-----------------------------------------------------------------------------
19 *-----------------------------------------------------------------------------
20 * Abstract :Declaration of Mali functions
21 *-----------------------------------------------------------------------------
25 **************************************************************/
30 #define MALI_BASE 0x2D000000
32 #define MALI_BASE 0xC0000000
35 /****************************************************************************
36 * SYSTEM SPECIFIC FUNCTIONS
37 ****************************************************************************/
38 void CPU_EnableInterrupts(void);
39 void CPU_DisableInterrupts(void);
40 void CPU_InitialiseInterrupts(void);
42 void Mali_WaitForClk(int);
43 void Mali_WaitForInterrupt(void);
44 void Mali_InstallIntHandlers(void (*callback_mali_gpu)(void),
45 void (*callback_mali_mmu)(void),
46 void (*callback_mali_job)(void));
47 void Mali_Message(char *s);
48 void Mali_SetupOutputFrame(void);
49 void Mali_JobPartDone(void);
51 /****************************************************************************
52 * MALI REGISTER READ / WRITE
53 ****************************************************************************/
54 void Mali_Reset(void);
55 void *Mali_LdMem(void *srcptr,int size,int ttb_base);
56 void Mali_WrReg(int unit,int core,int regnum,int value);
57 int Mali_RdReg(int unit,int core,int regnum);
58 unsigned int Mali_PollReg (unsigned int unit, unsigned int core, unsigned int regnum, unsigned int bit_location, unsigned int val, char * name_str);
60 void Mali_DisplayReg(int unit,int core, int regnum);
62 void Mali_Identify(void);
64 int Mali_InterruptCheck(int i_mask, int i_value);
65 int Mali_AnyInterruptCheck(int type, int i_mask, int i_value);
66 void Mali_MaskAllInterrupts(void);
68 void Mali_SetInterruptErrMask(int type, int e_mask);
70 /****************************************************************************
71 * MALI PERFORMANCE COUNTERS
72 ****************************************************************************/
73 void Mali_InitPerfCounters(void);
74 void Mali_ReadPerfCounters(void);
76 /****************************************************************************
77 * UTILITY FUNCTIONS FOR COPYING DATA INTO MALI MEMORY
78 ****************************************************************************/
79 int Mali_MemCpy(unsigned int *malidata_page,
81 unsigned int *refdata,
82 unsigned int refoffset,
85 int Mali_MemCpyMasked(unsigned int *malidata_page,
87 unsigned int *refdata,
88 unsigned int *refmask,
89 unsigned int refoffset,
92 /****************************************************************************
93 * UTILITY FUNCTIONS FOR CHECKING TEST RESULTS
94 ****************************************************************************/
95 int Mali_MemCmp(unsigned int *malidata_page,
97 unsigned int *refdata,
98 unsigned int refoffset,
101 int Mali_MemCmpMasked(unsigned int *malidata_page,
102 unsigned int mali_va,
103 unsigned int *refdata,
104 unsigned int *refmask,
105 unsigned int refoffset,
108 int Mali_CompareRegs(unsigned int *reference_ptr,
114 /****************************************************************************
115 * FUNCTIONS THAT ARE USEFUL FOR DEBUG
116 ****************************************************************************/
117 void Mali_PrintMem (volatile unsigned int * memory_address, unsigned int word_count );
118 void Mali_ReadDescriptor (volatile unsigned int * descriptor_address );
121 int RunMaliTest_sim1_t760 (int *base);
122 int RunMaliTest_sim2_t760 (int *base);
123 int RunMaliTest_sim3_t760 (int *base);
124 int RunMaliTest_sim4_t760 (int *base);