summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h')
-rw-r--r--jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h267
1 files changed, 0 insertions, 267 deletions
diff --git a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h b/jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h
deleted file mode 100644
index da1bade..0000000
--- a/jacinto6/sgx_src/eurasia_km/services4/system/omap4/syslocal.h
+++ /dev/null
@@ -1,267 +0,0 @@
1/*************************************************************************/ /*!
2@Title Local system definitions
3@Copyright Copyright (c) Imagination Technologies Ltd. All Rights Reserved
4@Description This header provides local system declarations and macros
5@License Dual MIT/GPLv2
6
7The contents of this file are subject to the MIT license as set out below.
8
9Permission is hereby granted, free of charge, to any person obtaining a copy
10of this software and associated documentation files (the "Software"), to deal
11in the Software without restriction, including without limitation the rights
12to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
13copies of the Software, and to permit persons to whom the Software is
14furnished to do so, subject to the following conditions:
15
16The above copyright notice and this permission notice shall be included in
17all copies or substantial portions of the Software.
18
19Alternatively, the contents of this file may be used under the terms of
20the GNU General Public License Version 2 ("GPL") in which case the provisions
21of GPL are applicable instead of those above.
22
23If you wish to allow use of your version of this file only under the terms of
24GPL, and not to allow others to use your version of this file under the terms
25of the MIT license, indicate your decision by deleting the provisions above
26and replace them with the notice and other provisions required by GPL as set
27out in the file called "GPL-COPYING" included in this distribution. If you do
28not delete the provisions above, a recipient may use your version of this file
29under the terms of either the MIT license or GPL.
30
31This License is also included in this distribution in the file called
32"MIT-COPYING".
33
34EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
35PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
36BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
37PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
38COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
39IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
40CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41*/ /**************************************************************************/
42
43#if !defined(__SYSLOCAL_H__)
44#define __SYSLOCAL_H__
45
46#if defined(__linux__)
47
48#include <linux/version.h>
49#include <linux/clk.h>
50#if defined(PVR_LINUX_USING_WORKQUEUES)
51#include <linux/mutex.h>
52#else
53#include <linux/spinlock.h>
54#endif
55#include <asm/atomic.h>
56
57#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
58#include <linux/semaphore.h>
59#include <linux/resource.h>
60#else /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)) */
61#include <asm/semaphore.h>
62#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22))
63#include <asm/arch/resource.h>
64#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22)) */
65#endif /* (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26)) */
66
67
68#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
69#if !defined(LDM_PLATFORM)
70#error "LDM_PLATFORM must be set"
71#endif
72#define PVR_LINUX_DYNAMIC_SGX_RESOURCE_INFO
73#include <linux/platform_device.h>
74#endif
75
76#if ((defined(DEBUG) || defined(TIMING)) && \
77 (LINUX_VERSION_CODE == KERNEL_VERSION(2,6,34))) && \
78 !defined(PVR_NO_OMAP_TIMER)
79/*
80 * We need to explicitly enable the GPTIMER11 clocks, or we'll get an
81 * abort when we try to access the timer registers.
82 */
83#define PVR_OMAP4_TIMING_PRCM
84#endif
85
86#if (LINUX_VERSION_CODE >= KERNEL_VERSION(2,6,35))
87#if (LINUX_VERSION_CODE < KERNEL_VERSION(3,8,0))
88#include <plat/gpu.h>
89#endif
90#if !defined(PVR_NO_OMAP_TIMER)
91#define PVR_OMAP_USE_DM_TIMER_API
92#include <plat/dmtimer.h>
93#endif
94#endif
95
96#if defined(CONFIG_HAS_WAKELOCK)
97#include <linux/wakelock.h>
98#endif
99
100#if !defined(PVR_NO_OMAP_TIMER)
101#define PVR_OMAP_TIMER_BASE_IN_SYS_SPEC_DATA
102#endif
103#endif /* defined(__linux__) */
104
105#if !defined(NO_HARDWARE) && \
106 defined(SYS_USING_INTERRUPTS)
107#define SGX_OCP_REGS_ENABLED
108#endif
109
110#if defined(__linux__)
111#if defined(SGX_OCP_REGS_ENABLED)
112#define SGX_OCP_NO_INT_BYPASS
113#endif
114#endif
115
116#if defined (__cplusplus)
117extern "C" {
118#endif
119
120/*****************************************************************************
121 * system specific data structures
122 *****************************************************************************/
123
124/*****************************************************************************
125 * system specific function prototypes
126 *****************************************************************************/
127
128IMG_VOID DisableSystemClocks(SYS_DATA *psSysData);
129PVRSRV_ERROR EnableSystemClocks(SYS_DATA *psSysData);
130
131IMG_VOID DisableSGXClocks(SYS_DATA *psSysData);
132PVRSRV_ERROR EnableSGXClocks(SYS_DATA *psSysData);
133
134/*
135 * Various flags to indicate what has been initialised, and what
136 * has been temporarily deinitialised for power management purposes.
137 */
138#define SYS_SPECIFIC_DATA_ENABLE_SYSCLOCKS 0x00000001
139#define SYS_SPECIFIC_DATA_ENABLE_LISR 0x00000002
140#define SYS_SPECIFIC_DATA_ENABLE_MISR 0x00000004
141#define SYS_SPECIFIC_DATA_ENABLE_ENVDATA 0x00000008
142#define SYS_SPECIFIC_DATA_ENABLE_LOCDEV 0x00000010
143#define SYS_SPECIFIC_DATA_ENABLE_REGDEV 0x00000020
144#define SYS_SPECIFIC_DATA_ENABLE_PDUMPINIT 0x00000040
145#define SYS_SPECIFIC_DATA_ENABLE_INITDEV 0x00000080
146#define SYS_SPECIFIC_DATA_ENABLE_LOCATEDEV 0x00000100
147
148#define SYS_SPECIFIC_DATA_PM_UNINSTALL_LISR 0x00000200
149#define SYS_SPECIFIC_DATA_PM_DISABLE_SYSCLOCKS 0x00000400
150#define SYS_SPECIFIC_DATA_ENABLE_OCPREGS 0x00000800
151#define SYS_SPECIFIC_DATA_ENABLE_PM_RUNTIME 0x00001000
152#define SYS_SPECIFIC_DATA_IRQ_ENABLED 0x00002000
153#define SYS_SPECIFIC_DATA_DVFS_INIT 0x00004000
154
155#define SYS_SPECIFIC_DATA_SET(psSysSpecData, flag) ((IMG_VOID)((psSysSpecData)->ui32SysSpecificData |= (flag)))
156
157#define SYS_SPECIFIC_DATA_CLEAR(psSysSpecData, flag) ((IMG_VOID)((psSysSpecData)->ui32SysSpecificData &= ~(flag)))
158
159#define SYS_SPECIFIC_DATA_TEST(psSysSpecData, flag) (((psSysSpecData)->ui32SysSpecificData & (flag)) != 0)
160
161typedef struct _SYS_SPECIFIC_DATA_TAG_
162{
163 IMG_UINT32 ui32SysSpecificData;
164 PVRSRV_DEVICE_NODE *psSGXDevNode;
165 IMG_BOOL bSGXInitComplete;
166#if defined(PVR_OMAP_TIMER_BASE_IN_SYS_SPEC_DATA)
167 IMG_CPU_PHYADDR sTimerRegPhysBase;
168#endif
169#if !defined(__linux__)
170 IMG_BOOL bSGXClocksEnabled;
171#endif
172 IMG_UINT32 ui32SrcClockDiv;
173#if defined(__linux__)
174 IMG_BOOL bSysClocksOneTimeInit;
175 atomic_t sSGXClocksEnabled;
176#if defined(PVR_LINUX_USING_WORKQUEUES)
177 struct mutex sPowerLock;
178#else
179 IMG_BOOL bConstraintNotificationsEnabled;
180 spinlock_t sPowerLock;
181 atomic_t sPowerLockCPU;
182 spinlock_t sNotifyLock;
183 atomic_t sNotifyLockCPU;
184 IMG_BOOL bCallVDD2PostFunc;
185#endif
186#if defined(DEBUG) || defined(TIMING)
187 struct clk *psGPT11_FCK;
188 struct clk *psGPT11_ICK;
189#endif
190#if defined(PVR_OMAP_USE_DM_TIMER_API)
191 struct omap_dm_timer *psGPTimer;
192#endif
193#if defined(CONFIG_HAS_WAKELOCK)
194 struct wake_lock wake_lock;
195#endif /* CONFIG_HAS_WAKELOCK */
196#endif /* defined(__linux__) */
197} SYS_SPECIFIC_DATA;
198
199extern SYS_SPECIFIC_DATA *gpsSysSpecificData;
200
201#if defined(SGX_OCP_REGS_ENABLED) && defined(SGX_OCP_NO_INT_BYPASS)
202IMG_VOID SysEnableSGXInterrupts(SYS_DATA* psSysData);
203IMG_VOID SysDisableSGXInterrupts(SYS_DATA* psSysData);
204#else
205#define SysEnableSGXInterrupts(psSysData)
206#define SysDisableSGXInterrupts(psSysData)
207#endif
208
209#if defined(SYS_CUSTOM_POWERLOCK_WRAP)
210IMG_BOOL WrapSystemPowerChange(SYS_SPECIFIC_DATA *psSysSpecData);
211IMG_VOID UnwrapSystemPowerChange(SYS_SPECIFIC_DATA *psSysSpecData);
212#endif
213
214#if defined(__linux__)
215
216PVRSRV_ERROR SysPMRuntimeRegister(SYS_SPECIFIC_DATA *psSysSpecificData);
217PVRSRV_ERROR SysPMRuntimeUnregister(SYS_SPECIFIC_DATA *psSysSpecificData);
218
219PVRSRV_ERROR SysDvfsInitialize(SYS_SPECIFIC_DATA *psSysSpecificData);
220PVRSRV_ERROR SysDvfsDeinitialize(SYS_SPECIFIC_DATA *psSysSpecificData);
221int pvr_access_process_vm(struct task_struct *tsk, unsigned long addr, void *buf, int len, int write);
222
223#else /* defined(__linux__) */
224
225#ifdef INLINE_IS_PRAGMA
226#pragma inline(SysPMRuntimeRegister)
227#endif
228static INLINE PVRSRV_ERROR SysPMRuntimeRegister(void)
229{
230 return PVRSRV_OK;
231}
232
233#ifdef INLINE_IS_PRAGMA
234#pragma inline(SysPMRuntimeUnregister)
235#endif
236static INLINE PVRSRV_ERROR SysPMRuntimeUnregister(void)
237{
238 return PVRSRV_OK;
239}
240
241#ifdef INLINE_IS_PRAGMA
242#pragma inline(SysDvfsInitialize)
243#endif
244static INLINE PVRSRV_ERROR SysDvfsInitialize(void)
245{
246 return PVRSRV_OK;
247}
248
249#ifdef INLINE_IS_PRAGMA
250#pragma inline(SysDvfsDeinitialize)
251#endif
252static INLINE PVRSRV_ERROR SysDvfsDeinitialize(void)
253{
254 return PVRSRV_OK;
255}
256
257#define pvr_access_process_vm(tsk, addr, buf, len, write) -1
258
259#endif /* defined(__linux__) */
260
261#if defined(__cplusplus)
262}
263#endif
264
265#endif /* __SYSLOCAL_H__ */
266
267