RK3368 GPU: Rogue N Init.
[firefly-linux-kernel-4.4.55.git] / drivers / staging / imgtec / rogue / rgxheapconfig.h
1 /*************************************************************************/ /*!
2 @File
3 @Title          device configuration
4 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Description    Memory heaps device specific configuration
6 @License        Dual MIT/GPLv2
7
8 The contents of this file are subject to the MIT license as set out below.
9
10 Permission is hereby granted, free of charge, to any person obtaining a copy
11 of this software and associated documentation files (the "Software"), to deal
12 in the Software without restriction, including without limitation the rights
13 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
14 copies of the Software, and to permit persons to whom the Software is
15 furnished to do so, subject to the following conditions:
16
17 The above copyright notice and this permission notice shall be included in
18 all copies or substantial portions of the Software.
19
20 Alternatively, the contents of this file may be used under the terms of
21 the GNU General Public License Version 2 ("GPL") in which case the provisions
22 of GPL are applicable instead of those above.
23
24 If you wish to allow use of your version of this file only under the terms of
25 GPL, and not to allow others to use your version of this file under the terms
26 of the MIT license, indicate your decision by deleting the provisions above
27 and replace them with the notice and other provisions required by GPL as set
28 out in the file called "GPL-COPYING" included in this distribution. If you do
29 not delete the provisions above, a recipient may use your version of this file
30 under the terms of either the MIT license or GPL.
31
32 This License is also included in this distribution in the file called
33 "MIT-COPYING".
34
35 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
36 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
37 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
38 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
39 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
40 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
41 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
42 */ /**************************************************************************/
43
44 //#warning FIXME:  add the MMU specialisation defines here (or in hwdefs, perhaps?)
45
46 #ifndef __RGXHEAPCONFIG_H__
47 #define __RGXHEAPCONFIG_H__
48
49 #include "rgxdefs_km.h"
50
51 /*
52         RGX Device Virtual Address Space Definitions
53         NOTES:
54                 Base addresses have to be a multiple of 4MiB
55
56                 RGX_PDSCODEDATA_HEAP_BASE and RGX_USCCODE_HEAP_BASE will be programmed,
57                 on a global basis, into RGX_CR_PDS_EXEC_BASE and RGX_CR_USC_CODE_BASE_*
58                 respectively. Therefore if clients use multiple configs they must still
59                 be consistent with their definitions for these heaps.
60
61                 Shared virtual memory (GENERAL_SVM) support requires half of the address
62                 space be reserved for SVM allocations unless BRN fixes are required in
63                 which case the SVM heap is disabled. This is reflected in the device
64                 connection capability bits returned to userspace.
65                 
66                 Variable page-size heap (GENERAL_NON4K) support splits available fixed
67                 4K page-size heap (GENERAL) address space in half. The actual page size
68                 defaults to 16K; AppHint PVRSRV_APPHINT_GENERAL_NON4K_HEAP_PAGE_SIZE
69                 can be used to forced it to these values: 4K,64K,256K,1M,2M.
70 */
71
72         /* Start at 4 MiB Size of 512 GiB less 4 MiB (managed by OS/Services) */
73         #define RGX_GENERAL_SVM_HEAP_BASE                       IMG_UINT64_C(0x0000400000)
74         #define RGX_GENERAL_SVM_HEAP_SIZE                       IMG_UINT64_C(0x7FFFC00000)
75
76         /* Start at 512GiB. Size of 256 GiB */
77         #define RGX_GENERAL_HEAP_BASE                           IMG_UINT64_C(0x8000000000)
78         #define RGX_GENERAL_HEAP_SIZE                           IMG_UINT64_C(0x4000000000)
79
80         /* Start at 768GiB. Size of 64 GiB */
81         #define RGX_GENERAL_NON4K_HEAP_BASE                     IMG_UINT64_C(0xC000000000)
82         #define RGX_GENERAL_NON4K_HEAP_SIZE                     IMG_UINT64_C(0x1000000000)
83
84         /* Start at 832 GiB. Size of 32 GiB */
85         #define RGX_BIF_TILING_NUM_HEAPS                        4
86         #define RGX_BIF_TILING_HEAP_SIZE                        IMG_UINT64_C(0x0200000000)
87         #define RGX_BIF_TILING_HEAP_1_BASE                      IMG_UINT64_C(0xD000000000)
88         #define RGX_BIF_TILING_HEAP_2_BASE                      (RGX_BIF_TILING_HEAP_1_BASE + RGX_BIF_TILING_HEAP_SIZE)
89         #define RGX_BIF_TILING_HEAP_3_BASE                      (RGX_BIF_TILING_HEAP_2_BASE + RGX_BIF_TILING_HEAP_SIZE)
90         #define RGX_BIF_TILING_HEAP_4_BASE                      (RGX_BIF_TILING_HEAP_3_BASE + RGX_BIF_TILING_HEAP_SIZE)
91
92         /* HWBRN52402 workaround requires PDS memory to be below 16GB. Start at 8GB. Size of 4GB. */
93         #define RGX_PDSCODEDATA_BRN_52402_HEAP_BASE     IMG_UINT64_C(0x0200000000)
94         #define RGX_PDSCODEDATA_BRN_52402_HEAP_SIZE     IMG_UINT64_C(0x0100000000)
95
96         /* Start at 872 GiB. Size of 4 GiB */
97         #define RGX_PDSCODEDATA_HEAP_BASE                       IMG_UINT64_C(0xDA00000000)
98     #define RGX_PDSCODEDATA_HEAP_SIZE                   IMG_UINT64_C(0x0100000000)
99
100         /* HWBRN63142 workaround requires Region Header memory to be at the top
101            of a 16GB aligned range. This is so when masked with 0x03FFFFFFFF the
102            address will avoid aliasing PB addresses. Start at 879.75GB. Size of 256MB. */
103         #define RGX_RGNHDR_BRN_63142_HEAP_BASE          IMG_UINT64_C(0xDBF0000000)
104         #define RGX_RGNHDR_BRN_63142_HEAP_SIZE          IMG_UINT64_C(0x0010000000)
105
106         /* Start at 880 GiB, Size of 1 MiB */
107         #define RGX_VISTEST_HEAP_BASE                           IMG_UINT64_C(0xDC00000000)
108         #define RGX_VISTEST_HEAP_SIZE                           IMG_UINT64_C(0x0000100000)
109
110         /* HWBRN52402 workaround requires PDS memory to be below 16GB. Start at 12GB. Size of 4GB. */
111         #define RGX_USCCODE_BRN_52402_HEAP_BASE         IMG_UINT64_C(0x0300000000)
112         #define RGX_USCCODE_BRN_52402_HEAP_SIZE         IMG_UINT64_C(0x0100000000)
113
114         /* Start at 896 GiB Size of 4 GiB */
115         #define RGX_USCCODE_HEAP_BASE                           IMG_UINT64_C(0xE000000000)
116         #define RGX_USCCODE_HEAP_SIZE                           IMG_UINT64_C(0x0100000000)
117
118
119         /* Start at 903GiB. Size of 32MB per OSID (defined in rgxdefs_km.h)
120            #define RGX_FIRMWARE_HEAP_BASE                       IMG_UINT64_C(0xE1C0000000)
121            #define RGX_FIRMWARE_HEAP_SIZE                       (1<<RGX_FW_HEAP_SHIFT) 
122            #define RGX_FIRMWARE_HEAP_SHIFT                      RGX_FW_HEAP_SHIFT */
123
124         /* HWBRN52402 & HWBRN55091 workarounds requires TQ memory to be below 16GB and 16GB aligned. Start at 0GB. Size of 8GB. */
125         #define RGX_TQ3DPARAMETERS_BRN_52402_55091_HEAP_BASE            IMG_UINT64_C(0x0000000000)
126         #define RGX_TQ3DPARAMETERS_BRN_52402_55091_HEAP_SIZE            IMG_UINT64_C(0x0200000000)
127
128         /* Start at 912GiB. Size of 16 GiB. 16GB aligned to match RGX_CR_ISP_PIXEL_BASE */
129         #define RGX_TQ3DPARAMETERS_HEAP_BASE            IMG_UINT64_C(0xE400000000)
130         #define RGX_TQ3DPARAMETERS_HEAP_SIZE            IMG_UINT64_C(0x0400000000)
131
132         /* Size of 16 * 4 KB (think about large page systems .. */
133         #define RGX_HWBRN37200_HEAP_BASE                                IMG_UINT64_C(0xFFFFF00000)
134         #define RGX_HWBRN37200_HEAP_SIZE                                IMG_UINT64_C(0x0000100000)
135
136         /* Start at 928GiB. Size of 4 GiB */
137         #define RGX_DOPPLER_HEAP_BASE                           IMG_UINT64_C(0xE800000000)
138         #define RGX_DOPPLER_HEAP_SIZE                           IMG_UINT64_C(0x0100000000)
139
140         /* Start at 932GiB. Size of 4 GiB */
141         #define RGX_DOPPLER_OVERFLOW_HEAP_BASE          IMG_UINT64_C(0xE900000000)
142         #define RGX_DOPPLER_OVERFLOW_HEAP_SIZE          IMG_UINT64_C(0x0100000000)
143
144         /* Start at 936GiB. Two groups of 128 KBytes that must follow each other in this order. */
145         #define RGX_SERVICES_SIGNALS_HEAP_BASE          IMG_UINT64_C(0xEA00000000)
146         #define RGX_SERVICES_SIGNALS_HEAP_SIZE          IMG_UINT64_C(0x0000020000)
147
148         #define RGX_SIGNALS_HEAP_BASE                           IMG_UINT64_C(0xEA00020000)
149         #define RGX_SIGNALS_HEAP_SIZE                           IMG_UINT64_C(0x0000020000)
150
151         /* TDM TPU YUV coeffs - can be reduced to a single page */
152         #define RGX_TDM_TPU_YUV_COEFFS_HEAP_BASE        IMG_UINT64_C(0xEA00080000)
153         #define RGX_TDM_TPU_YUV_COEFFS_HEAP_SIZE        IMG_UINT64_C(0x0000040000)
154
155
156 #endif /* __RGXHEAPCONFIG_H__ */
157
158 /*****************************************************************************
159  End of file (rgxheapconfig.h)
160 *****************************************************************************/