diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2019-05-13 07:17:04 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2019-05-15 19:14:30 -0400 |
commit | 1f867543daece1ec529211d6d66c9799eab6220f (patch) | |
tree | e56b479d9807526a7c689c6d585329363e3e87e9 /drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c | |
parent | 543a904e630dfe78b193803ad04d2bd12380c2b0 (diff) |
gpu: nvgpu: Add DT support for TPC_PG_POWERGATE
Added support for TPC_PG_POWERGATE during probe for nvgpu via DT.
A new DT binding GV11B_FUSE_OPT_TPC_DISABLE is supported by nvgpu
driver that checks for valid masks and updates the global tpc_pg_mask
flag.
Bug 200518434
Change-Id: Ia65ae518b48e36d28de5e9375bc994232f6a9438
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/2117783
Reviewed-by: svc-mobile-coverity <svc-mobile-coverity@nvidia.com>
Reviewed-by: Deepak Goyal <dgoyal@nvidia.com>
Reviewed-by: Bibek Basu <bbasu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c')
-rw-r--r-- | drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c index dafa05e5..4a94c1cd 100644 --- a/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c +++ b/drivers/gpu/nvgpu/os/linux/platform_gv11b_tegra.c | |||
@@ -218,6 +218,28 @@ static int gv11b_tegra_suspend(struct device *dev) | |||
218 | return 0; | 218 | return 0; |
219 | } | 219 | } |
220 | 220 | ||
221 | static bool is_tpc_mask_valid(struct gk20a_platform *platform, u32 tpc_mask) | ||
222 | { | ||
223 | u32 i; | ||
224 | bool valid = false; | ||
225 | |||
226 | for (i = 0; i < MAX_TPC_PG_CONFIGS; i++) { | ||
227 | if (tpc_mask == platform->valid_tpc_mask[i]) | ||
228 | valid = true; | ||
229 | } | ||
230 | return valid; | ||
231 | } | ||
232 | |||
233 | static void gv11b_tegra_set_tpc_pg_mask(struct device *dev, u32 tpc_mask) | ||
234 | { | ||
235 | struct gk20a_platform *platform = gk20a_get_platform(dev); | ||
236 | struct gk20a *g = get_gk20a(dev); | ||
237 | |||
238 | if (is_tpc_mask_valid(platform, tpc_mask)) { | ||
239 | g->tpc_pg_mask = tpc_mask; | ||
240 | } | ||
241 | } | ||
242 | |||
221 | struct gk20a_platform gv11b_tegra_platform = { | 243 | struct gk20a_platform gv11b_tegra_platform = { |
222 | .has_syncpoints = true, | 244 | .has_syncpoints = true, |
223 | 245 | ||
@@ -237,6 +259,8 @@ struct gk20a_platform gv11b_tegra_platform = { | |||
237 | .valid_tpc_mask[1] = 0x1, | 259 | .valid_tpc_mask[1] = 0x1, |
238 | .valid_tpc_mask[2] = 0x5, | 260 | .valid_tpc_mask[2] = 0x5, |
239 | 261 | ||
262 | .set_tpc_pg_mask = gv11b_tegra_set_tpc_pg_mask, | ||
263 | |||
240 | .can_slcg = true, | 264 | .can_slcg = true, |
241 | .can_blcg = true, | 265 | .can_blcg = true, |
242 | .can_elcg = true, | 266 | .can_elcg = true, |