summaryrefslogtreecommitdiffstats
path: root/drivers/gpu
diff options
context:
space:
mode:
authorSunny He <suhe@nvidia.com>2017-06-27 19:08:48 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2017-07-26 05:44:14 -0400
commit92f6eb016cc759b24e249ed6c17cff537cc35db7 (patch)
tree4c3041422fa3c114f9aad3ab5e30ad6673389578 /drivers/gpu
parentb260df606b759e9d9e82a54e6eda05be18df5bf5 (diff)
gpu: nvgpu: Remove pmupstate flag from gpu_ops
Replace pmupstate boolean flag in gpu_ops with entry in common flag system. The new common flag is NVGPU_PMU_PSTATE Jira NVGPU-74 Change-Id: I4e1ba922a48145b1cf3488b6f14fde78107adb5b Signed-off-by: Sunny He <suhe@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/1514059 Reviewed-by: Automatic_Commit_Validation_User Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Diffstat (limited to 'drivers/gpu')
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gm20b/hal_gm20b.c2
-rw-r--r--drivers/gpu/nvgpu/gp106/hal_gp106.c4
-rw-r--r--drivers/gpu/nvgpu/gp10b/hal_gp10b.c3
-rw-r--r--drivers/gpu/nvgpu/include/nvgpu/enabled.h1
6 files changed, 9 insertions, 8 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 32441c5b..21e861fe 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -138,7 +138,7 @@ int gk20a_prepare_poweroff(struct gk20a *g)
138 ret |= g->ops.clk.suspend_clk_support(g); 138 ret |= g->ops.clk.suspend_clk_support(g);
139 139
140#ifdef CONFIG_ARCH_TEGRA_18x_SOC 140#ifdef CONFIG_ARCH_TEGRA_18x_SOC
141 if (g->ops.pmupstate) 141 if (nvgpu_is_enabled(g, NVGPU_PMU_PSTATE))
142 gk20a_deinit_pstate_support(g); 142 gk20a_deinit_pstate_support(g);
143#endif 143#endif
144 g->power_on = false; 144 g->power_on = false;
@@ -252,7 +252,7 @@ int gk20a_finalize_poweron(struct gk20a *g)
252 } 252 }
253 253
254#ifdef CONFIG_ARCH_TEGRA_18x_SOC 254#ifdef CONFIG_ARCH_TEGRA_18x_SOC
255 if (g->ops.pmupstate) { 255 if (nvgpu_is_enabled(g, NVGPU_PMU_PSTATE)) {
256 err = gk20a_init_pstate_support(g); 256 err = gk20a_init_pstate_support(g);
257 if (err) { 257 if (err) {
258 nvgpu_err(g, "failed to init pstates"); 258 nvgpu_err(g, "failed to init pstates");
@@ -276,7 +276,7 @@ int gk20a_finalize_poweron(struct gk20a *g)
276 } 276 }
277 277
278#ifdef CONFIG_ARCH_TEGRA_18x_SOC 278#ifdef CONFIG_ARCH_TEGRA_18x_SOC
279 if (g->ops.pmupstate) { 279 if (nvgpu_is_enabled(g, NVGPU_PMU_PSTATE)) {
280 err = gk20a_init_pstate_pmu_support(g); 280 err = gk20a_init_pstate_pmu_support(g);
281 if (err) { 281 if (err) {
282 nvgpu_err(g, "failed to init pstates"); 282 nvgpu_err(g, "failed to init pstates");
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index ff8eb988..17a06099 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -994,7 +994,6 @@ struct gpu_ops {
994 } priv_ring; 994 } priv_ring;
995 bool privsecurity; 995 bool privsecurity;
996 bool securegpccs; 996 bool securegpccs;
997 bool pmupstate;
998}; 997};
999 998
1000struct nvgpu_bios_ucode { 999struct nvgpu_bios_ucode {
diff --git a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
index bdee1149..7415e6c1 100644
--- a/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/hal_gm20b.c
@@ -352,7 +352,7 @@ int gm20b_init_hal(struct gk20a *g)
352 gops->get_litter_value = gm20b_ops.get_litter_value; 352 gops->get_litter_value = gm20b_ops.get_litter_value;
353 353
354 gops->securegpccs = false; 354 gops->securegpccs = false;
355 gops->pmupstate = false; 355 __nvgpu_set_enabled(g, NVGPU_PMU_PSTATE, false);
356#ifdef CONFIG_TEGRA_ACR 356#ifdef CONFIG_TEGRA_ACR
357 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) { 357 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) {
358 gops->privsecurity = 1; 358 gops->privsecurity = 1;
diff --git a/drivers/gpu/nvgpu/gp106/hal_gp106.c b/drivers/gpu/nvgpu/gp106/hal_gp106.c
index fa767c3b..2a661734 100644
--- a/drivers/gpu/nvgpu/gp106/hal_gp106.c
+++ b/drivers/gpu/nvgpu/gp106/hal_gp106.c
@@ -62,6 +62,7 @@
62#include <nvgpu/debug.h> 62#include <nvgpu/debug.h>
63#include <nvgpu/bug.h> 63#include <nvgpu/bug.h>
64#include <nvgpu/bus.h> 64#include <nvgpu/bus.h>
65#include <nvgpu/enabled.h>
65 66
66#include <nvgpu/hw/gp106/hw_proj_gp106.h> 67#include <nvgpu/hw/gp106/hw_proj_gp106.h>
67#include <nvgpu/hw/gp106/hw_fifo_gp106.h> 68#include <nvgpu/hw/gp106/hw_fifo_gp106.h>
@@ -417,8 +418,7 @@ int gp106_init_hal(struct gk20a *g)
417 418
418 gops->privsecurity = 1; 419 gops->privsecurity = 1;
419 gops->securegpccs = 1; 420 gops->securegpccs = 1;
420 gops->pmupstate = true; 421 __nvgpu_set_enabled(g, NVGPU_PMU_PSTATE, true);
421
422 422
423 g->bootstrap_owner = LSF_FALCON_ID_SEC2; 423 g->bootstrap_owner = LSF_FALCON_ID_SEC2;
424 gp106_init_gr(gops); 424 gp106_init_gr(gops);
diff --git a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
index d603703b..177a7c9f 100644
--- a/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
+++ b/drivers/gpu/nvgpu/gp10b/hal_gp10b.c
@@ -364,7 +364,8 @@ int gp10b_init_hal(struct gk20a *g)
364 gp10b_ops.chip_init_gpu_characteristics; 364 gp10b_ops.chip_init_gpu_characteristics;
365 gops->get_litter_value = gp10b_ops.get_litter_value; 365 gops->get_litter_value = gp10b_ops.get_litter_value;
366 366
367 gops->pmupstate = false; 367 __nvgpu_set_enabled(g, NVGPU_PMU_PSTATE, false);
368
368#ifdef CONFIG_TEGRA_ACR 369#ifdef CONFIG_TEGRA_ACR
369 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) { 370 if (nvgpu_is_enabled(g, NVGPU_IS_FMODEL)) {
370 gops->privsecurity = 0; 371 gops->privsecurity = 0;
diff --git a/drivers/gpu/nvgpu/include/nvgpu/enabled.h b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
index 3bfd4899..6fa7dcfa 100644
--- a/drivers/gpu/nvgpu/include/nvgpu/enabled.h
+++ b/drivers/gpu/nvgpu/include/nvgpu/enabled.h
@@ -42,6 +42,7 @@ struct gk20a;
42 */ 42 */
43/* perfmon enabled or disabled for PMU */ 43/* perfmon enabled or disabled for PMU */
44#define NVGPU_PMU_PERFMON 48 44#define NVGPU_PMU_PERFMON 48
45#define NVGPU_PMU_PSTATE 49
45 46
46/* 47/*
47 * Must be greater than the largest bit offset in the above list. 48 * Must be greater than the largest bit offset in the above list.