gpu: nvgpu: Make LTC disabling common code

Refactor the sync_debugfs LTC HAL op so that the logic to enable
or disable LTC goes to common code nvgpu_ltc_sync_enabled() and
the LTC HAL set_enabled only performs the hardware register access.

Create a new common function nvgpu_init_ltc_support() to initialize
the LTC software variable, and move hardware initialization of LTC to
be called from it.

JIRA NVGPU-62

Change-Id: Ib1cf4f5b83ca3dac08407464ed56a732e0a33923
Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1528262
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Terje Bergstrom
2017-07-27 12:58:03 -07:00
committed by mobile promotions
parent c16797e35c
commit b8efd9d045
16 changed files with 101 additions and 75 deletions

View File

@@ -26,6 +26,7 @@
#include <nvgpu/enabled.h>
#include <nvgpu/pmu.h>
#include <nvgpu/gmmu.h>
#include <nvgpu/ltc.h>
#include <trace/events/gk20a.h>
@@ -216,8 +217,11 @@ int gk20a_finalize_poweron(struct gk20a *g)
goto done;
}
if (g->ops.ltc.init_fs_state)
g->ops.ltc.init_fs_state(g);
err = nvgpu_init_ltc_support(g);
if (err) {
nvgpu_err(g, "failed to init ltc");
goto done;
}
err = gk20a_init_mm_support(g);
if (err) {