1
/**********************************************************************
3
* Copyright (C) Imagination Technologies Ltd. All rights reserved.
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.
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.
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.
18
* The full GNU General Public License is included in this distribution in
19
* the file called "COPYING".
21
* Contact Information:
22
* Imagination Technologies Ltd. <gpl-support@imgtec.com>
23
* Home Park Estate, Kings Langley, Herts, WD4 8LZ, UK
25
******************************************************************************/
27
#ifndef __SGXCONFIG_H__
28
#define __SGXCONFIG_H__
32
#define DEV_DEVICE_TYPE PVRSRV_DEVICE_TYPE_SGX
33
#define DEV_DEVICE_CLASS PVRSRV_DEVICE_CLASS_3D
35
#define DEV_MAJOR_VERSION 1
36
#define DEV_MINOR_VERSION 0
38
#if SGX_FEATURE_ADDRESS_SPACE_SIZE == 32
39
#if defined(FIX_HW_BRN_31620)
40
#if defined(SGX_FEATURE_2D_HARDWARE)
41
#define SGX_2D_HEAP_BASE 0x04000000
42
#define SGX_2D_HEAP_SIZE (0x08000000-0x04000000-0x00001000)
45
#define SGX_GENERAL_HEAP_BASE 0x08000000
46
#define SGX_GENERAL_HEAP_SIZE (0xB8000000-0x00001000)
49
#define SGX_3DPARAMETERS_HEAP_SIZE 0x10000000
52
#if !defined(HYBRID_SHARED_PB_SIZE)
53
#define HYBRID_SHARED_PB_SIZE (SGX_3DPARAMETERS_HEAP_SIZE >> 1)
55
#if defined(SUPPORT_HYBRID_PB)
56
#define SGX_SHARED_3DPARAMETERS_SIZE (HYBRID_SHARED_PB_SIZE)
57
#define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (HYBRID_SHARED_PB_SIZE-0x00001000)
58
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - SGX_SHARED_3DPARAMETERS_SIZE - 0x00001000)
60
#if defined(SUPPORT_PERCONTEXT_PB)
61
#define SGX_SHARED_3DPARAMETERS_SIZE 0
62
#define SGX_SHARED_3DPARAMETERS_HEAP_SIZE 0
63
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000)
65
#if defined(SUPPORT_SHARED_PB)
66
#define SGX_SHARED_3DPARAMETERS_SIZE SGX_3DPARAMETERS_HEAP_SIZE
67
#define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000)
68
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE 0
72
#define SGX_SHARED_3DPARAMETERS_HEAP_BASE 0xC0000000
75
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE)
78
#define SGX_TADATA_HEAP_BASE 0xD0000000
79
#define SGX_TADATA_HEAP_SIZE (0x0D000000-0x00001000)
81
#define SGX_SYNCINFO_HEAP_BASE 0xE0000000
82
#define SGX_SYNCINFO_HEAP_SIZE (0x01000000-0x00001000)
84
#define SGX_PDSPIXEL_CODEDATA_HEAP_BASE 0xE4000000
85
#define SGX_PDSPIXEL_CODEDATA_HEAP_SIZE (0x02000000-0x00001000)
87
#define SGX_KERNEL_CODE_HEAP_BASE 0xE8000000
88
#define SGX_KERNEL_CODE_HEAP_SIZE (0x00080000-0x00001000)
90
#define SGX_PDSVERTEX_CODEDATA_HEAP_BASE 0xEC000000
91
#define SGX_PDSVERTEX_CODEDATA_HEAP_SIZE (0x01C00000-0x00001000)
93
#define SGX_KERNEL_DATA_HEAP_BASE 0xF0000000
94
#define SGX_KERNEL_DATA_HEAP_SIZE (0x03000000-0x00001000)
97
#define SGX_PIXELSHADER_HEAP_BASE 0xF4000000
98
#define SGX_PIXELSHADER_HEAP_SIZE (0x05000000-0x00001000)
100
#define SGX_VERTEXSHADER_HEAP_BASE 0xFC000000
101
#define SGX_VERTEXSHADER_HEAP_SIZE (0x02000000-0x00001000)
103
#if defined(SGX_FEATURE_2D_HARDWARE)
104
#define SGX_2D_HEAP_BASE 0x00100000
105
#define SGX_2D_HEAP_SIZE (0x08000000-0x00100000-0x00001000)
107
#if defined(FIX_HW_BRN_26915)
108
#define SGX_CGBUFFER_HEAP_BASE 0x00100000
109
#define SGX_CGBUFFER_HEAP_SIZE (0x08000000-0x00100000-0x00001000)
113
#if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
114
#define SGX_GENERAL_MAPPING_HEAP_BASE 0x08000000
115
#define SGX_GENERAL_MAPPING_HEAP_SIZE (0x08000000-0x00001000)
118
#define SGX_GENERAL_HEAP_BASE 0x10000000
119
#define SGX_GENERAL_HEAP_SIZE (0xC2000000-0x00001000)
122
#define SGX_3DPARAMETERS_HEAP_SIZE 0x10000000
125
#if !defined(HYBRID_SHARED_PB_SIZE)
126
#define HYBRID_SHARED_PB_SIZE (SGX_3DPARAMETERS_HEAP_SIZE >> 1)
128
#if defined(SUPPORT_HYBRID_PB)
129
#define SGX_SHARED_3DPARAMETERS_SIZE (HYBRID_SHARED_PB_SIZE)
130
#define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (HYBRID_SHARED_PB_SIZE-0x00001000)
131
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - SGX_SHARED_3DPARAMETERS_SIZE - 0x00001000)
133
#if defined(SUPPORT_PERCONTEXT_PB)
134
#define SGX_SHARED_3DPARAMETERS_SIZE 0
135
#define SGX_SHARED_3DPARAMETERS_HEAP_SIZE 0
136
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000)
138
#if defined(SUPPORT_SHARED_PB)
139
#define SGX_SHARED_3DPARAMETERS_SIZE SGX_3DPARAMETERS_HEAP_SIZE
140
#define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000)
141
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE 0
145
#define SGX_SHARED_3DPARAMETERS_HEAP_BASE 0xD2000000
148
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE)
151
#define SGX_TADATA_HEAP_BASE 0xE2000000
152
#define SGX_TADATA_HEAP_SIZE (0x0D000000-0x00001000)
154
#define SGX_SYNCINFO_HEAP_BASE 0xEF000000
155
#define SGX_SYNCINFO_HEAP_SIZE (0x01000000-0x00001000)
157
#define SGX_PDSPIXEL_CODEDATA_HEAP_BASE 0xF0000000
158
#define SGX_PDSPIXEL_CODEDATA_HEAP_SIZE (0x02000000-0x00001000)
160
#define SGX_KERNEL_CODE_HEAP_BASE 0xF2000000
161
#define SGX_KERNEL_CODE_HEAP_SIZE (0x00080000-0x00001000)
163
#define SGX_PDSVERTEX_CODEDATA_HEAP_BASE 0xF2400000
164
#define SGX_PDSVERTEX_CODEDATA_HEAP_SIZE (0x01C00000-0x00001000)
166
#define SGX_KERNEL_DATA_HEAP_BASE 0xF4000000
167
#define SGX_KERNEL_DATA_HEAP_SIZE (0x05000000-0x00001000)
170
#define SGX_PIXELSHADER_HEAP_BASE 0xF9000000
171
#define SGX_PIXELSHADER_HEAP_SIZE (0x05000000-0x00001000)
173
#define SGX_VERTEXSHADER_HEAP_BASE 0xFE000000
174
#define SGX_VERTEXSHADER_HEAP_SIZE (0x02000000-0x00001000)
177
#define SGX_CORE_IDENTIFIED
180
#if SGX_FEATURE_ADDRESS_SPACE_SIZE == 28
182
#if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
183
#define SGX_GENERAL_MAPPING_HEAP_BASE 0x00001000
184
#define SGX_GENERAL_MAPPING_HEAP_SIZE (0x01800000-0x00001000-0x00001000)
186
#define SGX_GENERAL_HEAP_BASE 0x01800000
187
#define SGX_GENERAL_HEAP_SIZE (0x0A000000-0x00001000)
190
#define SGX_GENERAL_HEAP_BASE 0x00001000
191
#define SGX_GENERAL_HEAP_SIZE (0x0B800000-0x00001000-0x00001000)
194
#define SGX_3DPARAMETERS_HEAP_SIZE 0x01000000
197
#if !defined(HYBRID_SHARED_PB_SIZE)
198
#define HYBRID_SHARED_PB_SIZE (SGX_3DPARAMETERS_HEAP_SIZE >> 1)
200
#if defined(SUPPORT_HYBRID_PB)
201
#define SGX_SHARED_3DPARAMETERS_SIZE (HYBRID_SHARED_PB_SIZE)
202
#define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (HYBRID_SHARED_PB_SIZE-0x00001000)
203
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - SGX_SHARED_3DPARAMETERS_SIZE - 0x00001000)
205
#if defined(SUPPORT_PERCONTEXT_PB)
206
#define SGX_SHARED_3DPARAMETERS_SIZE 0
207
#define SGX_SHARED_3DPARAMETERS_HEAP_SIZE 0
208
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000)
210
#if defined(SUPPORT_SHARED_PB)
211
#define SGX_SHARED_3DPARAMETERS_SIZE SGX_3DPARAMETERS_HEAP_SIZE
212
#define SGX_SHARED_3DPARAMETERS_HEAP_SIZE (SGX_3DPARAMETERS_HEAP_SIZE - 0x00001000)
213
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE 0
217
#define SGX_SHARED_3DPARAMETERS_HEAP_BASE 0x0B800000
220
#define SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE (SGX_SHARED_3DPARAMETERS_HEAP_BASE + SGX_SHARED_3DPARAMETERS_SIZE)
223
#define SGX_TADATA_HEAP_BASE 0x0C800000
224
#define SGX_TADATA_HEAP_SIZE (0x01000000-0x00001000)
226
#define SGX_SYNCINFO_HEAP_BASE 0x0D800000
227
#define SGX_SYNCINFO_HEAP_SIZE (0x00400000-0x00001000)
229
#define SGX_PDSPIXEL_CODEDATA_HEAP_BASE 0x0DC00000
230
#define SGX_PDSPIXEL_CODEDATA_HEAP_SIZE (0x00800000-0x00001000)
232
#define SGX_KERNEL_CODE_HEAP_BASE 0x0E400000
233
#define SGX_KERNEL_CODE_HEAP_SIZE (0x00080000-0x00001000)
235
#define SGX_PDSVERTEX_CODEDATA_HEAP_BASE 0x0E800000
236
#define SGX_PDSVERTEX_CODEDATA_HEAP_SIZE (0x00800000-0x00001000)
238
#define SGX_KERNEL_DATA_HEAP_BASE 0x0F000000
239
#define SGX_KERNEL_DATA_HEAP_SIZE (0x00400000-0x00001000)
241
#define SGX_PIXELSHADER_HEAP_BASE 0x0F400000
242
#define SGX_PIXELSHADER_HEAP_SIZE (0x00500000-0x00001000)
244
#define SGX_VERTEXSHADER_HEAP_BASE 0x0FC00000
245
#define SGX_VERTEXSHADER_HEAP_SIZE (0x00200000-0x00001000)
248
#define SGX_CORE_IDENTIFIED
252
#if !defined(SGX_CORE_IDENTIFIED)
253
#error "sgxconfig.h: ERROR: unspecified SGX Core version"
256
#if !defined (SGX_FEATURE_EDM_VERTEX_PDSADDR_FULL_RANGE)
257
#if ((SGX_KERNEL_CODE_HEAP_BASE + SGX_KERNEL_CODE_HEAP_SIZE - SGX_PDSPIXEL_CODEDATA_HEAP_BASE) > 0x4000000)
258
#error "sgxconfig.h: ERROR: SGX_KERNEL_CODE_HEAP_BASE out of range of SGX_PDSPIXEL_CODEDATA_HEAP_BASE"
261
#if ((SGX_PDSVERTEX_CODEDATA_HEAP_BASE + SGX_PDSVERTEX_CODEDATA_HEAP_SIZE - SGX_PDSPIXEL_CODEDATA_HEAP_BASE) > 0x4000000)
262
#error "sgxconfig.h: ERROR: SGX_PDSVERTEX_CODEDATA_HEAP_BASE out of range of SGX_PDSPIXEL_CODEDATA_HEAP_BASE"
266
#if defined(SGX_FEATURE_2D_HARDWARE) && defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
267
#if ((SGX_GENERAL_MAPPING_HEAP_BASE + SGX_GENERAL_MAPPING_HEAP_SIZE - SGX_2D_HEAP_BASE) >= EUR_CR_BIF_TWOD_REQ_BASE_ADDR_MASK)
268
#error "sgxconfig.h: ERROR: SGX_GENERAL_MAPPING_HEAP inaccessable by 2D requestor"
272
#if defined (EURASIA_USE_CODE_PAGE_SIZE)
273
#if ((SGX_KERNEL_CODE_HEAP_BASE & (EURASIA_USE_CODE_PAGE_SIZE - 1)) != 0)
274
#error "sgxconfig.h: ERROR: Kernel code heap base misalignment"
278
#if defined(SGX_FEATURE_2D_HARDWARE)
279
#if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
280
#if ((SGX_2D_HEAP_BASE + SGX_2D_HEAP_SIZE) >= SGX_GENERAL_MAPPING_HEAP_BASE)
281
#error "sgxconfig.h: ERROR: SGX_2D_HEAP overlaps SGX_GENERAL_MAPPING_HEAP"
284
#if ((SGX_2D_HEAP_BASE + SGX_2D_HEAP_SIZE) >= SGX_GENERAL_HEAP_BASE)
285
#error "sgxconfig.h: ERROR: SGX_2D_HEAP overlaps SGX_GENERAL_HEAP_BASE"
289
#if defined(FIX_HW_BRN_26915)
290
#if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
291
#if ((SGX_CGBUFFER_HEAP_BASE + SGX_CGBUFFER_HEAP_SIZE) >= SGX_GENERAL_MAPPING_HEAP_BASE)
292
#error "sgxconfig.h: ERROR: SGX_CGBUFFER_HEAP overlaps SGX_GENERAL_MAPPING_HEAP"
295
#if ((SGX_CGBUFFER_HEAP_BASE + SGX_CGBUFFER_HEAP_SIZE) >= SGX_GENERAL_HEAP_BASE)
296
#error "sgxconfig.h: ERROR: SGX_CGBUFFER_HEAP overlaps SGX_GENERAL_HEAP_BASE"
302
#if defined(SUPPORT_SGX_GENERAL_MAPPING_HEAP)
303
#if ((SGX_GENERAL_MAPPING_HEAP_BASE + SGX_GENERAL_MAPPING_HEAP_SIZE) >= SGX_GENERAL_HEAP_BASE)
304
#error "sgxconfig.h: ERROR: SGX_GENERAL_MAPPING_HEAP overlaps SGX_GENERAL_HEAP"
308
#if defined(SUPPORT_HYBRID_PB)
309
#if ((HYBRID_SHARED_PB_SIZE + 0x000001000) > SGX_3DPARAMETERS_HEAP_SIZE)
310
#error "sgxconfig.h: ERROR: HYBRID_SHARED_PB_SIZE too large"
314
#if ((SGX_GENERAL_HEAP_BASE + SGX_GENERAL_HEAP_SIZE) >= SGX_SHARED_3DPARAMETERS_HEAP_BASE)
315
#error "sgxconfig.h: ERROR: SGX_GENERAL_HEAP overlaps SGX_3DPARAMETERS_HEAP"
318
#if (((SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE + SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE) >= SGX_TADATA_HEAP_BASE) && (SGX_PERCONTEXT_3DPARAMETERS_HEAP_SIZE > 0))
319
#error "sgxconfig.h: ERROR: SGX_PERCONTEXT_3DPARAMETERS_HEAP_BASE overlaps SGX_TADATA_HEAP"
322
#if ((SGX_TADATA_HEAP_BASE + SGX_TADATA_HEAP_SIZE) >= SGX_SYNCINFO_HEAP_BASE)
323
#error "sgxconfig.h: ERROR: SGX_TADATA_HEAP overlaps SGX_SYNCINFO_HEAP"
326
#if ((SGX_SYNCINFO_HEAP_BASE + SGX_SYNCINFO_HEAP_SIZE) >= SGX_PDSPIXEL_CODEDATA_HEAP_BASE)
327
#error "sgxconfig.h: ERROR: SGX_SYNCINFO_HEAP overlaps SGX_PDSPIXEL_CODEDATA_HEAP"
330
#if ((SGX_PDSPIXEL_CODEDATA_HEAP_BASE + SGX_PDSPIXEL_CODEDATA_HEAP_SIZE) >= SGX_KERNEL_CODE_HEAP_BASE)
331
#error "sgxconfig.h: ERROR: SGX_PDSPIXEL_CODEDATA_HEAP overlaps SGX_KERNEL_CODE_HEAP"
334
#if ((SGX_KERNEL_CODE_HEAP_BASE + SGX_KERNEL_CODE_HEAP_SIZE) >= SGX_PDSVERTEX_CODEDATA_HEAP_BASE)
335
#error "sgxconfig.h: ERROR: SGX_KERNEL_CODE_HEAP overlaps SGX_PDSVERTEX_CODEDATA_HEAP"
338
#if ((SGX_PDSVERTEX_CODEDATA_HEAP_BASE + SGX_PDSVERTEX_CODEDATA_HEAP_SIZE) >= SGX_KERNEL_DATA_HEAP_BASE)
339
#error "sgxconfig.h: ERROR: SGX_PDSVERTEX_CODEDATA_HEAP overlaps SGX_KERNEL_DATA_HEAP"
342
#if ((SGX_KERNEL_DATA_HEAP_BASE + SGX_KERNEL_DATA_HEAP_SIZE) >= SGX_PIXELSHADER_HEAP_BASE)
343
#error "sgxconfig.h: ERROR: SGX_KERNEL_DATA_HEAP overlaps SGX_PIXELSHADER_HEAP"
346
#if ((SGX_PIXELSHADER_HEAP_BASE + SGX_PIXELSHADER_HEAP_SIZE) >= SGX_VERTEXSHADER_HEAP_BASE)
347
#error "sgxconfig.h: ERROR: SGX_PIXELSHADER_HEAP overlaps SGX_VERTEXSHADER_HEAP"
350
#if ((SGX_VERTEXSHADER_HEAP_BASE + SGX_VERTEXSHADER_HEAP_SIZE) < SGX_VERTEXSHADER_HEAP_BASE)
351
#error "sgxconfig.h: ERROR: SGX_VERTEXSHADER_HEAP_BASE size cause wraparound"