linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/6] thermal: exynos: Fixes for v3.12
@ 2013-09-24  8:08 Lukasz Majewski
  2013-09-24  8:08 ` [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL Lukasz Majewski
                   ` (8 more replies)
  0 siblings, 9 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-09-24  8:08 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, linux-samsung-soc

This patch series is divided into two parts:
1. Device tree node definition and enabelement for TMU at Exynos4412 (Trats2)
2. Exynos thermal subsystem regressions for v3.12-rc1. Several commits were 
   necessary to properly fix regression for TMU test MUX address setting after
   reset.

Test HW:
- Exynos4412 - TRATS2 board (Linux v3.12-rc1)

Lukasz Majewski (6):
  thermal: exynos: fix: Return from exynos_report_trigger() when
    therm_dev is NULL
  thermal: exynos: Provide separate TMU data for Exynos4412
  thermal: exynos: Provide initial setting for TMU's test MUX address
    at Exynos4412
  thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
  ARM: dts: exynos4x12: Device tree node definition for TMU on
    Exynos4x12
  ARM: dts: exynos4412-trats2: Enable TMU support at Trats2

 arch/arm/boot/dts/exynos4412-trats2.dts         |    5 +++++
 arch/arm/boot/dts/exynos4x12.dtsi               |   10 +++++++++
 drivers/thermal/samsung/exynos_thermal_common.c |    2 +-
 drivers/thermal/samsung/exynos_tmu.c            |   12 +++++++----
 drivers/thermal/samsung/exynos_tmu.h            |    3 ++-
 drivers/thermal/samsung/exynos_tmu_data.c       |   26 +++++++++++++++++------
 drivers/thermal/samsung/exynos_tmu_data.h       |   13 +++++++++++-
 7 files changed, 58 insertions(+), 13 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL
  2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
@ 2013-09-24  8:08 ` Lukasz Majewski
  2013-09-30 10:52   ` amit daniel kachhap
  2013-10-03 21:40   ` Eduardo Valentin
  2013-09-24  8:08 ` [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
                   ` (7 subsequent siblings)
  8 siblings, 2 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-09-24  8:08 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, linux-samsung-soc

The commit 4de0bdaa9677d11406c9becb70c60887c957e1f0
("thermal: exynos: Add support for instance based register/unregister")
broke check for presence of therm_dev at global thermal zone in
exynos_report_trigger().

The resulting wrong test prevents thermal_zone_device_update() call, which
calls handlers for situation when trip points are passed.
Such behavior prevents thermal driver from proper reaction (when TMU interrupt
is raised) in a situation when overheating is detected at TMU hardware.
This patch fixes it.

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>
---
 drivers/thermal/samsung/exynos_thermal_common.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
index f10a6ad..55a912a 100644
--- a/drivers/thermal/samsung/exynos_thermal_common.c
+++ b/drivers/thermal/samsung/exynos_thermal_common.c
@@ -310,7 +310,7 @@ void exynos_report_trigger(struct thermal_sensor_conf *conf)
 	}
 
 	th_zone = conf->pzone_data;
-	if (th_zone->therm_dev)
+	if (!th_zone->therm_dev)
 		return;
 
 	if (th_zone->bind == false) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412
  2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
  2013-09-24  8:08 ` [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL Lukasz Majewski
@ 2013-09-24  8:08 ` Lukasz Majewski
  2013-09-30 11:43   ` amit daniel kachhap
  2013-10-03 22:01   ` Eduardo Valentin
  2013-09-24  8:08 ` [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
                   ` (6 subsequent siblings)
  8 siblings, 2 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-09-24  8:08 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, linux-samsung-soc

Up till now Exynos5250 and Exynos4412 had the same definitions for TMU
data. Following commit changes that, by introducing separate
exynos4412_default_tmu_data structure.

Since Exynos4412 was chronologically first, the corresponding name for
TMU registers and default data was renamed.

Additionally, new SOC_ARCH_EXYNOS4412 type has been defined.

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>
---
 drivers/thermal/samsung/exynos_tmu.c      |    7 ++++---
 drivers/thermal/samsung/exynos_tmu.h      |    1 +
 drivers/thermal/samsung/exynos_tmu_data.c |   26 ++++++++++++++++++++------
 drivers/thermal/samsung/exynos_tmu_data.h |    9 ++++++++-
 4 files changed, 33 insertions(+), 10 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index b43afda..a858cc4 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -488,7 +488,7 @@ static const struct of_device_id exynos_tmu_match[] = {
 	},
 	{
 		.compatible = "samsung,exynos4412-tmu",
-		.data = (void *)EXYNOS5250_TMU_DRV_DATA,
+		.data = (void *)EXYNOS4412_TMU_DRV_DATA,
 	},
 	{
 		.compatible = "samsung,exynos5250-tmu",
@@ -630,8 +630,9 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 		return ret;
 
 	if (pdata->type == SOC_ARCH_EXYNOS ||
-		pdata->type == SOC_ARCH_EXYNOS4210 ||
-				pdata->type == SOC_ARCH_EXYNOS5440)
+	    pdata->type == SOC_ARCH_EXYNOS4210 ||
+	    pdata->type == SOC_ARCH_EXYNOS4412 ||
+	    pdata->type == SOC_ARCH_EXYNOS5440)
 		data->soc = pdata->type;
 	else {
 		ret = -EINVAL;
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
index b364c9e..db37df0 100644
--- a/drivers/thermal/samsung/exynos_tmu.h
+++ b/drivers/thermal/samsung/exynos_tmu.h
@@ -41,6 +41,7 @@ enum calibration_mode {
 
 enum soc_type {
 	SOC_ARCH_EXYNOS4210 = 1,
+	SOC_ARCH_EXYNOS4412,
 	SOC_ARCH_EXYNOS,
 	SOC_ARCH_EXYNOS5440,
 };
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index 9002499..bd08093 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -90,8 +90,8 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
 };
 #endif
 
-#if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)
-static const struct exynos_tmu_registers exynos5250_tmu_registers = {
+#if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
+static const struct exynos_tmu_registers exynos4412_tmu_registers = {
 	.triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
 	.triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
 	.triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
@@ -128,7 +128,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
 	.emul_time_mask = EXYNOS_EMUL_TIME_MASK,
 };
 
-#define EXYNOS5250_TMU_DATA \
+#define EXYNOS4412_TMU_DATA \
 	.threshold_falling = 10, \
 	.trigger_levels[0] = 85, \
 	.trigger_levels[1] = 103, \
@@ -162,15 +162,29 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
 		.temp_level = 103, \
 	}, \
 	.freq_tab_count = 2, \
-	.type = SOC_ARCH_EXYNOS, \
-	.registers = &exynos5250_tmu_registers, \
+	.registers = &exynos4412_tmu_registers, \
 	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
 			TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
 			TMU_SUPPORT_EMUL_TIME)
+#endif
 
+#if defined(CONFIG_SOC_EXYNOS4412)
+struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
+	.tmu_data = {
+		{ EXYNOS4412_TMU_DATA,
+		.type = SOC_ARCH_EXYNOS4412,
+		},
+	},
+	.tmu_count = 1,
+};
+#endif
+
+#if defined(CONFIG_SOC_EXYNOS5250)
 struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
 	.tmu_data = {
-		{ EXYNOS5250_TMU_DATA },
+		{ EXYNOS4412_TMU_DATA,
+		.type = SOC_ARCH_EXYNOS,
+		},
 	},
 	.tmu_count = 1,
 };
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
index dc7feb5..b130b1e 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.h
+++ b/drivers/thermal/samsung/exynos_tmu_data.h
@@ -138,7 +138,14 @@ extern struct exynos_tmu_init_data const exynos4210_default_tmu_data;
 #define EXYNOS4210_TMU_DRV_DATA (NULL)
 #endif
 
-#if (defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412))
+#if defined(CONFIG_SOC_EXYNOS4412)
+extern struct exynos_tmu_init_data const exynos4412_default_tmu_data;
+#define EXYNOS4412_TMU_DRV_DATA (&exynos4412_default_tmu_data)
+#else
+#define EXYNOS4412_TMU_DRV_DATA (NULL)
+#endif
+
+#if defined(CONFIG_SOC_EXYNOS5250)
 extern struct exynos_tmu_init_data const exynos5250_default_tmu_data;
 #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data)
 #else
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
  2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
  2013-09-24  8:08 ` [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL Lukasz Majewski
  2013-09-24  8:08 ` [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
@ 2013-09-24  8:08 ` Lukasz Majewski
  2013-09-30 11:59   ` amit daniel kachhap
  2013-10-03 22:05   ` Eduardo Valentin
  2013-09-24  8:08 ` [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250 Lukasz Majewski
                   ` (5 subsequent siblings)
  8 siblings, 2 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-09-24  8:08 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, linux-samsung-soc

The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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>
---
 drivers/thermal/samsung/exynos_tmu.c      |    3 +++
 drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
 2 files changed, 7 insertions(+)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index a858cc4..21b89e4 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -317,6 +317,9 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
 
 	con = readl(data->base + reg->tmu_ctrl);
 
+	if (pdata->type == SOC_ARCH_EXYNOS4412)
+		con |= (EXYNOS4412_MUX_ADDR_VALUE << EXYNOS4412_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;
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
index b130b1e..a1ea19d 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.h
+++ b/drivers/thermal/samsung/exynos_tmu_data.h
@@ -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
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
  2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
                   ` (2 preceding siblings ...)
  2013-09-24  8:08 ` [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
@ 2013-09-24  8:08 ` Lukasz Majewski
  2013-09-30 12:02   ` amit daniel kachhap
  2013-10-03 22:08   ` Eduardo Valentin
  2013-09-24  8:08 ` [PATCH 5/6] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12 Lukasz Majewski
                   ` (4 subsequent siblings)
  8 siblings, 2 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-09-24  8:08 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, linux-samsung-soc

The TMU data definition is now separated to Exynos4412 and Exynos5250.

Now SOC_ARCH_EXYNOS only refers to Exynos5250. Hence the name
SOC_ARCH_EXYNOS has been changed to SOC_ARCH_EXYNOS5250.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
---
 drivers/thermal/samsung/exynos_tmu.c      |    4 ++--
 drivers/thermal/samsung/exynos_tmu.h      |    2 +-
 drivers/thermal/samsung/exynos_tmu_data.c |    2 +-
 3 files changed, 4 insertions(+), 4 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 21b89e4..037cd46 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -632,9 +632,9 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	if (pdata->type == SOC_ARCH_EXYNOS ||
-	    pdata->type == SOC_ARCH_EXYNOS4210 ||
+	if (pdata->type == SOC_ARCH_EXYNOS4210 ||
 	    pdata->type == SOC_ARCH_EXYNOS4412 ||
+	    pdata->type == SOC_ARCH_EXYNOS5250 ||
 	    pdata->type == SOC_ARCH_EXYNOS5440)
 		data->soc = pdata->type;
 	else {
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
index db37df0..b42ece4 100644
--- a/drivers/thermal/samsung/exynos_tmu.h
+++ b/drivers/thermal/samsung/exynos_tmu.h
@@ -42,7 +42,7 @@ enum calibration_mode {
 enum soc_type {
 	SOC_ARCH_EXYNOS4210 = 1,
 	SOC_ARCH_EXYNOS4412,
-	SOC_ARCH_EXYNOS,
+	SOC_ARCH_EXYNOS5250,
 	SOC_ARCH_EXYNOS5440,
 };
 
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index bd08093..188223f 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -183,7 +183,7 @@ struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
 struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
 	.tmu_data = {
 		{ EXYNOS4412_TMU_DATA,
-		.type = SOC_ARCH_EXYNOS,
+		.type = SOC_ARCH_EXYNOS5250,
 		},
 	},
 	.tmu_count = 1,
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 5/6] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12
  2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
                   ` (3 preceding siblings ...)
  2013-09-24  8:08 ` [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250 Lukasz Majewski
@ 2013-09-24  8:08 ` Lukasz Majewski
  2013-09-24  8:08 ` [PATCH 6/6] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2 Lukasz Majewski
                   ` (3 subsequent siblings)
  8 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-09-24  8:08 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, linux-samsung-soc

The TMU device tree node definition for Exynos4x12 family of SoCs.

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>
---
 arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
index ad531fe..64c0ece 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -176,4 +176,14 @@
 			};
 		};
 	};
+
+	tmu@100C0000 {
+		compatible = "samsung,exynos4412-tmu";
+		interrupt-parent = <&combiner>;
+		interrupts = <2 4>;
+		reg = <0x100C0000 0x100>;
+		clocks = <&clock 383>;
+		clock-names = "tmu_apbif";
+		status = "disabled";
+	};
 };
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH 6/6] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
  2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
                   ` (4 preceding siblings ...)
  2013-09-24  8:08 ` [PATCH 5/6] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12 Lukasz Majewski
@ 2013-09-24  8:08 ` Lukasz Majewski
  2013-09-24  9:29 ` [PATCH 0/6] thermal: exynos: Fixes for v3.12 Tomasz Figa
                   ` (2 subsequent siblings)
  8 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-09-24  8:08 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, linux-samsung-soc

This patch enables support for TMU at Exynos4412 based Trats2 board.

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>
---
 arch/arm/boot/dts/exynos4412-trats2.dts |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index fb7b9ae..57136f8 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -467,6 +467,11 @@
 		status = "okay";
 	};
 
+	tmu@100C0000 {
+		vtmu-supply = <&ldo10_reg>;
+		status = "okay";
+	};
+
 	i2c_ak8975: i2c-gpio-0 {
 		compatible = "i2c-gpio";
 		gpios = <&gpy2 4 0>, <&gpy2 5 0>;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* Re: [PATCH 0/6] thermal: exynos: Fixes for v3.12
  2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
                   ` (5 preceding siblings ...)
  2013-09-24  8:08 ` [PATCH 6/6] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2 Lukasz Majewski
@ 2013-09-24  9:29 ` Tomasz Figa
  2013-10-03 13:29 ` Lukasz Majewski
  2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
  8 siblings, 0 replies; 43+ messages in thread
From: Tomasz Figa @ 2013-09-24  9:29 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap,
	Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	linux-kernel, Bartlomiej Zolnierkiewicz, Myungjoo Ham,
	devicetree, linux-samsung-soc

Hi Lukasz,

On Tuesday 24 of September 2013 10:08:16 Lukasz Majewski wrote:
> This patch series is divided into two parts:
> 1. Device tree node definition and enabelement for TMU at Exynos4412 (Trats2)
> 2. Exynos thermal subsystem regressions for v3.12-rc1. Several commits were 
>    necessary to properly fix regression for TMU test MUX address setting after
>    reset.
> 
> Test HW:
> - Exynos4412 - TRATS2 board (Linux v3.12-rc1)
> 
> Lukasz Majewski (6):
>   thermal: exynos: fix: Return from exynos_report_trigger() when
>     therm_dev is NULL
>   thermal: exynos: Provide separate TMU data for Exynos4412
>   thermal: exynos: Provide initial setting for TMU's test MUX address
>     at Exynos4412
>   thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
>   ARM: dts: exynos4x12: Device tree node definition for TMU on
>     Exynos4x12
>   ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
> 
>  arch/arm/boot/dts/exynos4412-trats2.dts         |    5 +++++
>  arch/arm/boot/dts/exynos4x12.dtsi               |   10 +++++++++
>  drivers/thermal/samsung/exynos_thermal_common.c |    2 +-
>  drivers/thermal/samsung/exynos_tmu.c            |   12 +++++++----
>  drivers/thermal/samsung/exynos_tmu.h            |    3 ++-
>  drivers/thermal/samsung/exynos_tmu_data.c       |   26 +++++++++++++++++------
>  drivers/thermal/samsung/exynos_tmu_data.h       |   13 +++++++++++-
>  7 files changed, 58 insertions(+), 13 deletions(-)
> 

For the whole series:

Reviewed-by: Tomasz Figa <t.figa@samsung.com>

Best regards,
Tomasz


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL
  2013-09-24  8:08 ` [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL Lukasz Majewski
@ 2013-09-30 10:52   ` amit daniel kachhap
  2013-10-03 21:40   ` Eduardo Valentin
  1 sibling, 0 replies; 43+ messages in thread
From: amit daniel kachhap @ 2013-09-30 10:52 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> The commit 4de0bdaa9677d11406c9becb70c60887c957e1f0
> ("thermal: exynos: Add support for instance based register/unregister")
> broke check for presence of therm_dev at global thermal zone in
> exynos_report_trigger().
>
> The resulting wrong test prevents thermal_zone_device_update() call, which
> calls handlers for situation when trip points are passed.
> Such behavior prevents thermal driver from proper reaction (when TMU interrupt
> is raised) in a situation when overheating is detected at TMU hardware.
> This patch fixes it.
>
> 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>
> ---
>  drivers/thermal/samsung/exynos_thermal_common.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
> index f10a6ad..55a912a 100644
> --- a/drivers/thermal/samsung/exynos_thermal_common.c
> +++ b/drivers/thermal/samsung/exynos_thermal_common.c
> @@ -310,7 +310,7 @@ void exynos_report_trigger(struct thermal_sensor_conf *conf)
>         }
>
>         th_zone = conf->pzone_data;
> -       if (th_zone->therm_dev)
> +       if (!th_zone->therm_dev)
>                 return;
Changes looks fine.
Reviewed-by: Amit Daniel Kachhap<amit.daniel@samsung.com>

Thanks,
Amit Daniel
>
>         if (th_zone->bind == false) {
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> The commit 4de0bdaa9677d11406c9becb70c60887c957e1f0
> ("thermal: exynos: Add support for instance based register/unregister")
> broke check for presence of therm_dev at global thermal zone in
> exynos_report_trigger().
>
> The resulting wrong test prevents thermal_zone_device_update() call, which
> calls handlers for situation when trip points are passed.
> Such behavior prevents thermal driver from proper reaction (when TMU interrupt
> is raised) in a situation when overheating is detected at TMU hardware.
> This patch fixes it.
>
> 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>
> ---
>  drivers/thermal/samsung/exynos_thermal_common.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
>
> diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
> index f10a6ad..55a912a 100644
> --- a/drivers/thermal/samsung/exynos_thermal_common.c
> +++ b/drivers/thermal/samsung/exynos_thermal_common.c
> @@ -310,7 +310,7 @@ void exynos_report_trigger(struct thermal_sensor_conf *conf)
>         }
>
>         th_zone = conf->pzone_data;
> -       if (th_zone->therm_dev)
> +       if (!th_zone->therm_dev)
>                 return;
>
>         if (th_zone->bind == false) {
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412
  2013-09-24  8:08 ` [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
@ 2013-09-30 11:43   ` amit daniel kachhap
  2013-10-03 22:01   ` Eduardo Valentin
  1 sibling, 0 replies; 43+ messages in thread
From: amit daniel kachhap @ 2013-09-30 11:43 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Up till now Exynos5250 and Exynos4412 had the same definitions for TMU
> data. Following commit changes that, by introducing separate
> exynos4412_default_tmu_data structure.
>
> Since Exynos4412 was chronologically first, the corresponding name for
> TMU registers and default data was renamed.
>
> Additionally, new SOC_ARCH_EXYNOS4412 type has been defined.
>
> 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>
Reviewed-by: Amit Daniel Kachhap<amit.daniel@samsung.com>

Thanks,
Amit Daniel
> ---
>  drivers/thermal/samsung/exynos_tmu.c      |    7 ++++---
>  drivers/thermal/samsung/exynos_tmu.h      |    1 +
>  drivers/thermal/samsung/exynos_tmu_data.c |   26 ++++++++++++++++++++------
>  drivers/thermal/samsung/exynos_tmu_data.h |    9 ++++++++-
>  4 files changed, 33 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index b43afda..a858cc4 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -488,7 +488,7 @@ static const struct of_device_id exynos_tmu_match[] = {
>         },
>         {
>                 .compatible = "samsung,exynos4412-tmu",
> -               .data = (void *)EXYNOS5250_TMU_DRV_DATA,
> +               .data = (void *)EXYNOS4412_TMU_DRV_DATA,
>         },
>         {
>                 .compatible = "samsung,exynos5250-tmu",
> @@ -630,8 +630,9 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>                 return ret;
>
>         if (pdata->type == SOC_ARCH_EXYNOS ||
> -               pdata->type == SOC_ARCH_EXYNOS4210 ||
> -                               pdata->type == SOC_ARCH_EXYNOS5440)
> +           pdata->type == SOC_ARCH_EXYNOS4210 ||
> +           pdata->type == SOC_ARCH_EXYNOS4412 ||
> +           pdata->type == SOC_ARCH_EXYNOS5440)
>                 data->soc = pdata->type;
>         else {
>                 ret = -EINVAL;
> diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
> index b364c9e..db37df0 100644
> --- a/drivers/thermal/samsung/exynos_tmu.h
> +++ b/drivers/thermal/samsung/exynos_tmu.h
> @@ -41,6 +41,7 @@ enum calibration_mode {
>
>  enum soc_type {
>         SOC_ARCH_EXYNOS4210 = 1,
> +       SOC_ARCH_EXYNOS4412,
>         SOC_ARCH_EXYNOS,
>         SOC_ARCH_EXYNOS5440,
>  };
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
> index 9002499..bd08093 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.c
> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> @@ -90,8 +90,8 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
>  };
>  #endif
>
> -#if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)
> -static const struct exynos_tmu_registers exynos5250_tmu_registers = {
> +#if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
> +static const struct exynos_tmu_registers exynos4412_tmu_registers = {
>         .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
>         .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
>         .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
> @@ -128,7 +128,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
>         .emul_time_mask = EXYNOS_EMUL_TIME_MASK,
>  };
>
> -#define EXYNOS5250_TMU_DATA \
> +#define EXYNOS4412_TMU_DATA \
>         .threshold_falling = 10, \
>         .trigger_levels[0] = 85, \
>         .trigger_levels[1] = 103, \
> @@ -162,15 +162,29 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
>                 .temp_level = 103, \
>         }, \
>         .freq_tab_count = 2, \
> -       .type = SOC_ARCH_EXYNOS, \
> -       .registers = &exynos5250_tmu_registers, \
> +       .registers = &exynos4412_tmu_registers, \
>         .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
>                         TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
>                         TMU_SUPPORT_EMUL_TIME)
> +#endif
>
> +#if defined(CONFIG_SOC_EXYNOS4412)
> +struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
> +       .tmu_data = {
> +               { EXYNOS4412_TMU_DATA,
> +               .type = SOC_ARCH_EXYNOS4412,
> +               },
> +       },
> +       .tmu_count = 1,
> +};
> +#endif
> +
> +#if defined(CONFIG_SOC_EXYNOS5250)
>  struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
>         .tmu_data = {
> -               { EXYNOS5250_TMU_DATA },
> +               { EXYNOS4412_TMU_DATA,
> +               .type = SOC_ARCH_EXYNOS,
> +               },
>         },
>         .tmu_count = 1,
>  };
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
> index dc7feb5..b130b1e 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.h
> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> @@ -138,7 +138,14 @@ extern struct exynos_tmu_init_data const exynos4210_default_tmu_data;
>  #define EXYNOS4210_TMU_DRV_DATA (NULL)
>  #endif
>
> -#if (defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412))
> +#if defined(CONFIG_SOC_EXYNOS4412)
> +extern struct exynos_tmu_init_data const exynos4412_default_tmu_data;
> +#define EXYNOS4412_TMU_DRV_DATA (&exynos4412_default_tmu_data)
> +#else
> +#define EXYNOS4412_TMU_DRV_DATA (NULL)
> +#endif
> +
> +#if defined(CONFIG_SOC_EXYNOS5250)
>  extern struct exynos_tmu_init_data const exynos5250_default_tmu_data;
>  #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data)
>  #else
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> Up till now Exynos5250 and Exynos4412 had the same definitions for TMU
> data. Following commit changes that, by introducing separate
> exynos4412_default_tmu_data structure.
>
> Since Exynos4412 was chronologically first, the corresponding name for
> TMU registers and default data was renamed.
>
> Additionally, new SOC_ARCH_EXYNOS4412 type has been defined.
>
> 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>
> ---
>  drivers/thermal/samsung/exynos_tmu.c      |    7 ++++---
>  drivers/thermal/samsung/exynos_tmu.h      |    1 +
>  drivers/thermal/samsung/exynos_tmu_data.c |   26 ++++++++++++++++++++------
>  drivers/thermal/samsung/exynos_tmu_data.h |    9 ++++++++-
>  4 files changed, 33 insertions(+), 10 deletions(-)
>
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index b43afda..a858cc4 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -488,7 +488,7 @@ static const struct of_device_id exynos_tmu_match[] = {
>         },
>         {
>                 .compatible = "samsung,exynos4412-tmu",
> -               .data = (void *)EXYNOS5250_TMU_DRV_DATA,
> +               .data = (void *)EXYNOS4412_TMU_DRV_DATA,
>         },
>         {
>                 .compatible = "samsung,exynos5250-tmu",
> @@ -630,8 +630,9 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>                 return ret;
>
>         if (pdata->type == SOC_ARCH_EXYNOS ||
> -               pdata->type == SOC_ARCH_EXYNOS4210 ||
> -                               pdata->type == SOC_ARCH_EXYNOS5440)
> +           pdata->type == SOC_ARCH_EXYNOS4210 ||
> +           pdata->type == SOC_ARCH_EXYNOS4412 ||
> +           pdata->type == SOC_ARCH_EXYNOS5440)
>                 data->soc = pdata->type;
>         else {
>                 ret = -EINVAL;
> diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
> index b364c9e..db37df0 100644
> --- a/drivers/thermal/samsung/exynos_tmu.h
> +++ b/drivers/thermal/samsung/exynos_tmu.h
> @@ -41,6 +41,7 @@ enum calibration_mode {
>
>  enum soc_type {
>         SOC_ARCH_EXYNOS4210 = 1,
> +       SOC_ARCH_EXYNOS4412,
>         SOC_ARCH_EXYNOS,
>         SOC_ARCH_EXYNOS5440,
>  };
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
> index 9002499..bd08093 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.c
> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> @@ -90,8 +90,8 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
>  };
>  #endif
>
> -#if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)
> -static const struct exynos_tmu_registers exynos5250_tmu_registers = {
> +#if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
> +static const struct exynos_tmu_registers exynos4412_tmu_registers = {
>         .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
>         .triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
>         .triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
> @@ -128,7 +128,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
>         .emul_time_mask = EXYNOS_EMUL_TIME_MASK,
>  };
>
> -#define EXYNOS5250_TMU_DATA \
> +#define EXYNOS4412_TMU_DATA \
>         .threshold_falling = 10, \
>         .trigger_levels[0] = 85, \
>         .trigger_levels[1] = 103, \
> @@ -162,15 +162,29 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
>                 .temp_level = 103, \
>         }, \
>         .freq_tab_count = 2, \
> -       .type = SOC_ARCH_EXYNOS, \
> -       .registers = &exynos5250_tmu_registers, \
> +       .registers = &exynos4412_tmu_registers, \
>         .features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
>                         TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
>                         TMU_SUPPORT_EMUL_TIME)
> +#endif
>
> +#if defined(CONFIG_SOC_EXYNOS4412)
> +struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
> +       .tmu_data = {
> +               { EXYNOS4412_TMU_DATA,
> +               .type = SOC_ARCH_EXYNOS4412,
> +               },
> +       },
> +       .tmu_count = 1,
> +};
> +#endif
> +
> +#if defined(CONFIG_SOC_EXYNOS5250)
>  struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
>         .tmu_data = {
> -               { EXYNOS5250_TMU_DATA },
> +               { EXYNOS4412_TMU_DATA,
> +               .type = SOC_ARCH_EXYNOS,
> +               },
>         },
>         .tmu_count = 1,
>  };
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
> index dc7feb5..b130b1e 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.h
> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> @@ -138,7 +138,14 @@ extern struct exynos_tmu_init_data const exynos4210_default_tmu_data;
>  #define EXYNOS4210_TMU_DRV_DATA (NULL)
>  #endif
>
> -#if (defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412))
> +#if defined(CONFIG_SOC_EXYNOS4412)
> +extern struct exynos_tmu_init_data const exynos4412_default_tmu_data;
> +#define EXYNOS4412_TMU_DRV_DATA (&exynos4412_default_tmu_data)
> +#else
> +#define EXYNOS4412_TMU_DRV_DATA (NULL)
> +#endif
> +
> +#if defined(CONFIG_SOC_EXYNOS5250)
>  extern struct exynos_tmu_init_data const exynos5250_default_tmu_data;
>  #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data)
>  #else
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
  2013-09-24  8:08 ` [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
@ 2013-09-30 11:59   ` amit daniel kachhap
  2013-10-01  6:55     ` Lukasz Majewski
  2013-10-03 22:05   ` Eduardo Valentin
  1 sibling, 1 reply; 43+ messages in thread
From: amit daniel kachhap @ 2013-09-30 11:59 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

Hi,

On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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.
Right In 5250 this field is not defined so didn't catch this. The
changes looks fine but I have a minor comment that if this field is
defined in 4412 in detail then you can add a field entry in
exynos_tmu_registers with proper name and populate this field. The
good thing is that in 5250 also this field is reserved and the default
value is 0x6 so same TMU_DATA can be used for 5250 and 4412. The main
idea of this suggestion is to reduce the soc checks in the driver.

Thanks,
Amit Daniel
>
> 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>
> ---
>  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
>  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index a858cc4..21b89e4 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -317,6 +317,9 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
>
>         con = readl(data->base + reg->tmu_ctrl);
>
> +       if (pdata->type == SOC_ARCH_EXYNOS4412)
> +               con |= (EXYNOS4412_MUX_ADDR_VALUE << EXYNOS4412_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;
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
> index b130b1e..a1ea19d 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.h
> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> @@ -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
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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>
> ---
>  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
>  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
>  2 files changed, 7 insertions(+)
>
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index a858cc4..21b89e4 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -317,6 +317,9 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
>
>         con = readl(data->base + reg->tmu_ctrl);
>
> +       if (pdata->type == SOC_ARCH_EXYNOS4412)
> +               con |= (EXYNOS4412_MUX_ADDR_VALUE << EXYNOS4412_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;
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
> index b130b1e..a1ea19d 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.h
> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> @@ -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
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
  2013-09-24  8:08 ` [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250 Lukasz Majewski
@ 2013-09-30 12:02   ` amit daniel kachhap
  2013-10-03 22:08   ` Eduardo Valentin
  1 sibling, 0 replies; 43+ messages in thread
From: amit daniel kachhap @ 2013-09-30 12:02 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski <l.majewski@samsung.com> wrote:
> The TMU data definition is now separated to Exynos4412 and Exynos5250.
>
> Now SOC_ARCH_EXYNOS only refers to Exynos5250. Hence the name
> SOC_ARCH_EXYNOS has been changed to SOC_ARCH_EXYNOS5250.
>
> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Changes looks fine.
Reviewed-by: Amit Daniel Kachhap<amit.daniel@samsung.com>

Thanks,
Amit
> ---
>  drivers/thermal/samsung/exynos_tmu.c      |    4 ++--
>  drivers/thermal/samsung/exynos_tmu.h      |    2 +-
>  drivers/thermal/samsung/exynos_tmu_data.c |    2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 21b89e4..037cd46 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -632,9 +632,9 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>         if (ret)
>                 return ret;
>
> -       if (pdata->type == SOC_ARCH_EXYNOS ||
> -           pdata->type == SOC_ARCH_EXYNOS4210 ||
> +       if (pdata->type == SOC_ARCH_EXYNOS4210 ||
>             pdata->type == SOC_ARCH_EXYNOS4412 ||
> +           pdata->type == SOC_ARCH_EXYNOS5250 ||
>             pdata->type == SOC_ARCH_EXYNOS5440)
>                 data->soc = pdata->type;
>         else {
> diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
> index db37df0..b42ece4 100644
> --- a/drivers/thermal/samsung/exynos_tmu.h
> +++ b/drivers/thermal/samsung/exynos_tmu.h
> @@ -42,7 +42,7 @@ enum calibration_mode {
>  enum soc_type {
>         SOC_ARCH_EXYNOS4210 = 1,
>         SOC_ARCH_EXYNOS4412,
> -       SOC_ARCH_EXYNOS,
> +       SOC_ARCH_EXYNOS5250,
>         SOC_ARCH_EXYNOS5440,
>  };
>
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
> index bd08093..188223f 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.c
> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> @@ -183,7 +183,7 @@ struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
>  struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
>         .tmu_data = {
>                 { EXYNOS4412_TMU_DATA,
> -               .type = SOC_ARCH_EXYNOS,
> +               .type = SOC_ARCH_EXYNOS5250,
>                 },
>         },
>         .tmu_count = 1,
> --
> 1.7.10.4
>
> --
> To unsubscribe from this list: send the line "unsubscribe linux-samsung-soc" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
  2013-09-30 11:59   ` amit daniel kachhap
@ 2013-10-01  6:55     ` Lukasz Majewski
  0 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-01  6:55 UTC (permalink / raw)
  To: amit daniel kachhap
  Cc: Zhang Rui, Eduardo Valentin, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

Hi Amit,

> Hi,
> 
> On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski
> <l.majewski@samsung.com> wrote:
> > The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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.
> Right In 5250 this field is not defined so didn't catch this. The
> changes looks fine but I have a minor comment that if this field is
> defined in 4412 in detail then you can add a field entry in
> exynos_tmu_registers with proper name and populate this field. 

It seems, that only at Exynos4412 (and Exynos4212) this field is valid.
When I extent exynos_tmu_registers structure, then all other Samsung
SoCs will be aware of it.
Define with explicit EXYNOS4412 seems more readable. 


Also at exynos_tmu_control() function we use constructs like:
data->base + EXYNOS_TMU_REG_CONTROL, not data->base + regs->tmu_ctrl.

> The
> good thing is that in 5250 also this field is reserved and the default
> value is 0x6 so same TMU_DATA can be used for 5250 and 4412.

I'm not keen to this kind of hacks. This field is only valid on
Exynos4x12. And for Exynos5250 is reserved, which means that we shall
not touch it.

> The main
> idea of this suggestion is to reduce the soc checks in the driver.

Correct me if I'm wrong, but this MUX_ADDR initialization is performed
at exynos_tmu_control() which is called at probe and thermal power
management functions. Therefore, it seems that checking if SoC ==
Exynos4412 there is not an overkill.

If you don't mind I would leave those patches as they are and kindly
ask thermal maintainers for pulling them to v3.12.

> 
> Thanks,
> Amit Daniel
> >
> > 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>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
> >  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
> >  2 files changed, 7 insertions(+)
> >
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index a858cc4..21b89e4 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -317,6 +317,9 @@ static void exynos_tmu_control(struct
> > platform_device *pdev, bool on)
> >
> >         con = readl(data->base + reg->tmu_ctrl);
> >
> > +       if (pdata->type == SOC_ARCH_EXYNOS4412)
> > +               con |= (EXYNOS4412_MUX_ADDR_VALUE <<
> > EXYNOS4412_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; diff --git
> > a/drivers/thermal/samsung/exynos_tmu_data.h
> > b/drivers/thermal/samsung/exynos_tmu_data.h index b130b1e..a1ea19d
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h +++
> > b/drivers/thermal/samsung/exynos_tmu_data.h @@ -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
> > --
> > 1.7.10.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-pm"
> > in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> On Tue, Sep 24, 2013 at 1:38 PM, Lukasz Majewski
> <l.majewski@samsung.com> wrote:
> > The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
> >  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
> >  2 files changed, 7 insertions(+)
> >
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index a858cc4..21b89e4 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -317,6 +317,9 @@ static void exynos_tmu_control(struct
> > platform_device *pdev, bool on)
> >
> >         con = readl(data->base + reg->tmu_ctrl);
> >
> > +       if (pdata->type == SOC_ARCH_EXYNOS4412)
> > +               con |= (EXYNOS4412_MUX_ADDR_VALUE <<
> > EXYNOS4412_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; diff --git
> > a/drivers/thermal/samsung/exynos_tmu_data.h
> > b/drivers/thermal/samsung/exynos_tmu_data.h index b130b1e..a1ea19d
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h +++
> > b/drivers/thermal/samsung/exynos_tmu_data.h @@ -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
> > --
> > 1.7.10.4
> >
> > --
> > To unsubscribe from this list: send the line "unsubscribe linux-pm"
> > in the body of a message to majordomo@vger.kernel.org
> > More majordomo info at  http://vger.kernel.org/majordomo-info.html



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 0/6] thermal: exynos: Fixes for v3.12
  2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
                   ` (6 preceding siblings ...)
  2013-09-24  9:29 ` [PATCH 0/6] thermal: exynos: Fixes for v3.12 Tomasz Figa
@ 2013-10-03 13:29 ` Lukasz Majewski
  2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
  8 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-03 13:29 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap
  Cc: Lukasz Majewski, Rafael J. Wysocki, Linux PM list, Jonghwa Lee,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, linux-samsung-soc

Dear All,

> This patch series is divided into two parts:
> 1. Device tree node definition and enabelement for TMU at Exynos4412
> (Trats2) 2. Exynos thermal subsystem regressions for v3.12-rc1.
> Several commits were necessary to properly fix regression for TMU
> test MUX address setting after reset.

Zhang or Eduardo - will you find time to review those changes?
They have already been reviewed by Amit.

Now we have -rc3 and there is no feedback for regression/critical
patches (posted for -rc1).

> 
> Test HW:
> - Exynos4412 - TRATS2 board (Linux v3.12-rc1)
> 
> Lukasz Majewski (6):
>   thermal: exynos: fix: Return from exynos_report_trigger() when
>     therm_dev is NULL
>   thermal: exynos: Provide separate TMU data for Exynos4412
>   thermal: exynos: Provide initial setting for TMU's test MUX address
>     at Exynos4412
>   thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
>   ARM: dts: exynos4x12: Device tree node definition for TMU on
>     Exynos4x12
>   ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
> 
>  arch/arm/boot/dts/exynos4412-trats2.dts         |    5 +++++
>  arch/arm/boot/dts/exynos4x12.dtsi               |   10 +++++++++
>  drivers/thermal/samsung/exynos_thermal_common.c |    2 +-
>  drivers/thermal/samsung/exynos_tmu.c            |   12 +++++++----
>  drivers/thermal/samsung/exynos_tmu.h            |    3 ++-
>  drivers/thermal/samsung/exynos_tmu_data.c       |   26
> +++++++++++++++++------
> drivers/thermal/samsung/exynos_tmu_data.h       |   13 +++++++++++- 7
> files changed, 58 insertions(+), 13 deletions(-)
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL
  2013-09-24  8:08 ` [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL Lukasz Majewski
  2013-09-30 10:52   ` amit daniel kachhap
@ 2013-10-03 21:40   ` Eduardo Valentin
  2013-10-04  9:56     ` Lukasz Majewski
  1 sibling, 1 reply; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-03 21:40 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap,
	Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	linux-kernel, Bartlomiej Zolnierkiewicz, Tomasz Figa,
	Myungjoo Ham, devicetree, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 2295 bytes --]

On 24-09-2013 04:08, Lukasz Majewski wrote:
> The commit 4de0bdaa9677d11406c9becb70c60887c957e1f0
> ("thermal: exynos: Add support for instance based register/unregister")
> broke check for presence of therm_dev at global thermal zone in
> exynos_report_trigger().
> 
> The resulting wrong test prevents thermal_zone_device_update() call, which
> calls handlers for situation when trip points are passed.
> Such behavior prevents thermal driver from proper reaction (when TMU interrupt
> is raised) in a situation when overheating is detected at TMU hardware.
> This patch fixes it.
> 
> 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>
> ---
>  drivers/thermal/samsung/exynos_thermal_common.c |    2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
> index f10a6ad..55a912a 100644
> --- a/drivers/thermal/samsung/exynos_thermal_common.c
> +++ b/drivers/thermal/samsung/exynos_thermal_common.c
> @@ -310,7 +310,7 @@ void exynos_report_trigger(struct thermal_sensor_conf *conf)
>  	}
>  
>  	th_zone = conf->pzone_data;
> -	if (th_zone->therm_dev)
> +	if (!th_zone->therm_dev)

Fine with this fix, as it really looks obvious. But after reading the
code a bit, I am considering if we can remove the above check at all.

Reading the driver code piece at drivers/thermal/samsung/exynos_tmu.c,
by checking how exynos_register_thermal gets called, and how error is
handled, I assume we do not need to check for th_zone->therm_dev.

To me looks like the driver only allows th_zone's exist only with valid
therm_dev, isn't it? Except for the probe sequence, maybe, at run time
there is a time window that we have valid th_zone with invalid
therm_dev. However, reading the probe, still, the irq gets initialized
only in very end, so the work queue don't get queue till then at least.

So, my question before acking is, shall we remove this check altogether?


>  		return;
>  
>  	if (th_zone->bind == false) {
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412
  2013-09-24  8:08 ` [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
  2013-09-30 11:43   ` amit daniel kachhap
@ 2013-10-03 22:01   ` Eduardo Valentin
  2013-10-04 10:04     ` Lukasz Majewski
  1 sibling, 1 reply; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-03 22:01 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap,
	Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	linux-kernel, Bartlomiej Zolnierkiewicz, Tomasz Figa,
	Myungjoo Ham, devicetree, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 5908 bytes --]

Lukasz,

Just minor comments.

On 24-09-2013 04:08, Lukasz Majewski wrote:
> Up till now Exynos5250 and Exynos4412 had the same definitions for TMU
> data. Following commit changes that, by introducing separate
> exynos4412_default_tmu_data structure.
> 
> Since Exynos4412 was chronologically first, the corresponding name for
> TMU registers and default data was renamed.
> 
> Additionally, new SOC_ARCH_EXYNOS4412 type has been defined.

It is not clear the objective of the patch itself. Was it just to make
the code more readable or are you fixing something?

> 
> 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>
> ---
>  drivers/thermal/samsung/exynos_tmu.c      |    7 ++++---
>  drivers/thermal/samsung/exynos_tmu.h      |    1 +
>  drivers/thermal/samsung/exynos_tmu_data.c |   26 ++++++++++++++++++++------
>  drivers/thermal/samsung/exynos_tmu_data.h |    9 ++++++++-
>  4 files changed, 33 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index b43afda..a858cc4 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -488,7 +488,7 @@ static const struct of_device_id exynos_tmu_match[] = {
>  	},
>  	{
>  		.compatible = "samsung,exynos4412-tmu",
> -		.data = (void *)EXYNOS5250_TMU_DRV_DATA,
> +		.data = (void *)EXYNOS4412_TMU_DRV_DATA,
>  	},
>  	{
>  		.compatible = "samsung,exynos5250-tmu",
> @@ -630,8 +630,9 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>  		return ret;
>  
>  	if (pdata->type == SOC_ARCH_EXYNOS ||
> -		pdata->type == SOC_ARCH_EXYNOS4210 ||
> -				pdata->type == SOC_ARCH_EXYNOS5440)
> +	    pdata->type == SOC_ARCH_EXYNOS4210 ||
> +	    pdata->type == SOC_ARCH_EXYNOS4412 ||
> +	    pdata->type == SOC_ARCH_EXYNOS5440)
>  		data->soc = pdata->type;
>  	else {
>  		ret = -EINVAL;
> diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
> index b364c9e..db37df0 100644
> --- a/drivers/thermal/samsung/exynos_tmu.h
> +++ b/drivers/thermal/samsung/exynos_tmu.h
> @@ -41,6 +41,7 @@ enum calibration_mode {
>  
>  enum soc_type {
>  	SOC_ARCH_EXYNOS4210 = 1,
> +	SOC_ARCH_EXYNOS4412,
>  	SOC_ARCH_EXYNOS,
>  	SOC_ARCH_EXYNOS5440,
>  };

I believe the above enum needs some documentation. SOC_ARCH_EXYNOS seams
to be a bit confusing.

> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
> index 9002499..bd08093 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.c
> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> @@ -90,8 +90,8 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
>  };
>  #endif
>  
> -#if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)
> -static const struct exynos_tmu_registers exynos5250_tmu_registers = {
> +#if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
> +static const struct exynos_tmu_registers exynos4412_tmu_registers = {
>  	.triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
>  	.triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
>  	.triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
> @@ -128,7 +128,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
>  	.emul_time_mask = EXYNOS_EMUL_TIME_MASK,
>  };
>  
> -#define EXYNOS5250_TMU_DATA \
> +#define EXYNOS4412_TMU_DATA \
>  	.threshold_falling = 10, \
>  	.trigger_levels[0] = 85, \
>  	.trigger_levels[1] = 103, \
> @@ -162,15 +162,29 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
>  		.temp_level = 103, \
>  	}, \
>  	.freq_tab_count = 2, \
> -	.type = SOC_ARCH_EXYNOS, \
> -	.registers = &exynos5250_tmu_registers, \
> +	.registers = &exynos4412_tmu_registers, \
>  	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
>  			TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
>  			TMU_SUPPORT_EMUL_TIME)
> +#endif
>  
> +#if defined(CONFIG_SOC_EXYNOS4412)
> +struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
> +	.tmu_data = {
> +		{ EXYNOS4412_TMU_DATA,
> +		.type = SOC_ARCH_EXYNOS4412,
> +		},
> +	},
> +	.tmu_count = 1,
> +};
> +#endif
> +
> +#if defined(CONFIG_SOC_EXYNOS5250)
>  struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
>  	.tmu_data = {
> -		{ EXYNOS5250_TMU_DATA },
> +		{ EXYNOS4412_TMU_DATA,
> +		.type = SOC_ARCH_EXYNOS,
> +		},

Please add a comment on this initialization, specially because we start
to mix macros with inline initialization. Starts to be hard to follow.

Besides, I believe
+		{
+			EXYNOS4412_TMU_DATA,
+			.type = SOC_ARCH_EXYNOS,
+		},

is a much more common style.


>  	},
>  	.tmu_count = 1,
>  };
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
> index dc7feb5..b130b1e 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.h
> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> @@ -138,7 +138,14 @@ extern struct exynos_tmu_init_data const exynos4210_default_tmu_data;
>  #define EXYNOS4210_TMU_DRV_DATA (NULL)
>  #endif
>  
> -#if (defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412))
> +#if defined(CONFIG_SOC_EXYNOS4412)
> +extern struct exynos_tmu_init_data const exynos4412_default_tmu_data;
> +#define EXYNOS4412_TMU_DRV_DATA (&exynos4412_default_tmu_data)
> +#else
> +#define EXYNOS4412_TMU_DRV_DATA (NULL)
> +#endif
> +
> +#if defined(CONFIG_SOC_EXYNOS5250)
>  extern struct exynos_tmu_init_data const exynos5250_default_tmu_data;
>  #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data)
>  #else
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
  2013-09-24  8:08 ` [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
  2013-09-30 11:59   ` amit daniel kachhap
@ 2013-10-03 22:05   ` Eduardo Valentin
  2013-10-04 10:20     ` Lukasz Majewski
  1 sibling, 1 reply; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-03 22:05 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap,
	Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	linux-kernel, Bartlomiej Zolnierkiewicz, Tomasz Figa,
	Myungjoo Ham, devicetree, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 2428 bytes --]

On 24-09-2013 04:08, Lukasz Majewski wrote:
> The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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>
> ---
>  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
>  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
>  2 files changed, 7 insertions(+)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index a858cc4..21b89e4 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -317,6 +317,9 @@ static void exynos_tmu_control(struct platform_device *pdev, bool on)
>  
>  	con = readl(data->base + reg->tmu_ctrl);
>  
> +	if (pdata->type == SOC_ARCH_EXYNOS4412)
> +		con |= (EXYNOS4412_MUX_ADDR_VALUE << EXYNOS4412_MUX_ADDR_SHIFT);

Amit has introduced a way to describe features instead of checking
features per type. It would be interesting to have a reasoning why not
to use it. Think what if new Exynos TMU versions come, are you guys
going to steadily increase the above check for type?

> +
>  	if (pdata->reference_voltage) {
>  		con &= ~(reg->buf_vref_sel_mask << reg->buf_vref_sel_shift);
>  		con |= pdata->reference_voltage << reg->buf_vref_sel_shift;
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
> index b130b1e..a1ea19d 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.h
> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> @@ -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
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
  2013-09-24  8:08 ` [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250 Lukasz Majewski
  2013-09-30 12:02   ` amit daniel kachhap
@ 2013-10-03 22:08   ` Eduardo Valentin
  2013-10-04 10:13     ` Bartlomiej Zolnierkiewicz
  2013-10-04 10:23     ` Lukasz Majewski
  1 sibling, 2 replies; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-03 22:08 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, Amit Daniel Kachhap,
	Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	linux-kernel, Bartlomiej Zolnierkiewicz, Tomasz Figa,
	Myungjoo Ham, devicetree, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 2320 bytes --]

On 24-09-2013 04:08, Lukasz Majewski wrote:
> The TMU data definition is now separated to Exynos4412 and Exynos5250.
> 
> Now SOC_ARCH_EXYNOS only refers to Exynos5250. Hence the name
> SOC_ARCH_EXYNOS has been changed to SOC_ARCH_EXYNOS5250.
> 

How about merging this one with patch 02?

> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> ---
>  drivers/thermal/samsung/exynos_tmu.c      |    4 ++--
>  drivers/thermal/samsung/exynos_tmu.h      |    2 +-
>  drivers/thermal/samsung/exynos_tmu_data.c |    2 +-
>  3 files changed, 4 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 21b89e4..037cd46 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -632,9 +632,9 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	if (pdata->type == SOC_ARCH_EXYNOS ||
> -	    pdata->type == SOC_ARCH_EXYNOS4210 ||
> +	if (pdata->type == SOC_ARCH_EXYNOS4210 ||
>  	    pdata->type == SOC_ARCH_EXYNOS4412 ||
> +	    pdata->type == SOC_ARCH_EXYNOS5250 ||
>  	    pdata->type == SOC_ARCH_EXYNOS5440)
>  		data->soc = pdata->type;
>  	else {
> diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
> index db37df0..b42ece4 100644
> --- a/drivers/thermal/samsung/exynos_tmu.h
> +++ b/drivers/thermal/samsung/exynos_tmu.h
> @@ -42,7 +42,7 @@ enum calibration_mode {
>  enum soc_type {
>  	SOC_ARCH_EXYNOS4210 = 1,
>  	SOC_ARCH_EXYNOS4412,
> -	SOC_ARCH_EXYNOS,
> +	SOC_ARCH_EXYNOS5250,
>  	SOC_ARCH_EXYNOS5440,
>  };
>  
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
> index bd08093..188223f 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.c
> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> @@ -183,7 +183,7 @@ struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
>  struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
>  	.tmu_data = {
>  		{ EXYNOS4412_TMU_DATA,
> -		.type = SOC_ARCH_EXYNOS,
> +		.type = SOC_ARCH_EXYNOS5250,
>  		},
>  	},
>  	.tmu_count = 1,
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL
  2013-10-03 21:40   ` Eduardo Valentin
@ 2013-10-04  9:56     ` Lukasz Majewski
  0 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-04  9:56 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Zhang Rui, Amit Daniel Kachhap, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

Hi Eduardo,

Thanks for reply.

> On 24-09-2013 04:08, Lukasz Majewski wrote:
> > The commit 4de0bdaa9677d11406c9becb70c60887c957e1f0
> > ("thermal: exynos: Add support for instance based
> > register/unregister") broke check for presence of therm_dev at
> > global thermal zone in exynos_report_trigger().
> > 
> > The resulting wrong test prevents thermal_zone_device_update()
> > call, which calls handlers for situation when trip points are
> > passed. Such behavior prevents thermal driver from proper reaction
> > (when TMU interrupt is raised) in a situation when overheating is
> > detected at TMU hardware. This patch fixes it.
> > 
> > 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>
> > ---
> >  drivers/thermal/samsung/exynos_thermal_common.c |    2 +-
> >  1 file changed, 1 insertion(+), 1 deletion(-)
> > 
> > diff --git a/drivers/thermal/samsung/exynos_thermal_common.c
> > b/drivers/thermal/samsung/exynos_thermal_common.c index
> > f10a6ad..55a912a 100644 ---
> > a/drivers/thermal/samsung/exynos_thermal_common.c +++
> > b/drivers/thermal/samsung/exynos_thermal_common.c @@ -310,7 +310,7
> > @@ void exynos_report_trigger(struct thermal_sensor_conf *conf) }
> >  
> >  	th_zone = conf->pzone_data;
> > -	if (th_zone->therm_dev)
> > +	if (!th_zone->therm_dev)
> 
> Fine with this fix, as it really looks obvious. But after reading the
> code a bit, I am considering if we can remove the above check at all.

I have just preserved the old behaviour for -rcX fix.

> 
> Reading the driver code piece at drivers/thermal/samsung/exynos_tmu.c,
> by checking how exynos_register_thermal gets called, and how error is
> handled, I assume we do not need to check for th_zone->therm_dev.

It looks like we don't need this check (we will not register the
thermal zone if therm dev is not correct).

> 
> To me looks like the driver only allows th_zone's exist only with
> valid therm_dev, isn't it? Except for the probe sequence, maybe, at
> run time there is a time window that we have valid th_zone with
> invalid therm_dev. However, reading the probe, still, the irq gets
> initialized only in very end, so the work queue don't get queue till
> then at least.
> 
> So, my question before acking is, shall we remove this check
> altogether?

I think that it is up to you to decide how we proceed. 

Shall this patch go into v3.12-rcX since it is "obvious" (and documents
what and when was broken) or would you require to prepare "new" patch
with removal of this check?

> 
> 
> >  		return;
> >  
> >  	if (th_zone->bind == false) {
> > 
> 
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412
  2013-10-03 22:01   ` Eduardo Valentin
@ 2013-10-04 10:04     ` Lukasz Majewski
  0 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-04 10:04 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Zhang Rui, Amit Daniel Kachhap, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

Hi Eduardo,

> Lukasz,
> 
> Just minor comments.
> 
> On 24-09-2013 04:08, Lukasz Majewski wrote:
> > Up till now Exynos5250 and Exynos4412 had the same definitions for
> > TMU data. Following commit changes that, by introducing separate
> > exynos4412_default_tmu_data structure.
> > 
> > Since Exynos4412 was chronologically first, the corresponding name
> > for TMU registers and default data was renamed.
> > 
> > Additionally, new SOC_ARCH_EXYNOS4412 type has been defined.
> 
> It is not clear the objective of the patch itself. Was it just to make
> the code more readable or are you fixing something?

I'm fixing thermal on EXYNOS4412 device (trats2). The problem here is
to do it properly, since on the current code EXYNOS4412 and EXYNOS5250
uses the same configuration data.

To fix this problem, I had to split them. Also chronologically the
THERMAL IP first appeared on EXYNOS4412, not EXYNOS5250.

> 
> > 
> > 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>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c      |    7 ++++---
> >  drivers/thermal/samsung/exynos_tmu.h      |    1 +
> >  drivers/thermal/samsung/exynos_tmu_data.c |   26
> > ++++++++++++++++++++------
> > drivers/thermal/samsung/exynos_tmu_data.h |    9 ++++++++- 4 files
> > changed, 33 insertions(+), 10 deletions(-)
> > 
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index b43afda..a858cc4 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -488,7 +488,7 @@ static const struct of_device_id
> > exynos_tmu_match[] = { },
> >  	{
> >  		.compatible = "samsung,exynos4412-tmu",
> > -		.data = (void *)EXYNOS5250_TMU_DRV_DATA,
> > +		.data = (void *)EXYNOS4412_TMU_DRV_DATA,
> >  	},
> >  	{
> >  		.compatible = "samsung,exynos5250-tmu",
> > @@ -630,8 +630,9 @@ static int exynos_tmu_probe(struct
> > platform_device *pdev) return ret;
> >  
> >  	if (pdata->type == SOC_ARCH_EXYNOS ||
> > -		pdata->type == SOC_ARCH_EXYNOS4210 ||
> > -				pdata->type == SOC_ARCH_EXYNOS5440)
> > +	    pdata->type == SOC_ARCH_EXYNOS4210 ||
> > +	    pdata->type == SOC_ARCH_EXYNOS4412 ||
> > +	    pdata->type == SOC_ARCH_EXYNOS5440)
> >  		data->soc = pdata->type;
> >  	else {
> >  		ret = -EINVAL;
> > diff --git a/drivers/thermal/samsung/exynos_tmu.h
> > b/drivers/thermal/samsung/exynos_tmu.h index b364c9e..db37df0 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.h
> > +++ b/drivers/thermal/samsung/exynos_tmu.h
> > @@ -41,6 +41,7 @@ enum calibration_mode {
> >  
> >  enum soc_type {
> >  	SOC_ARCH_EXYNOS4210 = 1,
> > +	SOC_ARCH_EXYNOS4412,
> >  	SOC_ARCH_EXYNOS,
> >  	SOC_ARCH_EXYNOS5440,
> >  };
> 
> I believe the above enum needs some documentation. SOC_ARCH_EXYNOS
> seams to be a bit confusing.

This is fixed at patch 4/6 of the series.

> 
> > diff --git a/drivers/thermal/samsung/exynos_tmu_data.c
> > b/drivers/thermal/samsung/exynos_tmu_data.c index 9002499..bd08093
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c
> > +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> > @@ -90,8 +90,8 @@ struct exynos_tmu_init_data const
> > exynos4210_default_tmu_data = { };
> >  #endif
> >  
> > -#if defined(CONFIG_SOC_EXYNOS5250) ||
> > defined(CONFIG_SOC_EXYNOS4412) -static const struct
> > exynos_tmu_registers exynos5250_tmu_registers = { +#if
> > defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
> > +static const struct exynos_tmu_registers exynos4412_tmu_registers
> > = { .triminfo_data = EXYNOS_TMU_REG_TRIMINFO, .triminfo_25_shift =
> > EXYNOS_TRIMINFO_25_SHIFT, .triminfo_85_shift =
> > EXYNOS_TRIMINFO_85_SHIFT, @@ -128,7 +128,7 @@ static const struct
> > exynos_tmu_registers exynos5250_tmu_registers = { .emul_time_mask =
> > EXYNOS_EMUL_TIME_MASK, };
> >  
> > -#define EXYNOS5250_TMU_DATA \
> > +#define EXYNOS4412_TMU_DATA \
> >  	.threshold_falling = 10, \
> >  	.trigger_levels[0] = 85, \
> >  	.trigger_levels[1] = 103, \
> > @@ -162,15 +162,29 @@ static const struct exynos_tmu_registers
> > exynos5250_tmu_registers = { .temp_level = 103, \
> >  	}, \
> >  	.freq_tab_count = 2, \
> > -	.type = SOC_ARCH_EXYNOS, \
> > -	.registers = &exynos5250_tmu_registers, \
> > +	.registers = &exynos4412_tmu_registers, \
> >  	.features = (TMU_SUPPORT_EMULATION |
> > TMU_SUPPORT_TRIM_RELOAD | \ TMU_SUPPORT_FALLING_TRIP |
> > TMU_SUPPORT_READY_STATUS | \ TMU_SUPPORT_EMUL_TIME)
> > +#endif
> >  
> > +#if defined(CONFIG_SOC_EXYNOS4412)
> > +struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
> > +	.tmu_data = {
> > +		{ EXYNOS4412_TMU_DATA,
> > +		.type = SOC_ARCH_EXYNOS4412,
> > +		},
> > +	},
> > +	.tmu_count = 1,
> > +};
> > +#endif
> > +
> > +#if defined(CONFIG_SOC_EXYNOS5250)
> >  struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
> >  	.tmu_data = {
> > -		{ EXYNOS5250_TMU_DATA },
> > +		{ EXYNOS4412_TMU_DATA,
> > +		.type = SOC_ARCH_EXYNOS,
> > +		},
> 
> Please add a comment on this initialization, specially because we
> start to mix macros with inline initialization. Starts to be hard to
> follow.
> 
> Besides, I believe
> +		{
> +			EXYNOS4412_TMU_DATA,
> +			.type = SOC_ARCH_EXYNOS,
> +		},
> 
> is a much more common style.

Ok.

> 
> 
> >  	},
> >  	.tmu_count = 1,
> >  };
> > diff --git a/drivers/thermal/samsung/exynos_tmu_data.h
> > b/drivers/thermal/samsung/exynos_tmu_data.h index dc7feb5..b130b1e
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h
> > +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> > @@ -138,7 +138,14 @@ extern struct exynos_tmu_init_data const
> > exynos4210_default_tmu_data; #define EXYNOS4210_TMU_DRV_DATA (NULL)
> >  #endif
> >  
> > -#if (defined(CONFIG_SOC_EXYNOS5250) ||
> > defined(CONFIG_SOC_EXYNOS4412)) +#if defined(CONFIG_SOC_EXYNOS4412)
> > +extern struct exynos_tmu_init_data const
> > exynos4412_default_tmu_data; +#define EXYNOS4412_TMU_DRV_DATA
> > (&exynos4412_default_tmu_data) +#else
> > +#define EXYNOS4412_TMU_DRV_DATA (NULL)
> > +#endif
> > +
> > +#if defined(CONFIG_SOC_EXYNOS5250)
> >  extern struct exynos_tmu_init_data const
> > exynos5250_default_tmu_data; #define EXYNOS5250_TMU_DRV_DATA
> > (&exynos5250_default_tmu_data) #else
> > 
> 
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
  2013-10-03 22:08   ` Eduardo Valentin
@ 2013-10-04 10:13     ` Bartlomiej Zolnierkiewicz
  2013-10-04 10:23     ` Lukasz Majewski
  1 sibling, 0 replies; 43+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2013-10-04 10:13 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Lukasz Majewski, Zhang Rui, Amit Daniel Kachhap,
	Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	linux-kernel, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc


Hi,

On Thursday, October 03, 2013 06:08:45 PM Eduardo Valentin wrote:
> On 24-09-2013 04:08, Lukasz Majewski wrote:
> > The TMU data definition is now separated to Exynos4412 and Exynos5250.
> > 
> > Now SOC_ARCH_EXYNOS only refers to Exynos5250. Hence the name
> > SOC_ARCH_EXYNOS has been changed to SOC_ARCH_EXYNOS5250.
> > 
> 
> How about merging this one with patch 02?

I would prefer that this is not done since patch #2 is a separate logical
change and it should be kept as a minimal preparatory patch for patch #3
(which is an important bugfix) to make potential backporting of fixes into
-stable etc. easier.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c      |    4 ++--
> >  drivers/thermal/samsung/exynos_tmu.h      |    2 +-
> >  drivers/thermal/samsung/exynos_tmu_data.c |    2 +-
> >  3 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> > index 21b89e4..037cd46 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -632,9 +632,9 @@ static int exynos_tmu_probe(struct platform_device *pdev)
> >  	if (ret)
> >  		return ret;
> >  
> > -	if (pdata->type == SOC_ARCH_EXYNOS ||
> > -	    pdata->type == SOC_ARCH_EXYNOS4210 ||
> > +	if (pdata->type == SOC_ARCH_EXYNOS4210 ||
> >  	    pdata->type == SOC_ARCH_EXYNOS4412 ||
> > +	    pdata->type == SOC_ARCH_EXYNOS5250 ||
> >  	    pdata->type == SOC_ARCH_EXYNOS5440)
> >  		data->soc = pdata->type;
> >  	else {
> > diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
> > index db37df0..b42ece4 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.h
> > +++ b/drivers/thermal/samsung/exynos_tmu.h
> > @@ -42,7 +42,7 @@ enum calibration_mode {
> >  enum soc_type {
> >  	SOC_ARCH_EXYNOS4210 = 1,
> >  	SOC_ARCH_EXYNOS4412,
> > -	SOC_ARCH_EXYNOS,
> > +	SOC_ARCH_EXYNOS5250,
> >  	SOC_ARCH_EXYNOS5440,
> >  };
> >  
> > diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
> > index bd08093..188223f 100644
> > --- a/drivers/thermal/samsung/exynos_tmu_data.c
> > +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> > @@ -183,7 +183,7 @@ struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
> >  struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
> >  	.tmu_data = {
> >  		{ EXYNOS4412_TMU_DATA,
> > -		.type = SOC_ARCH_EXYNOS,
> > +		.type = SOC_ARCH_EXYNOS5250,
> >  		},
> >  	},
> >  	.tmu_count = 1,


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
  2013-10-03 22:05   ` Eduardo Valentin
@ 2013-10-04 10:20     ` Lukasz Majewski
  0 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-04 10:20 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Zhang Rui, Amit Daniel Kachhap, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

Hi Eduardo,

> On 24-09-2013 04:08, Lukasz Majewski wrote:
> > The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
> >  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
> >  2 files changed, 7 insertions(+)
> > 
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index a858cc4..21b89e4 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -317,6 +317,9 @@ static void exynos_tmu_control(struct
> > platform_device *pdev, bool on) 
> >  	con = readl(data->base + reg->tmu_ctrl);
> >  
> > +	if (pdata->type == SOC_ARCH_EXYNOS4412)
> > +		con |= (EXYNOS4412_MUX_ADDR_VALUE <<
> > EXYNOS4412_MUX_ADDR_SHIFT);
> 
> Amit has introduced a way to describe features instead of checking
> features per type. It would be interesting to have a reasoning why not
> to use it. 

Problem with Exynos4412 and Exynos4212 is that _only_ those SoCs export
this MUX_ADDR field at TMU_CONTROL register. Also I _must_ setup it
correctly after reset (reset value causes board emergency shutdown).

The Exynos5250 defines it as a "reserved".

> Think what if new Exynos TMU versions come, are you guys
> going to steadily increase the above check for type?

As the alternative I can define the TMU_SUPPORT_MUX_ADDR at .features
field for EXYNOS4412_TMU_DATA.

Then I can test for this feature at exynos_tmu_control function.
Proper shift and mask can be defined at struct exynos_tmu_registers.

Eduardo, Amit, will we manage to review/pull those patches with new
approach before -rcX ends?

> 
> > +
> >  	if (pdata->reference_voltage) {
> >  		con &= ~(reg->buf_vref_sel_mask <<
> > reg->buf_vref_sel_shift); con |= pdata->reference_voltage <<
> > reg->buf_vref_sel_shift; diff --git
> > a/drivers/thermal/samsung/exynos_tmu_data.h
> > b/drivers/thermal/samsung/exynos_tmu_data.h index b130b1e..a1ea19d
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h +++
> > b/drivers/thermal/samsung/exynos_tmu_data.h @@ -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
> > 
> 
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
  2013-10-03 22:08   ` Eduardo Valentin
  2013-10-04 10:13     ` Bartlomiej Zolnierkiewicz
@ 2013-10-04 10:23     ` Lukasz Majewski
  2013-10-04 10:47       ` Bartlomiej Zolnierkiewicz
  1 sibling, 1 reply; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-04 10:23 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Zhang Rui, Amit Daniel Kachhap, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

Hi Eduardo,

> On 24-09-2013 04:08, Lukasz Majewski wrote:
> > The TMU data definition is now separated to Exynos4412 and
> > Exynos5250.
> > 
> > Now SOC_ARCH_EXYNOS only refers to Exynos5250. Hence the name
> > SOC_ARCH_EXYNOS has been changed to SOC_ARCH_EXYNOS5250.
> > 
> 
> How about merging this one with patch 02?

I wanted to show how the work was logically split - patch 02
extracts Exynos4412 from Exynos5250. Then this patch changes the name.

I will merge those two patches. No problem.

> 
> > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > ---
> >  drivers/thermal/samsung/exynos_tmu.c      |    4 ++--
> >  drivers/thermal/samsung/exynos_tmu.h      |    2 +-
> >  drivers/thermal/samsung/exynos_tmu_data.c |    2 +-
> >  3 files changed, 4 insertions(+), 4 deletions(-)
> > 
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index 21b89e4..037cd46 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -632,9 +632,9 @@ static int exynos_tmu_probe(struct
> > platform_device *pdev) if (ret)
> >  		return ret;
> >  
> > -	if (pdata->type == SOC_ARCH_EXYNOS ||
> > -	    pdata->type == SOC_ARCH_EXYNOS4210 ||
> > +	if (pdata->type == SOC_ARCH_EXYNOS4210 ||
> >  	    pdata->type == SOC_ARCH_EXYNOS4412 ||
> > +	    pdata->type == SOC_ARCH_EXYNOS5250 ||
> >  	    pdata->type == SOC_ARCH_EXYNOS5440)
> >  		data->soc = pdata->type;
> >  	else {
> > diff --git a/drivers/thermal/samsung/exynos_tmu.h
> > b/drivers/thermal/samsung/exynos_tmu.h index db37df0..b42ece4 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.h
> > +++ b/drivers/thermal/samsung/exynos_tmu.h
> > @@ -42,7 +42,7 @@ enum calibration_mode {
> >  enum soc_type {
> >  	SOC_ARCH_EXYNOS4210 = 1,
> >  	SOC_ARCH_EXYNOS4412,
> > -	SOC_ARCH_EXYNOS,
> > +	SOC_ARCH_EXYNOS5250,
> >  	SOC_ARCH_EXYNOS5440,
> >  };
> >  
> > diff --git a/drivers/thermal/samsung/exynos_tmu_data.c
> > b/drivers/thermal/samsung/exynos_tmu_data.c index bd08093..188223f
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c
> > +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> > @@ -183,7 +183,7 @@ struct exynos_tmu_init_data const
> > exynos4412_default_tmu_data = { struct exynos_tmu_init_data const
> > exynos5250_default_tmu_data = { .tmu_data = {
> >  		{ EXYNOS4412_TMU_DATA,
> > -		.type = SOC_ARCH_EXYNOS,
> > +		.type = SOC_ARCH_EXYNOS5250,
> >  		},
> >  	},
> >  	.tmu_count = 1,
> > 
> 
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
  2013-10-04 10:23     ` Lukasz Majewski
@ 2013-10-04 10:47       ` Bartlomiej Zolnierkiewicz
  2013-10-04 15:07         ` Eduardo Valentin
  0 siblings, 1 reply; 43+ messages in thread
From: Bartlomiej Zolnierkiewicz @ 2013-10-04 10:47 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Eduardo Valentin, Zhang Rui, Amit Daniel Kachhap,
	Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	linux-kernel, Tomasz Figa, Myungjoo Ham, devicetree,
	linux-samsung-soc

On Friday, October 04, 2013 12:23:30 PM Lukasz Majewski wrote:
> Hi Eduardo,
> 
> > On 24-09-2013 04:08, Lukasz Majewski wrote:
> > > The TMU data definition is now separated to Exynos4412 and
> > > Exynos5250.
> > > 
> > > Now SOC_ARCH_EXYNOS only refers to Exynos5250. Hence the name
> > > SOC_ARCH_EXYNOS has been changed to SOC_ARCH_EXYNOS5250.
> > > 
> > 
> > How about merging this one with patch 02?
> 
> I wanted to show how the work was logically split - patch 02
> extracts Exynos4412 from Exynos5250. Then this patch changes the name.
> 
> I will merge those two patches. No problem.

Oh, well. Looking at the patch #2 again the merge can be done without
sacrificing backportability.

Best regards,
--
Bartlomiej Zolnierkiewicz
Samsung R&D Institute Poland
Samsung Electronics

> > 
> > > Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
> > > ---
> > >  drivers/thermal/samsung/exynos_tmu.c      |    4 ++--
> > >  drivers/thermal/samsung/exynos_tmu.h      |    2 +-
> > >  drivers/thermal/samsung/exynos_tmu_data.c |    2 +-
> > >  3 files changed, 4 insertions(+), 4 deletions(-)
> > > 
> > > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > > b/drivers/thermal/samsung/exynos_tmu.c index 21b89e4..037cd46 100644
> > > --- a/drivers/thermal/samsung/exynos_tmu.c
> > > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > > @@ -632,9 +632,9 @@ static int exynos_tmu_probe(struct
> > > platform_device *pdev) if (ret)
> > >  		return ret;
> > >  
> > > -	if (pdata->type == SOC_ARCH_EXYNOS ||
> > > -	    pdata->type == SOC_ARCH_EXYNOS4210 ||
> > > +	if (pdata->type == SOC_ARCH_EXYNOS4210 ||
> > >  	    pdata->type == SOC_ARCH_EXYNOS4412 ||
> > > +	    pdata->type == SOC_ARCH_EXYNOS5250 ||
> > >  	    pdata->type == SOC_ARCH_EXYNOS5440)
> > >  		data->soc = pdata->type;
> > >  	else {
> > > diff --git a/drivers/thermal/samsung/exynos_tmu.h
> > > b/drivers/thermal/samsung/exynos_tmu.h index db37df0..b42ece4 100644
> > > --- a/drivers/thermal/samsung/exynos_tmu.h
> > > +++ b/drivers/thermal/samsung/exynos_tmu.h
> > > @@ -42,7 +42,7 @@ enum calibration_mode {
> > >  enum soc_type {
> > >  	SOC_ARCH_EXYNOS4210 = 1,
> > >  	SOC_ARCH_EXYNOS4412,
> > > -	SOC_ARCH_EXYNOS,
> > > +	SOC_ARCH_EXYNOS5250,
> > >  	SOC_ARCH_EXYNOS5440,
> > >  };
> > >  
> > > diff --git a/drivers/thermal/samsung/exynos_tmu_data.c
> > > b/drivers/thermal/samsung/exynos_tmu_data.c index bd08093..188223f
> > > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c
> > > +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> > > @@ -183,7 +183,7 @@ struct exynos_tmu_init_data const
> > > exynos4412_default_tmu_data = { struct exynos_tmu_init_data const
> > > exynos5250_default_tmu_data = { .tmu_data = {
> > >  		{ EXYNOS4412_TMU_DATA,
> > > -		.type = SOC_ARCH_EXYNOS,
> > > +		.type = SOC_ARCH_EXYNOS5250,
> > >  		},
> > >  	},
> > >  	.tmu_count = 1,


^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
  2013-10-04 10:47       ` Bartlomiej Zolnierkiewicz
@ 2013-10-04 15:07         ` Eduardo Valentin
  0 siblings, 0 replies; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-04 15:07 UTC (permalink / raw)
  To: Bartlomiej Zolnierkiewicz
  Cc: Lukasz Majewski, Eduardo Valentin, Zhang Rui,
	Amit Daniel Kachhap, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel, Tomasz Figa,
	Myungjoo Ham, devicetree, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 3515 bytes --]

On 04-10-2013 06:47, Bartlomiej Zolnierkiewicz wrote:
> On Friday, October 04, 2013 12:23:30 PM Lukasz Majewski wrote:
>> Hi Eduardo,
>>
>>> On 24-09-2013 04:08, Lukasz Majewski wrote:
>>>> The TMU data definition is now separated to Exynos4412 and
>>>> Exynos5250.
>>>>
>>>> Now SOC_ARCH_EXYNOS only refers to Exynos5250. Hence the name
>>>> SOC_ARCH_EXYNOS has been changed to SOC_ARCH_EXYNOS5250.
>>>>
>>>
>>> How about merging this one with patch 02?
>>
>> I wanted to show how the work was logically split - patch 02
>> extracts Exynos4412 from Exynos5250. Then this patch changes the name.
>>
>> I will merge those two patches. No problem.
> 
> Oh, well. Looking at the patch #2 again the merge can be done without
> sacrificing backportability.

Please, merge them and describe that you are reworking the type and the
enum definition. Also add your reasonings, specially if you found bugs.
The way the descriptions are being presented, the bugs you found do not
get properly explained.

> 
> Best regards,
> --
> Bartlomiej Zolnierkiewicz
> Samsung R&D Institute Poland
> Samsung Electronics
> 
>>>
>>>> Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
>>>> ---
>>>>  drivers/thermal/samsung/exynos_tmu.c      |    4 ++--
>>>>  drivers/thermal/samsung/exynos_tmu.h      |    2 +-
>>>>  drivers/thermal/samsung/exynos_tmu_data.c |    2 +-
>>>>  3 files changed, 4 insertions(+), 4 deletions(-)
>>>>
>>>> diff --git a/drivers/thermal/samsung/exynos_tmu.c
>>>> b/drivers/thermal/samsung/exynos_tmu.c index 21b89e4..037cd46 100644
>>>> --- a/drivers/thermal/samsung/exynos_tmu.c
>>>> +++ b/drivers/thermal/samsung/exynos_tmu.c
>>>> @@ -632,9 +632,9 @@ static int exynos_tmu_probe(struct
>>>> platform_device *pdev) if (ret)
>>>>  		return ret;
>>>>  
>>>> -	if (pdata->type == SOC_ARCH_EXYNOS ||
>>>> -	    pdata->type == SOC_ARCH_EXYNOS4210 ||
>>>> +	if (pdata->type == SOC_ARCH_EXYNOS4210 ||
>>>>  	    pdata->type == SOC_ARCH_EXYNOS4412 ||
>>>> +	    pdata->type == SOC_ARCH_EXYNOS5250 ||
>>>>  	    pdata->type == SOC_ARCH_EXYNOS5440)
>>>>  		data->soc = pdata->type;
>>>>  	else {
>>>> diff --git a/drivers/thermal/samsung/exynos_tmu.h
>>>> b/drivers/thermal/samsung/exynos_tmu.h index db37df0..b42ece4 100644
>>>> --- a/drivers/thermal/samsung/exynos_tmu.h
>>>> +++ b/drivers/thermal/samsung/exynos_tmu.h
>>>> @@ -42,7 +42,7 @@ enum calibration_mode {
>>>>  enum soc_type {
>>>>  	SOC_ARCH_EXYNOS4210 = 1,
>>>>  	SOC_ARCH_EXYNOS4412,
>>>> -	SOC_ARCH_EXYNOS,
>>>> +	SOC_ARCH_EXYNOS5250,
>>>>  	SOC_ARCH_EXYNOS5440,
>>>>  };
>>>>  
>>>> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c
>>>> b/drivers/thermal/samsung/exynos_tmu_data.c index bd08093..188223f
>>>> 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c
>>>> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
>>>> @@ -183,7 +183,7 @@ struct exynos_tmu_init_data const
>>>> exynos4412_default_tmu_data = { struct exynos_tmu_init_data const
>>>> exynos5250_default_tmu_data = { .tmu_data = {
>>>>  		{ EXYNOS4412_TMU_DATA,
>>>> -		.type = SOC_ARCH_EXYNOS,
>>>> +		.type = SOC_ARCH_EXYNOS5250,
>>>>  		},
>>>>  	},
>>>>  	.tmu_count = 1,
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
  2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
                   ` (7 preceding siblings ...)
  2013-10-03 13:29 ` Lukasz Majewski
@ 2013-10-09  6:29 ` Lukasz Majewski
  2013-10-09  6:29   ` [PATCH v2 1/5] thermal: exynos: Remove check for thermal device pointer at exynos_report_trigger() Lukasz Majewski
                     ` (5 more replies)
  8 siblings, 6 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-09  6:29 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, kgene.kim
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, Amit Daniel Kachhap,
	linux-samsung-soc

This patch series is divided into two parts:
1. Device tree node definition and enabelement for TMU at Exynos4412 (Trats2)
2. Exynos thermal subsystem regressions for v3.12-rc4. Several commits were 
   necessary to properly fix regression for TMU test MUX address setting after
   reset.

Test HW:
- Exynos4412 - TRATS2 board (Linux v3.12-rc4)
SHA1: 8b5ede69d24db939f52b47effff2f6fe1e83e08b


Lukasz Majewski (5):
  thermal: exynos: Remove check for thermal device pointer at
    exynos_report_trigger()
  thermal: exynos: Provide separate TMU data for Exynos4412
  thermal: exynos: Provide initial setting for TMU's test MUX address
    at Exynos4412
  ARM: dts: exynos4x12: Device tree node definition for TMU on
    Exynos4x12
  ARM: dts: exynos4412-trats2: Enable TMU support at Trats2

 arch/arm/boot/dts/exynos4412-trats2.dts         |    5 ++++
 arch/arm/boot/dts/exynos4x12.dtsi               |   10 ++++++++
 drivers/thermal/samsung/exynos_thermal_common.c |    2 --
 drivers/thermal/samsung/exynos_tmu.c            |   12 ++++++---
 drivers/thermal/samsung/exynos_tmu.h            |    7 +++++-
 drivers/thermal/samsung/exynos_tmu_data.c       |   30 ++++++++++++++++++-----
 drivers/thermal/samsung/exynos_tmu_data.h       |   13 +++++++++-
 7 files changed, 65 insertions(+), 14 deletions(-)

-- 
1.7.10.4


^ permalink raw reply	[flat|nested] 43+ messages in thread

* [PATCH v2 1/5] thermal: exynos: Remove check for thermal device pointer at exynos_report_trigger()
  2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
@ 2013-10-09  6:29   ` Lukasz Majewski
  2013-10-09  6:29   ` [PATCH v2 2/5] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-09  6:29 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, kgene.kim
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, Amit Daniel Kachhap,
	linux-samsung-soc

The commit 4de0bdaa9677d11406c9becb70c60887c957e1f0
("thermal: exynos: Add support for instance based register/unregister")
broke check for presence of therm_dev at global thermal zone in
exynos_report_trigger().

The resulting wrong test prevents thermal_zone_device_update() call, which
calls handlers for situation when trip points are passed.
Such behavior prevents thermal driver from proper reaction (when TMU interrupt
is raised) in a situation when overheating is detected at TMU hardware.

It turns out, that after exynos thermal subsystem redesign (at v3.12) this
check is not needed, since it is not possible to register thermal zone
without valid thermal device.

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>

---
Changes for v2:
- Remove check for th_zone->therm_dev at exynos_report_trigger()

 drivers/thermal/samsung/exynos_thermal_common.c |    2 --
 1 file changed, 2 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_thermal_common.c b/drivers/thermal/samsung/exynos_thermal_common.c
index f10a6ad..c2301da 100644
--- a/drivers/thermal/samsung/exynos_thermal_common.c
+++ b/drivers/thermal/samsung/exynos_thermal_common.c
@@ -310,8 +310,6 @@ void exynos_report_trigger(struct thermal_sensor_conf *conf)
 	}
 
 	th_zone = conf->pzone_data;
-	if (th_zone->therm_dev)
-		return;
 
 	if (th_zone->bind == false) {
 		for (i = 0; i < th_zone->cool_dev_size; i++) {
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 2/5] thermal: exynos: Provide separate TMU data for Exynos4412
  2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
  2013-10-09  6:29   ` [PATCH v2 1/5] thermal: exynos: Remove check for thermal device pointer at exynos_report_trigger() Lukasz Majewski
@ 2013-10-09  6:29   ` Lukasz Majewski
  2013-10-14 14:20     ` Eduardo Valentin
  2013-10-09  6:29   ` [PATCH v2 3/5] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
                     ` (3 subsequent siblings)
  5 siblings, 1 reply; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-09  6:29 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, kgene.kim
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, Amit Daniel Kachhap,
	linux-samsung-soc

Up till now Exynos5250 and Exynos4412 had the same definitions for TMU
data. Following commit changes that, by introducing separate
exynos4412_default_tmu_data structure.

Since Exynos4412 was chronologically first, the corresponding name for
TMU registers and default data was renamed.

Additionally, new SOC_ARCH_EXYNOS4412 type has been defined.

Moreover, the SOC_ARCH_EXYNOS name has been changed to SOC_ARCH_EXYNOS5250.

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>

---
Changes for v2:
- Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
- Fix coding style for tmu_data elements definition

 drivers/thermal/samsung/exynos_tmu.c      |    9 +++++----
 drivers/thermal/samsung/exynos_tmu.h      |    3 ++-
 drivers/thermal/samsung/exynos_tmu_data.c |   28 ++++++++++++++++++++++------
 drivers/thermal/samsung/exynos_tmu_data.h |    9 ++++++++-
 4 files changed, 37 insertions(+), 12 deletions(-)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index b43afda..1312b34 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -488,7 +488,7 @@ static const struct of_device_id exynos_tmu_match[] = {
 	},
 	{
 		.compatible = "samsung,exynos4412-tmu",
-		.data = (void *)EXYNOS5250_TMU_DRV_DATA,
+		.data = (void *)EXYNOS4412_TMU_DRV_DATA,
 	},
 	{
 		.compatible = "samsung,exynos5250-tmu",
@@ -629,9 +629,10 @@ static int exynos_tmu_probe(struct platform_device *pdev)
 	if (ret)
 		return ret;
 
-	if (pdata->type == SOC_ARCH_EXYNOS ||
-		pdata->type == SOC_ARCH_EXYNOS4210 ||
-				pdata->type == SOC_ARCH_EXYNOS5440)
+	if (pdata->type == SOC_ARCH_EXYNOS4210 ||
+	    pdata->type == SOC_ARCH_EXYNOS4412 ||
+	    pdata->type == SOC_ARCH_EXYNOS5250 ||
+	    pdata->type == SOC_ARCH_EXYNOS5440)
 		data->soc = pdata->type;
 	else {
 		ret = -EINVAL;
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
index b364c9e..b42ece4 100644
--- a/drivers/thermal/samsung/exynos_tmu.h
+++ b/drivers/thermal/samsung/exynos_tmu.h
@@ -41,7 +41,8 @@ enum calibration_mode {
 
 enum soc_type {
 	SOC_ARCH_EXYNOS4210 = 1,
-	SOC_ARCH_EXYNOS,
+	SOC_ARCH_EXYNOS4412,
+	SOC_ARCH_EXYNOS5250,
 	SOC_ARCH_EXYNOS5440,
 };
 
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index 9002499..d8de5c1 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -90,8 +90,8 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
 };
 #endif
 
-#if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)
-static const struct exynos_tmu_registers exynos5250_tmu_registers = {
+#if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
+static const struct exynos_tmu_registers exynos4412_tmu_registers = {
 	.triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
 	.triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
 	.triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
@@ -128,7 +128,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
 	.emul_time_mask = EXYNOS_EMUL_TIME_MASK,
 };
 
-#define EXYNOS5250_TMU_DATA \
+#define EXYNOS4412_TMU_DATA \
 	.threshold_falling = 10, \
 	.trigger_levels[0] = 85, \
 	.trigger_levels[1] = 103, \
@@ -162,15 +162,31 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
 		.temp_level = 103, \
 	}, \
 	.freq_tab_count = 2, \
-	.type = SOC_ARCH_EXYNOS, \
-	.registers = &exynos5250_tmu_registers, \
+	.registers = &exynos4412_tmu_registers, \
 	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
 			TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
 			TMU_SUPPORT_EMUL_TIME)
+#endif
 
+#if defined(CONFIG_SOC_EXYNOS4412)
+struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
+	.tmu_data = {
+		{
+			EXYNOS4412_TMU_DATA,
+			.type = SOC_ARCH_EXYNOS4412,
+		},
+	},
+	.tmu_count = 1,
+};
+#endif
+
+#if defined(CONFIG_SOC_EXYNOS5250)
 struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
 	.tmu_data = {
-		{ EXYNOS5250_TMU_DATA },
+		{
+			EXYNOS4412_TMU_DATA,
+			.type = SOC_ARCH_EXYNOS5250,
+		},
 	},
 	.tmu_count = 1,
 };
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
index dc7feb5..b130b1e 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.h
+++ b/drivers/thermal/samsung/exynos_tmu_data.h
@@ -138,7 +138,14 @@ extern struct exynos_tmu_init_data const exynos4210_default_tmu_data;
 #define EXYNOS4210_TMU_DRV_DATA (NULL)
 #endif
 
-#if (defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412))
+#if defined(CONFIG_SOC_EXYNOS4412)
+extern struct exynos_tmu_init_data const exynos4412_default_tmu_data;
+#define EXYNOS4412_TMU_DRV_DATA (&exynos4412_default_tmu_data)
+#else
+#define EXYNOS4412_TMU_DRV_DATA (NULL)
+#endif
+
+#if defined(CONFIG_SOC_EXYNOS5250)
 extern struct exynos_tmu_init_data const exynos5250_default_tmu_data;
 #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data)
 #else
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 3/5] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
  2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
  2013-10-09  6:29   ` [PATCH v2 1/5] thermal: exynos: Remove check for thermal device pointer at exynos_report_trigger() Lukasz Majewski
  2013-10-09  6:29   ` [PATCH v2 2/5] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
@ 2013-10-09  6:29   ` Lukasz Majewski
  2013-10-14 14:24     ` Eduardo Valentin
  2013-10-09  6:29   ` [PATCH v2 4/5] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12 Lukasz Majewski
                     ` (2 subsequent siblings)
  5 siblings, 1 reply; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-09  6:29 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, kgene.kim
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, Amit Daniel Kachhap,
	linux-samsung-soc

The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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>

---
Changes for v2:
- Define test_mux and test_mux_addr_shift to not use direct register access
- Remove pdata->type == SOC_ARCH_EXYNOS4412 check at exynos_tmu_control() and
  use only generic code

 drivers/thermal/samsung/exynos_tmu.c      |    3 +++
 drivers/thermal/samsung/exynos_tmu.h      |    4 ++++
 drivers/thermal/samsung/exynos_tmu_data.c |    2 ++
 drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
 4 files changed, 13 insertions(+)

diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
index 1312b34..32f38b9 100644
--- a/drivers/thermal/samsung/exynos_tmu.c
+++ b/drivers/thermal/samsung/exynos_tmu.c
@@ -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;
diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
index b42ece4..3fb6554 100644
--- a/drivers/thermal/samsung/exynos_tmu.h
+++ b/drivers/thermal/samsung/exynos_tmu.h
@@ -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.
@@ -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;
@@ -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.
@@ -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;
diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
index d8de5c1..073c292 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.c
+++ b/drivers/thermal/samsung/exynos_tmu_data.c
@@ -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,
@@ -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,
diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
index b130b1e..a1ea19d 100644
--- a/drivers/thermal/samsung/exynos_tmu_data.h
+++ b/drivers/thermal/samsung/exynos_tmu_data.h
@@ -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
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 4/5] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12
  2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
                     ` (2 preceding siblings ...)
  2013-10-09  6:29   ` [PATCH v2 3/5] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
@ 2013-10-09  6:29   ` Lukasz Majewski
  2014-11-14 10:03     ` [RESEND PATCH 1/2] " Lukasz Majewski
  2013-10-09  6:29   ` [PATCH v2 5/5] " Lukasz Majewski
  2013-10-14  5:46   ` [PATCH v2 0/5] thermal: exynos: Fixes for v3.12 Lukasz Majewski
  5 siblings, 1 reply; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-09  6:29 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, kgene.kim
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, Amit Daniel Kachhap,
	linux-samsung-soc

The TMU device tree node definition for Exynos4x12 family of SoCs.

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>

---
Changes for v2:
- None

 arch/arm/boot/dts/exynos4x12.dtsi |   10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
index ad531fe..64c0ece 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -176,4 +176,14 @@
 			};
 		};
 	};
+
+	tmu@100C0000 {
+		compatible = "samsung,exynos4412-tmu";
+		interrupt-parent = <&combiner>;
+		interrupts = <2 4>;
+		reg = <0x100C0000 0x100>;
+		clocks = <&clock 383>;
+		clock-names = "tmu_apbif";
+		status = "disabled";
+	};
 };
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [PATCH v2 5/5] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
  2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
                     ` (3 preceding siblings ...)
  2013-10-09  6:29   ` [PATCH v2 4/5] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12 Lukasz Majewski
@ 2013-10-09  6:29   ` Lukasz Majewski
  2013-10-14  5:46   ` [PATCH v2 0/5] thermal: exynos: Fixes for v3.12 Lukasz Majewski
  5 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-09  6:29 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, kgene.kim
  Cc: Rafael J. Wysocki, Linux PM list, Jonghwa Lee, Lukasz Majewski,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	Tomasz Figa, Myungjoo Ham, devicetree, Amit Daniel Kachhap,
	linux-samsung-soc

This patch enables support for TMU at Exynos4412 based Trats2 board.

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>

---
Changes for v2:
- None

 arch/arm/boot/dts/exynos4412-trats2.dts |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index fb7b9ae..57136f8 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -467,6 +467,11 @@
 		status = "okay";
 	};
 
+	tmu@100C0000 {
+		vtmu-supply = <&ldo10_reg>;
+		status = "okay";
+	};
+
 	i2c_ak8975: i2c-gpio-0 {
 		compatible = "i2c-gpio";
 		gpios = <&gpy2 4 0>, <&gpy2 5 0>;
-- 
1.7.10.4


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
  2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
                     ` (4 preceding siblings ...)
  2013-10-09  6:29   ` [PATCH v2 5/5] " Lukasz Majewski
@ 2013-10-14  5:46   ` Lukasz Majewski
  2013-10-14  5:52     ` Zhang, Rui
  5 siblings, 1 reply; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-14  5:46 UTC (permalink / raw)
  To: Zhang Rui, Eduardo Valentin, kgene.kim
  Cc: Lukasz Majewski, Linux PM list, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, devicetree, Amit Daniel Kachhap,
	linux-samsung-soc

Hi Zhang, Eduardo,

> This patch series is divided into two parts:
> 1. Device tree node definition and enabelement for TMU at Exynos4412
> (Trats2) 2. Exynos thermal subsystem regressions for v3.12-rc4.
> Several commits were necessary to properly fix regression for TMU
> test MUX address setting after reset.
> 
> Test HW:
> - Exynos4412 - TRATS2 board (Linux v3.12-rc4)
> SHA1: 8b5ede69d24db939f52b47effff2f6fe1e83e08b
> 
> 
> Lukasz Majewski (5):
>   thermal: exynos: Remove check for thermal device pointer at
>     exynos_report_trigger()
>   thermal: exynos: Provide separate TMU data for Exynos4412
>   thermal: exynos: Provide initial setting for TMU's test MUX address
>     at Exynos4412
>   ARM: dts: exynos4x12: Device tree node definition for TMU on
>     Exynos4x12
>   ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
> 

Zhang, Eduardo - any comments?

Would it be possible to add them to v3.12 since they do fix critical
error and regression on Exynos4412.


>  arch/arm/boot/dts/exynos4412-trats2.dts         |    5 ++++
>  arch/arm/boot/dts/exynos4x12.dtsi               |   10 ++++++++
>  drivers/thermal/samsung/exynos_thermal_common.c |    2 --
>  drivers/thermal/samsung/exynos_tmu.c            |   12 ++++++---
>  drivers/thermal/samsung/exynos_tmu.h            |    7 +++++-
>  drivers/thermal/samsung/exynos_tmu_data.c       |   30
> ++++++++++++++++++-----
> drivers/thermal/samsung/exynos_tmu_data.h       |   13 +++++++++- 7
> files changed, 65 insertions(+), 14 deletions(-)
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* RE: [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
  2013-10-14  5:46   ` [PATCH v2 0/5] thermal: exynos: Fixes for v3.12 Lukasz Majewski
@ 2013-10-14  5:52     ` Zhang, Rui
  2013-10-14 19:13       ` Eduardo Valentin
  0 siblings, 1 reply; 43+ messages in thread
From: Zhang, Rui @ 2013-10-14  5:52 UTC (permalink / raw)
  To: Lukasz Majewski, Eduardo Valentin, kgene.kim
  Cc: Linux PM list, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, devicetree, Amit Daniel Kachhap,
	linux-samsung-soc

Eduardo,

What's your opinion on this patch set?
BTW, please send me all the urgent fixes for thermal soc drivers that you think should go to 3.12.

Thanks,
rui
> -----Original Message-----
> From: Lukasz Majewski [mailto:l.majewski@samsung.com]
> Sent: Monday, October 14, 2013 1:47 PM
> To: Zhang, Rui; Eduardo Valentin; kgene.kim@samsung.com
> Cc: Lukasz Majewski; Linux PM list; Lukasz Majewski; linux-kernel;
> Bartlomiej Zolnierkiewicz; devicetree@vger.kernel.org; Amit Daniel
> Kachhap; linux-samsung-soc@vger.kernel.org
> Subject: Re: [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
> Importance: High
> 
> Hi Zhang, Eduardo,
> 
> > This patch series is divided into two parts:
> > 1. Device tree node definition and enabelement for TMU at Exynos4412
> > (Trats2) 2. Exynos thermal subsystem regressions for v3.12-rc4.
> > Several commits were necessary to properly fix regression for TMU
> test
> > MUX address setting after reset.
> >
> > Test HW:
> > - Exynos4412 - TRATS2 board (Linux v3.12-rc4)
> > SHA1: 8b5ede69d24db939f52b47effff2f6fe1e83e08b
> >
> >
> > Lukasz Majewski (5):
> >   thermal: exynos: Remove check for thermal device pointer at
> >     exynos_report_trigger()
> >   thermal: exynos: Provide separate TMU data for Exynos4412
> >   thermal: exynos: Provide initial setting for TMU's test MUX address
> >     at Exynos4412
> >   ARM: dts: exynos4x12: Device tree node definition for TMU on
> >     Exynos4x12
> >   ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
> >
> 
> Zhang, Eduardo - any comments?
> 
> Would it be possible to add them to v3.12 since they do fix critical
> error and regression on Exynos4412.
> 
> 
> >  arch/arm/boot/dts/exynos4412-trats2.dts         |    5 ++++
> >  arch/arm/boot/dts/exynos4x12.dtsi               |   10 ++++++++
> >  drivers/thermal/samsung/exynos_thermal_common.c |    2 --
> >  drivers/thermal/samsung/exynos_tmu.c            |   12 ++++++---
> >  drivers/thermal/samsung/exynos_tmu.h            |    7 +++++-
> >  drivers/thermal/samsung/exynos_tmu_data.c       |   30
> > ++++++++++++++++++-----
> > drivers/thermal/samsung/exynos_tmu_data.h       |   13 +++++++++- 7
> > files changed, 65 insertions(+), 14 deletions(-)
> >
> 
> 
> 
> --
> Best regards,
> 
> Lukasz Majewski
> 
> Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 2/5] thermal: exynos: Provide separate TMU data for Exynos4412
  2013-10-09  6:29   ` [PATCH v2 2/5] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
@ 2013-10-14 14:20     ` Eduardo Valentin
  2013-10-14 14:52       ` Lukasz Majewski
  0 siblings, 1 reply; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-14 14:20 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, kgene.kim, Rafael J. Wysocki,
	Linux PM list, Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	Amit Daniel Kachhap, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 5783 bytes --]

On 09-10-2013 02:29, Lukasz Majewski wrote:
> Up till now Exynos5250 and Exynos4412 had the same definitions for TMU
> data. Following commit changes that, by introducing separate
> exynos4412_default_tmu_data structure.
> 
> Since Exynos4412 was chronologically first, the corresponding name for
> TMU registers and default data was renamed.
> 
> Additionally, new SOC_ARCH_EXYNOS4412 type has been defined.
> 
> Moreover, the SOC_ARCH_EXYNOS name has been changed to SOC_ARCH_EXYNOS5250.
> 
> 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>
> 
> ---
> Changes for v2:
> - Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
> - Fix coding style for tmu_data elements definition
> 
>  drivers/thermal/samsung/exynos_tmu.c      |    9 +++++----
>  drivers/thermal/samsung/exynos_tmu.h      |    3 ++-
>  drivers/thermal/samsung/exynos_tmu_data.c |   28 ++++++++++++++++++++++------
>  drivers/thermal/samsung/exynos_tmu_data.h |    9 ++++++++-
>  4 files changed, 37 insertions(+), 12 deletions(-)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index b43afda..1312b34 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -488,7 +488,7 @@ static const struct of_device_id exynos_tmu_match[] = {
>  	},
>  	{
>  		.compatible = "samsung,exynos4412-tmu",
> -		.data = (void *)EXYNOS5250_TMU_DRV_DATA,
> +		.data = (void *)EXYNOS4412_TMU_DRV_DATA,
>  	},
>  	{
>  		.compatible = "samsung,exynos5250-tmu",
> @@ -629,9 +629,10 @@ static int exynos_tmu_probe(struct platform_device *pdev)
>  	if (ret)
>  		return ret;
>  
> -	if (pdata->type == SOC_ARCH_EXYNOS ||
> -		pdata->type == SOC_ARCH_EXYNOS4210 ||
> -				pdata->type == SOC_ARCH_EXYNOS5440)
> +	if (pdata->type == SOC_ARCH_EXYNOS4210 ||
> +	    pdata->type == SOC_ARCH_EXYNOS4412 ||
> +	    pdata->type == SOC_ARCH_EXYNOS5250 ||
> +	    pdata->type == SOC_ARCH_EXYNOS5440)
>  		data->soc = pdata->type;
>  	else {
>  		ret = -EINVAL;
> diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
> index b364c9e..b42ece4 100644
> --- a/drivers/thermal/samsung/exynos_tmu.h
> +++ b/drivers/thermal/samsung/exynos_tmu.h
> @@ -41,7 +41,8 @@ enum calibration_mode {
>  
>  enum soc_type {
>  	SOC_ARCH_EXYNOS4210 = 1,
> -	SOC_ARCH_EXYNOS,
> +	SOC_ARCH_EXYNOS4412,
> +	SOC_ARCH_EXYNOS5250,
>  	SOC_ARCH_EXYNOS5440,
>  };
>  
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
> index 9002499..d8de5c1 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.c
> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> @@ -90,8 +90,8 @@ struct exynos_tmu_init_data const exynos4210_default_tmu_data = {
>  };
>  #endif
>  
> -#if defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412)
> -static const struct exynos_tmu_registers exynos5250_tmu_registers = {
> +#if defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)

Below will be only 4412 definitions,right? Why should we test for 5250?

> +static const struct exynos_tmu_registers exynos4412_tmu_registers = {
>  	.triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
>  	.triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
>  	.triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
> @@ -128,7 +128,7 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
>  	.emul_time_mask = EXYNOS_EMUL_TIME_MASK,
>  };
>  
> -#define EXYNOS5250_TMU_DATA \
> +#define EXYNOS4412_TMU_DATA \
>  	.threshold_falling = 10, \
>  	.trigger_levels[0] = 85, \
>  	.trigger_levels[1] = 103, \
> @@ -162,15 +162,31 @@ static const struct exynos_tmu_registers exynos5250_tmu_registers = {
>  		.temp_level = 103, \
>  	}, \
>  	.freq_tab_count = 2, \
> -	.type = SOC_ARCH_EXYNOS, \
> -	.registers = &exynos5250_tmu_registers, \
> +	.registers = &exynos4412_tmu_registers, \
>  	.features = (TMU_SUPPORT_EMULATION | TMU_SUPPORT_TRIM_RELOAD | \
>  			TMU_SUPPORT_FALLING_TRIP | TMU_SUPPORT_READY_STATUS | \
>  			TMU_SUPPORT_EMUL_TIME)
> +#endif
>  
> +#if defined(CONFIG_SOC_EXYNOS4412)
> +struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
> +	.tmu_data = {
> +		{
> +			EXYNOS4412_TMU_DATA,
> +			.type = SOC_ARCH_EXYNOS4412,
> +		},
> +	},
> +	.tmu_count = 1,
> +};
> +#endif
> +
> +#if defined(CONFIG_SOC_EXYNOS5250)
>  struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
>  	.tmu_data = {
> -		{ EXYNOS5250_TMU_DATA },
> +		{
> +			EXYNOS4412_TMU_DATA,
> +			.type = SOC_ARCH_EXYNOS5250,
> +		},
>  	},
>  	.tmu_count = 1,
>  };
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
> index dc7feb5..b130b1e 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.h
> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> @@ -138,7 +138,14 @@ extern struct exynos_tmu_init_data const exynos4210_default_tmu_data;
>  #define EXYNOS4210_TMU_DRV_DATA (NULL)
>  #endif
>  
> -#if (defined(CONFIG_SOC_EXYNOS5250) || defined(CONFIG_SOC_EXYNOS4412))
> +#if defined(CONFIG_SOC_EXYNOS4412)
> +extern struct exynos_tmu_init_data const exynos4412_default_tmu_data;
> +#define EXYNOS4412_TMU_DRV_DATA (&exynos4412_default_tmu_data)
> +#else
> +#define EXYNOS4412_TMU_DRV_DATA (NULL)
> +#endif
> +
> +#if defined(CONFIG_SOC_EXYNOS5250)
>  extern struct exynos_tmu_init_data const exynos5250_default_tmu_data;
>  #define EXYNOS5250_TMU_DRV_DATA (&exynos5250_default_tmu_data)
>  #else
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 3/5] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
  2013-10-09  6:29   ` [PATCH v2 3/5] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
@ 2013-10-14 14:24     ` Eduardo Valentin
  2013-10-14 15:00       ` Lukasz Majewski
  0 siblings, 1 reply; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-14 14:24 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Zhang Rui, Eduardo Valentin, kgene.kim, Rafael J. Wysocki,
	Linux PM list, Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	Amit Daniel Kachhap, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 5310 bytes --]

On 09-10-2013 02:29, Lukasz Majewski wrote:
> The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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>
> 
> ---
> Changes for v2:
> - Define test_mux and test_mux_addr_shift to not use direct register access
> - Remove pdata->type == SOC_ARCH_EXYNOS4412 check at exynos_tmu_control() and
>   use only generic code
> 
>  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
>  drivers/thermal/samsung/exynos_tmu.h      |    4 ++++
>  drivers/thermal/samsung/exynos_tmu_data.c |    2 ++
>  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
>  4 files changed, 13 insertions(+)
> 
> diff --git a/drivers/thermal/samsung/exynos_tmu.c b/drivers/thermal/samsung/exynos_tmu.c
> index 1312b34..32f38b9 100644
> --- a/drivers/thermal/samsung/exynos_tmu.c
> +++ b/drivers/thermal/samsung/exynos_tmu.c
> @@ -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)


test_mux field is in fact an address, correct? Can 0 be a valid address?

Why not using the feature flags to test for capabilities, features and
required configurations instead of assuming obscure domain and address
ranges?


> +		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;
> diff --git a/drivers/thermal/samsung/exynos_tmu.h b/drivers/thermal/samsung/exynos_tmu.h
> index b42ece4..3fb6554 100644
> --- a/drivers/thermal/samsung/exynos_tmu.h
> +++ b/drivers/thermal/samsung/exynos_tmu.h
> @@ -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.
> @@ -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;
> @@ -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.
> @@ -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;
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c b/drivers/thermal/samsung/exynos_tmu_data.c
> index d8de5c1..073c292 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.c
> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> @@ -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,
> @@ -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,
> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h b/drivers/thermal/samsung/exynos_tmu_data.h
> index b130b1e..a1ea19d 100644
> --- a/drivers/thermal/samsung/exynos_tmu_data.h
> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> @@ -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
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 2/5] thermal: exynos: Provide separate TMU data for Exynos4412
  2013-10-14 14:20     ` Eduardo Valentin
@ 2013-10-14 14:52       ` Lukasz Majewski
  0 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-14 14:52 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Zhang Rui, kgene.kim, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	Amit Daniel Kachhap, linux-samsung-soc

Hi Eduardo,

> On 09-10-2013 02:29, Lukasz Majewski wrote:
> > Up till now Exynos5250 and Exynos4412 had the same definitions for
> > TMU data. Following commit changes that, by introducing separate
> > exynos4412_default_tmu_data structure.
> > 
> > Since Exynos4412 was chronologically first, the corresponding name
> > for TMU registers and default data was renamed.
> > 
> > Additionally, new SOC_ARCH_EXYNOS4412 type has been defined.
> > 
> > Moreover, the SOC_ARCH_EXYNOS name has been changed to
> > SOC_ARCH_EXYNOS5250.
> > 
> > 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>
> > 
> > ---
> > Changes for v2:
> > - Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250
> > - Fix coding style for tmu_data elements definition
> > 
> >  drivers/thermal/samsung/exynos_tmu.c      |    9 +++++----
> >  drivers/thermal/samsung/exynos_tmu.h      |    3 ++-
> >  drivers/thermal/samsung/exynos_tmu_data.c |   28
> > ++++++++++++++++++++++------
> > drivers/thermal/samsung/exynos_tmu_data.h |    9 ++++++++- 4 files
> > changed, 37 insertions(+), 12 deletions(-)
> > 
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index b43afda..1312b34 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -488,7 +488,7 @@ static const struct of_device_id
> > exynos_tmu_match[] = { },
> >  	{
> >  		.compatible = "samsung,exynos4412-tmu",
> > -		.data = (void *)EXYNOS5250_TMU_DRV_DATA,
> > +		.data = (void *)EXYNOS4412_TMU_DRV_DATA,
> >  	},
> >  	{
> >  		.compatible = "samsung,exynos5250-tmu",
> > @@ -629,9 +629,10 @@ static int exynos_tmu_probe(struct
> > platform_device *pdev) if (ret)
> >  		return ret;
> >  
> > -	if (pdata->type == SOC_ARCH_EXYNOS ||
> > -		pdata->type == SOC_ARCH_EXYNOS4210 ||
> > -				pdata->type == SOC_ARCH_EXYNOS5440)
> > +	if (pdata->type == SOC_ARCH_EXYNOS4210 ||
> > +	    pdata->type == SOC_ARCH_EXYNOS4412 ||
> > +	    pdata->type == SOC_ARCH_EXYNOS5250 ||
> > +	    pdata->type == SOC_ARCH_EXYNOS5440)
> >  		data->soc = pdata->type;
> >  	else {
> >  		ret = -EINVAL;
> > diff --git a/drivers/thermal/samsung/exynos_tmu.h
> > b/drivers/thermal/samsung/exynos_tmu.h index b364c9e..b42ece4 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.h
> > +++ b/drivers/thermal/samsung/exynos_tmu.h
> > @@ -41,7 +41,8 @@ enum calibration_mode {
> >  
> >  enum soc_type {
> >  	SOC_ARCH_EXYNOS4210 = 1,
> > -	SOC_ARCH_EXYNOS,
> > +	SOC_ARCH_EXYNOS4412,
> > +	SOC_ARCH_EXYNOS5250,
> >  	SOC_ARCH_EXYNOS5440,
> >  };
> >  
> > diff --git a/drivers/thermal/samsung/exynos_tmu_data.c
> > b/drivers/thermal/samsung/exynos_tmu_data.c index 9002499..d8de5c1
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c
> > +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> > @@ -90,8 +90,8 @@ struct exynos_tmu_init_data const
> > exynos4210_default_tmu_data = { };
> >  #endif
> >  
> > -#if defined(CONFIG_SOC_EXYNOS5250) ||
> > defined(CONFIG_SOC_EXYNOS4412) -static const struct
> > exynos_tmu_registers exynos5250_tmu_registers = { +#if
> > defined(CONFIG_SOC_EXYNOS4412) || defined(CONFIG_SOC_EXYNOS5250)
> 
> Below will be only 4412 definitions,right? Why should we test for
> 5250? 
   ^^^^^^^^ [1]

Below are registers definitions for Exynos4412, which appeared first.

However, the Exynos5250 is reusing those registers. 

The exact separation between Exynos4412 and Exynos5250 is done when we
assign value to .tmu_data at exynos4412_default_tmu_data and
exynos5250_default_tmu_data.

The test [1] is correct here.

> 
> > +static const struct exynos_tmu_registers exynos4412_tmu_registers
> > = { .triminfo_data = EXYNOS_TMU_REG_TRIMINFO,
> >  	.triminfo_25_shift = EXYNOS_TRIMINFO_25_SHIFT,
> >  	.triminfo_85_shift = EXYNOS_TRIMINFO_85_SHIFT,
> > @@ -128,7 +128,7 @@ static const struct exynos_tmu_registers
> > exynos5250_tmu_registers = { .emul_time_mask =
> > EXYNOS_EMUL_TIME_MASK, };
> >  
> > -#define EXYNOS5250_TMU_DATA \
> > +#define EXYNOS4412_TMU_DATA \
> >  	.threshold_falling = 10, \
> >  	.trigger_levels[0] = 85, \
> >  	.trigger_levels[1] = 103, \
> > @@ -162,15 +162,31 @@ static const struct exynos_tmu_registers
> > exynos5250_tmu_registers = { .temp_level = 103, \
> >  	}, \
> >  	.freq_tab_count = 2, \
> > -	.type = SOC_ARCH_EXYNOS, \
> > -	.registers = &exynos5250_tmu_registers, \
> > +	.registers = &exynos4412_tmu_registers, \
> >  	.features = (TMU_SUPPORT_EMULATION |
> > TMU_SUPPORT_TRIM_RELOAD | \ TMU_SUPPORT_FALLING_TRIP |
> > TMU_SUPPORT_READY_STATUS | \ TMU_SUPPORT_EMUL_TIME)
> > +#endif
> >  
> > +#if defined(CONFIG_SOC_EXYNOS4412)
> > +struct exynos_tmu_init_data const exynos4412_default_tmu_data = {
> > +	.tmu_data = {
> > +		{
> > +			EXYNOS4412_TMU_DATA,
> > +			.type = SOC_ARCH_EXYNOS4412,
> > +		},
> > +	},
> > +	.tmu_count = 1,
> > +};
> > +#endif
> > +
> > +#if defined(CONFIG_SOC_EXYNOS5250)
> >  struct exynos_tmu_init_data const exynos5250_default_tmu_data = {
> >  	.tmu_data = {
> > -		{ EXYNOS5250_TMU_DATA },
> > +		{
> > +			EXYNOS4412_TMU_DATA,
> > +			.type = SOC_ARCH_EXYNOS5250,
> > +		},
> >  	},
> >  	.tmu_count = 1,
> >  };
> > diff --git a/drivers/thermal/samsung/exynos_tmu_data.h
> > b/drivers/thermal/samsung/exynos_tmu_data.h index dc7feb5..b130b1e
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h
> > +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> > @@ -138,7 +138,14 @@ extern struct exynos_tmu_init_data const
> > exynos4210_default_tmu_data; #define EXYNOS4210_TMU_DRV_DATA (NULL)
> >  #endif
> >  
> > -#if (defined(CONFIG_SOC_EXYNOS5250) ||
> > defined(CONFIG_SOC_EXYNOS4412)) +#if defined(CONFIG_SOC_EXYNOS4412)
> > +extern struct exynos_tmu_init_data const
> > exynos4412_default_tmu_data; +#define EXYNOS4412_TMU_DRV_DATA
> > (&exynos4412_default_tmu_data) +#else
> > +#define EXYNOS4412_TMU_DRV_DATA (NULL)
> > +#endif
> > +
> > +#if defined(CONFIG_SOC_EXYNOS5250)
> >  extern struct exynos_tmu_init_data const
> > exynos5250_default_tmu_data; #define EXYNOS5250_TMU_DRV_DATA
> > (&exynos5250_default_tmu_data) #else
> > 
> 
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 3/5] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
  2013-10-14 14:24     ` Eduardo Valentin
@ 2013-10-14 15:00       ` Lukasz Majewski
  2013-10-14 19:20         ` Eduardo Valentin
  0 siblings, 1 reply; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-14 15:00 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Zhang Rui, kgene.kim, Rafael J. Wysocki, Linux PM list,
	Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	Amit Daniel Kachhap, linux-samsung-soc

Hi Eduardo,

> On 09-10-2013 02:29, Lukasz Majewski wrote:
> > The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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>
> > 
> > ---
> > Changes for v2:
> > - Define test_mux and test_mux_addr_shift to not use direct
> > register access
> > - Remove pdata->type == SOC_ARCH_EXYNOS4412 check at
> > exynos_tmu_control() and use only generic code
> > 
> >  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
> >  drivers/thermal/samsung/exynos_tmu.h      |    4 ++++
> >  drivers/thermal/samsung/exynos_tmu_data.c |    2 ++
> >  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
> >  4 files changed, 13 insertions(+)
> > 
> > diff --git a/drivers/thermal/samsung/exynos_tmu.c
> > b/drivers/thermal/samsung/exynos_tmu.c index 1312b34..32f38b9 100644
> > --- a/drivers/thermal/samsung/exynos_tmu.c
> > +++ b/drivers/thermal/samsung/exynos_tmu.c
> > @@ -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)
> 
> 
> test_mux field is in fact an address, correct? Can 0 be a valid
> address?

No it isn't an address. It is the value which shall be written to
test_mux field of TMU_CONTROL register.

> 
> Why not using the feature flags to test for capabilities,

It is easier to assign value to test_mux tmu_data struct, than write
separate set of features for Exynos4412 and Exynos5250, which share the
code.

Also .features seems to define SoC independent features of TMU IP (like
TMU_SUPPORT_EMULATION).

The TEST_MUX setting is platform dependent (only Exynos4412 uses it),
so this is the rationale to define it at tmu platform data.

> features and
> required configurations instead of assuming obscure domain and address
> ranges?

TMU_MUX only uses 

(test_mux << test_mux_addr_shift) at tmu_ctrl register.


> 
> 
> > +		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; diff --git
> > a/drivers/thermal/samsung/exynos_tmu.h
> > b/drivers/thermal/samsung/exynos_tmu.h index b42ece4..3fb6554
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++
> > b/drivers/thermal/samsung/exynos_tmu.h @@ -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. @@ -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;
> > @@ -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. @@ -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;
> > diff --git a/drivers/thermal/samsung/exynos_tmu_data.c
> > b/drivers/thermal/samsung/exynos_tmu_data.c index d8de5c1..073c292
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c
> > +++ b/drivers/thermal/samsung/exynos_tmu_data.c
> > @@ -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,
> > @@ -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,
> > diff --git a/drivers/thermal/samsung/exynos_tmu_data.h
> > b/drivers/thermal/samsung/exynos_tmu_data.h index b130b1e..a1ea19d
> > 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h
> > +++ b/drivers/thermal/samsung/exynos_tmu_data.h
> > @@ -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
> > 
> 
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
  2013-10-14  5:52     ` Zhang, Rui
@ 2013-10-14 19:13       ` Eduardo Valentin
  2013-10-14 19:22         ` Eduardo Valentin
  0 siblings, 1 reply; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-14 19:13 UTC (permalink / raw)
  To: Zhang, Rui
  Cc: Lukasz Majewski, Eduardo Valentin, kgene.kim, Linux PM list,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	devicetree, Amit Daniel Kachhap, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 3016 bytes --]

On 14-10-2013 01:52, Zhang, Rui wrote:
> Eduardo,
> 
> What's your opinion on this patch set?
> BTW, please send me all the urgent fixes for thermal soc drivers that
you think should go to 3.12.
> 

I will be sending these + one fix on ti soc thermal for 3.12 soon.

The new chip support on exynos needs to be reworked and there are couple
of new drivers that needs to be reworked too. But those I don't think
are ready to go now.

> Thanks,
> rui
>> -----Original Message-----
>> From: Lukasz Majewski [mailto:l.majewski@samsung.com]
>> Sent: Monday, October 14, 2013 1:47 PM
>> To: Zhang, Rui; Eduardo Valentin; kgene.kim@samsung.com
>> Cc: Lukasz Majewski; Linux PM list; Lukasz Majewski; linux-kernel;
>> Bartlomiej Zolnierkiewicz; devicetree@vger.kernel.org; Amit Daniel
>> Kachhap; linux-samsung-soc@vger.kernel.org
>> Subject: Re: [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
>> Importance: High
>>
>> Hi Zhang, Eduardo,
>>
>>> This patch series is divided into two parts:
>>> 1. Device tree node definition and enabelement for TMU at Exynos4412
>>> (Trats2) 2. Exynos thermal subsystem regressions for v3.12-rc4.
>>> Several commits were necessary to properly fix regression for TMU
>> test
>>> MUX address setting after reset.
>>>
>>> Test HW:
>>> - Exynos4412 - TRATS2 board (Linux v3.12-rc4)
>>> SHA1: 8b5ede69d24db939f52b47effff2f6fe1e83e08b
>>>
>>>
>>> Lukasz Majewski (5):
>>>   thermal: exynos: Remove check for thermal device pointer at
>>>     exynos_report_trigger()
>>>   thermal: exynos: Provide separate TMU data for Exynos4412
>>>   thermal: exynos: Provide initial setting for TMU's test MUX address
>>>     at Exynos4412
>>>   ARM: dts: exynos4x12: Device tree node definition for TMU on
>>>     Exynos4x12
>>>   ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
>>>
>>
>> Zhang, Eduardo - any comments?
>>
>> Would it be possible to add them to v3.12 since they do fix critical
>> error and regression on Exynos4412.
>>
>>
>>>  arch/arm/boot/dts/exynos4412-trats2.dts         |    5 ++++
>>>  arch/arm/boot/dts/exynos4x12.dtsi               |   10 ++++++++
>>>  drivers/thermal/samsung/exynos_thermal_common.c |    2 --
>>>  drivers/thermal/samsung/exynos_tmu.c            |   12 ++++++---
>>>  drivers/thermal/samsung/exynos_tmu.h            |    7 +++++-
>>>  drivers/thermal/samsung/exynos_tmu_data.c       |   30
>>> ++++++++++++++++++-----
>>> drivers/thermal/samsung/exynos_tmu_data.h       |   13 +++++++++- 7
>>> files changed, 65 insertions(+), 14 deletions(-)
>>>
>>
>>
>>
>> --
>> Best regards,
>>
>> Lukasz Majewski
>>
>> Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
> --
> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 3/5] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412
  2013-10-14 15:00       ` Lukasz Majewski
@ 2013-10-14 19:20         ` Eduardo Valentin
  0 siblings, 0 replies; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-14 19:20 UTC (permalink / raw)
  To: Lukasz Majewski
  Cc: Eduardo Valentin, Zhang Rui, kgene.kim, Rafael J. Wysocki,
	Linux PM list, Jonghwa Lee, Lukasz Majewski, linux-kernel,
	Bartlomiej Zolnierkiewicz, Tomasz Figa, Myungjoo Ham, devicetree,
	Amit Daniel Kachhap, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 6561 bytes --]

On 14-10-2013 11:00, Lukasz Majewski wrote:
> Hi Eduardo,
> 
>> On 09-10-2013 02:29, Lukasz Majewski wrote:
>>> The commit d0a0ce3e77c795258d47f9163e92d5031d0c5221 ("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>
>>>
>>> ---
>>> Changes for v2:
>>> - Define test_mux and test_mux_addr_shift to not use direct
>>> register access
>>> - Remove pdata->type == SOC_ARCH_EXYNOS4412 check at
>>> exynos_tmu_control() and use only generic code
>>>
>>>  drivers/thermal/samsung/exynos_tmu.c      |    3 +++
>>>  drivers/thermal/samsung/exynos_tmu.h      |    4 ++++
>>>  drivers/thermal/samsung/exynos_tmu_data.c |    2 ++
>>>  drivers/thermal/samsung/exynos_tmu_data.h |    4 ++++
>>>  4 files changed, 13 insertions(+)
>>>
>>> diff --git a/drivers/thermal/samsung/exynos_tmu.c
>>> b/drivers/thermal/samsung/exynos_tmu.c index 1312b34..32f38b9 100644
>>> --- a/drivers/thermal/samsung/exynos_tmu.c
>>> +++ b/drivers/thermal/samsung/exynos_tmu.c
>>> @@ -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)
>>
>>
>> test_mux field is in fact an address, correct? Can 0 be a valid
>> address?
> 
> No it isn't an address. It is the value which shall be written to
> test_mux field of TMU_CONTROL register.
> 
>>
>> Why not using the feature flags to test for capabilities,
> 
> It is easier to assign value to test_mux tmu_data struct, than write
> separate set of features for Exynos4412 and Exynos5250, which share the
> code.
> 

It is harder to write, yes, but things that are easy to write are
usually harder to read. Besides, my concern is if 0x0 is a valid value
to be written. And if yes, then makes the patch you sent might be
incomplete.

> Also .features seems to define SoC independent features of TMU IP (like
> TMU_SUPPORT_EMULATION).
> 
> The TEST_MUX setting is platform dependent (only Exynos4412 uses it),
> so this is the rationale to define it at tmu platform data.
> 

Is test mux something pinctrl should be handling?

>> features and
>> required configurations instead of assuming obscure domain and address
>> ranges?
> 
> TMU_MUX only uses 
> 
> (test_mux << test_mux_addr_shift) at tmu_ctrl register.
> 
> 
>>
>>
>>> +		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; diff --git
>>> a/drivers/thermal/samsung/exynos_tmu.h
>>> b/drivers/thermal/samsung/exynos_tmu.h index b42ece4..3fb6554
>>> 100644 --- a/drivers/thermal/samsung/exynos_tmu.h +++
>>> b/drivers/thermal/samsung/exynos_tmu.h @@ -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. @@ -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;
>>> @@ -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. @@ -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;
>>> diff --git a/drivers/thermal/samsung/exynos_tmu_data.c
>>> b/drivers/thermal/samsung/exynos_tmu_data.c index d8de5c1..073c292
>>> 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.c
>>> +++ b/drivers/thermal/samsung/exynos_tmu_data.c
>>> @@ -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,
>>> @@ -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,
>>> diff --git a/drivers/thermal/samsung/exynos_tmu_data.h
>>> b/drivers/thermal/samsung/exynos_tmu_data.h index b130b1e..a1ea19d
>>> 100644 --- a/drivers/thermal/samsung/exynos_tmu_data.h
>>> +++ b/drivers/thermal/samsung/exynos_tmu_data.h
>>> @@ -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
>>>
>>
>>
> 
> 
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
  2013-10-14 19:13       ` Eduardo Valentin
@ 2013-10-14 19:22         ` Eduardo Valentin
  2013-10-15  6:23           ` Lukasz Majewski
  0 siblings, 1 reply; 43+ messages in thread
From: Eduardo Valentin @ 2013-10-14 19:22 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Zhang, Rui, Lukasz Majewski, kgene.kim, Linux PM list,
	Lukasz Majewski, linux-kernel, Bartlomiej Zolnierkiewicz,
	devicetree, Amit Daniel Kachhap, linux-samsung-soc

[-- Attachment #1: Type: text/plain, Size: 3281 bytes --]

On 14-10-2013 15:13, Eduardo Valentin wrote:
> On 14-10-2013 01:52, Zhang, Rui wrote:
>> Eduardo,
>>
>> What's your opinion on this patch set?
>> BTW, please send me all the urgent fixes for thermal soc drivers that
> you think should go to 3.12.
>>
> 
> I will be sending these + one fix on ti soc thermal for 3.12 soon.
> 
> The new chip support on exynos needs to be reworked and there are couple
> of new drivers that needs to be reworked too. But those I don't think
> are ready to go now.
> 

Just to be clear, on this patch set obviously I wont be sending the DT
changes. Those should go via the correct tree.

>> Thanks,
>> rui
>>> -----Original Message-----
>>> From: Lukasz Majewski [mailto:l.majewski@samsung.com]
>>> Sent: Monday, October 14, 2013 1:47 PM
>>> To: Zhang, Rui; Eduardo Valentin; kgene.kim@samsung.com
>>> Cc: Lukasz Majewski; Linux PM list; Lukasz Majewski; linux-kernel;
>>> Bartlomiej Zolnierkiewicz; devicetree@vger.kernel.org; Amit Daniel
>>> Kachhap; linux-samsung-soc@vger.kernel.org
>>> Subject: Re: [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
>>> Importance: High
>>>
>>> Hi Zhang, Eduardo,
>>>
>>>> This patch series is divided into two parts:
>>>> 1. Device tree node definition and enabelement for TMU at Exynos4412
>>>> (Trats2) 2. Exynos thermal subsystem regressions for v3.12-rc4.
>>>> Several commits were necessary to properly fix regression for TMU
>>> test
>>>> MUX address setting after reset.
>>>>
>>>> Test HW:
>>>> - Exynos4412 - TRATS2 board (Linux v3.12-rc4)
>>>> SHA1: 8b5ede69d24db939f52b47effff2f6fe1e83e08b
>>>>
>>>>
>>>> Lukasz Majewski (5):
>>>>   thermal: exynos: Remove check for thermal device pointer at
>>>>     exynos_report_trigger()
>>>>   thermal: exynos: Provide separate TMU data for Exynos4412
>>>>   thermal: exynos: Provide initial setting for TMU's test MUX address
>>>>     at Exynos4412
>>>>   ARM: dts: exynos4x12: Device tree node definition for TMU on
>>>>     Exynos4x12
>>>>   ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
>>>>
>>>
>>> Zhang, Eduardo - any comments?
>>>
>>> Would it be possible to add them to v3.12 since they do fix critical
>>> error and regression on Exynos4412.
>>>
>>>
>>>>  arch/arm/boot/dts/exynos4412-trats2.dts         |    5 ++++
>>>>  arch/arm/boot/dts/exynos4x12.dtsi               |   10 ++++++++
>>>>  drivers/thermal/samsung/exynos_thermal_common.c |    2 --
>>>>  drivers/thermal/samsung/exynos_tmu.c            |   12 ++++++---
>>>>  drivers/thermal/samsung/exynos_tmu.h            |    7 +++++-
>>>>  drivers/thermal/samsung/exynos_tmu_data.c       |   30
>>>> ++++++++++++++++++-----
>>>> drivers/thermal/samsung/exynos_tmu_data.h       |   13 +++++++++- 7
>>>> files changed, 65 insertions(+), 14 deletions(-)
>>>>
>>>
>>>
>>>
>>> --
>>> Best regards,
>>>
>>> Lukasz Majewski
>>>
>>> Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
>> --
>> To unsubscribe from this list: send the line "unsubscribe linux-pm" in
>> the body of a message to majordomo@vger.kernel.org
>> More majordomo info at  http://vger.kernel.org/majordomo-info.html
>>
>>
> 
> 


-- 
You have got to be excited about what you are doing. (L. Lamport)

Eduardo Valentin


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 295 bytes --]

^ permalink raw reply	[flat|nested] 43+ messages in thread

* Re: [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
  2013-10-14 19:22         ` Eduardo Valentin
@ 2013-10-15  6:23           ` Lukasz Majewski
  0 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2013-10-15  6:23 UTC (permalink / raw)
  To: Eduardo Valentin
  Cc: Zhang, Rui, kgene.kim, Linux PM list, Lukasz Majewski,
	linux-kernel, Bartlomiej Zolnierkiewicz, devicetree,
	Amit Daniel Kachhap, linux-samsung-soc

Hi Eduardo,

> On 14-10-2013 15:13, Eduardo Valentin wrote:
> > On 14-10-2013 01:52, Zhang, Rui wrote:
> >> Eduardo,
> >>
> >> What's your opinion on this patch set?
> >> BTW, please send me all the urgent fixes for thermal soc drivers
> >> that
> > you think should go to 3.12.
> >>
> > 
> > I will be sending these + one fix on ti soc thermal for 3.12 soon.
> > 
> > The new chip support on exynos needs to be reworked and there are
> > couple of new drivers that needs to be reworked too. But those I
> > don't think are ready to go now.
> > 
> 
> Just to be clear, on this patch set obviously I wont be sending the DT
> changes. Those should go via the correct tree.

I understand. I will ask Mr. Kukjin Kim to take the DT changes.

> 
> >> Thanks,
> >> rui
> >>> -----Original Message-----
> >>> From: Lukasz Majewski [mailto:l.majewski@samsung.com]
> >>> Sent: Monday, October 14, 2013 1:47 PM
> >>> To: Zhang, Rui; Eduardo Valentin; kgene.kim@samsung.com
> >>> Cc: Lukasz Majewski; Linux PM list; Lukasz Majewski; linux-kernel;
> >>> Bartlomiej Zolnierkiewicz; devicetree@vger.kernel.org; Amit Daniel
> >>> Kachhap; linux-samsung-soc@vger.kernel.org
> >>> Subject: Re: [PATCH v2 0/5] thermal: exynos: Fixes for v3.12
> >>> Importance: High
> >>>
> >>> Hi Zhang, Eduardo,
> >>>
> >>>> This patch series is divided into two parts:
> >>>> 1. Device tree node definition and enabelement for TMU at
> >>>> Exynos4412 (Trats2) 2. Exynos thermal subsystem regressions for
> >>>> v3.12-rc4. Several commits were necessary to properly fix
> >>>> regression for TMU
> >>> test
> >>>> MUX address setting after reset.
> >>>>
> >>>> Test HW:
> >>>> - Exynos4412 - TRATS2 board (Linux v3.12-rc4)
> >>>> SHA1: 8b5ede69d24db939f52b47effff2f6fe1e83e08b
> >>>>
> >>>>
> >>>> Lukasz Majewski (5):
> >>>>   thermal: exynos: Remove check for thermal device pointer at
> >>>>     exynos_report_trigger()
> >>>>   thermal: exynos: Provide separate TMU data for Exynos4412
> >>>>   thermal: exynos: Provide initial setting for TMU's test MUX
> >>>> address at Exynos4412
> >>>>   ARM: dts: exynos4x12: Device tree node definition for TMU on
> >>>>     Exynos4x12
> >>>>   ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
> >>>>
> >>>
> >>> Zhang, Eduardo - any comments?
> >>>
> >>> Would it be possible to add them to v3.12 since they do fix
> >>> critical error and regression on Exynos4412.
> >>>
> >>>
> >>>>  arch/arm/boot/dts/exynos4412-trats2.dts         |    5 ++++
> >>>>  arch/arm/boot/dts/exynos4x12.dtsi               |   10 ++++++++
> >>>>  drivers/thermal/samsung/exynos_thermal_common.c |    2 --
> >>>>  drivers/thermal/samsung/exynos_tmu.c            |   12 ++++++---
> >>>>  drivers/thermal/samsung/exynos_tmu.h            |    7 +++++-
> >>>>  drivers/thermal/samsung/exynos_tmu_data.c       |   30
> >>>> ++++++++++++++++++-----
> >>>> drivers/thermal/samsung/exynos_tmu_data.h       |   13
> >>>> +++++++++- 7 files changed, 65 insertions(+), 14 deletions(-)
> >>>>
> >>>
> >>>
> >>>
> >>> --
> >>> Best regards,
> >>>
> >>> Lukasz Majewski
> >>>
> >>> Samsung R&D Institute Poland (SRPOL) | Linux Platform Group
> >> --
> >> To unsubscribe from this list: send the line "unsubscribe
> >> linux-pm" in the body of a message to majordomo@vger.kernel.org
> >> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> >>
> >>
> > 
> > 
> 
> 



-- 
Best regards,

Lukasz Majewski

Samsung R&D Institute Poland (SRPOL) | Linux Platform Group

^ permalink raw reply	[flat|nested] 43+ messages in thread

* [RESEND PATCH 1/2] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12
  2013-10-09  6:29   ` [PATCH v2 4/5] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12 Lukasz Majewski
@ 2014-11-14 10:03     ` Lukasz Majewski
  2014-11-14 10:03       ` [RESEND PATCH 2/2] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2 Lukasz Majewski
  0 siblings, 1 reply; 43+ messages in thread
From: Lukasz Majewski @ 2014-11-14 10:03 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Ben Dooks, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, Russell King, linux-arm-kernel, linux-samsung-soc,
	devicetree, linux-kernel, Bartlomiej Zolnierkiewicz, Tomasz Figa,
	Lukasz Majewski

The TMU device tree node definition for Exynos4x12 family of SoCs.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 arch/arm/boot/dts/exynos4x12.dtsi | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4x12.dtsi b/arch/arm/boot/dts/exynos4x12.dtsi
index 861bb91..2e9f1f7 100644
--- a/arch/arm/boot/dts/exynos4x12.dtsi
+++ b/arch/arm/boot/dts/exynos4x12.dtsi
@@ -271,4 +271,14 @@
 		compatible = "samsung,exynos4x12-usb2-phy";
 		samsung,sysreg-phandle = <&sys_reg>;
 	};
+
+	tmu@100C0000 {
+		compatible = "samsung,exynos4412-tmu";
+		interrupt-parent = <&combiner>;
+		interrupts = <2 4>;
+		reg = <0x100C0000 0x100>;
+		clocks = <&clock 383>;
+		clock-names = "tmu_apbif";
+		status = "disabled";
+	};
 };
-- 
2.0.0.rc2


^ permalink raw reply related	[flat|nested] 43+ messages in thread

* [RESEND PATCH 2/2] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2
  2014-11-14 10:03     ` [RESEND PATCH 1/2] " Lukasz Majewski
@ 2014-11-14 10:03       ` Lukasz Majewski
  0 siblings, 0 replies; 43+ messages in thread
From: Lukasz Majewski @ 2014-11-14 10:03 UTC (permalink / raw)
  To: Kukjin Kim
  Cc: Ben Dooks, Rob Herring, Pawel Moll, Mark Rutland, Ian Campbell,
	Kumar Gala, Russell King, linux-arm-kernel, linux-samsung-soc,
	devicetree, linux-kernel, Bartlomiej Zolnierkiewicz, Tomasz Figa,
	Lukasz Majewski

This patch enables support for TMU at Exynos4412 based Trats2 board.

Signed-off-by: Lukasz Majewski <l.majewski@samsung.com>
Reviewed-by: Bartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>
Reviewed-by: Tomasz Figa <tomasz.figa@gmail.com>
---
 arch/arm/boot/dts/exynos4412-trats2.dts | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/arch/arm/boot/dts/exynos4412-trats2.dts b/arch/arm/boot/dts/exynos4412-trats2.dts
index 5e066cd..121430d 100644
--- a/arch/arm/boot/dts/exynos4412-trats2.dts
+++ b/arch/arm/boot/dts/exynos4412-trats2.dts
@@ -551,6 +551,11 @@
 		status = "okay";
 	};
 
+	tmu@100C0000 {
+		vtmu-supply = <&ldo10_reg>;
+		status = "okay";
+	};
+
 	i2c_ak8975: i2c-gpio-0 {
 		compatible = "i2c-gpio";
 		gpios = <&gpy2 4 0>, <&gpy2 5 0>;
-- 
2.0.0.rc2


^ permalink raw reply related	[flat|nested] 43+ messages in thread

end of thread, other threads:[~2014-11-14 10:04 UTC | newest]

Thread overview: 43+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2013-09-24  8:08 [PATCH 0/6] thermal: exynos: Fixes for v3.12 Lukasz Majewski
2013-09-24  8:08 ` [PATCH 1/6] thermal: exynos: fix: Return from exynos_report_trigger() when therm_dev is NULL Lukasz Majewski
2013-09-30 10:52   ` amit daniel kachhap
2013-10-03 21:40   ` Eduardo Valentin
2013-10-04  9:56     ` Lukasz Majewski
2013-09-24  8:08 ` [PATCH 2/6] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
2013-09-30 11:43   ` amit daniel kachhap
2013-10-03 22:01   ` Eduardo Valentin
2013-10-04 10:04     ` Lukasz Majewski
2013-09-24  8:08 ` [PATCH 3/6] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
2013-09-30 11:59   ` amit daniel kachhap
2013-10-01  6:55     ` Lukasz Majewski
2013-10-03 22:05   ` Eduardo Valentin
2013-10-04 10:20     ` Lukasz Majewski
2013-09-24  8:08 ` [PATCH 4/6] thermal: exynos: Replace SOC_ARCH_EXYNOS with SOC_ARCH_EXYNOS5250 Lukasz Majewski
2013-09-30 12:02   ` amit daniel kachhap
2013-10-03 22:08   ` Eduardo Valentin
2013-10-04 10:13     ` Bartlomiej Zolnierkiewicz
2013-10-04 10:23     ` Lukasz Majewski
2013-10-04 10:47       ` Bartlomiej Zolnierkiewicz
2013-10-04 15:07         ` Eduardo Valentin
2013-09-24  8:08 ` [PATCH 5/6] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12 Lukasz Majewski
2013-09-24  8:08 ` [PATCH 6/6] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2 Lukasz Majewski
2013-09-24  9:29 ` [PATCH 0/6] thermal: exynos: Fixes for v3.12 Tomasz Figa
2013-10-03 13:29 ` Lukasz Majewski
2013-10-09  6:29 ` [PATCH v2 0/5] " Lukasz Majewski
2013-10-09  6:29   ` [PATCH v2 1/5] thermal: exynos: Remove check for thermal device pointer at exynos_report_trigger() Lukasz Majewski
2013-10-09  6:29   ` [PATCH v2 2/5] thermal: exynos: Provide separate TMU data for Exynos4412 Lukasz Majewski
2013-10-14 14:20     ` Eduardo Valentin
2013-10-14 14:52       ` Lukasz Majewski
2013-10-09  6:29   ` [PATCH v2 3/5] thermal: exynos: Provide initial setting for TMU's test MUX address at Exynos4412 Lukasz Majewski
2013-10-14 14:24     ` Eduardo Valentin
2013-10-14 15:00       ` Lukasz Majewski
2013-10-14 19:20         ` Eduardo Valentin
2013-10-09  6:29   ` [PATCH v2 4/5] ARM: dts: exynos4x12: Device tree node definition for TMU on Exynos4x12 Lukasz Majewski
2014-11-14 10:03     ` [RESEND PATCH 1/2] " Lukasz Majewski
2014-11-14 10:03       ` [RESEND PATCH 2/2] ARM: dts: exynos4412-trats2: Enable TMU support at Trats2 Lukasz Majewski
2013-10-09  6:29   ` [PATCH v2 5/5] " Lukasz Majewski
2013-10-14  5:46   ` [PATCH v2 0/5] thermal: exynos: Fixes for v3.12 Lukasz Majewski
2013-10-14  5:52     ` Zhang, Rui
2013-10-14 19:13       ` Eduardo Valentin
2013-10-14 19:22         ` Eduardo Valentin
2013-10-15  6:23           ` Lukasz Majewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).