linux-omap.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V2] ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families
@ 2020-08-17 13:39 Adam Ford
  2020-08-17 19:59 ` Andreas Kemnade
  2020-08-21 13:44 ` Pavel Machek
  0 siblings, 2 replies; 6+ messages in thread
From: Adam Ford @ 2020-08-17 13:39 UTC (permalink / raw)
  To: linux-omap
  Cc: aford, Adam Ford, Benoît Cousson, Tony Lindgren,
	Rob Herring, devicetree, linux-kernel

The OMAP3530, OMAP3630, and DM3730 all show thresholds of 90C and 105C
depending on commercial or industrial temperature ratings.

This patch expands the thermal information to include the limits of 90
and 105C for alert and critical.  It sets the coolings-cells for the
34xx and 36xx CPU's which both point to omap3-cpu-thermal.dtsi.

For boards who never use industrial temperatures, these can be
changed on their respective device trees with something like:

&cpu_alert0 {
	temperature = <85000>; /* millicelsius */
};

&cpu_crit {
	temperature = <90000>; /* millicelsius */
};

OMAP3_THERMAL will need to be enabled.  It is off by default.

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: H. Nikolaus Schaller <hns@goldelico.com> # on GTA04A5 with dm3730cbp100

---
V2:  Rebase on Linux 5.9-rc1

diff --git a/arch/arm/boot/dts/omap3-cpu-thermal.dtsi b/arch/arm/boot/dts/omap3-cpu-thermal.dtsi
index aee46fa8c055..99858eb0d7f6 100644
--- a/arch/arm/boot/dts/omap3-cpu-thermal.dtsi
+++ b/arch/arm/boot/dts/omap3-cpu-thermal.dtsi
@@ -17,4 +17,25 @@ cpu_thermal: cpu_thermal {
 
 			/* sensor       ID */
 	thermal-sensors = <&bandgap     0>;
+
+	cpu_trips: trips {
+		cpu_alert0: cpu_alert {
+			temperature = <90000>; /* millicelsius */
+			hysteresis = <2000>; /* millicelsius */
+			type = "passive";
+		};
+		cpu_crit: cpu_crit {
+			temperature = <105000>; /* millicelsius */
+			hysteresis = <2000>; /* millicelsius */
+			type = "critical";
+		};
+	};
+
+	cpu_cooling_maps: cooling-maps {
+		map0 {
+			trip = <&cpu_alert0>;
+			cooling-device =
+				<&cpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+		};
+	};
 };
diff --git a/arch/arm/boot/dts/omap34xx.dtsi b/arch/arm/boot/dts/omap34xx.dtsi
index 9c3ee4ac8165..c0dcc75833a8 100644
--- a/arch/arm/boot/dts/omap34xx.dtsi
+++ b/arch/arm/boot/dts/omap34xx.dtsi
@@ -20,6 +20,7 @@
 			operating-points-v2 = <&cpu0_opp_table>;
 
 			clock-latency = <300000>; /* From legacy driver */
+			#cooling-cells = <2>;
 		};
 	};
 
diff --git a/arch/arm/boot/dts/omap36xx.dtsi b/arch/arm/boot/dts/omap36xx.dtsi
index 9c3beefc0fe0..fadbf308feff 100644
--- a/arch/arm/boot/dts/omap36xx.dtsi
+++ b/arch/arm/boot/dts/omap36xx.dtsi
@@ -25,6 +25,7 @@
 
 			vbb-supply = <&abb_mpu_iva>;
 			clock-latency = <300000>; /* From omap-cpufreq driver */
+			#cooling-cells = <2>;
 		};
 	};
 
-- 
2.17.1


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

* Re: [PATCH V2] ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families
  2020-08-17 13:39 [PATCH V2] ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families Adam Ford
@ 2020-08-17 19:59 ` Andreas Kemnade
  2020-08-17 20:02   ` Adam Ford
  2020-08-21 13:44 ` Pavel Machek
  1 sibling, 1 reply; 6+ messages in thread
From: Andreas Kemnade @ 2020-08-17 19:59 UTC (permalink / raw)
  To: Adam Ford
  Cc: linux-omap, aford, Benoît Cousson, Tony Lindgren,
	Rob Herring, devicetree, linux-kernel, hns

On Mon, 17 Aug 2020 08:39:31 -0500
Adam Ford <aford173@gmail.com> wrote:

> The OMAP3530, OMAP3630, and DM3730 all show thresholds of 90C and 105C
> depending on commercial or industrial temperature ratings.
> 
> This patch expands the thermal information to include the limits of 90
> and 105C for alert and critical.  It sets the coolings-cells for the
> 34xx and 36xx CPU's which both point to omap3-cpu-thermal.dtsi.
> 
> For boards who never use industrial temperatures, these can be
> changed on their respective device trees with something like:
> 
> &cpu_alert0 {
> 	temperature = <85000>; /* millicelsius */
> };
> 
> &cpu_crit {
> 	temperature = <90000>; /* millicelsius */
> };
> 
> OMAP3_THERMAL will need to be enabled.  It is off by default.
> 
hmm, I think the patch for idling core when OMAP3_THERMAL is enabled
got stuck somewhere. It still seems not to work. Shouldn't that patch
be applied first?

Regards,
Andreas

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

* Re: [PATCH V2] ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families
  2020-08-17 19:59 ` Andreas Kemnade
@ 2020-08-17 20:02   ` Adam Ford
  2020-08-17 20:15     ` Andreas Kemnade
  0 siblings, 1 reply; 6+ messages in thread
From: Adam Ford @ 2020-08-17 20:02 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Linux-OMAP, Adam Ford-BE, Benoît Cousson, Tony Lindgren,
	Rob Herring, devicetree, Linux Kernel Mailing List,
	H. Nikolaus Schaller

On Mon, Aug 17, 2020 at 2:59 PM Andreas Kemnade <andreas@kemnade.info> wrote:
>
> On Mon, 17 Aug 2020 08:39:31 -0500
> Adam Ford <aford173@gmail.com> wrote:
>
> > The OMAP3530, OMAP3630, and DM3730 all show thresholds of 90C and 105C
> > depending on commercial or industrial temperature ratings.
> >
> > This patch expands the thermal information to include the limits of 90
> > and 105C for alert and critical.  It sets the coolings-cells for the
> > 34xx and 36xx CPU's which both point to omap3-cpu-thermal.dtsi.
> >
> > For boards who never use industrial temperatures, these can be
> > changed on their respective device trees with something like:
> >
> > &cpu_alert0 {
> >       temperature = <85000>; /* millicelsius */
> > };
> >
> > &cpu_crit {
> >       temperature = <90000>; /* millicelsius */
> > };
> >
> > OMAP3_THERMAL will need to be enabled.  It is off by default.
> >
> hmm, I think the patch for idling core when OMAP3_THERMAL is enabled
> got stuck somewhere. It still seems not to work. Shouldn't that patch
> be applied first?

I rebased the idle stuff, and now I get errors, so I haven't pushed it
yet.  I put a note that OMAP3_THERMAL is off by default, but this
patch would at least get the framing in there.  I know at least two of
us that use 1GHZ processors which are not supposed to run at that
speed above 90MHz, so the idea was to tolerate the higher current for
now, and when the idle stuff works, we'll enable the OMAP3_THERMAL by
default.

adam
>
> Regards,
> Andreas

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

* Re: [PATCH V2] ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families
  2020-08-17 20:02   ` Adam Ford
@ 2020-08-17 20:15     ` Andreas Kemnade
  2020-08-18  8:58       ` Tony Lindgren
  0 siblings, 1 reply; 6+ messages in thread
From: Andreas Kemnade @ 2020-08-17 20:15 UTC (permalink / raw)
  To: Adam Ford
  Cc: Linux-OMAP, Adam Ford-BE, Benoît Cousson, Tony Lindgren,
	Rob Herring, devicetree, Linux Kernel Mailing List,
	H. Nikolaus Schaller

On Mon, 17 Aug 2020 15:02:27 -0500
Adam Ford <aford173@gmail.com> wrote:

> On Mon, Aug 17, 2020 at 2:59 PM Andreas Kemnade <andreas@kemnade.info> wrote:
> >
> > On Mon, 17 Aug 2020 08:39:31 -0500
> > Adam Ford <aford173@gmail.com> wrote:
> >  
> > > The OMAP3530, OMAP3630, and DM3730 all show thresholds of 90C and 105C
> > > depending on commercial or industrial temperature ratings.
> > >
> > > This patch expands the thermal information to include the limits of 90
> > > and 105C for alert and critical.  It sets the coolings-cells for the
> > > 34xx and 36xx CPU's which both point to omap3-cpu-thermal.dtsi.
> > >
> > > For boards who never use industrial temperatures, these can be
> > > changed on their respective device trees with something like:
> > >
> > > &cpu_alert0 {
> > >       temperature = <85000>; /* millicelsius */
> > > };
> > >
> > > &cpu_crit {
> > >       temperature = <90000>; /* millicelsius */
> > > };
> > >
> > > OMAP3_THERMAL will need to be enabled.  It is off by default.
> > >  
> > hmm, I think the patch for idling core when OMAP3_THERMAL is enabled
> > got stuck somewhere. It still seems not to work. Shouldn't that patch
> > be applied first?  
> 
> I rebased the idle stuff, and now I get errors, so I haven't pushed it
> yet.  I put a note that OMAP3_THERMAL is off by default, but this
> patch would at least get the framing in there.  I know at least two of
> us that use 1GHZ processors which are not supposed to run at that
> speed above 90MHz, so the idea was to tolerate the higher current for
> now, and when the idle stuff works, we'll enable the OMAP3_THERMAL by
> default.
> 
yes, makes sense, so with this patch we have the choice to either
optimize for low speeds and currents (by disabling OMAP3_THERMAL and
1GHz) or high speeds (by enabling OMAP3_THERMAL and 1 Ghz).

Regards,
Andreas

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

* Re: [PATCH V2] ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families
  2020-08-17 20:15     ` Andreas Kemnade
@ 2020-08-18  8:58       ` Tony Lindgren
  0 siblings, 0 replies; 6+ messages in thread
From: Tony Lindgren @ 2020-08-18  8:58 UTC (permalink / raw)
  To: Andreas Kemnade
  Cc: Adam Ford, Linux-OMAP, Adam Ford-BE, Benoît Cousson,
	Rob Herring, devicetree, Linux Kernel Mailing List,
	H. Nikolaus Schaller

* Andreas Kemnade <andreas@kemnade.info> [200817 20:15]:
> On Mon, 17 Aug 2020 15:02:27 -0500
> Adam Ford <aford173@gmail.com> wrote:
> 
> > On Mon, Aug 17, 2020 at 2:59 PM Andreas Kemnade <andreas@kemnade.info> wrote:
> > >
> > > On Mon, 17 Aug 2020 08:39:31 -0500
> > > Adam Ford <aford173@gmail.com> wrote:
> > >  
> > > > The OMAP3530, OMAP3630, and DM3730 all show thresholds of 90C and 105C
> > > > depending on commercial or industrial temperature ratings.
> > > >
> > > > This patch expands the thermal information to include the limits of 90
> > > > and 105C for alert and critical.  It sets the coolings-cells for the
> > > > 34xx and 36xx CPU's which both point to omap3-cpu-thermal.dtsi.
> > > >
> > > > For boards who never use industrial temperatures, these can be
> > > > changed on their respective device trees with something like:
> > > >
> > > > &cpu_alert0 {
> > > >       temperature = <85000>; /* millicelsius */
> > > > };
> > > >
> > > > &cpu_crit {
> > > >       temperature = <90000>; /* millicelsius */
> > > > };

I think you should set the lower temperatures by default and have
only the boards known to work with higher values configure them as
needed.

> > > > OMAP3_THERMAL will need to be enabled.  It is off by default.
> > > >  
> > > hmm, I think the patch for idling core when OMAP3_THERMAL is enabled
> > > got stuck somewhere. It still seems not to work. Shouldn't that patch
> > > be applied first?  
> > 
> > I rebased the idle stuff, and now I get errors, so I haven't pushed it
> > yet.  I put a note that OMAP3_THERMAL is off by default, but this
> > patch would at least get the framing in there.  I know at least two of
> > us that use 1GHZ processors which are not supposed to run at that
> > speed above 90MHz, so the idea was to tolerate the higher current for
> > now, and when the idle stuff works, we'll enable the OMAP3_THERMAL by
> > default.
> > 
> yes, makes sense, so with this patch we have the choice to either
> optimize for low speeds and currents (by disabling OMAP3_THERMAL and
> 1GHz) or high speeds (by enabling OMAP3_THERMAL and 1 Ghz).

Maybe add something like that to the patch description too?

Regards,

Tony

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

* Re: [PATCH V2] ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families
  2020-08-17 13:39 [PATCH V2] ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families Adam Ford
  2020-08-17 19:59 ` Andreas Kemnade
@ 2020-08-21 13:44 ` Pavel Machek
  1 sibling, 0 replies; 6+ messages in thread
From: Pavel Machek @ 2020-08-21 13:44 UTC (permalink / raw)
  To: Adam Ford
  Cc: linux-omap, aford, Beno??t Cousson, Tony Lindgren, Rob Herring,
	devicetree, linux-kernel

On Mon 2020-08-17 08:39:31, Adam Ford wrote:
> The OMAP3530, OMAP3630, and DM3730 all show thresholds of 90C and 105C
> depending on commercial or industrial temperature ratings.
> 
> This patch expands the thermal information to include the limits of 90
> and 105C for alert and critical.  It sets the coolings-cells for the
> 34xx and 36xx CPU's which both point to omap3-cpu-thermal.dtsi.
> 
> For boards who never use industrial temperatures, these can be
> changed on their respective device trees with something like:
> 
> &cpu_alert0 {
> 	temperature = <85000>; /* millicelsius */
> };
> 
> &cpu_crit {
> 	temperature = <90000>; /* millicelsius */
> };

That should be the other way around. Provide safe values by default.

										Pavel

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

end of thread, other threads:[~2020-08-21 13:46 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-08-17 13:39 [PATCH V2] ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families Adam Ford
2020-08-17 19:59 ` Andreas Kemnade
2020-08-17 20:02   ` Adam Ford
2020-08-17 20:15     ` Andreas Kemnade
2020-08-18  8:58       ` Tony Lindgren
2020-08-21 13:44 ` Pavel Machek

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).