aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/samsung/exynos_tmu_data.c
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/thermal/samsung/exynos_tmu_data.c')
-rw-r--r--drivers/thermal/samsung/exynos_tmu_data.c211
1 files changed, 201 insertions, 10 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index 476b768c633e..c1d81dcd7819 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -40,13 +40,13 @@ static const struct exynos_tmu_registers exynos4210_tmu_registers = {
40 .threshold_temp = EXYNOS4210_TMU_REG_THRESHOLD_TEMP, 40 .threshold_temp = EXYNOS4210_TMU_REG_THRESHOLD_TEMP,
41 .threshold_th0 = EXYNOS4210_TMU_REG_TRIG_LEVEL0, 41 .threshold_th0 = EXYNOS4210_TMU_REG_TRIG_LEVEL0,
42 .tmu_inten = EXYNOS_TMU_REG_INTEN, 42 .tmu_inten = EXYNOS_TMU_REG_INTEN,
43 .inten_rise_mask = EXYNOS4210_TMU_TRIG_LEVEL_MASK,
44 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT, 43 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
45 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT, 44 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
46 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, 45 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
47 .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT, 46 .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT,
48 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT, 47 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
49 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, 48 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
49 .intclr_rise_mask = EXYNOS4210_TMU_TRIG_LEVEL_MASK,
50}; 50};
51 51
52struct exynos_tmu_init_data const exynos4210_default_tmu_data = { 52struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
@@ -112,10 +112,6 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
112 .threshold_th0 = EXYNOS_THD_TEMP_RISE, 112 .threshold_th0 = EXYNOS_THD_TEMP_RISE,
113 .threshold_th1 = EXYNOS_THD_TEMP_FALL, 113 .threshold_th1 = EXYNOS_THD_TEMP_FALL,
114 .tmu_inten = EXYNOS_TMU_REG_INTEN, 114 .tmu_inten = EXYNOS_TMU_REG_INTEN,
115 .inten_rise_mask = EXYNOS_TMU_RISE_INT_MASK,
116 .inten_rise_shift = EXYNOS_TMU_RISE_INT_SHIFT,
117 .inten_fall_mask = EXYNOS_TMU_FALL_INT_MASK,
118 .inten_fall_shift = EXYNOS_TMU_FALL_INT_SHIFT,
119 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT, 115 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
120 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT, 116 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
121 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT, 117 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
@@ -123,6 +119,10 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
123 .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT, 119 .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
124 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT, 120 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
125 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR, 121 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
122 .intclr_fall_shift = EXYNOS_TMU_CLEAR_FALL_INT_SHIFT,
123 .intclr_rise_shift = EXYNOS_TMU_RISE_INT_SHIFT,
124 .intclr_rise_mask = EXYNOS_TMU_RISE_INT_MASK,
125 .intclr_fall_mask = EXYNOS_TMU_FALL_INT_MASK,
126 .emul_con = EXYNOS_EMUL_CON, 126 .emul_con = EXYNOS_EMUL_CON,
127 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT, 127 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
128 .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT, 128 .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
@@ -194,6 +194,197 @@ struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
194}; 194};
195#endif 195#endif
196 196
197#if defined(CONFIG_SOC_EXYNOS5260)
198static const struct exynos_tmu_registers exynos5260_tmu_registers = {
199 .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
200 .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
201 .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
202 .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
203 .tmu_ctrl = EXYNOS_TMU_REG_CONTROL1,
204 .buf_vref_sel_shift = EXYNOS_TMU_REF_VOLTAGE_SHIFT,
205 .buf_vref_sel_mask = EXYNOS_TMU_REF_VOLTAGE_MASK,
206 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
207 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
208 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
209 .buf_slope_sel_shift = EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT,
210 .buf_slope_sel_mask = EXYNOS_TMU_BUF_SLOPE_SEL_MASK,
211 .core_en_shift = EXYNOS_TMU_CORE_EN_SHIFT,
212 .tmu_status = EXYNOS_TMU_REG_STATUS,
213 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
214 .threshold_th0 = EXYNOS_THD_TEMP_RISE,
215 .threshold_th1 = EXYNOS_THD_TEMP_FALL,
216 .tmu_inten = EXYNOS5260_TMU_REG_INTEN,
217 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
218 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
219 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
220 .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT,
221 .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
222 .tmu_intstat = EXYNOS5260_TMU_REG_INTSTAT,
223 .tmu_intclear = EXYNOS5260_TMU_REG_INTCLEAR,
224 .intclr_fall_shift = EXYNOS5420_TMU_CLEAR_FALL_INT_SHIFT,
225 .intclr_rise_shift = EXYNOS_TMU_RISE_INT_SHIFT,
226 .intclr_rise_mask = EXYNOS5260_TMU_RISE_INT_MASK,
227 .intclr_fall_mask = EXYNOS5260_TMU_FALL_INT_MASK,
228 .emul_con = EXYNOS5260_EMUL_CON,
229 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
230 .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
231 .emul_time_mask = EXYNOS_EMUL_TIME_MASK,
232};
233
234#define __EXYNOS5260_TMU_DATA \
235 .threshold_falling = 10, \
236 .trigger_levels[0] = 85, \
237 .trigger_levels[1] = 103, \
238 .trigger_levels[2] = 110, \
239 .trigger_levels[3] = 120, \
240 .trigger_enable[0] = true, \
241 .trigger_enable[1] = true, \
242 .trigger_enable[2] = true, \
243 .trigger_enable[3] = false, \
244 .trigger_type[0] = THROTTLE_ACTIVE, \
245 .trigger_type[1] = THROTTLE_ACTIVE, \
246 .trigger_type[2] = SW_TRIP, \
247 .trigger_type[3] = HW_TRIP, \
248 .max_trigger_level = 4, \
249 .gain = 8, \
250 .reference_voltage = 16, \
251 .noise_cancel_mode = 4, \
252 .cal_type = TYPE_ONE_POINT_TRIMMING, \
253 .efuse_value = 55, \
254 .min_efuse_value = 40, \
255 .max_efuse_value = 100, \
256 .first_point_trim = 25, \
257 .second_point_trim = 85, \
258 .default_temp_offset = 50, \
259 .freq_tab[0] = { \
260 .freq_clip_max = 800 * 1000, \
261 .temp_level = 85, \
262 }, \
263 .freq_tab[1] = { \
264 .freq_clip_max = 200 * 1000, \
265 .temp_level = 103, \
266 }, \
267 .freq_tab_count = 2, \
268 .registers = &exynos5260_tmu_registers, \
269
270#define EXYNOS5260_TMU_DATA \
271 __EXYNOS5260_TMU_DATA \
272 .type = SOC_ARCH_EXYNOS5260, \
273 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
274 TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
275 TMU_SUPPORT_EMUL_TIME)
276
277struct exynos_tmu_init_data const exynos5260_default_tmu_data = {
278 .tmu_data = {
279 { EXYNOS5260_TMU_DATA },
280 { EXYNOS5260_TMU_DATA },
281 { EXYNOS5260_TMU_DATA },
282 { EXYNOS5260_TMU_DATA },
283 { EXYNOS5260_TMU_DATA },
284 },
285 .tmu_count = 5,
286};
287#endif
288
289#if defined(CONFIG_SOC_EXYNOS5420)
290static const struct exynos_tmu_registers exynos5420_tmu_registers = {
291 .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
292 .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
293 .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
294 .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
295 .buf_vref_sel_shift = EXYNOS_TMU_REF_VOLTAGE_SHIFT,
296 .buf_vref_sel_mask = EXYNOS_TMU_REF_VOLTAGE_MASK,
297 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
298 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
299 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
300 .buf_slope_sel_shift = EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT,
301 .buf_slope_sel_mask = EXYNOS_TMU_BUF_SLOPE_SEL_MASK,
302 .core_en_shift = EXYNOS_TMU_CORE_EN_SHIFT,
303 .tmu_status = EXYNOS_TMU_REG_STATUS,
304 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
305 .threshold_th0 = EXYNOS_THD_TEMP_RISE,
306 .threshold_th1 = EXYNOS_THD_TEMP_FALL,
307 .tmu_inten = EXYNOS_TMU_REG_INTEN,
308 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
309 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
310 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
311 /* INTEN_RISE3 Not availble in exynos5420 */
312 .inten_rise3_shift = EXYNOS_TMU_INTEN_RISE3_SHIFT,
313 .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
314 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
315 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
316 .intclr_fall_shift = EXYNOS5420_TMU_CLEAR_FALL_INT_SHIFT,
317 .intclr_rise_shift = EXYNOS_TMU_RISE_INT_SHIFT,
318 .intclr_rise_mask = EXYNOS_TMU_RISE_INT_MASK,
319 .intclr_fall_mask = EXYNOS_TMU_FALL_INT_MASK,
320 .emul_con = EXYNOS_EMUL_CON,
321 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
322 .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
323 .emul_time_mask = EXYNOS_EMUL_TIME_MASK,
324};
325
326#define __EXYNOS5420_TMU_DATA \
327 .threshold_falling = 10, \
328 .trigger_levels[0] = 85, \
329 .trigger_levels[1] = 103, \
330 .trigger_levels[2] = 110, \
331 .trigger_levels[3] = 120, \
332 .trigger_enable[0] = true, \
333 .trigger_enable[1] = true, \
334 .trigger_enable[2] = true, \
335 .trigger_enable[3] = false, \
336 .trigger_type[0] = THROTTLE_ACTIVE, \
337 .trigger_type[1] = THROTTLE_ACTIVE, \
338 .trigger_type[2] = SW_TRIP, \
339 .trigger_type[3] = HW_TRIP, \
340 .max_trigger_level = 4, \
341 .gain = 8, \
342 .reference_voltage = 16, \
343 .noise_cancel_mode = 4, \
344 .cal_type = TYPE_ONE_POINT_TRIMMING, \
345 .efuse_value = 55, \
346 .min_efuse_value = 40, \
347 .max_efuse_value = 100, \
348 .first_point_trim = 25, \
349 .second_point_trim = 85, \
350 .default_temp_offset = 50, \
351 .freq_tab[0] = { \
352 .freq_clip_max = 800 * 1000, \
353 .temp_level = 85, \
354 }, \
355 .freq_tab[1] = { \
356 .freq_clip_max = 200 * 1000, \
357 .temp_level = 103, \
358 }, \
359 .freq_tab_count = 2, \
360 .registers = &exynos5420_tmu_registers, \
361
362#define EXYNOS5420_TMU_DATA \
363 __EXYNOS5420_TMU_DATA \
364 .type = SOC_ARCH_EXYNOS5250, \
365 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
366 TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
367 TMU_SUPPORT_EMUL_TIME)
368
369#define EXYNOS5420_TMU_DATA_SHARED \
370 __EXYNOS5420_TMU_DATA \
371 .type = SOC_ARCH_EXYNOS5420_TRIMINFO, \
372 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
373 TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
374 TMU_SUPPORT_EMUL_TIME | TMU_SUPPORT_ADDRESS_MULTIPLE)
375
376struct exynos_tmu_init_data const exynos5420_default_tmu_data = {
377 .tmu_data = {
378 { EXYNOS5420_TMU_DATA },
379 { EXYNOS5420_TMU_DATA },
380 { EXYNOS5420_TMU_DATA_SHARED },
381 { EXYNOS5420_TMU_DATA_SHARED },
382 { EXYNOS5420_TMU_DATA_SHARED },
383 },
384 .tmu_count = 5,
385};
386#endif
387
197#if defined(CONFIG_SOC_EXYNOS5440) 388#if defined(CONFIG_SOC_EXYNOS5440)
198static const struct exynos_tmu_registers exynos5440_tmu_registers = { 389static const struct exynos_tmu_registers exynos5440_tmu_registers = {
199 .triminfo_data = EXYNOS5440_TMU_S0_7_TRIM, 390 .triminfo_data = EXYNOS5440_TMU_S0_7_TRIM,
@@ -217,10 +408,6 @@ static const struct exynos_tmu_registers exynos5440_tmu_registers = {
217 .threshold_th2 = EXYNOS5440_TMU_S0_7_TH2, 408 .threshold_th2 = EXYNOS5440_TMU_S0_7_TH2,
218 .threshold_th3_l0_shift = EXYNOS5440_TMU_TH_RISE4_SHIFT, 409 .threshold_th3_l0_shift = EXYNOS5440_TMU_TH_RISE4_SHIFT,
219 .tmu_inten = EXYNOS5440_TMU_S0_7_IRQEN, 410 .tmu_inten = EXYNOS5440_TMU_S0_7_IRQEN,
220 .inten_rise_mask = EXYNOS5440_TMU_RISE_INT_MASK,
221 .inten_rise_shift = EXYNOS5440_TMU_RISE_INT_SHIFT,
222 .inten_fall_mask = EXYNOS5440_TMU_FALL_INT_MASK,
223 .inten_fall_shift = EXYNOS5440_TMU_FALL_INT_SHIFT,
224 .inten_rise0_shift = EXYNOS5440_TMU_INTEN_RISE0_SHIFT, 411 .inten_rise0_shift = EXYNOS5440_TMU_INTEN_RISE0_SHIFT,
225 .inten_rise1_shift = EXYNOS5440_TMU_INTEN_RISE1_SHIFT, 412 .inten_rise1_shift = EXYNOS5440_TMU_INTEN_RISE1_SHIFT,
226 .inten_rise2_shift = EXYNOS5440_TMU_INTEN_RISE2_SHIFT, 413 .inten_rise2_shift = EXYNOS5440_TMU_INTEN_RISE2_SHIFT,
@@ -228,6 +415,10 @@ static const struct exynos_tmu_registers exynos5440_tmu_registers = {
228 .inten_fall0_shift = EXYNOS5440_TMU_INTEN_FALL0_SHIFT, 415 .inten_fall0_shift = EXYNOS5440_TMU_INTEN_FALL0_SHIFT,
229 .tmu_intstat = EXYNOS5440_TMU_S0_7_IRQ, 416 .tmu_intstat = EXYNOS5440_TMU_S0_7_IRQ,
230 .tmu_intclear = EXYNOS5440_TMU_S0_7_IRQ, 417 .tmu_intclear = EXYNOS5440_TMU_S0_7_IRQ,
418 .intclr_fall_shift = EXYNOS5440_TMU_CLEAR_FALL_INT_SHIFT,
419 .intclr_rise_shift = EXYNOS5440_TMU_RISE_INT_SHIFT,
420 .intclr_rise_mask = EXYNOS5440_TMU_RISE_INT_MASK,
421 .intclr_fall_mask = EXYNOS5440_TMU_FALL_INT_MASK,
231 .tmu_irqstatus = EXYNOS5440_TMU_IRQ_STATUS, 422 .tmu_irqstatus = EXYNOS5440_TMU_IRQ_STATUS,
232 .emul_con = EXYNOS5440_TMU_S0_7_DEBUG, 423 .emul_con = EXYNOS5440_TMU_S0_7_DEBUG,
233 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT, 424 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
@@ -255,7 +446,7 @@ static const struct exynos_tmu_registers exynos5440_tmu_registers = {
255 .type = SOC_ARCH_EXYNOS5440, \ 446 .type = SOC_ARCH_EXYNOS5440, \
256 .registers = &exynos5440_tmu_registers, \ 447 .registers = &exynos5440_tmu_registers, \
257 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \ 448 .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_FALLING_TRIP | \
258 TMU_SUPPORT_MULTI_INST | TMU_SUPPORT_SHARED_MEMORY), 449 TMU_SUPPORT_MULTI_INST | TMU_SUPPORT_ADDRESS_MULTIPLE),
259 450
260struct exynos_tmu_init_data const exynos5440_default_tmu_data = { 451struct exynos_tmu_init_data const exynos5440_default_tmu_data = {
261 .tmu_data = { 452 .tmu_data = {