From 432017248e432df0619dc2df30f915a52634338f Mon Sep 17 00:00:00 2001 From: Vijayakumar Subbu Date: Sat, 30 Jul 2016 10:44:30 -0700 Subject: gpu: nvgpu: Add dGPU clocks support JIRA DNVGPU-42 Change-Id: Ic2fca9d0cf82f2823654ac5e8f0772a1eec7b3b5 Signed-off-by: Vijayakumar Subbu Signed-off-by: Terje Bergstrom Reviewed-on: http://git-master/r/1205850 (cherry picked from commit b9f5c6bc4e649162d63e33d65b725872340ca114) Reviewed-on: http://git-master/r/1227257 GVS: Gerrit_Virtual_Submit --- drivers/gpu/nvgpu/pstate/pstate.c | 101 ++++++++++++++++++++++++++++++++++++++ drivers/gpu/nvgpu/pstate/pstate.h | 19 +++++++ 2 files changed, 120 insertions(+) create mode 100644 drivers/gpu/nvgpu/pstate/pstate.c create mode 100644 drivers/gpu/nvgpu/pstate/pstate.h (limited to 'drivers/gpu/nvgpu/pstate') diff --git a/drivers/gpu/nvgpu/pstate/pstate.c b/drivers/gpu/nvgpu/pstate/pstate.c new file mode 100644 index 00000000..83f17937 --- /dev/null +++ b/drivers/gpu/nvgpu/pstate/pstate.c @@ -0,0 +1,101 @@ +/* + * general p state infrastructure + * + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "gk20a/gk20a.h" +#include "clk/clk.h" +#include "perf/perf.h" + +/*sw setup for pstate components*/ +int gk20a_init_pstate_support(struct gk20a *g) +{ + u32 err; + + gk20a_dbg_fn(""); + + err = clk_vin_sw_setup(g); + if (err) + return err; + + err = clk_fll_sw_setup(g); + if (err) + return err; + + err = vfe_var_sw_setup(g); + if (err) + return err; + + err = vfe_equ_sw_setup(g); + if (err) + return err; + + err = clk_domain_sw_setup(g); + if (err) + return err; + + err = clk_vf_point_sw_setup(g); + if (err) + return err; + + err = clk_prog_sw_setup(g); + return err; +} + +/*sw setup for pstate components*/ +int gk20a_init_pstate_pmu_support(struct gk20a *g) +{ + u32 err; + + gk20a_dbg_fn(""); + + err = vfe_var_pmu_setup(g); + if (err) + return err; + + err = vfe_equ_pmu_setup(g); + if (err) + return err; + + err = clk_domain_pmu_setup(g); + if (err) + return err; + + err = clk_prog_pmu_setup(g); + if (err) + return err; + + err = clk_vin_pmu_setup(g); + if (err) + return err; + + err = clk_fll_pmu_setup(g); + if (err) + return err; + + err = clk_vf_point_pmu_setup(g); + if (err) + return err; + + err = clk_pmu_vin_load(g); + if (err) + return err; + + err = perf_pmu_vfe_load(g); + if (err) + return err; + + err = clk_pmu_vf_inject(g); + return err; +} + diff --git a/drivers/gpu/nvgpu/pstate/pstate.h b/drivers/gpu/nvgpu/pstate/pstate.h new file mode 100644 index 00000000..fb49adf3 --- /dev/null +++ b/drivers/gpu/nvgpu/pstate/pstate.h @@ -0,0 +1,19 @@ +/* + * general p state infrastructure + * + * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. + * + * This program is free software; you can redistribute it and/or modify it + * under the terms and conditions of the GNU General Public License, + * version 2, as published by the Free Software Foundation. + * + * This program is distributed in the hope it will be useful, but WITHOUT + * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or + * FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for + * more details. + */ + +#include "gk20a/gk20a.h" + +int gk20a_init_pstate_support(struct gk20a *g); +int gk20a_init_pstate_pmu_support(struct gk20a *g); -- cgit v1.2.2