diff options
Diffstat (limited to 'drivers/gpu/nvgpu/gp106')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/hal_gp106.c | 12 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/therm_gp106.c | 24 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/therm_gp106.h | 13 |
3 files changed, 29 insertions, 20 deletions
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c index f9368621..8077c5e1 100644 --- a/drivers/gpu/nvgpu/gp106/hal_gp106.c +++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c | |||
@@ -343,6 +343,16 @@ static const struct gpu_ops gp106_ops = { | |||
343 | .exit = gk20a_pramin_exit, | 343 | .exit = gk20a_pramin_exit, |
344 | .data032_r = pram_data032_r, | 344 | .data032_r = pram_data032_r, |
345 | }, | 345 | }, |
346 | .therm = { | ||
347 | #ifdef CONFIG_DEBUG_FS | ||
348 | .therm_debugfs_init = gp106_therm_debugfs_init, | ||
349 | #endif /* CONFIG_DEBUG_FS */ | ||
350 | .elcg_init_idle_filters = gp106_elcg_init_idle_filters, | ||
351 | .get_internal_sensor_curr_temp = | ||
352 | gp106_get_internal_sensor_curr_temp, | ||
353 | .get_internal_sensor_limits = gp106_get_internal_sensor_limits, | ||
354 | .configure_therm_alert = gp106_configure_therm_alert, | ||
355 | }, | ||
346 | .mc = { | 356 | .mc = { |
347 | .intr_enable = mc_gp10b_intr_enable, | 357 | .intr_enable = mc_gp10b_intr_enable, |
348 | .intr_unit_config = mc_gp10b_intr_unit_config, | 358 | .intr_unit_config = mc_gp10b_intr_unit_config, |
@@ -436,6 +446,7 @@ int gp106_init_hal(struct gk20a *g) | |||
436 | gops->gr_ctx = gp106_ops.gr_ctx; | 446 | gops->gr_ctx = gp106_ops.gr_ctx; |
437 | gops->fecs_trace = gp106_ops.fecs_trace; | 447 | gops->fecs_trace = gp106_ops.fecs_trace; |
438 | gops->pramin = gp106_ops.pramin; | 448 | gops->pramin = gp106_ops.pramin; |
449 | gops->therm = gp106_ops.therm; | ||
439 | gops->mc = gp106_ops.mc; | 450 | gops->mc = gp106_ops.mc; |
440 | gops->debug = gp106_ops.debug; | 451 | gops->debug = gp106_ops.debug; |
441 | gops->dbg_session_ops = gp106_ops.dbg_session_ops; | 452 | gops->dbg_session_ops = gp106_ops.dbg_session_ops; |
@@ -467,7 +478,6 @@ int gp106_init_hal(struct gk20a *g) | |||
467 | gp106_init_clk_ops(gops); | 478 | gp106_init_clk_ops(gops); |
468 | gp106_init_clk_arb_ops(gops); | 479 | gp106_init_clk_arb_ops(gops); |
469 | gp106_init_regops(gops); | 480 | gp106_init_regops(gops); |
470 | gp106_init_therm_ops(gops); | ||
471 | 481 | ||
472 | g->name = "gp10x"; | 482 | g->name = "gp10x"; |
473 | 483 | ||
diff --git a/drivers/gpu/nvgpu/gp106/therm_gp106.c b/drivers/gpu/nvgpu/gp106/therm_gp106.c index dacebe93..4be8e6cd 100644 --- a/drivers/gpu/nvgpu/gp106/therm_gp106.c +++ b/drivers/gpu/nvgpu/gp106/therm_gp106.c | |||
@@ -11,6 +11,8 @@ | |||
11 | * more details. | 11 | * more details. |
12 | */ | 12 | */ |
13 | 13 | ||
14 | #include "gk20a/gk20a.h" | ||
15 | |||
14 | #include "therm_gp106.h" | 16 | #include "therm_gp106.h" |
15 | #include "therm/thrmpmu.h" | 17 | #include "therm/thrmpmu.h" |
16 | 18 | ||
@@ -22,13 +24,13 @@ | |||
22 | 24 | ||
23 | #include <nvgpu/hw/gp106/hw_therm_gp106.h> | 25 | #include <nvgpu/hw/gp106/hw_therm_gp106.h> |
24 | 26 | ||
25 | static void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8) | 27 | void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8) |
26 | { | 28 | { |
27 | *max_24_8 = (0x87 << 8); | 29 | *max_24_8 = (0x87 << 8); |
28 | *min_24_8 = ((-216) << 8); | 30 | *min_24_8 = ((-216) << 8); |
29 | } | 31 | } |
30 | 32 | ||
31 | static int gp106_get_internal_sensor_curr_temp(struct gk20a *g, u32 *temp_f24_8) | 33 | int gp106_get_internal_sensor_curr_temp(struct gk20a *g, u32 *temp_f24_8) |
32 | { | 34 | { |
33 | int err = 0; | 35 | int err = 0; |
34 | u32 readval; | 36 | u32 readval; |
@@ -68,7 +70,8 @@ static int therm_get_internal_sensor_curr_temp(void *data, u64 *val) | |||
68 | } | 70 | } |
69 | DEFINE_SIMPLE_ATTRIBUTE(therm_ctrl_fops, therm_get_internal_sensor_curr_temp, NULL, "%llu\n"); | 71 | DEFINE_SIMPLE_ATTRIBUTE(therm_ctrl_fops, therm_get_internal_sensor_curr_temp, NULL, "%llu\n"); |
70 | 72 | ||
71 | static void gp106_therm_debugfs_init(struct gk20a *g) { | 73 | void gp106_therm_debugfs_init(struct gk20a *g) |
74 | { | ||
72 | struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); | 75 | struct gk20a_platform *platform = dev_get_drvdata(dev_from_gk20a(g)); |
73 | struct dentry *dbgentry; | 76 | struct dentry *dbgentry; |
74 | 77 | ||
@@ -79,7 +82,7 @@ static void gp106_therm_debugfs_init(struct gk20a *g) { | |||
79 | } | 82 | } |
80 | #endif | 83 | #endif |
81 | 84 | ||
82 | static int gp106_elcg_init_idle_filters(struct gk20a *g) | 85 | int gp106_elcg_init_idle_filters(struct gk20a *g) |
83 | { | 86 | { |
84 | u32 gate_ctrl, idle_filter; | 87 | u32 gate_ctrl, idle_filter; |
85 | u32 engine_id; | 88 | u32 engine_id; |
@@ -117,7 +120,7 @@ static int gp106_elcg_init_idle_filters(struct gk20a *g) | |||
117 | return 0; | 120 | return 0; |
118 | } | 121 | } |
119 | 122 | ||
120 | static u32 gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp) | 123 | u32 gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp) |
121 | { | 124 | { |
122 | u32 err = 0; | 125 | u32 err = 0; |
123 | 126 | ||
@@ -128,14 +131,3 @@ static u32 gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp) | |||
128 | 131 | ||
129 | return err; | 132 | return err; |
130 | } | 133 | } |
131 | |||
132 | void gp106_init_therm_ops(struct gpu_ops *gops) { | ||
133 | #ifdef CONFIG_DEBUG_FS | ||
134 | gops->therm.therm_debugfs_init = gp106_therm_debugfs_init; | ||
135 | #endif | ||
136 | gops->therm.elcg_init_idle_filters = gp106_elcg_init_idle_filters; | ||
137 | gops->therm.get_internal_sensor_curr_temp = gp106_get_internal_sensor_curr_temp; | ||
138 | gops->therm.get_internal_sensor_limits = | ||
139 | gp106_get_internal_sensor_limits; | ||
140 | gops->therm.configure_therm_alert = gp106_configure_therm_alert; | ||
141 | } | ||
diff --git a/drivers/gpu/nvgpu/gp106/therm_gp106.h b/drivers/gpu/nvgpu/gp106/therm_gp106.h index 6db17c47..2866320b 100644 --- a/drivers/gpu/nvgpu/gp106/therm_gp106.h +++ b/drivers/gpu/nvgpu/gp106/therm_gp106.h | |||
@@ -1,7 +1,7 @@ | |||
1 | /* | 1 | /* |
2 | * general thermal control structures & definitions | 2 | * general thermal control structures & definitions |
3 | * | 3 | * |
4 | * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. | 4 | * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved. |
5 | * | 5 | * |
6 | * This program is free software; you can redistribute it and/or modify it | 6 | * This program is free software; you can redistribute it and/or modify it |
7 | * under the terms and conditions of the GNU General Public License, | 7 | * under the terms and conditions of the GNU General Public License, |
@@ -16,7 +16,14 @@ | |||
16 | #ifndef NVGPU_THERM_GP106_H | 16 | #ifndef NVGPU_THERM_GP106_H |
17 | #define NVGPU_THERM_GP106_H | 17 | #define NVGPU_THERM_GP106_H |
18 | 18 | ||
19 | #include "gk20a/gk20a.h" | 19 | struct gk20a; |
20 | |||
21 | void gp106_get_internal_sensor_limits(s32 *max_24_8, s32 *min_24_8); | ||
22 | int gp106_get_internal_sensor_curr_temp(struct gk20a *g, u32 *temp_f24_8); | ||
23 | #ifdef CONFIG_DEBUG_FS | ||
24 | void gp106_therm_debugfs_init(struct gk20a *g); | ||
25 | #endif | ||
26 | int gp106_elcg_init_idle_filters(struct gk20a *g); | ||
27 | u32 gp106_configure_therm_alert(struct gk20a *g, s32 curr_warn_temp); | ||
20 | 28 | ||
21 | void gp106_init_therm_ops(struct gpu_ops *gops); | ||
22 | #endif | 29 | #endif |