aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/thermal/samsung/exynos_tmu_data.c
diff options
context:
space:
mode:
authorChanwoo Choi <cw00.choi@samsung.com>2014-06-30 20:33:19 -0400
committerZhang Rui <rui.zhang@intel.com>2014-07-15 10:58:44 -0400
commit1fe56dc16a3dab400206443f70ae158c8f595c42 (patch)
tree99278a9e94d9eb3d92ee278d6195955741db9fa2 /drivers/thermal/samsung/exynos_tmu_data.c
parent4215688e7e55bcc80a0bbbc99164c261a112e4a1 (diff)
thermal: samsung: Add TMU support for Exynos3250 SoC
This patch add registers, bit fields and compatible strings for Exynos3250 TMU (Thermal Management Unit). Exynos3250 uses the Cortex-A7 dual cores and has a target speed of 1.0 GHz. Signed-off-by: Chanwoo Choi <cw00.choi@samsung.com> [Add MUX address setting bits by Jonghwa Lee] Signed-off-by: Jonghwa Lee <jonghwa3.lee@samsung.com> Acked-by: Kyungmin Park <kyungmin.park@samsung.com> Reviewed-by: Amit Daniel Kachhap<amit.daniel@samsung.com> Signed-off-by: Zhang Rui <rui.zhang@intel.com>
Diffstat (limited to 'drivers/thermal/samsung/exynos_tmu_data.c')
-rw-r--r--drivers/thermal/samsung/exynos_tmu_data.c89
1 files changed, 89 insertions, 0 deletions
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index c1d81dcd7819..aa8e0dee2055 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -90,6 +90,95 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
90}; 90};
91#endif 91#endif
92 92
93#if defined(CONFIG_SOC_EXYNOS3250)
94static const struct exynos_tmu_registers exynos3250_tmu_registers = {
95 .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
96 .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
97 .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
98 .tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
99 .test_mux_addr_shift = EXYNOS4412_MUX_ADDR_SHIFT,
100 .buf_vref_sel_shift = EXYNOS_TMU_REF_VOLTAGE_SHIFT,
101 .buf_vref_sel_mask = EXYNOS_TMU_REF_VOLTAGE_MASK,
102 .therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
103 .therm_trip_mode_mask = EXYNOS_TMU_TRIP_MODE_MASK,
104 .therm_trip_en_shift = EXYNOS_TMU_THERM_TRIP_EN_SHIFT,
105 .buf_slope_sel_shift = EXYNOS_TMU_BUF_SLOPE_SEL_SHIFT,
106 .buf_slope_sel_mask = EXYNOS_TMU_BUF_SLOPE_SEL_MASK,
107 .core_en_shift = EXYNOS_TMU_CORE_EN_SHIFT,
108 .tmu_status = EXYNOS_TMU_REG_STATUS,
109 .tmu_cur_temp = EXYNOS_TMU_REG_CURRENT_TEMP,
110 .threshold_th0 = EXYNOS_THD_TEMP_RISE,
111 .threshold_th1 = EXYNOS_THD_TEMP_FALL,
112 .tmu_inten = EXYNOS_TMU_REG_INTEN,
113 .inten_rise0_shift = EXYNOS_TMU_INTEN_RISE0_SHIFT,
114 .inten_rise1_shift = EXYNOS_TMU_INTEN_RISE1_SHIFT,
115 .inten_rise2_shift = EXYNOS_TMU_INTEN_RISE2_SHIFT,
116 .inten_fall0_shift = EXYNOS_TMU_INTEN_FALL0_SHIFT,
117 .tmu_intstat = EXYNOS_TMU_REG_INTSTAT,
118 .tmu_intclear = EXYNOS_TMU_REG_INTCLEAR,
119 .intclr_fall_shift = EXYNOS_TMU_CLEAR_FALL_INT_SHIFT,
120 .intclr_rise_shift = EXYNOS_TMU_RISE_INT_SHIFT,
121 .intclr_rise_mask = EXYNOS_TMU_RISE_INT_MASK,
122 .intclr_fall_mask = EXYNOS_TMU_FALL_INT_MASK,
123 .emul_con = EXYNOS_EMUL_CON,
124 .emul_temp_shift = EXYNOS_EMUL_DATA_SHIFT,
125 .emul_time_shift = EXYNOS_EMUL_TIME_SHIFT,
126 .emul_time_mask = EXYNOS_EMUL_TIME_MASK,
127};
128
129#define EXYNOS3250_TMU_DATA \
130 .threshold_falling = 10, \
131 .trigger_levels[0] = 70, \
132 .trigger_levels[1] = 95, \
133 .trigger_levels[2] = 110, \
134 .trigger_levels[3] = 120, \
135 .trigger_enable[0] = true, \
136 .trigger_enable[1] = true, \
137 .trigger_enable[2] = true, \
138 .trigger_enable[3] = false, \
139 .trigger_type[0] = THROTTLE_ACTIVE, \
140 .trigger_type[1] = THROTTLE_ACTIVE, \
141 .trigger_type[2] = SW_TRIP, \
142 .trigger_type[3] = HW_TRIP, \
143 .max_trigger_level = 4, \
144 .gain = 8, \
145 .reference_voltage = 16, \
146 .noise_cancel_mode = 4, \
147 .cal_type = TYPE_TWO_POINT_TRIMMING, \
148 .efuse_value = 55, \
149 .min_efuse_value = 40, \
150 .max_efuse_value = 100, \
151 .first_point_trim = 25, \
152 .second_point_trim = 85, \
153 .default_temp_offset = 50, \
154 .freq_tab[0] = { \
155 .freq_clip_max = 800 * 1000, \
156 .temp_level = 70, \
157 }, \
158 .freq_tab[1] = { \
159 .freq_clip_max = 400 * 1000, \
160 .temp_level = 95, \
161 }, \
162 .freq_tab_count = 2, \
163 .registers = &exynos3250_tmu_registers, \
164 .features = (TMU_SUPPORT_EMULATION | \
165 TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
166 TMU_SUPPORT_EMUL_TIME)
167#endif
168
169#if defined(CONFIG_SOC_EXYNOS3250)
170struct exynos_tmu_init_data const exynos3250_default_tmu_data = {
171 .tmu_data = {
172 {
173 EXYNOS3250_TMU_DATA,
174 .type = SOC_ARCH_EXYNOS3250,
175 .test_mux = EXYNOS4412_MUX_ADDR_VALUE,
176 },
177 },
178 .tmu_count = 1,
179};
180#endif
181
93#if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250) 182#if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
94static const struct exynos_tmu_registers exynos4412_tmu_registers = { 183static const struct exynos_tmu_registers exynos4412_tmu_registers = {
95 .triminfo_data = EXYNOS_TMU_REG_TRIMINFO, 184 .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,