RK3368 GPU: Rogue N Init.
[firefly-linux-kernel-4.4.55.git] / drivers / staging / imgtec / rogue / rgx_firmware_processor.h
1 /*************************************************************************/ /*!
2 @File           rgx_firmware_processor.h
3 @Title
4 @Copyright      Copyright (c) Imagination Technologies Ltd. All Rights Reserved
5 @Platform       RGX
6 @Description    Generic include file for firmware processors (META and MIPS)
7 @License        Dual MIT/GPLv2
8
9 The contents of this file are subject to the MIT license as set out below.
10
11 Permission is hereby granted, free of charge, to any person obtaining a copy
12 of this software and associated documentation files (the "Software"), to deal
13 in the Software without restriction, including without limitation the rights
14 to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
15 copies of the Software, and to permit persons to whom the Software is
16 furnished to do so, subject to the following conditions:
17
18 The above copyright notice and this permission notice shall be included in
19 all copies or substantial portions of the Software.
20
21 Alternatively, the contents of this file may be used under the terms of
22 the GNU General Public License Version 2 ("GPL") in which case the provisions
23 of GPL are applicable instead of those above.
24
25 If you wish to allow use of your version of this file only under the terms of
26 GPL, and not to allow others to use your version of this file under the terms
27 of the MIT license, indicate your decision by deleting the provisions above
28 and replace them with the notice and other provisions required by GPL as set
29 out in the file called "GPL-COPYING" included in this distribution. If you do
30 not delete the provisions above, a recipient may use your version of this file
31 under the terms of either the MIT license or GPL.
32
33 This License is also included in this distribution in the file called
34 "MIT-COPYING".
35
36 EXCEPT AS OTHERWISE STATED IN A NEGOTIATED AGREEMENT: (A) THE SOFTWARE IS
37 PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING
38 BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
39 PURPOSE AND NONINFRINGEMENT; AND (B) IN NO EVENT SHALL THE AUTHORS OR
40 COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
41 IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
42 CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
43 */ /**************************************************************************/
44
45
46 #if !defined(RGX_FIRMWARE_PROCESSOR_H)
47 #define RGX_FIRMWARE_PROCESSOR_H
48
49 #include "km/rgxdefs_km.h"
50
51 #include "rgx_meta.h"
52 #include "rgx_mips.h"
53
54 /* Processor independent need to be defined here common for all processors */
55 typedef enum
56 {
57         FW_PERF_CONF_NONE = 0,
58         FW_PERF_CONF_ICACHE = 1,
59         FW_PERF_CONF_DCACHE = 2,
60         FW_PERF_CONF_POLLS = 3,
61         FW_PERF_CONF_CUSTOM_TIMER = 4,
62         FW_PERF_CONF_JTLB_INSTR = 5,
63         FW_PERF_CONF_INSTRUCTIONS = 6
64 } FW_PERF_CONF;
65
66 #if !defined(__KERNEL__)
67         #if defined(RGX_FEATURE_MIPS)
68
69                 #define FW_CORE_ID_VALUE                                      RGXMIPSFW_CORE_ID_VALUE
70                 #define RGXFW_PROCESSOR                                       RGXFW_PROCESSOR_MIPS
71
72                 /* Firmware to host interrupts defines */
73                 #define RGXFW_CR_IRQ_STATUS                                   RGX_CR_MIPS_WRAPPER_IRQ_STATUS
74                 #define RGXFW_CR_IRQ_STATUS_EVENT_EN                          RGX_CR_MIPS_WRAPPER_IRQ_STATUS_EVENT_EN
75                 #define RGXFW_CR_IRQ_CLEAR                                    RGX_CR_MIPS_WRAPPER_IRQ_CLEAR
76                 #define RGXFW_CR_IRQ_CLEAR_MASK                               RGX_CR_MIPS_WRAPPER_IRQ_CLEAR_EVENT_EN
77
78         #else
79
80                 #define RGXFW_PROCESSOR         RGXFW_PROCESSOR_META
81
82                 /* Firmware to host interrupts defines */
83                 #define RGXFW_CR_IRQ_STATUS           RGX_CR_META_SP_MSLVIRQSTATUS
84                 #define RGXFW_CR_IRQ_STATUS_EVENT_EN  RGX_CR_META_SP_MSLVIRQSTATUS_TRIGVECT2_EN
85                 #define RGXFW_CR_IRQ_CLEAR            RGX_CR_META_SP_MSLVIRQSTATUS
86                 #define RGXFW_CR_IRQ_CLEAR_MASK       (RGX_CR_META_SP_MSLVIRQSTATUS_TRIGVECT2_CLRMSK & \
87                                                                                                         RGX_CR_META_SP_MSLVIRQSTATUS_MASKFULL)
88
89         #endif
90 #endif
91
92 #endif /* RGX_FIRMWARE_PROCESSOR_H */