From 0e8aee1c1a38abbc2dccf3f604a9843cf38071e0 Mon Sep 17 00:00:00 2001 From: Deepak Goyal Date: Fri, 22 Sep 2017 12:08:10 +0530 Subject: gpu: nvgpu: skip clk gating prog for sim/emu. For Simualtion/Emulation platforms,clock gating should be skipped as it is not supported. Added new flags "can_"X"lcg" to check platform capability before doing SLCG,BLCG and ELCG. Bug 200314250 Change-Id: I4124d444a77a4c06df8c1d82c6038bfd457f3db0 Signed-off-by: Deepak Goyal Reviewed-on: https://git-master.nvidia.com/r/1566049 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/gk20a/gr_gk20a.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'drivers/gpu/nvgpu/gk20a/gr_gk20a.c') diff --git a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c index 679b8492..628b6823 100644 --- a/drivers/gpu/nvgpu/gk20a/gr_gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gr_gk20a.c @@ -4067,6 +4067,9 @@ void gr_gk20a_init_blcg_mode(struct gk20a *g, u32 mode, u32 engine) { u32 gate_ctrl; + if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_BLCG)) + return; + gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); switch (mode) { @@ -4095,6 +4098,9 @@ void gr_gk20a_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine) gate_ctrl = gk20a_readl(g, therm_gate_ctrl_r(engine)); + if (!nvgpu_is_enabled(g, NVGPU_GPU_CAN_ELCG)) + return; + switch (mode) { case ELCG_RUN: gate_ctrl = set_field(gate_ctrl, -- cgit v1.2.2