summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/gp10b
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-07-26 21:08:00 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-27 19:34:45 -0400
commitf391f53c089ec12fcc501c491430380b668e3cbf (patch)
treecc7dde1ab600dedb48c1b712094c16ceafaf5cdc /drivers/gpu/nvgpu/gp10b
parentf0593bb43f3379baffd7bb77b89c9af18842ceef (diff)
gpu: nvgpu: Reorg therm HAL initialization
Reorganize HAL initialization to remove inheritance and construct the gpu_ops struct at compile time. This patch only covers the therm sub-module of the gpu_ops struct. Perform HAL function assignments in hal_gxxxx.c through the population of a chip-specific copy of gpu_ops. Jira NVGPU-74 Change-Id: Ic9d03304d3dcde0365cbf22af2dbe1e7eb0e04bb Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1527422 Reviewed-by: Automatic_Commit_Validation_User GVS: Gerrit_Virtual_Submit Reviewed-by: Terje Bergstrom <tbergstrom@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp10b')
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c6
-rw-r--r--drivers/gpu/nvgpu/gp10b/therm_gp10b.c4
-rw-r--r--drivers/gpu/nvgpu/gp10b/therm_gp10b.h7
3 files changed, 11 insertions, 6 deletions
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index 3a44f1ef..a2aacd2e 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -309,6 +309,10 @@ static const struct gpu_ops gp10b_ops = {
309 .exit = gk20a_pramin_exit, 309 .exit = gk20a_pramin_exit,
310 .data032_r = pram_data032_r, 310 .data032_r = pram_data032_r,
311 }, 311 },
312 .therm = {
313 .init_therm_setup_hw = gp10b_init_therm_setup_hw,
314 .elcg_init_idle_filters = gp10b_elcg_init_idle_filters,
315 },
312 .mc = { 316 .mc = {
313 .intr_enable = mc_gp10b_intr_enable, 317 .intr_enable = mc_gp10b_intr_enable,
314 .intr_unit_config = mc_gp10b_intr_unit_config, 318 .intr_unit_config = mc_gp10b_intr_unit_config,
@@ -385,6 +389,7 @@ int gp10b_init_hal(struct gk20a *g)
385 gops->gr_ctx = gp10b_ops.gr_ctx; 389 gops->gr_ctx = gp10b_ops.gr_ctx;
386 gops->fecs_trace = gp10b_ops.fecs_trace; 390 gops->fecs_trace = gp10b_ops.fecs_trace;
387 gops->pramin = gp10b_ops.pramin; 391 gops->pramin = gp10b_ops.pramin;
392 gops->therm = gp10b_ops.therm;
388 gops->mc = gp10b_ops.mc; 393 gops->mc = gp10b_ops.mc;
389 gops->debug = gp10b_ops.debug; 394 gops->debug = gp10b_ops.debug;
390 gops->dbg_session_ops = gp10b_ops.dbg_session_ops; 395 gops->dbg_session_ops = gp10b_ops.dbg_session_ops;
@@ -448,7 +453,6 @@ int gp10b_init_hal(struct gk20a *g)
448 gp10b_init_mm(gops); 453 gp10b_init_mm(gops);
449 gp10b_init_pmu_ops(g); 454 gp10b_init_pmu_ops(g);
450 gp10b_init_regops(gops); 455 gp10b_init_regops(gops);
451 gp10b_init_therm_ops(gops);
452 456
453 g->name = "gp10b"; 457 g->name = "gp10b";
454 458
diff --git a/drivers/gpu/nvgpu/gp10b/therm_gp10b.c b/drivers/gpu/nvgpu/gp10b/therm_gp10b.c
index 925fc69b..43f44c92 100644
--- a/drivers/gpu/nvgpu/gp10b/therm_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/therm_gp10b.c
@@ -20,7 +20,7 @@
20 20
21#include <nvgpu/hw/gp10b/hw_therm_gp10b.h> 21#include <nvgpu/hw/gp10b/hw_therm_gp10b.h>
22 22
23static int gp10b_init_therm_setup_hw(struct gk20a *g) 23int gp10b_init_therm_setup_hw(struct gk20a *g)
24{ 24{
25 u32 v; 25 u32 v;
26 26
@@ -80,7 +80,7 @@ static int gp10b_init_therm_setup_hw(struct gk20a *g)
80 return 0; 80 return 0;
81} 81}
82 82
83static int gp10b_elcg_init_idle_filters(struct gk20a *g) 83int gp10b_elcg_init_idle_filters(struct gk20a *g)
84{ 84{
85 u32 gate_ctrl, idle_filter; 85 u32 gate_ctrl, idle_filter;
86 u32 engine_id; 86 u32 engine_id;
diff --git a/drivers/gpu/nvgpu/gp10b/therm_gp10b.h b/drivers/gpu/nvgpu/gp10b/therm_gp10b.h
index 18c102fe..c9ed01e6 100644
--- a/drivers/gpu/nvgpu/gp10b/therm_gp10b.h
+++ b/drivers/gpu/nvgpu/gp10b/therm_gp10b.h
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2015, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2015-2017, 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,
@@ -13,7 +13,8 @@
13#ifndef THERM_GP10B_H 13#ifndef THERM_GP10B_H
14#define THERM_GP10B_H 14#define THERM_GP10B_H
15 15
16struct gpu_ops; 16struct gk20a;
17void gp10b_init_therm_ops(struct gpu_ops *gops); 17int gp10b_init_therm_setup_hw(struct gk20a *g);
18int gp10b_elcg_init_idle_filters(struct gk20a *g);
18 19
19#endif /* THERM_GP10B_H */ 20#endif /* THERM_GP10B_H */