summaryrefslogtreecommitdiffstats
path: root/drivers/gpu/nvgpu/clk/clk_vin.c
diff options
context:
space:
mode:
authorTerje Bergstrom <tbergstrom@nvidia.com>2017-01-25 18:08:45 -0500
committermobile promotions <svcmobile_promotions@nvidia.com>2017-01-26 17:12:22 -0500
commitc05cfcb576a96c8239201c71627f348b1ad79670 (patch)
tree92a16b293d5c9da0aea83071a42c093438a5f6a4 /drivers/gpu/nvgpu/clk/clk_vin.c
parente52c6ac1f2a8abfd51f933598b6368711c42a9fa (diff)
gpu: nvgpu: gp106: Generate new gp106 headers
Hardware headers have been outdated. Regenerate with newest tool. At the same time correct the incorrect usage of fuse fields. JIRA DNVGPU-172 Change-Id: If190bf0cf2e41d525e6ea374a30efd1f63963e5e Signed-off-by: Terje Bergstrom <tbergstrom@nvidia.com> Reviewed-on: http://git-master/r/1294267 Reviewed-by: svccoveritychecker <svccoveritychecker@nvidia.com> Reviewed-by: Alex Waterman <alexw@nvidia.com> GVS: Gerrit_Virtual_Submit
Diffstat (limited to 'drivers/gpu/nvgpu/clk/clk_vin.c')
-rw-r--r--drivers/gpu/nvgpu/clk/clk_vin.c47
1 files changed, 25 insertions, 22 deletions
diff --git a/drivers/gpu/nvgpu/clk/clk_vin.c b/drivers/gpu/nvgpu/clk/clk_vin.c
index e2a209ee..1ababe55 100644
--- a/drivers/gpu/nvgpu/clk/clk_vin.c
+++ b/drivers/gpu/nvgpu/clk/clk_vin.c
@@ -1,5 +1,5 @@
1/* 1/*
2 * Copyright (c) 2016, NVIDIA CORPORATION. All rights reserved. 2 * Copyright (c) 2016-2017, NVIDIA CORPORATION. All rights reserved.
3 * 3 *
4 * This program is free software; you can redistribute it and/or modify it 4 * This program is free software; you can redistribute it and/or modify it
5 * under the terms and conditions of the GNU General Public License, 5 * under the terms and conditions of the GNU General Public License,
@@ -43,7 +43,7 @@ static u32 vin_device_init_pmudata_super(struct gk20a *g,
43 43
44static u32 read_vin_cal_fuse_rev(struct gk20a *g) 44static u32 read_vin_cal_fuse_rev(struct gk20a *g)
45{ 45{
46 return fuse_vin_cal_fuse_rev_v( 46 return fuse_vin_cal_fuse_rev_data_v(
47 gk20a_readl(g, fuse_vin_cal_fuse_rev_r())); 47 gk20a_readl(g, fuse_vin_cal_fuse_rev_r()));
48} 48}
49 49
@@ -103,9 +103,11 @@ static u32 read_vin_cal_slope_intercept_fuse(struct gk20a *g,
103 if (data == 0xFFFFFFFF) 103 if (data == 0xFFFFFFFF)
104 return -EINVAL; 104 return -EINVAL;
105 105
106 gpc0interceptdata = fuse_vin_cal_gpc0_icpt_data_v(gpc0data) * 1000; 106 gpc0interceptdata = (fuse_vin_cal_gpc0_icpt_int_data_v(gpc0data) <<
107 gpc0interceptdata = gpc0interceptdata >> 107 fuse_vin_cal_gpc0_icpt_frac_data_s()) +
108 fuse_vin_cal_gpc0_icpt_frac_size_v(); 108 fuse_vin_cal_gpc0_icpt_frac_data_v(gpc0data);
109 gpc0interceptdata = (gpc0interceptdata * 1000U) >>
110 fuse_vin_cal_gpc0_icpt_frac_data_s();
109 111
110 switch (vin_id) { 112 switch (vin_id) {
111 case CTRL_CLK_VIN_ID_GPC0: 113 case CTRL_CLK_VIN_ID_GPC0:
@@ -119,33 +121,36 @@ static u32 read_vin_cal_slope_intercept_fuse(struct gk20a *g,
119 case CTRL_CLK_VIN_ID_SYS: 121 case CTRL_CLK_VIN_ID_SYS:
120 case CTRL_CLK_VIN_ID_XBAR: 122 case CTRL_CLK_VIN_ID_XBAR:
121 case CTRL_CLK_VIN_ID_LTC: 123 case CTRL_CLK_VIN_ID_LTC:
122 interceptdata = 124 interceptdata = (fuse_vin_cal_gpc1_delta_icpt_int_data_v(data) <<
123 (fuse_vin_cal_gpc1_icpt_data_v(data)) * 1000; 125 fuse_vin_cal_gpc1_delta_icpt_frac_data_s()) +
124 interceptdata = interceptdata >> 126 fuse_vin_cal_gpc1_delta_icpt_frac_data_v(data);
125 fuse_vin_cal_gpc1_icpt_frac_size_v(); 127 interceptdata = (interceptdata * 1000U) >>
128 fuse_vin_cal_gpc1_delta_icpt_frac_data_s();
126 break; 129 break;
127 130
128 case CTRL_CLK_VIN_ID_SRAM: 131 case CTRL_CLK_VIN_ID_SRAM:
129 interceptdata = 132 interceptdata = (fuse_vin_cal_sram_delta_icpt_int_data_v(data) <<
130 (fuse_vin_cal_sram_icpt_data_v(data)) * 1000; 133 fuse_vin_cal_sram_delta_icpt_frac_data_s()) +
131 interceptdata = interceptdata >> 134 fuse_vin_cal_sram_delta_icpt_frac_data_v(data);
132 fuse_vin_cal_sram_icpt_frac_size_v(); 135 interceptdata = (interceptdata * 1000U) >>
136 fuse_vin_cal_sram_delta_icpt_frac_data_s();
133 break; 137 break;
134 138
135 default: 139 default:
136 return -EINVAL; 140 return -EINVAL;
137 } 141 }
138 142
139 if (data & fuse_vin_cal_gpc1_icpt_sign_f()) 143 if (fuse_vin_cal_gpc1_delta_icpt_sign_data_v(data))
140 *intercept = gpc0interceptdata - interceptdata; 144 *intercept = gpc0interceptdata - interceptdata;
141 else 145 else
142 *intercept = gpc0interceptdata + interceptdata; 146 *intercept = gpc0interceptdata + interceptdata;
143 147
144 /* slope */ 148 /* slope */
145 gpc0slopedata = (fuse_vin_cal_gpc0_slope_data_v(gpc0data)) * 1000; 149 gpc0slopedata = (fuse_vin_cal_gpc0_slope_int_data_v(gpc0data) <<
146 gpc0slopedata = gpc0slopedata >> 150 fuse_vin_cal_gpc0_slope_frac_data_s()) +
147 fuse_vin_cal_gpc0_slope_frac_size_v(); 151 fuse_vin_cal_gpc0_slope_frac_data_v(gpc0data);
148 152 gpc0slopedata = (gpc0slopedata * 1000U) >>
153 fuse_vin_cal_gpc0_slope_frac_data_s();
149 switch (vin_id) { 154 switch (vin_id) {
150 case CTRL_CLK_VIN_ID_GPC0: 155 case CTRL_CLK_VIN_ID_GPC0:
151 break; 156 break;
@@ -160,16 +165,14 @@ static u32 read_vin_cal_slope_intercept_fuse(struct gk20a *g,
160 case CTRL_CLK_VIN_ID_LTC: 165 case CTRL_CLK_VIN_ID_LTC:
161 case CTRL_CLK_VIN_ID_SRAM: 166 case CTRL_CLK_VIN_ID_SRAM:
162 slopedata = 167 slopedata =
163 (fuse_vin_cal_gpc1_slope_data_v(data)) * 1000; 168 (fuse_vin_cal_gpc1_delta_slope_int_data_v(data)) * 1000;
164 slopedata = slopedata >>
165 fuse_vin_cal_gpc1_slope_frac_size_v();
166 break; 169 break;
167 170
168 default: 171 default:
169 return -EINVAL; 172 return -EINVAL;
170 } 173 }
171 174
172 if (data & fuse_vin_cal_gpc1_slope_sign_f()) 175 if (fuse_vin_cal_gpc1_delta_slope_sign_data_v(data))
173 *slope = gpc0slopedata - slopedata; 176 *slope = gpc0slopedata - slopedata;
174 else 177 else
175 *slope = gpc0slopedata + slopedata; 178 *slope = gpc0slopedata + slopedata;