From 65a362c01a1adc567fa176113dfeb1834777926d Mon Sep 17 00:00:00 2001 From: Vaikundanathan S Date: Tue, 3 Apr 2018 15:11:58 +0530 Subject: gpu: nvgpu: Update clk_vin interface as per chips_a clk_vin data structures updated as new calibration type (v20) is added. GP106 header does not have vin calibration type. Assuming V10 if calibration type is not V20. Add fuse calibration for V20 type. Bug 200399373 Change-Id: I9449de1ecb0d0873f3bc16f46660f93fab5b9eac Signed-off-by: Vaikundanathan S Signed-off-by: Mahantesh Kumbar Reviewed-on: https://git-master.nvidia.com/r/1687591 Reviewed-by: mobile promotions Tested-by: mobile promotions --- drivers/gpu/nvgpu/ctrl/ctrlclk.h | 24 ++++++++++++++++++++++++ drivers/gpu/nvgpu/ctrl/ctrlclkavfs.h | 8 ++++++++ 2 files changed, 32 insertions(+) (limited to 'drivers/gpu/nvgpu/ctrl') diff --git a/drivers/gpu/nvgpu/ctrl/ctrlclk.h b/drivers/gpu/nvgpu/ctrl/ctrlclk.h index 3a383c17..3d50f413 100644 --- a/drivers/gpu/nvgpu/ctrl/ctrlclk.h +++ b/drivers/gpu/nvgpu/ctrl/ctrlclk.h @@ -135,6 +135,30 @@ struct ctrl_clk_clk_delta { int volt_deltauv[CTRL_CLK_CLK_DELTA_MAX_VOLT_RAILS]; }; +struct ctrl_clk_vin_v10 { + u32 slope; + u32 intercept; +}; + +struct ctrl_clk_vin_v20 { + s8 offset; + s8 gain; +}; + +union ctrl_clk_vin_data_v20 { + struct ctrl_clk_vin_v10 cal_v10; + struct ctrl_clk_vin_v20 cal_v20; +}; + +struct ctrl_clk_vin_device_info_data_v10 { + struct ctrl_clk_vin_v10 vin_cal; +}; + +struct ctrl_clk_vin_device_info_data_v20 { + u8 cal_type; + union ctrl_clk_vin_data_v20 vin_cal; +}; + union ctrl_clk_clk_prog_1x_source_data { struct ctrl_clk_clk_prog_1x_source_pll pll; }; diff --git a/drivers/gpu/nvgpu/ctrl/ctrlclkavfs.h b/drivers/gpu/nvgpu/ctrl/ctrlclkavfs.h index 59a542c8..7338fa3a 100644 --- a/drivers/gpu/nvgpu/ctrl/ctrlclkavfs.h +++ b/drivers/gpu/nvgpu/ctrl/ctrlclkavfs.h @@ -41,6 +41,14 @@ #define CTRL_CLK_VIN_ID_UNDEFINED 0x000000FF #define CTRL_CLK_VIN_TYPE_DISABLED 0x00000000 +#define CTRL_CLK_VIN_TYPE_V10 0x00000001 +#define CTRL_CLK_VIN_TYPE_V20 0x00000002 + +/*! + * Various types of VIN calibration that the GPU can support + */ +#define CTRL_CLK_VIN_CAL_TYPE_V10 (0x00000000) +#define CTRL_CLK_VIN_CAL_TYPE_V20 (0x00000001) /*! * Mask of all GPC VIN IDs supported by RM -- cgit v1.2.2