gpu: nvgpu: add therm_max_fpdiv_factor gops.therm

Use therm_max_fpdiv_factor gops.therm for nvgpu-next to get the maximum
fp_div_factor.

Jira NVGPU-4860

Signed-off-by: Antony Clince Alex <aalex@nvidia.com>
Change-Id: If0e9b82f5b61289e226ceeff386fc88763af66e2
Reviewed-on: https://git-master.nvidia.com/r/c/linux-nvgpu/+/2313336
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
Antony Clince Alex
2020-03-16 17:15:53 +05:30
committed by Alex Waterman
parent 4f5bd9e633
commit da8ee8d615
4 changed files with 14 additions and 6 deletions

View File

@@ -1193,6 +1193,7 @@ NVGPU_COV_WHITELIST_BLOCK_END(NVGPU_MISRA(Rule, 8_7))
}
},
.therm = {
.therm_max_fpdiv_factor = gv11b_therm_max_fpdiv_factor,
.init_therm_support = nvgpu_init_therm_support,
.init_therm_setup_hw = gv11b_init_therm_setup_hw,
.init_elcg_mode = gv11b_therm_init_elcg_mode,

View File

@@ -1,5 +1,5 @@
/*
* Copyright (c) 2017, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2017-2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -26,5 +26,6 @@ struct gk20a;
int gv11b_elcg_init_idle_filters(struct gk20a *g);
int gv11b_init_therm_setup_hw(struct gk20a *g);
void gv11b_therm_init_elcg_mode(struct gk20a *g, u32 mode, u32 engine);
u32 gv11b_therm_max_fpdiv_factor(void);
#endif /* THERM_GV11B_H */

View File

@@ -1,7 +1,7 @@
/*
* GV11B Therm
*
* Copyright (c) 2015-2019, NVIDIA CORPORATION. All rights reserved.
* Copyright (c) 2015-2020, NVIDIA CORPORATION. All rights reserved.
*
* Permission is hereby granted, free of charge, to any person obtaining a
* copy of this software and associated documentation files (the "Software"),
@@ -66,13 +66,13 @@ int gv11b_init_therm_setup_hw(struct gk20a *g)
therm_grad_stepping_table_slowdown_factor0_f(
therm_grad_stepping_table_slowdown_factor0_fpdiv_by16_f()) |
therm_grad_stepping_table_slowdown_factor1_f(
therm_grad_stepping_table_slowdown_factor0_fpdiv_by32_f()) |
g->ops.therm.therm_max_fpdiv_factor()) |
therm_grad_stepping_table_slowdown_factor2_f(
therm_grad_stepping_table_slowdown_factor0_fpdiv_by32_f()) |
g->ops.therm.therm_max_fpdiv_factor()) |
therm_grad_stepping_table_slowdown_factor3_f(
therm_grad_stepping_table_slowdown_factor0_fpdiv_by32_f()) |
g->ops.therm.therm_max_fpdiv_factor()) |
therm_grad_stepping_table_slowdown_factor4_f(
therm_grad_stepping_table_slowdown_factor0_fpdiv_by32_f()));
g->ops.therm.therm_max_fpdiv_factor()));
v = nvgpu_readl(g, therm_clk_timing_r(0));
v |= therm_clk_timing_grad_slowdown_enabled_f();
@@ -184,3 +184,8 @@ int gv11b_elcg_init_idle_filters(struct gk20a *g)
return 0;
}
u32 gv11b_therm_max_fpdiv_factor(void)
{
return therm_grad_stepping_table_slowdown_factor0_fpdiv_by32_f();
}

View File

@@ -129,6 +129,7 @@ struct gops_therm {
#ifdef CONFIG_DEBUG_FS
void (*therm_debugfs_init)(struct gk20a *g);
#endif
u32 (*therm_max_fpdiv_factor)(void);
/** @endcond DOXYGEN_SHOULD_SKIP_THIS */
};