MALI: rockchip: upgrade midgard DDK to r14p0-01rel0
[firefly-linux-kernel-4.4.55.git] / drivers / gpu / arm / midgard / mali_kbase_ipa_tables.h
1 /*
2  *
3  * (C) COPYRIGHT 2015 ARM Limited. All rights reserved.
4  *
5  * This program is free software and is provided to you under the terms of the
6  * GNU General Public License version 2 as published by the Free Software
7  * Foundation, and any use by you of this program is subject to the terms
8  * of such GNU licence.
9  *
10  * A copy of the licence is included with the program, and can also be obtained
11  * from Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
12  * Boston, MA  02110-1301, USA.
13  *
14  */
15
16
17
18 #define NR_BYTES_PER_CNT  4
19 #define NR_CNT_PER_BLOCK 64
20
21 #define JM_BASE    (0 * NR_CNT_PER_BLOCK * NR_BYTES_PER_CNT)
22 #define TILER_BASE (1 * NR_CNT_PER_BLOCK * NR_BYTES_PER_CNT)
23 #define MMU_BASE   (2 * NR_CNT_PER_BLOCK * NR_BYTES_PER_CNT)
24 #define SC0_BASE   (3 * NR_CNT_PER_BLOCK * NR_BYTES_PER_CNT)
25
26 #define GPU_ACTIVE       (JM_BASE    + NR_BYTES_PER_CNT *  6)
27 #define TILER_ACTIVE     (TILER_BASE + NR_BYTES_PER_CNT * 45)
28 #define L2_ANY_LOOKUP    (MMU_BASE   + NR_BYTES_PER_CNT * 25)
29 #define FRAG_ACTIVE      (SC0_BASE   + NR_BYTES_PER_CNT *  4)
30 #define EXEC_CORE_ACTIVE (SC0_BASE   + NR_BYTES_PER_CNT * 26)
31 #define EXEC_INSTR_COUNT (SC0_BASE   + NR_BYTES_PER_CNT * 28)
32 #define TEX_COORD_ISSUE  (SC0_BASE   + NR_BYTES_PER_CNT * 40)
33 #define VARY_SLOT_32     (SC0_BASE   + NR_BYTES_PER_CNT * 50)
34 #define VARY_SLOT_16     (SC0_BASE   + NR_BYTES_PER_CNT * 51)
35 #define BEATS_RD_LSC     (SC0_BASE   + NR_BYTES_PER_CNT * 56)
36 #define BEATS_WR_LSC     (SC0_BASE   + NR_BYTES_PER_CNT * 61)
37
38 static u32 calc_power_group0(struct kbase_ipa_context *ctx,
39                 struct ipa_group *group);
40 static u32 calc_power_group1(struct kbase_ipa_context *ctx,
41                 struct ipa_group *group);
42 static u32 calc_power_group2(struct kbase_ipa_context *ctx,
43                 struct ipa_group *group);
44 static u32 calc_power_group3(struct kbase_ipa_context *ctx,
45                 struct ipa_group *group);
46 static u32 calc_power_group4(struct kbase_ipa_context *ctx,
47                 struct ipa_group *group);
48 static u32 calc_power_group5(struct kbase_ipa_context *ctx,
49                 struct ipa_group *group);
50 static u32 calc_power_group6(struct kbase_ipa_context *ctx,
51                 struct ipa_group *group);
52 static u32 calc_power_group7(struct kbase_ipa_context *ctx,
53                 struct ipa_group *group);
54
55 static struct ipa_group ipa_groups_def[] = {
56         /* L2 */
57         {
58                 .name = "group0",
59                 .capacitance = 687,
60                 .calc_power = calc_power_group0,
61         },
62         /* TILER */
63         {
64                 .name = "group1",
65                 .capacitance = 0,
66                 .calc_power = calc_power_group1,
67         },
68         /* FRAG */
69         {
70                 .name = "group2",
71                 .capacitance = 23,
72                 .calc_power = calc_power_group2,
73         },
74         /* VARY */
75         {
76                 .name = "group3",
77                 .capacitance = 108,
78                 .calc_power = calc_power_group3,
79         },
80         /* TEX */
81         {
82                 .name = "group4",
83                 .capacitance = 128,
84                 .calc_power = calc_power_group4,
85         },
86         /* EXEC INSTR */
87         {
88                 .name = "group5",
89                 .capacitance = 249,
90                 .calc_power = calc_power_group5,
91         },
92         /* LSC */
93         {
94                 .name = "group6",
95                 .capacitance = 0,
96                 .calc_power = calc_power_group6,
97         },
98         /* EXEC OVERHEAD */
99         {
100                 .name = "group7",
101                 .capacitance = 29,
102                 .calc_power = calc_power_group7,
103         },
104 };