2020-03-23 12:36:13

by Anson Huang

[permalink] [raw]
Subject: [PATCH V3 1/3] dt-bindings: thermal: imx8mm-thermal: Add support for i.MX8MP

Add thermal binding doc for Freescale's i.MX8MP Thermal Monitoring Unit.

Signed-off-by: Anson Huang <[email protected]>
---
No change.
---
Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt b/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
index d09ae82..3629d3c 100644
--- a/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
+++ b/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
@@ -1,10 +1,10 @@
* Thermal Monitoring Unit (TMU) on Freescale i.MX8MM SoC

Required properties:
-- compatible : Must be "fsl,imx8mm-tmu".
+- compatible : Must be "fsl,imx8mm-tmu" or "fsl,imx8mp-tmu".
- reg : Address range of TMU registers.
- clocks : TMU's clock source.
-- #thermal-sensor-cells : Should be 0. See ./thermal.txt for a description.
+- #thermal-sensor-cells : Should be 0 or 1. See ./thermal.txt for a description.

Example:
tmu: tmu@30260000 {
--
2.7.4


2020-03-23 12:36:32

by Anson Huang

[permalink] [raw]
Subject: [PATCH V3 3/3] arm64: dts: imx8mp: Add thermal zones support

i.MX8MP has a TMU inside which supports two thermal zones, add support
for them.

Signed-off-by: Anson Huang <[email protected]>
---
No change.
---
arch/arm64/boot/dts/freescale/imx8mp.dtsi | 63 +++++++++++++++++++++++++++++++
1 file changed, 63 insertions(+)

diff --git a/arch/arm64/boot/dts/freescale/imx8mp.dtsi b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
index 9b1616e..175165b 100644
--- a/arch/arm64/boot/dts/freescale/imx8mp.dtsi
+++ b/arch/arm64/boot/dts/freescale/imx8mp.dtsi
@@ -7,6 +7,7 @@
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/interrupt-controller/arm-gic.h>
+#include <dt-bindings/thermal/thermal.h>

#include "imx8mp-pinfunc.h"

@@ -43,6 +44,7 @@
clocks = <&clk IMX8MP_CLK_ARM>;
enable-method = "psci";
next-level-cache = <&A53_L2>;
+ #cooling-cells = <2>;
};

A53_1: cpu@1 {
@@ -53,6 +55,7 @@
clocks = <&clk IMX8MP_CLK_ARM>;
enable-method = "psci";
next-level-cache = <&A53_L2>;
+ #cooling-cells = <2>;
};

A53_2: cpu@2 {
@@ -63,6 +66,7 @@
clocks = <&clk IMX8MP_CLK_ARM>;
enable-method = "psci";
next-level-cache = <&A53_L2>;
+ #cooling-cells = <2>;
};

A53_3: cpu@3 {
@@ -73,6 +77,7 @@
clocks = <&clk IMX8MP_CLK_ARM>;
enable-method = "psci";
next-level-cache = <&A53_L2>;
+ #cooling-cells = <2>;
};

A53_L2: l2-cache0 {
@@ -127,6 +132,57 @@
method = "smc";
};

+ thermal-zones {
+ cpu-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <2000>;
+ thermal-sensors = <&tmu 0x0>;
+ trips {
+ cpu_alert0: trip0 {
+ temperature = <85000>;
+ hysteresis = <2000>;
+ type = "passive";
+ };
+
+ cpu_crit0: trip1 {
+ temperature = <95000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+ };
+
+ cooling-maps {
+ map0 {
+ trip = <&cpu_alert0>;
+ cooling-device =
+ <&A53_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&A53_1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&A53_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&A53_3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ };
+ };
+ };
+
+ soc-thermal {
+ polling-delay-passive = <250>;
+ polling-delay = <2000>;
+ thermal-sensors = <&tmu 0x1>;
+ trips {
+ soc_alert0: trip0 {
+ temperature = <85000>;
+ hysteresis = <2000>;
+ type = "passive";
+ };
+
+ soc_crit0: trip1 {
+ temperature = <95000>;
+ hysteresis = <2000>;
+ type = "critical";
+ };
+ };
+ };
+ };
+
timer {
compatible = "arm,armv8-timer";
interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
@@ -215,6 +271,13 @@
gpio-ranges = <&iomuxc 0 114 30>;
};

+ tmu: tmu@30260000 {
+ compatible = "fsl,imx8mp-tmu";
+ reg = <0x30260000 0x10000>;
+ clocks = <&clk IMX8MP_CLK_TSENSOR_ROOT>;
+ #thermal-sensor-cells = <1>;
+ };
+
wdog1: watchdog@30280000 {
compatible = "fsl,imx8mp-wdt", "fsl,imx21-wdt";
reg = <0x30280000 0x10000>;
--
2.7.4

2020-04-02 10:41:00

by Amit Kucheria

[permalink] [raw]
Subject: Re: [PATCH V3 3/3] arm64: dts: imx8mp: Add thermal zones support

On Mon, Mar 23, 2020 at 6:05 PM Anson Huang <[email protected]> wrote:
>
> i.MX8MP has a TMU inside which supports two thermal zones, add support
> for them.
>
> Signed-off-by: Anson Huang <[email protected]>


[snip]

>
> + thermal-zones {
> + cpu-thermal {
> + polling-delay-passive = <250>;
> + polling-delay = <2000>;
> + thermal-sensors = <&tmu 0x0>;

No need for 0x0, just use 0

> + trips {
> + cpu_alert0: trip0 {
> + temperature = <85000>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
> +
> + cpu_crit0: trip1 {
> + temperature = <95000>;
> + hysteresis = <2000>;
> + type = "critical";
> + };
> + };
> +
> + cooling-maps {
> + map0 {
> + trip = <&cpu_alert0>;
> + cooling-device =
> + <&A53_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> + <&A53_1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> + <&A53_2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> + <&A53_3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> + };
> + };
> + };
> +
> + soc-thermal {
> + polling-delay-passive = <250>;
> + polling-delay = <2000>;
> + thermal-sensors = <&tmu 0x1>;

No need for 0x1, just use 1

> + trips {
> + soc_alert0: trip0 {
> + temperature = <85000>;
> + hysteresis = <2000>;
> + type = "passive";
> + };
> +
> + soc_crit0: trip1 {
> + temperature = <95000>;
> + hysteresis = <2000>;
> + type = "critical";
> + };
> + };

You need a cooling-map here since you have a passive trip point.


> + };
> + };
> +
> timer {
> compatible = "arm,armv8-timer";
> interrupts = <GIC_PPI 13 (GIC_CPU_MASK_SIMPLE(6) | IRQ_TYPE_LEVEL_LOW)>,
> @@ -215,6 +271,13 @@
> gpio-ranges = <&iomuxc 0 114 30>;
> };
>
> + tmu: tmu@30260000 {
> + compatible = "fsl,imx8mp-tmu";
> + reg = <0x30260000 0x10000>;
> + clocks = <&clk IMX8MP_CLK_TSENSOR_ROOT>;
> + #thermal-sensor-cells = <1>;
> + };
> +
> wdog1: watchdog@30280000 {
> compatible = "fsl,imx8mp-wdt", "fsl,imx21-wdt";
> reg = <0x30280000 0x10000>;
> --
> 2.7.4
>

2020-04-03 03:37:41

by Anson Huang

[permalink] [raw]
Subject: RE: [PATCH V3 3/3] arm64: dts: imx8mp: Add thermal zones support

Hi, Amit

> Subject: Re: [PATCH V3 3/3] arm64: dts: imx8mp: Add thermal zones support
>
> On Mon, Mar 23, 2020 at 6:05 PM Anson Huang <[email protected]>
> wrote:
> >
> > i.MX8MP has a TMU inside which supports two thermal zones, add support
> > for them.
> >
> > Signed-off-by: Anson Huang <[email protected]>
>
>
> [snip]
>
> >
> > + thermal-zones {
> > + cpu-thermal {
> > + polling-delay-passive = <250>;
> > + polling-delay = <2000>;
> > + thermal-sensors = <&tmu 0x0>;
>
> No need for 0x0, just use 0

OK.

>
> > + trips {
> > + cpu_alert0: trip0 {
> > + temperature = <85000>;
> > + hysteresis = <2000>;
> > + type = "passive";
> > + };
> > +
> > + cpu_crit0: trip1 {
> > + temperature = <95000>;
> > + hysteresis = <2000>;
> > + type = "critical";
> > + };
> > + };
> > +
> > + cooling-maps {
> > + map0 {
> > + trip = <&cpu_alert0>;
> > + cooling-device =
> > + <&A53_0
> THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> > + <&A53_1
> THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> > + <&A53_2
> THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> > + <&A53_3
> THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> > + };
> > + };
> > + };
> > +
> > + soc-thermal {
> > + polling-delay-passive = <250>;
> > + polling-delay = <2000>;
> > + thermal-sensors = <&tmu 0x1>;
>
> No need for 0x1, just use 1

OK.

>
> > + trips {
> > + soc_alert0: trip0 {
> > + temperature = <85000>;
> > + hysteresis = <2000>;
> > + type = "passive";
> > + };
> > +
> > + soc_crit0: trip1 {
> > + temperature = <95000>;
> > + hysteresis = <2000>;
> > + type = "critical";
> > + };
> > + };
>
> You need a cooling-map here since you have a passive trip point.

Currently, there is no cooling map defined for soc thermal zone, the cpufreq cooling
is mapped to cpu thermal zone already, so do you think it is OK to leave it as no cooling
map, or it is better to put cpufreq cooling for soc thermal zone as well?


Thanks,
Anson

2020-04-03 05:47:05

by Amit Kucheria

[permalink] [raw]
Subject: Re: [PATCH V3 3/3] arm64: dts: imx8mp: Add thermal zones support

On Fri, Apr 3, 2020 at 9:04 AM Anson Huang <[email protected]> wrote:
>
> Hi, Amit
>
> > Subject: Re: [PATCH V3 3/3] arm64: dts: imx8mp: Add thermal zones support
> >
> > On Mon, Mar 23, 2020 at 6:05 PM Anson Huang <[email protected]>
> > wrote:
> > >
> > > i.MX8MP has a TMU inside which supports two thermal zones, add support
> > > for them.
> > >
> > > Signed-off-by: Anson Huang <[email protected]>
> >
> >
> > [snip]
> >
> > >
> > > + thermal-zones {
> > > + cpu-thermal {
> > > + polling-delay-passive = <250>;
> > > + polling-delay = <2000>;
> > > + thermal-sensors = <&tmu 0x0>;
> >
> > No need for 0x0, just use 0
>
> OK.
>
> >
> > > + trips {
> > > + cpu_alert0: trip0 {
> > > + temperature = <85000>;
> > > + hysteresis = <2000>;
> > > + type = "passive";
> > > + };
> > > +
> > > + cpu_crit0: trip1 {
> > > + temperature = <95000>;
> > > + hysteresis = <2000>;
> > > + type = "critical";
> > > + };
> > > + };
> > > +
> > > + cooling-maps {
> > > + map0 {
> > > + trip = <&cpu_alert0>;
> > > + cooling-device =
> > > + <&A53_0
> > THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> > > + <&A53_1
> > THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> > > + <&A53_2
> > THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> > > + <&A53_3
> > THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> > > + };
> > > + };
> > > + };
> > > +
> > > + soc-thermal {
> > > + polling-delay-passive = <250>;
> > > + polling-delay = <2000>;
> > > + thermal-sensors = <&tmu 0x1>;
> >
> > No need for 0x1, just use 1
>
> OK.
>
> >
> > > + trips {
> > > + soc_alert0: trip0 {
> > > + temperature = <85000>;
> > > + hysteresis = <2000>;
> > > + type = "passive";
> > > + };
> > > +
> > > + soc_crit0: trip1 {
> > > + temperature = <95000>;
> > > + hysteresis = <2000>;
> > > + type = "critical";
> > > + };
> > > + };
> >
> > You need a cooling-map here since you have a passive trip point.
>
> Currently, there is no cooling map defined for soc thermal zone, the cpufreq cooling
> is mapped to cpu thermal zone already, so do you think it is OK to leave it as no cooling
> map, or it is better to put cpufreq cooling for soc thermal zone as well?
>

If there is no cooling, why do you need a passive trip point? Just
make it a hot trip that will send you a nofication (if .notify
callback registered).

Regards,
Amit

2020-04-03 06:06:51

by Anson Huang

[permalink] [raw]
Subject: RE: [PATCH V3 3/3] arm64: dts: imx8mp: Add thermal zones support

Hi, Amit

> Subject: Re: [PATCH V3 3/3] arm64: dts: imx8mp: Add thermal zones support
>
> On Fri, Apr 3, 2020 at 9:04 AM Anson Huang <[email protected]> wrote:
> >
> > Hi, Amit
> >
> > > Subject: Re: [PATCH V3 3/3] arm64: dts: imx8mp: Add thermal zones
> > > support
> > >
> > > On Mon, Mar 23, 2020 at 6:05 PM Anson Huang
> <[email protected]>
> > > wrote:
> > > >
> > > > i.MX8MP has a TMU inside which supports two thermal zones, add
> > > > support for them.
> > > >
> > > > Signed-off-by: Anson Huang <[email protected]>
> > >
> > >
> > > [snip]
> > >
> > > >
> > > > + thermal-zones {
> > > > + cpu-thermal {
> > > > + polling-delay-passive = <250>;
> > > > + polling-delay = <2000>;
> > > > + thermal-sensors = <&tmu 0x0>;
> > >
> > > No need for 0x0, just use 0
> >
> > OK.
> >
> > >
> > > > + trips {
> > > > + cpu_alert0: trip0 {
> > > > + temperature = <85000>;
> > > > + hysteresis = <2000>;
> > > > + type = "passive";
> > > > + };
> > > > +
> > > > + cpu_crit0: trip1 {
> > > > + temperature = <95000>;
> > > > + hysteresis = <2000>;
> > > > + type = "critical";
> > > > + };
> > > > + };
> > > > +
> > > > + cooling-maps {
> > > > + map0 {
> > > > + trip = <&cpu_alert0>;
> > > > + cooling-device =
> > > > + <&A53_0
> > > THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> > > > + <&A53_1
> > > THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> > > > + <&A53_2
> > > THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> > > > + <&A53_3
> > > THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> > > > + };
> > > > + };
> > > > + };
> > > > +
> > > > + soc-thermal {
> > > > + polling-delay-passive = <250>;
> > > > + polling-delay = <2000>;
> > > > + thermal-sensors = <&tmu 0x1>;
> > >
> > > No need for 0x1, just use 1
> >
> > OK.
> >
> > >
> > > > + trips {
> > > > + soc_alert0: trip0 {
> > > > + temperature = <85000>;
> > > > + hysteresis = <2000>;
> > > > + type = "passive";
> > > > + };
> > > > +
> > > > + soc_crit0: trip1 {
> > > > + temperature = <95000>;
> > > > + hysteresis = <2000>;
> > > > + type = "critical";
> > > > + };
> > > > + };
> > >
> > > You need a cooling-map here since you have a passive trip point.
> >
> > Currently, there is no cooling map defined for soc thermal zone, the
> > cpufreq cooling is mapped to cpu thermal zone already, so do you think
> > it is OK to leave it as no cooling map, or it is better to put cpufreq cooling for
> soc thermal zone as well?
> >
>
> If there is no cooling, why do you need a passive trip point? Just make it a hot
> trip that will send you a nofication (if .notify callback registered).

OK, understood, I prefer to keep the passive trip point same as cpu thermal zone,
so I will also put the cpufreq cooling map for soc thermal zone.

Thanks,
Anson

2020-04-03 12:38:02

by Amit Kucheria

[permalink] [raw]
Subject: Re: [PATCH V3 1/3] dt-bindings: thermal: imx8mm-thermal: Add support for i.MX8MP

Hi Anson,

On Mon, Mar 23, 2020 at 6:05 PM Anson Huang <[email protected]> wrote:
>
> Add thermal binding doc for Freescale's i.MX8MP Thermal Monitoring Unit.
>

I realise this got merged already, but please send a patch converting
this binding to yaml at some point.

Regards,
Amit

> Signed-off-by: Anson Huang <[email protected]>
> ---
> No change.
> ---
> Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt b/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
> index d09ae82..3629d3c 100644
> --- a/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
> +++ b/Documentation/devicetree/bindings/thermal/imx8mm-thermal.txt
> @@ -1,10 +1,10 @@
> * Thermal Monitoring Unit (TMU) on Freescale i.MX8MM SoC
>
> Required properties:
> -- compatible : Must be "fsl,imx8mm-tmu".
> +- compatible : Must be "fsl,imx8mm-tmu" or "fsl,imx8mp-tmu".
> - reg : Address range of TMU registers.
> - clocks : TMU's clock source.
> -- #thermal-sensor-cells : Should be 0. See ./thermal.txt for a description.
> +- #thermal-sensor-cells : Should be 0 or 1. See ./thermal.txt for a description.
>
> Example:
> tmu: tmu@30260000 {
> --
> 2.7.4
>

2020-04-03 12:40:09

by Anson Huang

[permalink] [raw]
Subject: RE: [PATCH V3 1/3] dt-bindings: thermal: imx8mm-thermal: Add support for i.MX8MP

Hi, Amit

> Subject: Re: [PATCH V3 1/3] dt-bindings: thermal: imx8mm-thermal: Add
> support for i.MX8MP
>
> Hi Anson,
>
> On Mon, Mar 23, 2020 at 6:05 PM Anson Huang <[email protected]>
> wrote:
> >
> > Add thermal binding doc for Freescale's i.MX8MP Thermal Monitoring Unit.
> >
>
> I realise this got merged already, but please send a patch converting this
> binding to yaml at some point.

Got it, I will find some time to convert i.MX thermal binding doc to yaml format.

Thanks,
Anson