summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/gpu/nvgpu/clk')
-rw-r--r--drivers/gpu/nvgpu/clk/clk.c37
-rw-r--r--drivers/gpu/nvgpu/clk/clk.h1
2 files changed, 38 insertions, 0 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk.c b/drivers/gpu/nvgpu/clk/clk.c
index f0624595..8532a08b 100644
--- a/drivers/gpu/nvgpu/clk/clk.c
+++ b/drivers/gpu/nvgpu/clk/clk.c
@@ -866,6 +866,43 @@ u32 nvgpu_clk_set_boot_fll_clk_gv10x(struct gk20a *g)
866 return status; 866 return status;
867} 867}
868 868
869int nvgpu_clk_set_fll_clk_gv10x(struct gk20a *g)
870{
871 int status;
872 struct change_fll_clk bootfllclk;
873 u16 gpcclk_clkmhz = BOOT_GPCCLK_MHZ;
874 u32 gpcclk_voltuv = 0U;
875 u32 voltuv = 0U;
876
877 status = clk_vf_point_cache(g);
878 if (status != 0) {
879 nvgpu_err(g, "caching failed");
880 return status;
881 }
882
883 status = clk_domain_get_f_or_v(g, CTRL_CLK_DOMAIN_GPCCLK,
884 &gpcclk_clkmhz, &gpcclk_voltuv, CTRL_VOLT_DOMAIN_LOGIC);
885 if (status != 0) {
886 return status;
887 }
888
889 voltuv = gpcclk_voltuv;
890
891 status = volt_set_voltage(g, voltuv, 0U);
892 if (status != 0) {
893 nvgpu_err(g, "attempt to set max voltage failed %d", voltuv);
894 }
895
896 bootfllclk.api_clk_domain = CTRL_CLK_DOMAIN_GPCCLK;
897 bootfllclk.clkmhz = gpcclk_clkmhz;
898 bootfllclk.voltuv = voltuv;
899 status = clk_program_fllclks(g, &bootfllclk);
900 if (status != 0) {
901 nvgpu_err(g, "attempt to set max gpcclk failed");
902 }
903 return status;
904}
905
869u32 clk_domain_get_f_or_v( 906u32 clk_domain_get_f_or_v(
870 struct gk20a *g, 907 struct gk20a *g,
871 u32 clkapidomain, 908 u32 clkapidomain,
diff --git a/drivers/gpu/nvgpu/clk/clk.h b/drivers/gpu/nvgpu/clk/clk.h
index 5a6aeae3..3f4bdf73 100644
--- a/drivers/gpu/nvgpu/clk/clk.h
+++ b/drivers/gpu/nvgpu/clk/clk.h
@@ -138,6 +138,7 @@ u32 nvgpu_clk_vf_change_inject_data_fill_gp10x(struct gk20a *g,
138 struct nv_pmu_clk_rpc *rpccall, 138 struct nv_pmu_clk_rpc *rpccall,
139 struct set_fll_clk *setfllclk); 139 struct set_fll_clk *setfllclk);
140u32 nvgpu_clk_set_boot_fll_clk_gv10x(struct gk20a *g); 140u32 nvgpu_clk_set_boot_fll_clk_gv10x(struct gk20a *g);
141int nvgpu_clk_set_fll_clk_gv10x(struct gk20a *g);
141int clk_pmu_freq_effective_avg_load(struct gk20a *g, bool bload); 142int clk_pmu_freq_effective_avg_load(struct gk20a *g, bool bload);
142u32 clk_freq_effective_avg(struct gk20a *g, u32 clkDomainMask); 143u32 clk_freq_effective_avg(struct gk20a *g, u32 clkDomainMask);
143#endif /* NVGPU_CLK_H */ 144#endif /* NVGPU_CLK_H */