diff options
author | Debarshi Dutta <ddutta@nvidia.com> | 2018-06-26 06:11:12 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2018-09-04 10:25:41 -0400 |
commit | 16ad9f537979c5f3717fc5781b1c2fad22a76f96 (patch) | |
tree | 2a150c50983180051fa5ecc942764e081961d787 /drivers/gpu/nvgpu/gp106/clk_gp106.c | |
parent | f125d1b681c324d5d58abcc42fac1301e1faa921 (diff) |
gpu: nvgpu: move gp106 specific clk_arbiter code into HAL
Currently, clock arbiter code is extensively using dgpu specific
implementation. This patch restructures the clk_arbiter code and moves
gp106 specific code into HAL. Following changes are made in this patch
1) clk_domain_get_f_points is now invoked via HAL for gp106 i.e.
g->ops.clk.clk_domain_get_f_points.
2) moved nvgpu_clk_arb_change_vf_point and other related static
functions to clk_arb_gp106.c.
3) Instead of only checking if get_arbiter_clk_domain is empty, a
check for support_clk_freq_controller is also added. This is to enable
the clk_arbiter based on support from both the OS and the chips.
Bug 2061372
Change-Id: I65b0a4e02145a86fbbfb420ed591b1fa3c86f6dc
Signed-off-by: Debarshi Dutta <ddutta@nvidia.com>
Reviewed-on: https://git-master.nvidia.com/r/1774279
Reviewed-by: svc-misra-checker <svc-misra-checker@nvidia.com>
GVS: Gerrit_Virtual_Submit
Reviewed-by: Deepak Nibade <dnibade@nvidia.com>
Reviewed-by: Vijayakumar Subbu <vsubbu@nvidia.com>
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers/gpu/nvgpu/gp106/clk_gp106.c')
-rw-r--r-- | drivers/gpu/nvgpu/gp106/clk_gp106.c | 33 |
1 files changed, 33 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c index 24b07112..dd7a2dd6 100644 --- a/drivers/gpu/nvgpu/gp106/clk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c | |||
@@ -32,7 +32,9 @@ | |||
32 | #include <nvgpu/list.h> | 32 | #include <nvgpu/list.h> |
33 | #include <nvgpu/clk_arb.h> | 33 | #include <nvgpu/clk_arb.h> |
34 | #include <nvgpu/timers.h> | 34 | #include <nvgpu/timers.h> |
35 | #include <nvgpu/pmu.h> | ||
35 | 36 | ||
37 | #include "clk/clk.h" | ||
36 | #include "gk20a/gk20a.h" | 38 | #include "gk20a/gk20a.h" |
37 | #include "gp106/mclk_gp106.h" | 39 | #include "gp106/mclk_gp106.h" |
38 | 40 | ||
@@ -243,6 +245,37 @@ read_err: | |||
243 | 245 | ||
244 | } | 246 | } |
245 | 247 | ||
248 | int gp106_clk_domain_get_f_points( | ||
249 | struct gk20a *g, | ||
250 | u32 clkapidomain, | ||
251 | u32 *pfpointscount, | ||
252 | u16 *pfreqpointsinmhz) | ||
253 | { | ||
254 | int status = -EINVAL; | ||
255 | struct clk_domain *pdomain; | ||
256 | u8 i; | ||
257 | struct clk_pmupstate *pclk = &g->clk_pmu; | ||
258 | |||
259 | if (pfpointscount == NULL) | ||
260 | return -EINVAL; | ||
261 | |||
262 | if ((pfreqpointsinmhz == NULL) && (*pfpointscount != 0)) | ||
263 | return -EINVAL; | ||
264 | |||
265 | BOARDOBJGRP_FOR_EACH(&(pclk->clk_domainobjs.super.super), | ||
266 | struct clk_domain *, pdomain, i) { | ||
267 | if (pdomain->api_domain == clkapidomain) { | ||
268 | status = pdomain->clkdomainclkgetfpoints(g, pclk, | ||
269 | pdomain, pfpointscount, | ||
270 | pfreqpointsinmhz, | ||
271 | CLK_PROG_VFE_ENTRY_LOGIC); | ||
272 | return status; | ||
273 | } | ||
274 | } | ||
275 | return status; | ||
276 | } | ||
277 | |||
278 | |||
246 | #ifdef CONFIG_DEBUG_FS | 279 | #ifdef CONFIG_DEBUG_FS |
247 | static int gp106_get_rate_show(void *data , u64 *val) { | 280 | static int gp106_get_rate_show(void *data , u64 *val) { |
248 | struct namemap_cfg *c = (struct namemap_cfg *) data; | 281 | struct namemap_cfg *c = (struct namemap_cfg *) data; |