summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorseshendra Gadagottu <sgadagottu@nvidia.com>2016-10-27 13:54:18 -0400
committermobile promotions <svcmobile_promotions@nvidia.com>2016-11-01 14:36:51 -0400
commit161b61e6cc76c2050115039141027320a2f2e745 (patch)
treefdfdefb9bcb19c03e7d3f6cb315105dc473f88bb
parent9dce41e208818c0084c91685c8255942a2ca6e8d (diff)
gpu: nvgpu: pmu HAL update
Update pmu HAL to check for pmu support. pmu initialization will check for pmu support in that platform. JIRA GV11B-21 Change-Id: Ib55be58a1540862b7a91a6162544d10be85b5eb4 Signed-off-by: seshendra Gadagottu <sgadagottu@nvidia.com> Reviewed-on: http://git-master/r/1243911 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.c22
-rw-r--r--drivers/gpu/nvgpu/gk20a/gk20a.h1
-rw-r--r--drivers/gpu/nvgpu/gk20a/pmu_gk20a.c6
-rw-r--r--drivers/gpu/nvgpu/gm206/pmu_gm206.c6
-rw-r--r--drivers/gpu/nvgpu/gm20b/acr_gm20b.c6
5 files changed, 32 insertions, 9 deletions
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c
index 606dbc1f..87f47cd8 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.c
@@ -955,11 +955,13 @@ int gk20a_pm_finalize_poweron(struct device *dev)
955 goto done; 955 goto done;
956 } 956 }
957 957
958 if (g->ops.pmu.prepare_ucode) 958 if (g->ops.pmu.is_pmu_supported(g)) {
959 err = g->ops.pmu.prepare_ucode(g); 959 if (g->ops.pmu.prepare_ucode)
960 if (err) { 960 err = g->ops.pmu.prepare_ucode(g);
961 gk20a_err(dev, "failed to init pmu ucode"); 961 if (err) {
962 goto done; 962 gk20a_err(dev, "failed to init pmu ucode");
963 goto done;
964 }
963 } 965 }
964 966
965#ifdef CONFIG_ARCH_TEGRA_18x_SOC 967#ifdef CONFIG_ARCH_TEGRA_18x_SOC
@@ -972,10 +974,12 @@ int gk20a_pm_finalize_poweron(struct device *dev)
972 } 974 }
973#endif 975#endif
974 976
975 err = gk20a_init_pmu_support(g); 977 if (g->ops.pmu.is_pmu_supported(g)) {
976 if (err) { 978 err = gk20a_init_pmu_support(g);
977 gk20a_err(dev, "failed to init gk20a pmu"); 979 if (err) {
978 goto done; 980 gk20a_err(dev, "failed to init gk20a pmu");
981 goto done;
982 }
979 } 983 }
980 984
981 err = gk20a_init_gr_support(g); 985 err = gk20a_init_gr_support(g);
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h
index ec0b4ba9..a230e98a 100644
--- a/drivers/gpu/nvgpu/gk20a/gk20a.h
+++ b/drivers/gpu/nvgpu/gk20a/gk20a.h
@@ -584,6 +584,7 @@ struct gpu_ops {
584 void (*therm_debugfs_init)(struct gk20a *g); 584 void (*therm_debugfs_init)(struct gk20a *g);
585 } therm; 585 } therm;
586 struct { 586 struct {
587 bool (*is_pmu_supported)(struct gk20a *g);
587 int (*prepare_ucode)(struct gk20a *g); 588 int (*prepare_ucode)(struct gk20a *g);
588 int (*pmu_setup_hw_and_bootstrap)(struct gk20a *g); 589 int (*pmu_setup_hw_and_bootstrap)(struct gk20a *g);
589 int (*pmu_nsbootstrap)(struct pmu_gk20a *pmu); 590 int (*pmu_nsbootstrap)(struct pmu_gk20a *pmu);
diff --git a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
index cd4bab76..58fb2acc 100644
--- a/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
+++ b/drivers/gpu/nvgpu/gk20a/pmu_gk20a.c
@@ -3266,8 +3266,14 @@ int gk20a_pmu_reset(struct gk20a *g)
3266 return err; 3266 return err;
3267} 3267}
3268 3268
3269static bool gk20a_is_pmu_supported(struct gk20a *g)
3270{
3271 return true;
3272}
3273
3269void gk20a_init_pmu_ops(struct gpu_ops *gops) 3274void gk20a_init_pmu_ops(struct gpu_ops *gops)
3270{ 3275{
3276 gops->pmu.is_pmu_supported = gk20a_is_pmu_supported;
3271 gops->pmu.prepare_ucode = gk20a_prepare_ucode; 3277 gops->pmu.prepare_ucode = gk20a_prepare_ucode;
3272 gops->pmu.pmu_setup_hw_and_bootstrap = gk20a_init_pmu_setup_hw1; 3278 gops->pmu.pmu_setup_hw_and_bootstrap = gk20a_init_pmu_setup_hw1;
3273 gops->pmu.pmu_nsbootstrap = pmu_bootstrap; 3279 gops->pmu.pmu_nsbootstrap = pmu_bootstrap;
diff --git a/drivers/gpu/nvgpu/gm206/pmu_gm206.c b/drivers/gpu/nvgpu/gm206/pmu_gm206.c
index e0ae06ea..a87ecc1d 100644
--- a/drivers/gpu/nvgpu/gm206/pmu_gm206.c
+++ b/drivers/gpu/nvgpu/gm206/pmu_gm206.c
@@ -129,9 +129,15 @@ int gm206_load_falcon_ucode(struct gk20a *g, u32 falconidmask)
129 return 0; 129 return 0;
130} 130}
131 131
132static bool gm206_is_pmu_supported(struct gk20a *g)
133{
134 return true;
135}
136
132 137
133void gm206_init_pmu_ops(struct gpu_ops *gops) 138void gm206_init_pmu_ops(struct gpu_ops *gops)
134{ 139{
140 gops->pmu.is_pmu_supported = gm206_is_pmu_supported;
135 if (gops->privsecurity) { 141 if (gops->privsecurity) {
136 gm206_init_secure_pmu(gops); 142 gm206_init_secure_pmu(gops);
137 gops->pmu.init_wpr_region = gm20b_pmu_init_acr; 143 gops->pmu.init_wpr_region = gm20b_pmu_init_acr;
diff --git a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
index 310a3bc8..f9e2d477 100644
--- a/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
+++ b/drivers/gpu/nvgpu/gm20b/acr_gm20b.c
@@ -94,8 +94,14 @@ static void gm20b_wpr_info(struct gk20a *g, struct wpr_carveout_info *inf)
94 inf->size = mem_inf.size; 94 inf->size = mem_inf.size;
95} 95}
96 96
97static bool gm20b_is_pmu_supported(struct gk20a *g)
98{
99 return true;
100}
101
97void gm20b_init_secure_pmu(struct gpu_ops *gops) 102void gm20b_init_secure_pmu(struct gpu_ops *gops)
98{ 103{
104 gops->pmu.is_pmu_supported = gm20b_is_pmu_supported;
99 gops->pmu.prepare_ucode = prepare_ucode_blob; 105 gops->pmu.prepare_ucode = prepare_ucode_blob;
100 gops->pmu.pmu_setup_hw_and_bootstrap = gm20b_bootstrap_hs_flcn; 106 gops->pmu.pmu_setup_hw_and_bootstrap = gm20b_bootstrap_hs_flcn;
101 gops->pmu.is_lazy_bootstrap = gm20b_is_lazy_bootstrap; 107 gops->pmu.is_lazy_bootstrap = gm20b_is_lazy_bootstrap;