Skip to content

Commit

Permalink
thermal: exynos: Provide initial setting for TMU's test MUX address a…
Browse files Browse the repository at this point in the history
…t Exynos4412

The commit d0a0ce3 ("thermal: exynos: Add
missing definations and code cleanup") has removed setting of test MUX address
value at TMU configuration setting.

This field is not present on Exynos4210 and Exynos5 SoCs. However on Exynos4412
SoC it is required to set this field after reset because without it TMU shows
maximal available temperature, which causes immediate platform shutdown.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Tomasz Figa <t.figa@samsung.com>
Signed-off-by: Eduardo Valentin <eduardo.valentin@ti.com>
  • Loading branch information
Lukasz Majewski authored and Eduardo Valentin committed Oct 15, 2013
1 parent 14ddfae commit 86f5362
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 0 deletions.
3 changes: 3 additions & 0 deletions drivers/thermal/samsung/exynos_tmu.c
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,9 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)

con = readl(data->base + reg->tmu_ctrl);

if (pdata->test_mux)
con |= (pdata->test_mux << reg->test_mux_addr_shift);

if (pdata->reference_voltage) {
con &= ~(reg->buf_vref_sel_mask << reg->buf_vref_sel_shift);
con |= pdata->reference_voltage << reg->buf_vref_sel_shift;
Expand Down
4 changes: 4 additions & 0 deletions drivers/thermal/samsung/exynos_tmu.h
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ enum soc_type {
* @triminfo_reload_shift: shift of triminfo reload enable bit in triminfo_ctrl
reg.
* @tmu_ctrl: TMU main controller register.
* @test_mux_addr_shift: shift bits of test mux address.
* @buf_vref_sel_shift: shift bits of reference voltage in tmu_ctrl register.
* @buf_vref_sel_mask: mask bits of reference voltage in tmu_ctrl register.
* @therm_trip_mode_shift: shift bits of tripping mode in tmu_ctrl register.
Expand Down Expand Up @@ -151,6 +152,7 @@ struct exynos_tmu_registers {
u32 triminfo_reload_shift;

u32 tmu_ctrl;
u32 test_mux_addr_shift;
u32 buf_vref_sel_shift;
u32 buf_vref_sel_mask;
u32 therm_trip_mode_shift;
Expand Down Expand Up @@ -258,6 +260,7 @@ struct exynos_tmu_registers {
* @first_point_trim: temp value of the first point trimming
* @second_point_trim: temp value of the second point trimming
* @default_temp_offset: default temperature offset in case of no trimming
* @test_mux; information if SoC supports test MUX
* @cal_type: calibration type for temperature
* @cal_mode: calibration mode for temperature
* @freq_clip_table: Table representing frequency reduction percentage.
Expand Down Expand Up @@ -287,6 +290,7 @@ struct exynos_tmu_platform_data {
u8 first_point_trim;
u8 second_point_trim;
u8 default_temp_offset;
u8 test_mux;

enum calibration_type cal_type;
enum calibration_mode cal_mode;
Expand Down
2 changes: 2 additions & 0 deletions drivers/thermal/samsung/exynos_tmu_data.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ static const struct exynos_tmu_registers exynos4412_tmu_registers = {
.triminfo_ctrl = EXYNOS_TMU_TRIMINFO_CON,
.triminfo_reload_shift = EXYNOS_TRIMINFO_RELOAD_SHIFT,
.tmu_ctrl = EXYNOS_TMU_REG_CONTROL,
.test_mux_addr_shift = EXYNOS4412_MUX_ADDR_SHIFT,
.buf_vref_sel_shift = EXYNOS_TMU_REF_VOLTAGE_SHIFT,
.buf_vref_sel_mask = EXYNOS_TMU_REF_VOLTAGE_MASK,
.therm_trip_mode_shift = EXYNOS_TMU_TRIP_MODE_SHIFT,
Expand Down Expand Up @@ -174,6 +175,7 @@ struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
{
EXYNOS4412_TMU_DATA,
.type = SOC_ARCH_EXYNOS4412,
.test_mux = EXYNOS4412_MUX_ADDR_VALUE,
},
},
.tmu_count = 1,
Expand Down
4 changes: 4 additions & 0 deletions drivers/thermal/samsung/exynos_tmu_data.h
Original file line number Diff line number Diff line change
Expand Up @@ -95,6 +95,10 @@

#define EXYNOS_MAX_TRIGGER_PER_REG 4

/* Exynos4412 specific */
#define EXYNOS4412_MUX_ADDR_VALUE 6
#define EXYNOS4412_MUX_ADDR_SHIFT 20

/*exynos5440 specific registers*/
#define EXYNOS5440_TMU_S0_7_TRIM 0x000
#define EXYNOS5440_TMU_S0_7_CTRL 0x020
Expand Down

0 comments on commit 86f5362

Please sign in to comment.