Message ID | 1432120598-18268-4-git-send-email-kong.kongxinwei@hisilicon.com (mailing list archive) |
---|---|
State | Not Applicable, archived |
Delegated to: | Eduardo Valentin |
Headers | show |
On Wed, May 20, 2015 at 07:16:38PM +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> Acked-by: Eduardo Valentin <edubezval@gmail.com> I have taken the patches containing the driver changes and the Documentation entry. But this patch needs to go via your your machine code tree (Wei Xu). BR, Eduardo Valentin > --- > arch/arm64/boot/dts/hisilicon/hi6220.dtsi | 124 ++++++++++++++++++++++++++++++ > 1 file changed, 124 insertions(+) > > diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi > index 8ade3d9..eb465a6 100644 > --- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi > +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi > @@ -6,6 +6,7 @@ > > #include <dt-bindings/clock/hi6220-clock.h> > #include <dt-bindings/interrupt-controller/arm-gic.h> > +#include <dt-bindings/thermal/thermal.h> > > / { > compatible = "hisilicon,hi6220"; > @@ -173,4 +174,127 @@ > clock-names = "uartclk", "apb_pclk"; > }; > }; > + > + tsensor: tsensor@0,f7030700 { > + compatible = "hisilicon,tsensor"; > + reg = <0x0 0xf7030700 0x0 0x1000>; > + interrupts = <0 7 0x4>; > + clocks = <&sys_ctrl 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 */ > + }; > + }; > + }; > }; > -- > 1.9.1 > >
diff --git a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi index 8ade3d9..eb465a6 100644 --- a/arch/arm64/boot/dts/hisilicon/hi6220.dtsi +++ b/arch/arm64/boot/dts/hisilicon/hi6220.dtsi @@ -6,6 +6,7 @@ #include <dt-bindings/clock/hi6220-clock.h> #include <dt-bindings/interrupt-controller/arm-gic.h> +#include <dt-bindings/thermal/thermal.h> / { compatible = "hisilicon,hi6220"; @@ -173,4 +174,127 @@ clock-names = "uartclk", "apb_pclk"; }; }; + + tsensor: tsensor@0,f7030700 { + compatible = "hisilicon,tsensor"; + reg = <0x0 0xf7030700 0x0 0x1000>; + interrupts = <0 7 0x4>; + clocks = <&sys_ctrl 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 */ + }; + }; + }; };