diff mbox

[v5,3/3] dts: hi6220: enable thermal sensor for hisilicon SoC

Message ID 1431933109-22764-4-git-send-email-kong.kongxinwei@hisilicon.com (mailing list archive)
State Changes Requested
Delegated to: Eduardo Valentin
Headers show

Commit Message

Xinwei Kong May 18, 2015, 7:11 a.m. UTC
From: kongxinwei <kong.kongxinwei@hisilicon.com>

Dts includes two part: the first part is related with thermal sensor;
the second part is related with thermal zones, in this part it will
define the thermal zones and which sensor device should be bound to.
it also need specify the polling interval for every thermal zone.

Signed-off-by: Leo Yan <leo.yan@linaro.org>
Signed-off-by: kongxinwei <kong.kongxinwei@hisilicon.com>
---
 arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 127 ++++++++++++++++++++++++++++++
 1 file changed, 127 insertions(+)
 create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220.dtsi

Comments

Xinwei Kong May 20, 2015, 3:02 a.m. UTC | #1
On 2015/5/20 12:51, Eduardo Valentin wrote:
> On Mon, May 18, 2015 at 03:11:49PM +0800, Xinwei Kong wrote:
>> From: kongxinwei <kong.kongxinwei@hisilicon.com>
>>
>> Dts includes two part: the first part is related with thermal sensor;
>> the second part is related with thermal zones, in this part it will
>> define the thermal zones and which sensor device should be bound to.
>> it also need specify the polling interval for every thermal zone.
>>
>> Signed-off-by: Leo Yan <leo.yan@linaro.org>
>> Signed-off-by: kongxinwei <kong.kongxinwei@hisilicon.com>
>> ---
>>  arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 127 ++++++++++++++++++++++++++++++
>>  1 file changed, 127 insertions(+)
>>  create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220.dtsi
>>
>> diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
>> new file mode 100644
>> index 0000000..82f213d
>> --- /dev/null
>> +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
>> @@ -0,0 +1,127 @@
>> +
>> +#include <dt-bindings/thermal/thermal.h>
>> +
>> +/ {
>> +
>> +	tsensor: tsensor@0,f7030700 {
>> +		compatible = "hisilicon,tsensor";
>> +		reg = <0x0 0xf7030700 0x0 0x1000>;
>> +		interrupts = <0 7 0x4>;
>> +		clocks = <&clock_sys HI6220_TSENSOR_CLK>;
>> +		clock-names = "thermal_clk";
>> +		#thermal-sensor-cells = <1>;

 		}

oh, my god. I miss it. add "}".
>> +
>> +	thermal-zones {
> 
> The thermal-zones node is typically in the root node, not inside the
> sensor node.
> 
>> +		local: local {
>> +			/* milliseconds */
>> +			polling-delay-passive = <1000>;
>> +			/* milliseconds */
>> +			polling-delay = <5000>;
>> +
>> +			/* sensor	ID */
>> +			thermal-sensors = <&tsensor  0>;
>> +
>> +			trips {
>> +				local_alert: local_alert {
>> +					/* millicelsius */
>> +					temperature = <70000>;
>> +					/* millicelsius */
>> +					hysteresis = <2000>;
>> +					type = "passive";
>> +				};
>> +				local_crit: local_crit {
>> +					temperature = <90000>;
>> +					hysteresis = <2000>;
>> +					type = "critical";
>> +				};
>> +			};
>> +
>> +			cooling-maps {
>> +				/* There are currently no cooling maps
>> +				because there are no cooling devices */
> 
> Not even cpufreq? in your driver you mention about cpufreq cooling.
> 
> Do you have cpufreq-dt driver  properly setup in your board?
> 
>> +			};
>> +		};
>> +
>> +		cluster1: cluster1 {
>> +			polling-delay-passive = <1000>;
>> +			polling-delay = <5000>;
>> +
>> +			/* sensor	ID */
>> +			thermal-sensors = <&tsensor  1>;
>> +
>> +			trips {
>> +				cluster1_alert: cluster1_alert {
>> +					temperature = <70000>;
>> +					hysteresis = <2000>;
>> +					type = "passive";
>> +				};
>> +				cluster1_crit: cluster1_crit {
>> +					temperature = <90000>;
>> +					hysteresis = <2000>;
>> +					type = "critical";
>> +				};
>> +			};
>> +
>> +			cooling-maps {
>> +				/* There are currently no cooling maps
>> +				because there are no cooling devices */
>> +			};
>> +		};
>> +
>> +		cluster0: cluster0 {
>> +			polling-delay-passive = <1000>;
>> +			polling-delay = <5000>;
>> +
>> +			/* sensor	ID */
>> +			thermal-sensors = <&tsensor  2>;
>> +
>> +			trips {
>> +				cluster0_alert: cluster0_alert {
>> +					temperature = <70000>;
>> +					hysteresis = <2000>;
>> +					type = "passive";
>> +				};
>> +				cluster0_crit: cluster0_crit {
>> +					temperature = <90000>;
>> +					hysteresis = <2000>;
>> +					type = "critical";
>> +				};
>> +			};
>> +
>> +			cooling-maps {
>> +				map0 {
>> +					trip = <&cluster0_alert>;
>> +					cooling-device =
>> +					    <&cpu0 THERMAL_NO_LIMIT
>> +						THERMAL_NO_LIMIT>;
>> +				};
>> +			};
>> +		};
>> +
>> +		gpu: gpu {
>> +			polling-delay-passive = <1000>;
>> +			polling-delay = <5000>;
>> +
>> +			/* sensor	ID */
>> +			thermal-sensors = <&tsensor  3>;
>> +
>> +			trips {
>> +				gpu_alert: gpu_alert {
>> +					temperature = <70000>;
>> +					hysteresis = <2000>;
>> +					type = "passive";
>> +				};
>> +				gpu_crit: gpu_crit {
>> +					temperature = <90000>;
>> +					hysteresis = <2000>;
>> +					type = "critical";
>> +				};
>> +			};
>> +
>> +			cooling-maps {
>> +				/* There are currently no cooling maps
>> +				because there are no cooling devices */
>> +			};
>> +		};
>> +	};
>> +}
> 
> Are you sure this DT file works? I think it misses a closing \}.

I will re-varify  this driver and enable or use this tsensor based
mainline kernel  4.1-rc1.
> 
>> -- 
>> 1.9.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
Leo Yan May 20, 2015, 3:02 a.m. UTC | #2
On Tue, May 19, 2015 at 09:51:01PM -0700, Eduardo Valentin wrote:
> On Mon, May 18, 2015 at 03:11:49PM +0800, Xinwei Kong wrote:
> > From: kongxinwei <kong.kongxinwei@hisilicon.com>
> > 
> > Dts includes two part: the first part is related with thermal sensor;
> > the second part is related with thermal zones, in this part it will
> > define the thermal zones and which sensor device should be bound to.
> > it also need specify the polling interval for every thermal zone.
> > 
> > Signed-off-by: Leo Yan <leo.yan@linaro.org>
> > Signed-off-by: kongxinwei <kong.kongxinwei@hisilicon.com>
> > ---
> >  arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 127 ++++++++++++++++++++++++++++++
> >  1 file changed, 127 insertions(+)
> >  create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> > 
> > diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> > new file mode 100644
> > index 0000000..82f213d
> > --- /dev/null
> > +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> > @@ -0,0 +1,127 @@
> > +
> > +#include <dt-bindings/thermal/thermal.h>
> > +
> > +/ {
> > +
> > +	tsensor: tsensor@0,f7030700 {
> > +		compatible = "hisilicon,tsensor";
> > +		reg = <0x0 0xf7030700 0x0 0x1000>;
> > +		interrupts = <0 7 0x4>;
> > +		clocks = <&clock_sys HI6220_TSENSOR_CLK>;
> > +		clock-names = "thermal_clk";
> > +		#thermal-sensor-cells = <1>;
> > +
> > +	thermal-zones {
> 
> The thermal-zones node is typically in the root node, not inside the
> sensor node.
> 
> > +		local: local {
> > +			/* milliseconds */
> > +			polling-delay-passive = <1000>;
> > +			/* milliseconds */
> > +			polling-delay = <5000>;
> > +
> > +			/* sensor	ID */
> > +			thermal-sensors = <&tsensor  0>;
> > +
> > +			trips {
> > +				local_alert: local_alert {
> > +					/* millicelsius */
> > +					temperature = <70000>;
> > +					/* millicelsius */
> > +					hysteresis = <2000>;
> > +					type = "passive";
> > +				};
> > +				local_crit: local_crit {
> > +					temperature = <90000>;
> > +					hysteresis = <2000>;
> > +					type = "critical";
> > +				};
> > +			};
> > +
> > +			cooling-maps {
> > +				/* There are currently no cooling maps
> > +				because there are no cooling devices */
> 
> Not even cpufreq? in your driver you mention about cpufreq cooling.
> 
> Do you have cpufreq-dt driver  properly setup in your board?

Yes, cpufreq-dt will be used on hi6220 to enable cpufreq cooling
device. [1]

Xinwei will resend this patch, and should verify it based on
hi6220's minimal system patch series. [2]

[1] http://archive.arm.linux.org.uk/lurker/message/20150330.052637.16e0f3f4.en.html
[2] http://archive.arm.linux.org.uk/lurker/message/20150507.140019.bde047ed.en.html

Thanks,
Leo Yan
--
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
Eduardo Valentin May 20, 2015, 4:51 a.m. UTC | #3
On Mon, May 18, 2015 at 03:11:49PM +0800, Xinwei Kong wrote:
> From: kongxinwei <kong.kongxinwei@hisilicon.com>
> 
> Dts includes two part: the first part is related with thermal sensor;
> the second part is related with thermal zones, in this part it will
> define the thermal zones and which sensor device should be bound to.
> it also need specify the polling interval for every thermal zone.
> 
> Signed-off-by: Leo Yan <leo.yan@linaro.org>
> Signed-off-by: kongxinwei <kong.kongxinwei@hisilicon.com>
> ---
>  arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 127 ++++++++++++++++++++++++++++++
>  1 file changed, 127 insertions(+)
>  create mode 100644 arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> 
> diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> new file mode 100644
> index 0000000..82f213d
> --- /dev/null
> +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
> @@ -0,0 +1,127 @@
> +
> +#include <dt-bindings/thermal/thermal.h>
> +
> +/ {
> +
> +	tsensor: tsensor@0,f7030700 {
> +		compatible = "hisilicon,tsensor";
> +		reg = <0x0 0xf7030700 0x0 0x1000>;
> +		interrupts = <0 7 0x4>;
> +		clocks = <&clock_sys HI6220_TSENSOR_CLK>;
> +		clock-names = "thermal_clk";
> +		#thermal-sensor-cells = <1>;
> +
> +	thermal-zones {

The thermal-zones node is typically in the root node, not inside the
sensor node.

> +		local: local {
> +			/* milliseconds */
> +			polling-delay-passive = <1000>;
> +			/* milliseconds */
> +			polling-delay = <5000>;
> +
> +			/* sensor	ID */
> +			thermal-sensors = <&tsensor  0>;
> +
> +			trips {
> +				local_alert: local_alert {
> +					/* millicelsius */
> +					temperature = <70000>;
> +					/* millicelsius */
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				local_crit: local_crit {
> +					temperature = <90000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +
> +			cooling-maps {
> +				/* There are currently no cooling maps
> +				because there are no cooling devices */

Not even cpufreq? in your driver you mention about cpufreq cooling.

Do you have cpufreq-dt driver  properly setup in your board?

> +			};
> +		};
> +
> +		cluster1: cluster1 {
> +			polling-delay-passive = <1000>;
> +			polling-delay = <5000>;
> +
> +			/* sensor	ID */
> +			thermal-sensors = <&tsensor  1>;
> +
> +			trips {
> +				cluster1_alert: cluster1_alert {
> +					temperature = <70000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				cluster1_crit: cluster1_crit {
> +					temperature = <90000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +
> +			cooling-maps {
> +				/* There are currently no cooling maps
> +				because there are no cooling devices */
> +			};
> +		};
> +
> +		cluster0: cluster0 {
> +			polling-delay-passive = <1000>;
> +			polling-delay = <5000>;
> +
> +			/* sensor	ID */
> +			thermal-sensors = <&tsensor  2>;
> +
> +			trips {
> +				cluster0_alert: cluster0_alert {
> +					temperature = <70000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				cluster0_crit: cluster0_crit {
> +					temperature = <90000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +
> +			cooling-maps {
> +				map0 {
> +					trip = <&cluster0_alert>;
> +					cooling-device =
> +					    <&cpu0 THERMAL_NO_LIMIT
> +						THERMAL_NO_LIMIT>;
> +				};
> +			};
> +		};
> +
> +		gpu: gpu {
> +			polling-delay-passive = <1000>;
> +			polling-delay = <5000>;
> +
> +			/* sensor	ID */
> +			thermal-sensors = <&tsensor  3>;
> +
> +			trips {
> +				gpu_alert: gpu_alert {
> +					temperature = <70000>;
> +					hysteresis = <2000>;
> +					type = "passive";
> +				};
> +				gpu_crit: gpu_crit {
> +					temperature = <90000>;
> +					hysteresis = <2000>;
> +					type = "critical";
> +				};
> +			};
> +
> +			cooling-maps {
> +				/* There are currently no cooling maps
> +				because there are no cooling devices */
> +			};
> +		};
> +	};
> +}

Are you sure this DT file works? I think it misses a closing \}.

> -- 
> 1.9.1
> 
>
diff mbox

Patch

diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
new file mode 100644
index 0000000..82f213d
--- /dev/null
+++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi
@@ -0,0 +1,127 @@ 
+
+#include <dt-bindings/thermal/thermal.h>
+
+/ {
+
+	tsensor: tsensor@0,f7030700 {
+		compatible = "hisilicon,tsensor";
+		reg = <0x0 0xf7030700 0x0 0x1000>;
+		interrupts = <0 7 0x4>;
+		clocks = <&clock_sys HI6220_TSENSOR_CLK>;
+		clock-names = "thermal_clk";
+		#thermal-sensor-cells = <1>;
+
+	thermal-zones {
+		local: local {
+			/* milliseconds */
+			polling-delay-passive = <1000>;
+			/* milliseconds */
+			polling-delay = <5000>;
+
+			/* sensor	ID */
+			thermal-sensors = <&tsensor  0>;
+
+			trips {
+				local_alert: local_alert {
+					/* millicelsius */
+					temperature = <70000>;
+					/* millicelsius */
+					hysteresis = <2000>;
+					type = "passive";
+				};
+				local_crit: local_crit {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				/* There are currently no cooling maps
+				because there are no cooling devices */
+			};
+		};
+
+		cluster1: cluster1 {
+			polling-delay-passive = <1000>;
+			polling-delay = <5000>;
+
+			/* sensor	ID */
+			thermal-sensors = <&tsensor  1>;
+
+			trips {
+				cluster1_alert: cluster1_alert {
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+				cluster1_crit: cluster1_crit {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				/* There are currently no cooling maps
+				because there are no cooling devices */
+			};
+		};
+
+		cluster0: cluster0 {
+			polling-delay-passive = <1000>;
+			polling-delay = <5000>;
+
+			/* sensor	ID */
+			thermal-sensors = <&tsensor  2>;
+
+			trips {
+				cluster0_alert: cluster0_alert {
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+				cluster0_crit: cluster0_crit {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				map0 {
+					trip = <&cluster0_alert>;
+					cooling-device =
+					    <&cpu0 THERMAL_NO_LIMIT
+						THERMAL_NO_LIMIT>;
+				};
+			};
+		};
+
+		gpu: gpu {
+			polling-delay-passive = <1000>;
+			polling-delay = <5000>;
+
+			/* sensor	ID */
+			thermal-sensors = <&tsensor  3>;
+
+			trips {
+				gpu_alert: gpu_alert {
+					temperature = <70000>;
+					hysteresis = <2000>;
+					type = "passive";
+				};
+				gpu_crit: gpu_crit {
+					temperature = <90000>;
+					hysteresis = <2000>;
+					type = "critical";
+				};
+			};
+
+			cooling-maps {
+				/* There are currently no cooling maps
+				because there are no cooling devices */
+			};
+		};
+	};
+}