diff mbox

[1/3] ARM: dts: OMAP5+: separate the cpu thermal zone definition from omap4

Message ID 1426880861-9266-2-git-send-email-nm@ti.com (mailing list archive)
State New, archived
Headers show

Commit Message

Nishanth Menon March 20, 2015, 7:47 p.m. UTC
From: Tero Kristo <t-kristo@ti.com>

OMAP4 has a finer counter granularity, which allows for a delay of 1000ms
in the thermal zone polling intervals. OMAP5/DRA7 have different counter
mechanism, which allows at maximum a 500ms timer. Adjust the cpu thermal
zone accordingly for OMAP5/DRA7.

Signed-off-by: Tero Kristo <t-kristo@ti.com>
Signed-off-by: Nishanth Menon <nm@ti.com>
---
 arch/arm/boot/dts/omap5-cpu-thermal.dtsi |   41 ++++++++++++++++++++++++++++++
 arch/arm/boot/dts/omap5.dtsi             |    2 +-
 2 files changed, 42 insertions(+), 1 deletion(-)
 create mode 100644 arch/arm/boot/dts/omap5-cpu-thermal.dtsi

Comments

Eduardo Valentin March 20, 2015, 9:54 p.m. UTC | #1
On Fri, Mar 20, 2015 at 02:47:39PM -0500, Nishanth Menon wrote:
> From: Tero Kristo <t-kristo@ti.com>
> 
> OMAP4 has a finer counter granularity, which allows for a delay of 1000ms
> in the thermal zone polling intervals. OMAP5/DRA7 have different counter
> mechanism, which allows at maximum a 500ms timer. Adjust the cpu thermal
> zone accordingly for OMAP5/DRA7.
> 
> Signed-off-by: Tero Kristo <t-kristo@ti.com>
> Signed-off-by: Nishanth Menon <nm@ti.com>


> ---
>  arch/arm/boot/dts/omap5-cpu-thermal.dtsi |   41 ++++++++++++++++++++++++++++++
>  arch/arm/boot/dts/omap5.dtsi             |    2 +-
>  2 files changed, 42 insertions(+), 1 deletion(-)
>  create mode 100644 arch/arm/boot/dts/omap5-cpu-thermal.dtsi
> 
> diff --git a/arch/arm/boot/dts/omap5-cpu-thermal.dtsi b/arch/arm/boot/dts/omap5-cpu-thermal.dtsi
> new file mode 100644
> index 000000000000..4a6427c1e47e
> --- /dev/null
> +++ b/arch/arm/boot/dts/omap5-cpu-thermal.dtsi
> @@ -0,0 +1,41 @@
> +/*
> + * Device Tree Source for OMAP4/5 SoC CPU thermal
> + *
> + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
> + * Contact: Tero Kristo <t-kristo@ti.com>
> + *
> + * This file is licensed under the terms of the GNU General Public License
> + * version 2.  This program is licensed "as is" without any warranty of any
> + * kind, whether express or implied.
> + */
> +
> +#include <dt-bindings/thermal/thermal.h>
> +
> +cpu_thermal: cpu_thermal {
> +	polling-delay-passive = <250>; /* milliseconds */
> +	polling-delay = <500>; /* milliseconds */
> +
> +			/* sensor       ID */
> +	thermal-sensors = <&bandgap     0>;
> +
> +	cpu_trips: trips {
> +		cpu_alert0: cpu_alert {
> +			temperature = <100000>; /* millicelsius */
> +			hysteresis = <2000>; /* millicelsius */
> +			type = "passive";
> +		};
> +		cpu_crit: cpu_crit {
> +			temperature = <125000>; /* millicelsius */
> +			hysteresis = <2000>; /* millicelsius */
> +			type = "critical";
> +		};
> +	};
> +
> +	cpu_cooling_maps: cooling-maps {
> +		map0 {
> +			trip = <&cpu_alert0>;
> +			cooling-device =
> +				<&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> +		};
> +	};
> +};
> diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
> index ddff674bd05e..e650d4eb59dd 100644
> --- a/arch/arm/boot/dts/omap5.dtsi
> +++ b/arch/arm/boot/dts/omap5.dtsi
> @@ -67,7 +67,7 @@
>  	};
>  
>  	thermal-zones {
> -		#include "omap4-cpu-thermal.dtsi"
> +		#include "omap5-cpu-thermal.dtsi"

Can't we simple change the polling value for the omap5 case and reuse
the omap4 file?

>  		#include "omap5-gpu-thermal.dtsi"
>  		#include "omap5-core-thermal.dtsi"
>  	};
> -- 
> 1.7.9.5
>
Tero Kristo March 23, 2015, 10:16 a.m. UTC | #2
On 03/20/2015 11:54 PM, Eduardo Valentin wrote:
> On Fri, Mar 20, 2015 at 02:47:39PM -0500, Nishanth Menon wrote:
>> From: Tero Kristo <t-kristo@ti.com>
>>
>> OMAP4 has a finer counter granularity, which allows for a delay of 1000ms
>> in the thermal zone polling intervals. OMAP5/DRA7 have different counter
>> mechanism, which allows at maximum a 500ms timer. Adjust the cpu thermal
>> zone accordingly for OMAP5/DRA7.
>>
>> Signed-off-by: Tero Kristo <t-kristo@ti.com>
>> Signed-off-by: Nishanth Menon <nm@ti.com>
>
>
>> ---
>>   arch/arm/boot/dts/omap5-cpu-thermal.dtsi |   41 ++++++++++++++++++++++++++++++
>>   arch/arm/boot/dts/omap5.dtsi             |    2 +-
>>   2 files changed, 42 insertions(+), 1 deletion(-)
>>   create mode 100644 arch/arm/boot/dts/omap5-cpu-thermal.dtsi
>>
>> diff --git a/arch/arm/boot/dts/omap5-cpu-thermal.dtsi b/arch/arm/boot/dts/omap5-cpu-thermal.dtsi
>> new file mode 100644
>> index 000000000000..4a6427c1e47e
>> --- /dev/null
>> +++ b/arch/arm/boot/dts/omap5-cpu-thermal.dtsi
>> @@ -0,0 +1,41 @@
>> +/*
>> + * Device Tree Source for OMAP4/5 SoC CPU thermal
>> + *
>> + * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
>> + * Contact: Tero Kristo <t-kristo@ti.com>
>> + *
>> + * This file is licensed under the terms of the GNU General Public License
>> + * version 2.  This program is licensed "as is" without any warranty of any
>> + * kind, whether express or implied.
>> + */
>> +
>> +#include <dt-bindings/thermal/thermal.h>
>> +
>> +cpu_thermal: cpu_thermal {
>> +	polling-delay-passive = <250>; /* milliseconds */
>> +	polling-delay = <500>; /* milliseconds */
>> +
>> +			/* sensor       ID */
>> +	thermal-sensors = <&bandgap     0>;
>> +
>> +	cpu_trips: trips {
>> +		cpu_alert0: cpu_alert {
>> +			temperature = <100000>; /* millicelsius */
>> +			hysteresis = <2000>; /* millicelsius */
>> +			type = "passive";
>> +		};
>> +		cpu_crit: cpu_crit {
>> +			temperature = <125000>; /* millicelsius */
>> +			hysteresis = <2000>; /* millicelsius */
>> +			type = "critical";
>> +		};
>> +	};
>> +
>> +	cpu_cooling_maps: cooling-maps {
>> +		map0 {
>> +			trip = <&cpu_alert0>;
>> +			cooling-device =
>> +				<&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
>> +		};
>> +	};
>> +};
>> diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
>> index ddff674bd05e..e650d4eb59dd 100644
>> --- a/arch/arm/boot/dts/omap5.dtsi
>> +++ b/arch/arm/boot/dts/omap5.dtsi
>> @@ -67,7 +67,7 @@
>>   	};
>>
>>   	thermal-zones {
>> -		#include "omap4-cpu-thermal.dtsi"
>> +		#include "omap5-cpu-thermal.dtsi"
>
> Can't we simple change the polling value for the omap5 case and reuse
> the omap4 file?

Hmm yea, I posted a patch like this before for o5 and it was queued 
already. See:

http://thread.gmane.org/gmane.linux.ports.arm.omap/123729

The dra7 part was missing from this set though, so patches 2/3 do not 
directly work with that one and will require some changes similar to the 
linked omap4 one.

-Tero

>
>>   		#include "omap5-gpu-thermal.dtsi"
>>   		#include "omap5-core-thermal.dtsi"
>>   	};
>> --
>> 1.7.9.5
>>

--
To unsubscribe from this list: send the line "unsubscribe linux-omap" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Nishanth Menon March 23, 2015, 5 p.m. UTC | #3
On 03/23/2015 05:16 AM, Tero Kristo wrote:
> On 03/20/2015 11:54 PM, Eduardo Valentin wrote:
>> On Fri, Mar 20, 2015 at 02:47:39PM -0500, Nishanth Menon wrote:
>>> From: Tero Kristo <t-kristo@ti.com>

[...]

>> Can't we simple change the polling value for the omap5 case and reuse
>> the omap4 file?
> 
> Hmm yea, I posted a patch like this before for o5 and it was queued 
> already. See:
> 
> http://thread.gmane.org/gmane.linux.ports.arm.omap/123729
> 
> The dra7 part was missing from this set though, so patches 2/3 do not 
> directly work with that one and will require some changes similar to the 
> linked omap4 one.

OK. will do that and as part of that, I will squash up patch 1 and 2
Since it is needed only when we introduce DRA7 thermal description -
Apologies on missing the O5 patch.
diff mbox

Patch

diff --git a/arch/arm/boot/dts/omap5-cpu-thermal.dtsi b/arch/arm/boot/dts/omap5-cpu-thermal.dtsi
new file mode 100644
index 000000000000..4a6427c1e47e
--- /dev/null
+++ b/arch/arm/boot/dts/omap5-cpu-thermal.dtsi
@@ -0,0 +1,41 @@ 
+/*
+ * Device Tree Source for OMAP4/5 SoC CPU thermal
+ *
+ * Copyright (C) 2013 Texas Instruments Incorporated - http://www.ti.com/
+ * Contact: Tero Kristo <t-kristo@ti.com>
+ *
+ * This file is licensed under the terms of the GNU General Public License
+ * version 2.  This program is licensed "as is" without any warranty of any
+ * kind, whether express or implied.
+ */
+
+#include <dt-bindings/thermal/thermal.h>
+
+cpu_thermal: cpu_thermal {
+	polling-delay-passive = <250>; /* milliseconds */
+	polling-delay = <500>; /* milliseconds */
+
+			/* sensor       ID */
+	thermal-sensors = <&bandgap     0>;
+
+	cpu_trips: trips {
+		cpu_alert0: cpu_alert {
+			temperature = <100000>; /* millicelsius */
+			hysteresis = <2000>; /* millicelsius */
+			type = "passive";
+		};
+		cpu_crit: cpu_crit {
+			temperature = <125000>; /* millicelsius */
+			hysteresis = <2000>; /* millicelsius */
+			type = "critical";
+		};
+	};
+
+	cpu_cooling_maps: cooling-maps {
+		map0 {
+			trip = <&cpu_alert0>;
+			cooling-device =
+				<&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+		};
+	};
+};
diff --git a/arch/arm/boot/dts/omap5.dtsi b/arch/arm/boot/dts/omap5.dtsi
index ddff674bd05e..e650d4eb59dd 100644
--- a/arch/arm/boot/dts/omap5.dtsi
+++ b/arch/arm/boot/dts/omap5.dtsi
@@ -67,7 +67,7 @@ 
 	};
 
 	thermal-zones {
-		#include "omap4-cpu-thermal.dtsi"
+		#include "omap5-cpu-thermal.dtsi"
 		#include "omap5-gpu-thermal.dtsi"
 		#include "omap5-core-thermal.dtsi"
 	};