diff options
author | Thomas Fleury <tfleury@nvidia.com> | 2017-06-21 14:13:22 -0400 |
---|---|---|
committer | mobile promotions <svcmobile_promotions@nvidia.com> | 2017-06-30 11:46:34 -0400 |
commit | c12eb17340c90086f378c239da3d9015e7878f0c (patch) | |
tree | de0d8d3886bbc11e4b8524bda0d35de3e4e8638d /drivers | |
parent | a89c3876c71f486cf5d5bca588f12af02d1b15be (diff) |
gpu: nvgpu: move mclk related functions to clk
Move mclk related functions be moved to clk structure instead of
pmu. We want to keep pmu only for basic pmu interaction and
split clk, lpwr etc.
Bug 1921094
Change-Id: I32394bc0e6d3657dfbd34dbcf19c9af56c12e194
Signed-off-by: Thomas Fleury <tfleury@nvidia.com>
Reviewed-on: https://git-master/r/1506586
Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com>
Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/nvgpu/clk/clk_arb.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.c | 8 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gk20a/gk20a.h | 6 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/clk_gp106.c | 5 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/pmu_gp106.c | 4 | ||||
-rw-r--r-- | drivers/gpu/nvgpu/gp106/pmu_mclk_gp106.c | 5 |
6 files changed, 16 insertions, 16 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c index 58d529c6..df62df5e 100644 --- a/drivers/gpu/nvgpu/clk/clk_arb.c +++ b/drivers/gpu/nvgpu/clk/clk_arb.c | |||
@@ -1989,7 +1989,7 @@ static int nvgpu_clk_arb_change_vf_point(struct gk20a *g, u16 gpc2clk_target, | |||
1989 | 1989 | ||
1990 | /* descending */ | 1990 | /* descending */ |
1991 | if (voltuv < arb->voltuv_actual) { | 1991 | if (voltuv < arb->voltuv_actual) { |
1992 | status = g->ops.pmu.mclk_change(g, mclk_target); | 1992 | status = g->ops.clk.mclk_change(g, mclk_target); |
1993 | if (status < 0) | 1993 | if (status < 0) |
1994 | return status; | 1994 | return status; |
1995 | 1995 | ||
@@ -2009,7 +2009,7 @@ static int nvgpu_clk_arb_change_vf_point(struct gk20a *g, u16 gpc2clk_target, | |||
2009 | if (status < 0) | 2009 | if (status < 0) |
2010 | return status; | 2010 | return status; |
2011 | 2011 | ||
2012 | status = g->ops.pmu.mclk_change(g, mclk_target); | 2012 | status = g->ops.clk.mclk_change(g, mclk_target); |
2013 | if (status < 0) | 2013 | if (status < 0) |
2014 | return status; | 2014 | return status; |
2015 | } | 2015 | } |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.c b/drivers/gpu/nvgpu/gk20a/gk20a.c index 7106ea03..65197aca 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.c +++ b/drivers/gpu/nvgpu/gk20a/gk20a.c | |||
@@ -137,8 +137,8 @@ int gk20a_prepare_poweroff(struct gk20a *g) | |||
137 | ret |= gk20a_mm_suspend(g); | 137 | ret |= gk20a_mm_suspend(g); |
138 | ret |= gk20a_fifo_suspend(g); | 138 | ret |= gk20a_fifo_suspend(g); |
139 | 139 | ||
140 | if (g->ops.pmu.mclk_deinit) | 140 | if (g->ops.clk.mclk_deinit) |
141 | g->ops.pmu.mclk_deinit(g); | 141 | g->ops.clk.mclk_deinit(g); |
142 | 142 | ||
143 | /* Disable GPCPLL */ | 143 | /* Disable GPCPLL */ |
144 | if (g->ops.clk.suspend_clk_support) | 144 | if (g->ops.clk.suspend_clk_support) |
@@ -273,8 +273,8 @@ int gk20a_finalize_poweron(struct gk20a *g) | |||
273 | goto done; | 273 | goto done; |
274 | } | 274 | } |
275 | 275 | ||
276 | if (g->ops.pmu.mclk_init) { | 276 | if (g->ops.clk.mclk_init) { |
277 | err = g->ops.pmu.mclk_init(g); | 277 | err = g->ops.clk.mclk_init(g); |
278 | if (err) { | 278 | if (err) { |
279 | nvgpu_err(g, "failed to set mclk"); | 279 | nvgpu_err(g, "failed to set mclk"); |
280 | /* Indicate error dont goto done */ | 280 | /* Indicate error dont goto done */ |
diff --git a/drivers/gpu/nvgpu/gk20a/gk20a.h b/drivers/gpu/nvgpu/gk20a/gk20a.h index 06db2b7f..9b28e0c6 100644 --- a/drivers/gpu/nvgpu/gk20a/gk20a.h +++ b/drivers/gpu/nvgpu/gk20a/gk20a.h | |||
@@ -772,9 +772,6 @@ struct gpu_ops { | |||
772 | void *lsfm, u32 *p_bl_gen_desc_size); | 772 | void *lsfm, u32 *p_bl_gen_desc_size); |
773 | int (*flcn_populate_bl_dmem_desc)(struct gk20a *g, | 773 | int (*flcn_populate_bl_dmem_desc)(struct gk20a *g, |
774 | void *lsfm, u32 *p_bl_gen_desc_size, u32 falconid); | 774 | void *lsfm, u32 *p_bl_gen_desc_size, u32 falconid); |
775 | int (*mclk_init)(struct gk20a *g); | ||
776 | void (*mclk_deinit)(struct gk20a *g); | ||
777 | int (*mclk_change)(struct gk20a *g, u16 val); | ||
778 | void (*handle_ext_irq)(struct gk20a *g, u32 intr); | 775 | void (*handle_ext_irq)(struct gk20a *g, u32 intr); |
779 | void (*set_irqmask)(struct gk20a *g); | 776 | void (*set_irqmask)(struct gk20a *g); |
780 | u32 lspmuwprinitdone; | 777 | u32 lspmuwprinitdone; |
@@ -802,6 +799,9 @@ struct gpu_ops { | |||
802 | int (*pll_reg_write)(struct gk20a *g, u32 reg, u32 val); | 799 | int (*pll_reg_write)(struct gk20a *g, u32 reg, u32 val); |
803 | int (*get_pll_debug_data)(struct gk20a *g, | 800 | int (*get_pll_debug_data)(struct gk20a *g, |
804 | struct nvgpu_clk_pll_debug_data *d); | 801 | struct nvgpu_clk_pll_debug_data *d); |
802 | int (*mclk_init)(struct gk20a *g); | ||
803 | void (*mclk_deinit)(struct gk20a *g); | ||
804 | int (*mclk_change)(struct gk20a *g, u16 val); | ||
805 | } clk; | 805 | } clk; |
806 | struct { | 806 | struct { |
807 | u32 (*get_arbiter_clk_domains)(struct gk20a *g); | 807 | u32 (*get_arbiter_clk_domains)(struct gk20a *g); |
diff --git a/drivers/gpu/nvgpu/gp106/clk_gp106.c b/drivers/gpu/nvgpu/gp106/clk_gp106.c index 4d865664..08639e0b 100644 --- a/drivers/gpu/nvgpu/gp106/clk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/clk_gp106.c | |||
@@ -30,6 +30,8 @@ | |||
30 | #include "clk_gp106.h" | 30 | #include "clk_gp106.h" |
31 | #include "clk/clk_arb.h" | 31 | #include "clk/clk_arb.h" |
32 | 32 | ||
33 | #include "gp106/pmu_mclk_gp106.h" | ||
34 | |||
33 | #include <nvgpu/hw/gp106/hw_trim_gp106.h> | 35 | #include <nvgpu/hw/gp106/hw_trim_gp106.h> |
34 | 36 | ||
35 | #define gk20a_dbg_clk(fmt, arg...) \ | 37 | #define gk20a_dbg_clk(fmt, arg...) \ |
@@ -281,4 +283,7 @@ void gp106_init_clk_ops(struct gpu_ops *gops) { | |||
281 | gops->clk.get_crystal_clk_hz = gp106_crystal_clk_hz; | 283 | gops->clk.get_crystal_clk_hz = gp106_crystal_clk_hz; |
282 | gops->clk.measure_freq = gp106_clk_measure_freq; | 284 | gops->clk.measure_freq = gp106_clk_measure_freq; |
283 | gops->clk.suspend_clk_support = gp106_suspend_clk_support; | 285 | gops->clk.suspend_clk_support = gp106_suspend_clk_support; |
286 | gops->clk.mclk_init = gp106_mclk_init; | ||
287 | gops->clk.mclk_change = gp106_mclk_change; | ||
288 | gops->clk.mclk_deinit = gp106_mclk_deinit; | ||
284 | } | 289 | } |
diff --git a/drivers/gpu/nvgpu/gp106/pmu_gp106.c b/drivers/gpu/nvgpu/gp106/pmu_gp106.c index 632023ba..eec89695 100644 --- a/drivers/gpu/nvgpu/gp106/pmu_gp106.c +++ b/drivers/gpu/nvgpu/gp106/pmu_gp106.c | |||
@@ -20,7 +20,6 @@ | |||
20 | #include "gm20b/pmu_gm20b.h" | 20 | #include "gm20b/pmu_gm20b.h" |
21 | #include "gp10b/pmu_gp10b.h" | 21 | #include "gp10b/pmu_gp10b.h" |
22 | #include "gp106/pmu_gp106.h" | 22 | #include "gp106/pmu_gp106.h" |
23 | #include "gp106/pmu_mclk_gp106.h" | ||
24 | #include "gp106/acr_gp106.h" | 23 | #include "gp106/acr_gp106.h" |
25 | 24 | ||
26 | #include "clk/clk_mclk.h" | 25 | #include "clk/clk_mclk.h" |
@@ -331,9 +330,6 @@ void gp106_init_pmu_ops(struct gpu_ops *gops) | |||
331 | gops->pmu.pmu_lpwr_disable_pg = nvgpu_lpwr_disable_pg; | 330 | gops->pmu.pmu_lpwr_disable_pg = nvgpu_lpwr_disable_pg; |
332 | gops->pmu.pmu_pg_param_post_init = nvgpu_lpwr_post_init; | 331 | gops->pmu.pmu_pg_param_post_init = nvgpu_lpwr_post_init; |
333 | gops->pmu.dump_secure_fuses = NULL; | 332 | gops->pmu.dump_secure_fuses = NULL; |
334 | gops->pmu.mclk_init = gp106_mclk_init; | ||
335 | gops->pmu.mclk_change = gp106_mclk_change; | ||
336 | gops->pmu.mclk_deinit = gp106_mclk_deinit; | ||
337 | gops->pmu.is_pmu_supported = gp106_is_pmu_supported; | 333 | gops->pmu.is_pmu_supported = gp106_is_pmu_supported; |
338 | gops->pmu.reset_engine = gp106_pmu_engine_reset; | 334 | gops->pmu.reset_engine = gp106_pmu_engine_reset; |
339 | gops->pmu.is_engine_in_reset = gp106_pmu_is_engine_in_reset; | 335 | gops->pmu.is_engine_in_reset = gp106_pmu_is_engine_in_reset; |
diff --git a/drivers/gpu/nvgpu/gp106/pmu_mclk_gp106.c b/drivers/gpu/nvgpu/gp106/pmu_mclk_gp106.c index b8dd3eac..c0e4269f 100644 --- a/drivers/gpu/nvgpu/gp106/pmu_mclk_gp106.c +++ b/drivers/gpu/nvgpu/gp106/pmu_mclk_gp106.c | |||
@@ -3276,7 +3276,6 @@ int gp106_mclk_init(struct gk20a *g) | |||
3276 | mclk->debugfs_set = true; | 3276 | mclk->debugfs_set = true; |
3277 | } | 3277 | } |
3278 | #endif | 3278 | #endif |
3279 | g->ops.pmu.mclk_change = gp106_mclk_change; | ||
3280 | 3279 | ||
3281 | mclk->init = true; | 3280 | mclk->init = true; |
3282 | 3281 | ||
@@ -3437,8 +3436,8 @@ static int mclk_debug_speed_set(void *data, u64 val) | |||
3437 | /* This is problematic because it can interrupt the arbiter | 3436 | /* This is problematic because it can interrupt the arbiter |
3438 | * and send it to sleep. we need to consider removing this | 3437 | * and send it to sleep. we need to consider removing this |
3439 | */ | 3438 | */ |
3440 | if (g->ops.pmu.mclk_change) | 3439 | if (g->ops.clk.mclk_change) |
3441 | return g->ops.pmu.mclk_change(g, (u16) val); | 3440 | return g->ops.clk.mclk_change(g, (u16) val); |
3442 | return 0; | 3441 | return 0; |
3443 | 3442 | ||
3444 | } | 3443 | } |