aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/gpu/pvr/omap3/syslocal.h
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/pvr/omap3/syslocal.h')
-rw-r--r--drivers/gpu/pvr/omap3/syslocal.h135
1 files changed, 135 insertions, 0 deletions
diff --git a/drivers/gpu/pvr/omap3/syslocal.h b/drivers/gpu/pvr/omap3/syslocal.h
new file mode 100644
index 00000000000..351ed695275
--- /dev/null
+++ b/drivers/gpu/pvr/omap3/syslocal.h
@@ -0,0 +1,135 @@
1/**********************************************************************
2 *
3 * Copyright(c) 2008 Imagination Technologies Ltd. All rights reserved.
4 *
5 * This program is free software; you can redistribute it and/or modify it
6 * under the terms and conditions of the GNU General Public License,
7 * version 2, as published by the Free Software Foundation.
8 *
9 * This program is distributed in the hope it will be useful but, except
10 * as otherwise stated in writing, without any warranty; without even the
11 * implied warranty of merchantability or fitness for a particular purpose.
12 * See the GNU General Public License for more details.
13 *
14 * You should have received a copy of the GNU General Public License along with
15 * this program; if not, write to the Free Software Foundation, Inc.,
16 * 51 Franklin St - Fifth Floor, Boston, MA 02110-1301 USA.
17 *
18 * The full GNU General Public License is included in this distribution in
19 * the file called "COPYING".
20 *
21 * Contact Information:
22 * Imagination Technologies Ltd. <gpl-support@imgtec.com>
23 * Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
24 *
25 ******************************************************************************/
26
27#if !defined(__SYSLOCAL_H__)
28#define __SYSLOCAL_H__
29
30#if defined(__linux__)
31
32#include <linux/version.h>
33#include <linux/clk.h>
34#if defined(PVR_LINUX_USING_WORKQUEUES)
35#include <linux/mutex.h>
36#else
37#include <linux/spinlock.h>
38#endif
39#include <asm/atomic.h>
40
41#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,26))
42#include <linux/semaphore.h>
43#include <linux/resource.h>
44#else
45#include <asm/semaphore.h>
46#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22))
47#include <asm/arch/resource.h>
48#endif
49#endif
50
51#endif
52
53#if defined (__cplusplus)
54extern "C" {
55#endif
56
57
58
59IMG_CHAR *SysCreateVersionString(IMG_CPU_PHYADDR sRegRegion);
60
61IMG_VOID DisableSystemClocks(SYS_DATA *psSysData);
62PVRSRV_ERROR EnableSystemClocks(SYS_DATA *psSysData);
63
64IMG_VOID DisableSGXClocks(SYS_DATA *psSysData);
65PVRSRV_ERROR EnableSGXClocks(SYS_DATA *psSysData);
66
67#define SYS_SPECIFIC_DATA_ENABLE_SYSCLOCKS 0x00000001
68#define SYS_SPECIFIC_DATA_ENABLE_LISR 0x00000002
69#define SYS_SPECIFIC_DATA_ENABLE_MISR 0x00000004
70#define SYS_SPECIFIC_DATA_ENABLE_ENVDATA 0x00000008
71#define SYS_SPECIFIC_DATA_ENABLE_LOCDEV 0x00000010
72#define SYS_SPECIFIC_DATA_ENABLE_REGDEV 0x00000020
73#define SYS_SPECIFIC_DATA_ENABLE_PDUMPINIT 0x00000040
74#define SYS_SPECIFIC_DATA_ENABLE_INITDEV 0x00000080
75#define SYS_SPECIFIC_DATA_ENABLE_LOCATEDEV 0x00000100
76
77#define SYS_SPECIFIC_DATA_PM_UNINSTALL_LISR 0x00000200
78#define SYS_SPECIFIC_DATA_PM_DISABLE_SYSCLOCKS 0x00000400
79
80#define SYS_SPECIFIC_DATA_SET(psSysSpecData, flag) ((IMG_VOID)((psSysSpecData)->ui32SysSpecificData |= (flag)))
81
82#define SYS_SPECIFIC_DATA_CLEAR(psSysSpecData, flag) ((IMG_VOID)((psSysSpecData)->ui32SysSpecificData &= ~(flag)))
83
84#define SYS_SPECIFIC_DATA_TEST(psSysSpecData, flag) (((psSysSpecData)->ui32SysSpecificData & (flag)) != 0)
85
86typedef struct _SYS_SPECIFIC_DATA_TAG_
87{
88 IMG_UINT32 ui32SysSpecificData;
89 PVRSRV_DEVICE_NODE *psSGXDevNode;
90 IMG_BOOL bSGXInitComplete;
91#if !defined(__linux__)
92 IMG_BOOL bSGXClocksEnabled;
93#endif
94 IMG_UINT32 ui32SrcClockDiv;
95#if defined(__linux__)
96 IMG_BOOL bSysClocksOneTimeInit;
97 atomic_t sSGXClocksEnabled;
98#if defined(PVR_LINUX_USING_WORKQUEUES)
99 struct mutex sPowerLock;
100#else
101 IMG_BOOL bConstraintNotificationsEnabled;
102 spinlock_t sPowerLock;
103 atomic_t sPowerLockCPU;
104 spinlock_t sNotifyLock;
105 atomic_t sNotifyLockCPU;
106 IMG_BOOL bCallVDD2PostFunc;
107#endif
108 struct clk *psCORE_CK;
109 struct clk *psSGX_FCK;
110 struct clk *psSGX_ICK;
111 struct clk *psMPU_CK;
112#if defined(DEBUG) || defined(TIMING)
113 struct clk *psGPT11_FCK;
114 struct clk *psGPT11_ICK;
115#endif
116#if (LINUX_VERSION_CODE > KERNEL_VERSION(2,6,22))
117 struct constraint_handle *pVdd2Handle;
118#endif
119#endif
120} SYS_SPECIFIC_DATA;
121
122extern SYS_SPECIFIC_DATA *gpsSysSpecificData;
123
124#if defined(SYS_CUSTOM_POWERLOCK_WRAP)
125IMG_BOOL WrapSystemPowerChange(SYS_SPECIFIC_DATA *psSysSpecData);
126IMG_VOID UnwrapSystemPowerChange(SYS_SPECIFIC_DATA *psSysSpecData);
127#endif
128
129#if defined(__cplusplus)
130}
131#endif
132
133#endif
134
135