diff --git a/drivers/gpu/nvgpu/clk/clk.c b/drivers/gpu/nvgpu/clk/clk.c index 615100066..6705a4d85 100644 --- a/drivers/gpu/nvgpu/clk/clk.c +++ b/drivers/gpu/nvgpu/clk/clk.c @@ -29,6 +29,7 @@ #include #include #include +#include #include "clk.h" #include diff --git a/drivers/gpu/nvgpu/clk/clk.h b/drivers/gpu/nvgpu/clk/clk.h index cb89aed13..df0d5429c 100644 --- a/drivers/gpu/nvgpu/clk/clk.h +++ b/drivers/gpu/nvgpu/clk/clk.h @@ -21,8 +21,10 @@ * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER * DEALINGS IN THE SOFTWARE. */ -#ifndef NVGPU_CLK_H -#define NVGPU_CLK_H +#ifndef NVGPU_CLK_CLK_H +#define NVGPU_CLK_CLK_H + +#include #include "clk_vin.h" #include "clk_fll.h" @@ -42,18 +44,6 @@ struct gk20a; int clk_set_boot_fll_clk(struct gk20a *g); -/* clock related defines for GPUs supporting clock control from pmu*/ -struct clk_pmupstate { - struct avfsvinobjs avfs_vinobjs; - struct avfsfllobjs avfs_fllobjs; - struct clk_domains clk_domainobjs; - struct clk_progs clk_progobjs; - struct clk_vf_points clk_vf_pointobjs; - struct clk_mclk_state clk_mclk; - struct clk_freq_controllers clk_freq_controllers; - struct nvgpu_clk_freq_domain_grp freq_domain_grp_objs; -}; - struct clockentry { u8 vbios_clk_domain; u8 clk_which; @@ -67,25 +57,6 @@ struct change_fll_clk { u32 voltuv; }; -struct set_fll_clk { - u32 voltuv; - u16 gpc2clkmhz; - u8 current_regime_id_gpc; - u8 target_regime_id_gpc; - u16 sys2clkmhz; - u8 current_regime_id_sys; - u8 target_regime_id_sys; - u16 xbar2clkmhz; - u8 current_regime_id_xbar; - u8 target_regime_id_xbar; - u16 nvdclkmhz; - u8 current_regime_id_nvd; - u8 target_regime_id_nvd; - u16 hostclkmhz; - u8 current_regime_id_host; - u8 target_regime_id_host; -}; - #define NV_PERF_HEADER_4X_CLOCKS_DOMAINS_MAX_NUMCLKS 9U struct vbios_clock_domain { @@ -125,10 +96,8 @@ struct vbios_clocks_table_1x_hal_clock_entry { #define PERF_CLK_PCIEGENCLK 12U #define PERF_CLK_NUM 13U -int clk_init_pmupstate(struct gk20a *g); -void clk_free_pmupstate(struct gk20a *g); -int clk_pmu_vin_load(struct gk20a *g); -int clk_pmu_clk_domains_load(struct gk20a *g); +struct set_fll_clk; + int clk_domain_print_vf_table(struct gk20a *g, u32 clkapidomain); int clk_domain_get_f_or_v(struct gk20a *g, u32 clkapidomain, u16 *pclkmhz, u32 *pvoltuv, u8 railidx); @@ -139,15 +108,6 @@ int clk_domain_volt_to_freq( struct gk20a *g, u8 clkdomain_idx, int clk_get_fll_clks(struct gk20a *g, struct set_fll_clk *setfllclk); int clk_set_fll_clks(struct gk20a *g, struct set_fll_clk *setfllclk); int clk_pmu_freq_controller_load(struct gk20a *g, bool bload, u8 bit_idx); -u32 nvgpu_clk_vf_change_inject_data_fill_gv10x(struct gk20a *g, - struct nv_pmu_clk_rpc *rpccall, - struct set_fll_clk *setfllclk); -u32 nvgpu_clk_vf_change_inject_data_fill_gp10x(struct gk20a *g, - struct nv_pmu_clk_rpc *rpccall, - struct set_fll_clk *setfllclk); -int nvgpu_clk_set_boot_fll_clk_gv10x(struct gk20a *g); -int nvgpu_clk_set_fll_clk_gv10x(struct gk20a *g); int clk_pmu_freq_effective_avg_load(struct gk20a *g, bool bload); int clk_freq_effective_avg(struct gk20a *g, u32 *freqkHz, u32 clkDomainMask); -int nvgpu_clk_set_boot_fll_clk_tu10x(struct gk20a *g); -#endif /* NVGPU_CLK_H */ +#endif /* NVGPU_CLK_CLK_H */ diff --git a/drivers/gpu/nvgpu/clk/clk_arb.c b/drivers/gpu/nvgpu/clk/clk_arb.c index 6a86ba714..b0f9cbd9e 100644 --- a/drivers/gpu/nvgpu/clk/clk_arb.c +++ b/drivers/gpu/nvgpu/clk/clk_arb.c @@ -36,8 +36,10 @@ #include #include #include +#include -#include "clk/clk.h" +#include "clk.h" +#include "clk_vf_point.h" int nvgpu_clk_notification_queue_alloc(struct gk20a *g, struct nvgpu_clk_notification_queue *queue, diff --git a/drivers/gpu/nvgpu/clk/clk_domain.h b/drivers/gpu/nvgpu/clk/clk_domain.h index 804a8c0ee..a0beaea8f 100644 --- a/drivers/gpu/nvgpu/clk/clk_domain.h +++ b/drivers/gpu/nvgpu/clk/clk_domain.h @@ -28,6 +28,7 @@ #include #include #include +#include #define CLK_DOMAIN_BOARDOBJGRP_VERSION 0x30 #define CLK_DOMAIN_BOARDOBJGRP_VERSION_35 0x35 @@ -38,58 +39,10 @@ struct clk_domains; struct clk_domain; -/*data and function definition to talk to driver*/ -int clk_domain_sw_setup(struct gk20a *g); -int clk_domain_pmu_setup(struct gk20a *g); - -typedef int clkproglink(struct gk20a *g, struct clk_pmupstate *pclk, - struct clk_domain *pdomain); - -typedef int clkvfsearch(struct gk20a *g, struct clk_pmupstate *pclk, - struct clk_domain *pdomain, u16 *clkmhz, - u32 *voltuv, u8 rail); - typedef int clkgetslaveclk(struct gk20a *g, struct clk_pmupstate *pclk, struct clk_domain *pdomain, u16 *clkmhz, u16 masterclkmhz); -typedef int clkgetfpoints(struct gk20a *g, struct clk_pmupstate *pclk, - struct clk_domain *pdomain, u32 *pfpointscount, - u16 *pfreqpointsinmhz, u8 rail); - -struct clk_domains { - struct boardobjgrp_e32 super; - u8 n_num_entries; - u8 version; - bool b_enforce_vf_monotonicity; - bool b_enforce_vf_smoothening; - bool b_override_o_v_o_c; - bool b_debug_mode; - u32 vbios_domains; - u16 cntr_sampling_periodms; - struct boardobjgrpmask_e32 prog_domains_mask; - struct boardobjgrpmask_e32 master_domains_mask; - struct ctrl_clk_clk_delta deltas; - - struct clk_domain *ordered_noise_aware_list[CTRL_BOARDOBJ_MAX_BOARD_OBJECTS]; - - struct clk_domain *ordered_noise_unaware_list[CTRL_BOARDOBJ_MAX_BOARD_OBJECTS]; -}; - -struct clk_domain { - struct boardobj super; - u32 api_domain; - u32 part_mask; - u32 domain; - u8 perf_domain_index; - u8 perf_domain_grp_idx; - u8 ratio_domain; - u8 usage; - clkproglink *clkdomainclkproglink; - clkvfsearch *clkdomainclkvfsearch; - clkgetfpoints *clkdomainclkgetfpoints; -}; - struct clk_domain_3x { struct clk_domain super; bool b_noise_aware_capable; diff --git a/drivers/gpu/nvgpu/clk/clk_fll.h b/drivers/gpu/nvgpu/clk/clk_fll.h index f3412d6df..19559e45d 100644 --- a/drivers/gpu/nvgpu/clk/clk_fll.h +++ b/drivers/gpu/nvgpu/clk/clk_fll.h @@ -27,20 +27,8 @@ #include #include -/*data and function definition to talk to driver*/ -int clk_fll_sw_setup(struct gk20a *g); -int clk_fll_pmu_setup(struct gk20a *g); - -struct avfsfllobjs { - struct boardobjgrp_e32 super; - struct boardobjgrpmask_e32 lut_prog_master_mask; - u32 lut_step_size_uv; - u32 lut_min_voltage_uv; - u8 lut_num_entries; - u16 max_min_freq_mhz; -}; - struct fll_device; +struct avfsfllobjs; typedef u32 fll_lut_broadcast_slave_register(struct gk20a *g, struct avfsfllobjs *pfllobjs, @@ -67,9 +55,6 @@ struct fll_device { fll_lut_broadcast_slave_register *lut_broadcast_slave_register; }; -u32 nvgpu_clk_get_vbios_clk_domain_gv10x( u32 vbios_domain); -u32 nvgpu_clk_get_vbios_clk_domain_gp10x( u32 vbios_domain); - #define CLK_FLL_LUT_VF_NUM_ENTRIES(pclk) \ ((pclk)->avfs_fllobjs.lut_num_entries) diff --git a/drivers/gpu/nvgpu/clk/clk_freq_controller.h b/drivers/gpu/nvgpu/clk/clk_freq_controller.h index ddd9bc5fa..1ad538a8b 100644 --- a/drivers/gpu/nvgpu/clk/clk_freq_controller.h +++ b/drivers/gpu/nvgpu/clk/clk_freq_controller.h @@ -70,15 +70,4 @@ struct clk_freq_controller_pi { bool bpoison; }; -struct clk_freq_controllers { - struct boardobjgrp_e32 super; - u32 sampling_period_ms; - struct boardobjgrpmask_e32 freq_ctrl_load_mask; - u8 volt_policy_idx; - void *pprereq_load; -}; - -int clk_freq_controller_sw_setup(struct gk20a *g); -int clk_freq_controller_pmu_setup(struct gk20a *g); - #endif /* NVGPU_CLK_FREQ_CONTROLLER_H */ diff --git a/drivers/gpu/nvgpu/clk/clk_freq_domain.h b/drivers/gpu/nvgpu/clk/clk_freq_domain.h index c67697641..cc8bfd6fb 100644 --- a/drivers/gpu/nvgpu/clk/clk_freq_domain.h +++ b/drivers/gpu/nvgpu/clk/clk_freq_domain.h @@ -33,12 +33,4 @@ struct nvgpu_clk_freq_domain { u32 clk_domain; }; -struct nvgpu_clk_freq_domain_grp { - struct boardobjgrp_e32 super; - u32 init_flags; -}; - -int nvgpu_clk_freq_domain_sw_setup(struct gk20a *g); -int nvgpu_clk_freq_domain_pmu_setup(struct gk20a *g); - #endif /* NVGPU_CLK_FREQ_DOMAIN_H */ diff --git a/drivers/gpu/nvgpu/clk/clk_mclk.h b/drivers/gpu/nvgpu/clk/clk_mclk.h index 47c81d111..90992c9ed 100644 --- a/drivers/gpu/nvgpu/clk/clk_mclk.h +++ b/drivers/gpu/nvgpu/clk/clk_mclk.h @@ -36,25 +36,4 @@ enum gk20a_mclk_speed { gk20a_mclk_high_speed, }; -struct clk_mclk_state { - u32 speed; - struct nvgpu_mutex mclk_lock; - struct nvgpu_mutex data_lock; - - u16 p5_min; - u16 p0_min; - - void *vreg_buf; - bool init; - -#ifdef CONFIG_DEBUG_FS - s64 switch_max; - s64 switch_min; - u64 switch_num; - s64 switch_avg; - s64 switch_std; - bool debugfs_set; -#endif -}; - #endif /* NVGPU_CLK_MCLK_H */ diff --git a/drivers/gpu/nvgpu/clk/clk_prog.h b/drivers/gpu/nvgpu/clk/clk_prog.h index 3248e69d3..c6241f4d2 100644 --- a/drivers/gpu/nvgpu/clk/clk_prog.h +++ b/drivers/gpu/nvgpu/clk/clk_prog.h @@ -30,8 +30,6 @@ #include #include -int clk_prog_sw_setup(struct gk20a *g); -int clk_prog_pmu_setup(struct gk20a *g); struct clk_prog_1x_master; typedef int vf_flatten(struct gk20a *g, struct clk_pmupstate *pclk, @@ -54,13 +52,6 @@ typedef int get_fpoints(struct gk20a *g, struct clk_pmupstate *pclk, u16 **ppfreqpointsinmhz, u8 rail); -struct clk_progs { - struct boardobjgrp_e255 super; - u8 slave_entry_count; - u8 vf_entry_count; - u8 vf_sec_entry_count; -}; - struct clk_prog { struct boardobj super; }; diff --git a/drivers/gpu/nvgpu/clk/clk_vf_point.h b/drivers/gpu/nvgpu/clk/clk_vf_point.h index 4c02f6723..1ba9637fb 100644 --- a/drivers/gpu/nvgpu/clk/clk_vf_point.h +++ b/drivers/gpu/nvgpu/clk/clk_vf_point.h @@ -26,12 +26,11 @@ #include #include #include +#include #include #define VMIN_PAD_UV 50000U -int clk_vf_point_sw_setup(struct gk20a *g); -int clk_vf_point_pmu_setup(struct gk20a *g); int clk_vf_point_cache(struct gk20a *g); struct nvgpu_clk_arb; struct nvgpu_clk_slave_freq{ @@ -45,10 +44,6 @@ struct nvgpu_clk_slave_freq{ int nvgpu_clk_set_req_fll_clk_ps35(struct gk20a *g, struct nvgpu_clk_slave_freq *vf_point); int nvgpu_clk_arb_find_slave_points(struct nvgpu_clk_arb *arb,struct nvgpu_clk_slave_freq *vf_point); -struct clk_vf_points { - struct boardobjgrp_e255 super; -}; - struct clk_vf_point { struct boardobj super; u8 vfe_equ_idx; diff --git a/drivers/gpu/nvgpu/clk/clk_vin.h b/drivers/gpu/nvgpu/clk/clk_vin.h index dcbb34b67..430976ac5 100644 --- a/drivers/gpu/nvgpu/clk/clk_vin.h +++ b/drivers/gpu/nvgpu/clk/clk_vin.h @@ -30,12 +30,6 @@ struct vin_device; struct clk_pmupstate; -struct avfsvinobjs { - struct boardobjgrp_e32 super; - u8 calibration_rev_vbios; - u8 calibration_rev_fused; - bool vin_is_disable_allowed; -}; typedef u32 vin_device_state_load(struct gk20a *g, struct clk_pmupstate *clk, struct vin_device *pdev); @@ -69,13 +63,6 @@ int construct_vindevice(struct gk20a *g, struct boardobj **ppboardobj, int vindeviceinit_pmudata_super(struct gk20a *g, struct boardobj *pboardobj, struct nv_pmu_boardobj *pmudata); -int clk_vin_sw_setup(struct gk20a *g); -int clk_vin_pmu_setup(struct gk20a *g); -int clk_avfs_get_vin_cal_fuse_v10(struct gk20a *g, - struct avfsvinobjs *pvinobjs, - struct vin_device_v20 *pvindev); -int clk_avfs_get_vin_cal_fuse_v20(struct gk20a *g, - struct avfsvinobjs *pvinobjs, - struct vin_device_v20 *pvindev); +struct avfsvinobjs; #endif /* NVGPU_CLK_VIN_H */ diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c index 1d2cf8b9c..8797c9fb6 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_fw.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_fw.c @@ -32,10 +32,7 @@ #include #include #include - -#include "clk/clk.h" -#include "clk/clk_vin.h" -#include "clk/clk_fll.h" +#include /* PMU NS UCODE IMG */ #define NVGPU_PMU_NS_UCODE_IMAGE "gpmu_ucode.bin" diff --git a/drivers/gpu/nvgpu/common/pmu/pmu_gp106.c b/drivers/gpu/nvgpu/common/pmu/pmu_gp106.c index 6d1f348ee..3383e652b 100644 --- a/drivers/gpu/nvgpu/common/pmu/pmu_gp106.c +++ b/drivers/gpu/nvgpu/common/pmu/pmu_gp106.c @@ -34,8 +34,6 @@ #include "pmu_gp106.h" #include "acr_gp106.h" -#include "clk/clk_mclk.h" - #include #include diff --git a/drivers/gpu/nvgpu/gv100/clk_arb_gv100.c b/drivers/gpu/nvgpu/gv100/clk_arb_gv100.c index d834160a3..a7d8c9799 100644 --- a/drivers/gpu/nvgpu/gv100/clk_arb_gv100.c +++ b/drivers/gpu/nvgpu/gv100/clk_arb_gv100.c @@ -22,7 +22,10 @@ #include #include +#include + #include "clk_arb_gv100.h" +#include "clk/clk.h" u32 gv100_get_arbiter_clk_domains(struct gk20a *g) { diff --git a/drivers/gpu/nvgpu/gv100/clk_gv100.c b/drivers/gpu/nvgpu/gv100/clk_gv100.c index cdf59c4f9..ab900c847 100644 --- a/drivers/gpu/nvgpu/gv100/clk_gv100.c +++ b/drivers/gpu/nvgpu/gv100/clk_gv100.c @@ -34,6 +34,7 @@ #include #include #include +#include #include "clk_gv100.h" diff --git a/drivers/gpu/nvgpu/include/nvgpu/boardobjgrpmask.h b/drivers/gpu/nvgpu/include/nvgpu/boardobjgrpmask.h index 879dd42b6..cfb424903 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/boardobjgrpmask.h +++ b/drivers/gpu/nvgpu/include/nvgpu/boardobjgrpmask.h @@ -24,6 +24,7 @@ #define NVGPU_BOARDOBJGRPMASK_H #include +#include struct ctrl_boardobjgrp_mask; diff --git a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h index 0bfb44d17..a11317f98 100644 --- a/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h +++ b/drivers/gpu/nvgpu/include/nvgpu/clk_arb.h @@ -39,8 +39,6 @@ struct gk20a; #include #include -#include "clk/clk.h" - #define MAX_F_POINTS 256 #define DEFAULT_EVENT_NUMBER 32 diff --git a/drivers/gpu/nvgpu/include/nvgpu/pmu/clk.h b/drivers/gpu/nvgpu/include/nvgpu/pmu/clk.h new file mode 100644 index 000000000..bbf549db3 --- /dev/null +++ b/drivers/gpu/nvgpu/include/nvgpu/pmu/clk.h @@ -0,0 +1,215 @@ +/* + * general clock structures & definitions + * + * Copyright (c) 2016-2019, 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"), + * to deal in the Software without restriction, including without limitation + * the rights to use, copy, modify, merge, publish, distribute, sublicense, + * and/or sell copies of the Software, and to permit persons to whom the + * Software is furnished to do so, subject to the following conditions: + * + * The above copyright notice and this permission notice shall be included in + * all copies or substantial portions of the Software. + * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR + * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, + * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL + * THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER + * LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING + * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER + * DEALINGS IN THE SOFTWARE. + */ +#ifndef NVGPU_PMU_CLK_H +#define NVGPU_PMU_CLK_H + +#include +#include +#include +#include +#include + +struct clk_domain; +struct gk20a; + +/* clock related defines for GPUs supporting clock control from pmu*/ +struct avfsvinobjs { + struct boardobjgrp_e32 super; + u8 calibration_rev_vbios; + u8 calibration_rev_fused; + bool vin_is_disable_allowed; +}; + +struct avfsfllobjs { + struct boardobjgrp_e32 super; + struct boardobjgrpmask_e32 lut_prog_master_mask; + u32 lut_step_size_uv; + u32 lut_min_voltage_uv; + u8 lut_num_entries; + u16 max_min_freq_mhz; +}; + +typedef int clkproglink(struct gk20a *g, struct clk_pmupstate *pclk, + struct clk_domain *pdomain); + +typedef int clkvfsearch(struct gk20a *g, struct clk_pmupstate *pclk, + struct clk_domain *pdomain, u16 *clkmhz, + u32 *voltuv, u8 rail); + +typedef int clkgetfpoints(struct gk20a *g, struct clk_pmupstate *pclk, + struct clk_domain *pdomain, u32 *pfpointscount, + u16 *pfreqpointsinmhz, u8 rail); + +struct clk_domain { + struct boardobj super; + u32 api_domain; + u32 part_mask; + u32 domain; + u8 perf_domain_index; + u8 perf_domain_grp_idx; + u8 ratio_domain; + u8 usage; + clkproglink *clkdomainclkproglink; + clkvfsearch *clkdomainclkvfsearch; + clkgetfpoints *clkdomainclkgetfpoints; +}; + +struct clk_domains { + struct boardobjgrp_e32 super; + u8 n_num_entries; + u8 version; + bool b_enforce_vf_monotonicity; + bool b_enforce_vf_smoothening; + bool b_override_o_v_o_c; + bool b_debug_mode; + u32 vbios_domains; + u16 cntr_sampling_periodms; + struct boardobjgrpmask_e32 prog_domains_mask; + struct boardobjgrpmask_e32 master_domains_mask; + struct ctrl_clk_clk_delta deltas; + + struct clk_domain *ordered_noise_aware_list[CTRL_BOARDOBJ_MAX_BOARD_OBJECTS]; + + struct clk_domain *ordered_noise_unaware_list[CTRL_BOARDOBJ_MAX_BOARD_OBJECTS]; +}; + +struct clk_progs { + struct boardobjgrp_e255 super; + u8 slave_entry_count; + u8 vf_entry_count; + u8 vf_sec_entry_count; +}; + +struct clk_vf_points { + struct boardobjgrp_e255 super; +}; + +struct clk_mclk_state { + u32 speed; + struct nvgpu_mutex mclk_lock; + struct nvgpu_mutex data_lock; + + u16 p5_min; + u16 p0_min; + + void *vreg_buf; + bool init; + + s64 switch_max; + s64 switch_min; + u64 switch_num; + s64 switch_avg; + s64 switch_std; + bool debugfs_set; +}; + +struct clk_freq_controllers { + struct boardobjgrp_e32 super; + u32 sampling_period_ms; + struct boardobjgrpmask_e32 freq_ctrl_load_mask; + u8 volt_policy_idx; + void *pprereq_load; +}; + +struct nvgpu_clk_freq_domain_grp { + struct boardobjgrp_e32 super; + u32 init_flags; +}; + +struct clk_pmupstate { + struct avfsvinobjs avfs_vinobjs; + struct avfsfllobjs avfs_fllobjs; + struct clk_domains clk_domainobjs; + struct clk_progs clk_progobjs; + struct clk_vf_points clk_vf_pointobjs; + struct clk_mclk_state clk_mclk; + struct clk_freq_controllers clk_freq_controllers; + struct nvgpu_clk_freq_domain_grp freq_domain_grp_objs; +}; + +struct set_fll_clk { + u32 voltuv; + u16 gpc2clkmhz; + u8 current_regime_id_gpc; + u8 target_regime_id_gpc; + u16 sys2clkmhz; + u8 current_regime_id_sys; + u8 target_regime_id_sys; + u16 xbar2clkmhz; + u8 current_regime_id_xbar; + u8 target_regime_id_xbar; + u16 nvdclkmhz; + u8 current_regime_id_nvd; + u8 target_regime_id_nvd; + u16 hostclkmhz; + u8 current_regime_id_host; + u8 target_regime_id_host; +}; + +int clk_init_pmupstate(struct gk20a *g); +void clk_free_pmupstate(struct gk20a *g); +int nvgpu_clk_set_fll_clk_gv10x(struct gk20a *g); +int clk_pmu_vin_load(struct gk20a *g); +int clk_pmu_clk_domains_load(struct gk20a *g); +u32 nvgpu_clk_vf_change_inject_data_fill_gv10x(struct gk20a *g, + struct nv_pmu_clk_rpc *rpccall, + struct set_fll_clk *setfllclk); +u32 nvgpu_clk_vf_change_inject_data_fill_gp10x(struct gk20a *g, + struct nv_pmu_clk_rpc *rpccall, + struct set_fll_clk *setfllclk); +int nvgpu_clk_set_boot_fll_clk_gv10x(struct gk20a *g); +int nvgpu_clk_set_boot_fll_clk_tu10x(struct gk20a *g); + +int clk_vin_sw_setup(struct gk20a *g); +int clk_vin_pmu_setup(struct gk20a *g); +int clk_avfs_get_vin_cal_fuse_v10(struct gk20a *g, + struct avfsvinobjs *pvinobjs, + struct vin_device_v20 *pvindev); +int clk_avfs_get_vin_cal_fuse_v20(struct gk20a *g, + struct avfsvinobjs *pvinobjs, + struct vin_device_v20 *pvindev); + +/*data and function definition to talk to driver*/ +int clk_fll_sw_setup(struct gk20a *g); +int clk_fll_pmu_setup(struct gk20a *g); +u32 nvgpu_clk_get_vbios_clk_domain_gv10x( u32 vbios_domain); +u32 nvgpu_clk_get_vbios_clk_domain_gp10x( u32 vbios_domain); + +/*data and function definition to talk to driver*/ +int clk_domain_sw_setup(struct gk20a *g); +int clk_domain_pmu_setup(struct gk20a *g); + +int clk_vf_point_sw_setup(struct gk20a *g); +int clk_vf_point_pmu_setup(struct gk20a *g); + +int clk_prog_sw_setup(struct gk20a *g); +int clk_prog_pmu_setup(struct gk20a *g); + +int nvgpu_clk_freq_domain_sw_setup(struct gk20a *g); +int nvgpu_clk_freq_domain_pmu_setup(struct gk20a *g); + +int clk_freq_controller_sw_setup(struct gk20a *g); +int clk_freq_controller_pmu_setup(struct gk20a *g); + +#endif /* NVGPU_PMU_CLK_H */ diff --git a/drivers/gpu/nvgpu/os/linux/debug_clk_gp106.c b/drivers/gpu/nvgpu/os/linux/debug_clk_gp106.c index 20d409243..b7e1eaeae 100644 --- a/drivers/gpu/nvgpu/os/linux/debug_clk_gp106.c +++ b/drivers/gpu/nvgpu/os/linux/debug_clk_gp106.c @@ -17,6 +17,7 @@ #include #include +#include #include "os_linux.h" #include "clk/clk.h" diff --git a/drivers/gpu/nvgpu/os/linux/ioctl_clk_arb.c b/drivers/gpu/nvgpu/os/linux/ioctl_clk_arb.c index 443bf3fe1..a91bbb1b9 100644 --- a/drivers/gpu/nvgpu/os/linux/ioctl_clk_arb.c +++ b/drivers/gpu/nvgpu/os/linux/ioctl_clk_arb.c @@ -41,8 +41,6 @@ #include #include -#include "clk/clk.h" - #ifdef CONFIG_DEBUG_FS #include "os_linux.h" #endif diff --git a/drivers/gpu/nvgpu/os/linux/pci.c b/drivers/gpu/nvgpu/os/linux/pci.c index b131d5289..4f4425662 100644 --- a/drivers/gpu/nvgpu/os/linux/pci.c +++ b/drivers/gpu/nvgpu/os/linux/pci.c @@ -31,8 +31,6 @@ #include #include "nvlink.h" -#include "clk/clk.h" -#include "clk/clk_mclk.h" #include "module.h" #include "intr.h" #include "sysfs.h" diff --git a/drivers/gpu/nvgpu/pmu_perf/change_seq.c b/drivers/gpu/nvgpu/pmu_perf/change_seq.c index bb0cbf5ba..383f8b729 100644 --- a/drivers/gpu/nvgpu/pmu_perf/change_seq.c +++ b/drivers/gpu/nvgpu/pmu_perf/change_seq.c @@ -27,9 +27,8 @@ #include #include #include +#include -#include "clk/clk.h" -#include "clk/clk_domain.h" #include "pmu_perf.h" #include "change_seq.h" diff --git a/drivers/gpu/nvgpu/pmu_perf/perf_gv100.c b/drivers/gpu/nvgpu/pmu_perf/perf_gv100.c index e3a3ab6a5..4b7515c98 100644 --- a/drivers/gpu/nvgpu/pmu_perf/perf_gv100.c +++ b/drivers/gpu/nvgpu/pmu_perf/perf_gv100.c @@ -25,10 +25,10 @@ #include #include #include +#include -#include "clk/clk.h" #include "perf_gv100.h" -#include "pmu_perf/pmu_perf.h" +#include "pmu_perf.h" static int pmu_set_boot_clk_runcb_fn(void *arg) { diff --git a/drivers/gpu/nvgpu/pstate/pstate.c b/drivers/gpu/nvgpu/pstate/pstate.c index 8219b66fd..35d54bc8d 100644 --- a/drivers/gpu/nvgpu/pstate/pstate.c +++ b/drivers/gpu/nvgpu/pstate/pstate.c @@ -25,9 +25,8 @@ #include #include #include +#include -#include "clk/clk.h" -#include "clk/clk_freq_domain.h" #include "pmu_perf/pmu_perf.h" #include "pmu_perf/change_seq.h" #include "pmgr/pmgr.h"