diff options
Diffstat (limited to 'drivers/gpu/nvgpu')
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/Makefile | 3 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hal_gp10b.c | 2 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/hw_therm_gp10b.h | 98 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/therm_gp10b.c | 46 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp10b/therm_gp10b.h | 19 |
5 files changed, 166 insertions, 2 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/Makefile b/drivers/gpu/nvgpu/gp10b/Makefile index ad198327..f34d836d 100644 --- a/drivers/gpu/nvgpu/gp10b/Makefile +++ b/drivers/gpu/nvgpu/gp10b/Makefile | |||
@@ -23,6 +23,7 @@ obj-$(CONFIG_GK20A) += \ | |||
23 | rpfb_gp10b.o \ | 23 | rpfb_gp10b.o \ |
24 | gp10b_gating_reglist.o \ | 24 | gp10b_gating_reglist.o \ |
25 | regops_gp10b.o \ | 25 | regops_gp10b.o \ |
26 | cde_gp10b.o | 26 | cde_gp10b.o \ |
27 | therm_gp10b.o | ||
27 | 28 | ||
28 | obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o | 29 | obj-$(CONFIG_TEGRA_GK20A) += platform_gp10b_tegra.o |
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c index 5222fca6..544be96b 100644 --- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c +++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c | |||
@@ -32,6 +32,7 @@ | |||
32 | #include "gp10b/gp10b_gating_reglist.h" | 32 | #include "gp10b/gp10b_gating_reglist.h" |
33 | #include "gp10b/regops_gp10b.h" | 33 | #include "gp10b/regops_gp10b.h" |
34 | #include "gp10b/cde_gp10b.h" | 34 | #include "gp10b/cde_gp10b.h" |
35 | #include "gp10b/therm_gp10b.h" | ||
35 | 36 | ||
36 | #include "gm20b/gr_gm20b.h" | 37 | #include "gm20b/gr_gm20b.h" |
37 | #include "gm20b/fifo_gm20b.h" | 38 | #include "gm20b/fifo_gm20b.h" |
@@ -144,6 +145,7 @@ int gp10b_init_hal(struct gk20a *g) | |||
144 | gk20a_init_debug_ops(gops); | 145 | gk20a_init_debug_ops(gops); |
145 | gp10b_init_regops(gops); | 146 | gp10b_init_regops(gops); |
146 | gp10b_init_cde_ops(gops); | 147 | gp10b_init_cde_ops(gops); |
148 | gp10b_init_therm_ops(gops); | ||
147 | gops->name = "gp10b"; | 149 | gops->name = "gp10b"; |
148 | 150 | ||
149 | c->twod_class = FERMI_TWOD_A; | 151 | c->twod_class = FERMI_TWOD_A; |
diff --git a/drivers/gpu/nvgpu/gp10b/hw_therm_gp10b.h b/drivers/gpu/nvgpu/gp10b/hw_therm_gp10b.h index 25eecb70..aed75481 100644 --- a/drivers/gpu/nvgpu/gp10b/hw_therm_gp10b.h +++ b/drivers/gpu/nvgpu/gp10b/hw_therm_gp10b.h | |||
@@ -1,5 +1,5 @@ | |||
1 | /* | 1 | /* |
2 | * Copyright (c) 2014, NVIDIA CORPORATION. All rights reserved. | 2 | * Copyright (c) 2014-2015, NVIDIA CORPORATION. All rights reserved. |
3 | * | 3 | * |
4 | * This program is free software; you can redistribute it and/or modify it | 4 | * This program is free software; you can redistribute it and/or modify it |
5 | * under the terms and conditions of the GNU General Public License, | 5 | * under the terms and conditions of the GNU General Public License, |
@@ -54,18 +54,114 @@ static inline u32 therm_use_a_r(void) | |||
54 | { | 54 | { |
55 | return 0x00020798; | 55 | return 0x00020798; |
56 | } | 56 | } |
57 | static inline u32 therm_use_a_ext_therm_0_enable_f(void) | ||
58 | { | ||
59 | return 0x1; | ||
60 | } | ||
61 | static inline u32 therm_use_a_ext_therm_1_enable_f(void) | ||
62 | { | ||
63 | return 0x2; | ||
64 | } | ||
65 | static inline u32 therm_use_a_ext_therm_2_enable_f(void) | ||
66 | { | ||
67 | return 0x4; | ||
68 | } | ||
57 | static inline u32 therm_evt_ext_therm_0_r(void) | 69 | static inline u32 therm_evt_ext_therm_0_r(void) |
58 | { | 70 | { |
59 | return 0x00020700; | 71 | return 0x00020700; |
60 | } | 72 | } |
73 | static inline u32 therm_evt_ext_therm_0_slow_factor_f(u32 v) | ||
74 | { | ||
75 | return (v & 0x3f) << 24; | ||
76 | } | ||
77 | static inline u32 therm_evt_ext_therm_0_slow_factor_init_v(void) | ||
78 | { | ||
79 | return 0x00000001; | ||
80 | } | ||
81 | static inline u32 therm_evt_ext_therm_0_mode_f(u32 v) | ||
82 | { | ||
83 | return (v & 0x3) << 30; | ||
84 | } | ||
85 | static inline u32 therm_evt_ext_therm_0_mode_normal_v(void) | ||
86 | { | ||
87 | return 0x00000000; | ||
88 | } | ||
89 | static inline u32 therm_evt_ext_therm_0_mode_inverted_v(void) | ||
90 | { | ||
91 | return 0x00000001; | ||
92 | } | ||
93 | static inline u32 therm_evt_ext_therm_0_mode_forced_v(void) | ||
94 | { | ||
95 | return 0x00000002; | ||
96 | } | ||
97 | static inline u32 therm_evt_ext_therm_0_mode_cleared_v(void) | ||
98 | { | ||
99 | return 0x00000003; | ||
100 | } | ||
61 | static inline u32 therm_evt_ext_therm_1_r(void) | 101 | static inline u32 therm_evt_ext_therm_1_r(void) |
62 | { | 102 | { |
63 | return 0x00020704; | 103 | return 0x00020704; |
64 | } | 104 | } |
105 | static inline u32 therm_evt_ext_therm_1_slow_factor_f(u32 v) | ||
106 | { | ||
107 | return (v & 0x3f) << 24; | ||
108 | } | ||
109 | static inline u32 therm_evt_ext_therm_1_slow_factor_init_v(void) | ||
110 | { | ||
111 | return 0x00000002; | ||
112 | } | ||
113 | static inline u32 therm_evt_ext_therm_1_mode_f(u32 v) | ||
114 | { | ||
115 | return (v & 0x3) << 30; | ||
116 | } | ||
117 | static inline u32 therm_evt_ext_therm_1_mode_normal_v(void) | ||
118 | { | ||
119 | return 0x00000000; | ||
120 | } | ||
121 | static inline u32 therm_evt_ext_therm_1_mode_inverted_v(void) | ||
122 | { | ||
123 | return 0x00000001; | ||
124 | } | ||
125 | static inline u32 therm_evt_ext_therm_1_mode_forced_v(void) | ||
126 | { | ||
127 | return 0x00000002; | ||
128 | } | ||
129 | static inline u32 therm_evt_ext_therm_1_mode_cleared_v(void) | ||
130 | { | ||
131 | return 0x00000003; | ||
132 | } | ||
65 | static inline u32 therm_evt_ext_therm_2_r(void) | 133 | static inline u32 therm_evt_ext_therm_2_r(void) |
66 | { | 134 | { |
67 | return 0x00020708; | 135 | return 0x00020708; |
68 | } | 136 | } |
137 | static inline u32 therm_evt_ext_therm_2_slow_factor_f(u32 v) | ||
138 | { | ||
139 | return (v & 0x3f) << 24; | ||
140 | } | ||
141 | static inline u32 therm_evt_ext_therm_2_slow_factor_init_v(void) | ||
142 | { | ||
143 | return 0x00000003; | ||
144 | } | ||
145 | static inline u32 therm_evt_ext_therm_2_mode_f(u32 v) | ||
146 | { | ||
147 | return (v & 0x3) << 30; | ||
148 | } | ||
149 | static inline u32 therm_evt_ext_therm_2_mode_normal_v(void) | ||
150 | { | ||
151 | return 0x00000000; | ||
152 | } | ||
153 | static inline u32 therm_evt_ext_therm_2_mode_inverted_v(void) | ||
154 | { | ||
155 | return 0x00000001; | ||
156 | } | ||
157 | static inline u32 therm_evt_ext_therm_2_mode_forced_v(void) | ||
158 | { | ||
159 | return 0x00000002; | ||
160 | } | ||
161 | static inline u32 therm_evt_ext_therm_2_mode_cleared_v(void) | ||
162 | { | ||
163 | return 0x00000003; | ||
164 | } | ||
69 | static inline u32 therm_weight_1_r(void) | 165 | static inline u32 therm_weight_1_r(void) |
70 | { | 166 | { |
71 | return 0x00020024; | 167 | return 0x00020024; |
diff --git a/drivers/gpu/nvgpu/gp10b/therm_gp10b.c b/drivers/gpu/nvgpu/gp10b/therm_gp10b.c new file mode 100644 index 00000000..471edb87 --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/therm_gp10b.c | |||
@@ -0,0 +1,46 @@ | |||
1 | /* | ||
2 | * drivers/gpu/nvgpu/gm20b/therm_gk20a.c | ||
3 | * | ||
4 | * GP10B Therm | ||
5 | * | ||
6 | * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. | ||
7 | * | ||
8 | * This program is free software; you can redistribute it and/or modify it | ||
9 | * under the terms and conditions of the GNU General Public License, | ||
10 | * version 2, as published by the Free Software Foundation. | ||
11 | * | ||
12 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
13 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
14 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
15 | * more details. | ||
16 | */ | ||
17 | |||
18 | #include "gk20a/gk20a.h" | ||
19 | #include "hw_therm_gp10b.h" | ||
20 | |||
21 | static int gp10b_init_therm_setup_hw(struct gk20a *g) | ||
22 | { | ||
23 | gk20a_dbg_fn(""); | ||
24 | |||
25 | /* program NV_THERM registers */ | ||
26 | gk20a_writel(g, therm_use_a_r(), therm_use_a_ext_therm_0_enable_f() | | ||
27 | therm_use_a_ext_therm_1_enable_f() | | ||
28 | therm_use_a_ext_therm_2_enable_f()); | ||
29 | gk20a_writel(g, therm_evt_ext_therm_0_r(), | ||
30 | therm_evt_ext_therm_0_slow_factor_f( | ||
31 | therm_evt_ext_therm_0_slow_factor_init_v())); | ||
32 | gk20a_writel(g, therm_evt_ext_therm_1_r(), | ||
33 | therm_evt_ext_therm_1_slow_factor_f( | ||
34 | therm_evt_ext_therm_1_slow_factor_init_v())); | ||
35 | gk20a_writel(g, therm_evt_ext_therm_2_r(), | ||
36 | therm_evt_ext_therm_2_slow_factor_f( | ||
37 | therm_evt_ext_therm_2_slow_factor_init_v())); | ||
38 | |||
39 | return 0; | ||
40 | } | ||
41 | |||
42 | void gp10b_init_therm_ops(struct gpu_ops *gops) | ||
43 | { | ||
44 | gops->therm.init_therm_setup_hw = gp10b_init_therm_setup_hw; | ||
45 | |||
46 | } | ||
diff --git a/drivers/gpu/nvgpu/gp10b/therm_gp10b.h b/drivers/gpu/nvgpu/gp10b/therm_gp10b.h new file mode 100644 index 00000000..18c102fe --- /dev/null +++ b/drivers/gpu/nvgpu/gp10b/therm_gp10b.h | |||
@@ -0,0 +1,19 @@ | |||
1 | /* | ||
2 | * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. | ||
3 | * | ||
4 | * This program is free software; you can redistribute it and/or modify it | ||
5 | * under the terms and conditions of the GNU General Public License, | ||
6 | * version 2, as published by the Free Software Foundation. | ||
7 | * | ||
8 | * This program is distributed in the hope it will be useful, but WITHOUT | ||
9 | * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or | ||
10 | * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for | ||
11 | * more details. | ||
12 | */ | ||
13 | #ifndef THERM_GP10B_H | ||
14 | #define THERM_GP10B_H | ||
15 | |||
16 | struct gpu_ops; | ||
17 | void gp10b_init_therm_ops(struct gpu_ops *gops); | ||
18 | |||
19 | #endif /* THERM_GP10B_H */ | ||