All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/3] ARM: dts: Configure missing thermal interrupt for 4430
@ 2020-12-30  8:42 Tony Lindgren
  2020-12-30  8:42 ` [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling Tony Lindgren
  2020-12-30  8:42 ` [PATCH 3/3] ARM: dts: motorola-mapphone: Add 1.2GHz OPP Tony Lindgren
  0 siblings, 2 replies; 7+ messages in thread
From: Tony Lindgren @ 2020-12-30  8:42 UTC (permalink / raw)
  To: linux-omap
  Cc: Benoît Cousson, devicetree, Carl Philipp Klemm,
	Daniel Lezcano, Eduardo Valentin, Merlijn Wajer, Pavel Machek,
	Peter Ujfalusi, Sebastian Reichel

We have gpio_86 wired internally to the bandgap thermal shutdown
interrupt on 4430 like we have it on 4460 according to the TRM.
This can be found easily by searching for TSHUT.

For some reason the thermal shutdown interrupt was never added
for 4430, let's add it. I believe this is needed for the thermal
shutdown interrupt handler ti_bandgap_tshut_irq_handler() to call
orderly_poweroff().

Fixes: aa9bb4bb8878 ("arm: dts: add omap4430 thermal data")
Cc: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Daniel Lezcano <daniel.lezcano@linaro.org>
Cc: Eduardo Valentin <edubezval@gmail.com>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Peter Ujfalusi <peter.ujfalusi@gmail.com>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/omap443x.dtsi | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/arch/arm/boot/dts/omap443x.dtsi b/arch/arm/boot/dts/omap443x.dtsi
--- a/arch/arm/boot/dts/omap443x.dtsi
+++ b/arch/arm/boot/dts/omap443x.dtsi
@@ -33,10 +33,12 @@ thermal-zones {
 	};
 
 	ocp {
+		/* 4430 has only gpio_86 tshut and no talert interrupt */
 		bandgap: bandgap@4a002260 {
 			reg = <0x4a002260 0x4
 			       0x4a00232C 0x4>;
 			compatible = "ti,omap4430-bandgap";
+			gpios = <&gpio3 22 GPIO_ACTIVE_HIGH>;
 
 			#thermal-sensor-cells = <0>;
 		};
-- 
2.29.2

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

* [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling
  2020-12-30  8:42 [PATCH 1/3] ARM: dts: Configure missing thermal interrupt for 4430 Tony Lindgren
@ 2020-12-30  8:42 ` Tony Lindgren
  2020-12-31 14:33   ` Pavel Machek
  2020-12-31 18:53   ` Pavel Machek
  2020-12-30  8:42 ` [PATCH 3/3] ARM: dts: motorola-mapphone: Add 1.2GHz OPP Tony Lindgren
  1 sibling, 2 replies; 7+ messages in thread
From: Tony Lindgren @ 2020-12-30  8:42 UTC (permalink / raw)
  To: linux-omap
  Cc: Benoît Cousson, devicetree, Carl Philipp Klemm,
	Merlijn Wajer, Pavel Machek, Sebastian Reichel, Daniel Lezcano,
	Eduardo Valentin, Peter Ujfalusi

The current cooling device temperature is too high at 100C as we have a
battery on the device right next to the SoC as pointed out by Carl Philipp
Klemm <philipp@uvos.xyz>. Let's configure the max temperature to 80C.

As we only have a tshut interrupt and no talert interrupt on 4430, we have
a passive cooling device configured for 4430. However, we want the poll
interval to be 10 seconds instead of 1 second for power management. The
value of 10 seconds seems like plenty of time to notice the temperature
increase above the 75C temperatures. Having the bandgap temperature change
seems to take several tens of seconds because of heat dissipation above
75C range as monitored with a full CPU load.

Cc: Carl Philipp Klemm <philipp@uvos.xyz>
Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sre@kernel.org>
Suggested-by: Carl Philipp Klemm <philipp@uvos.xyz>
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/motorola-mapphone-common.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)

diff --git a/arch/arm/boot/dts/motorola-mapphone-common.dtsi b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
--- a/arch/arm/boot/dts/motorola-mapphone-common.dtsi
+++ b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
@@ -192,6 +192,14 @@ backlight: backlight {
 	};
 };
 
+&cpu_thermal {
+	polling-delay = <10000>; /* milliseconds */
+};
+
+&cpu_alert0 {
+        temperature = <80000>; /* millicelsius */
+};
+
 &dss {
 	status = "okay";
 };
-- 
2.29.2

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

* [PATCH 3/3] ARM: dts: motorola-mapphone: Add 1.2GHz OPP
  2020-12-30  8:42 [PATCH 1/3] ARM: dts: Configure missing thermal interrupt for 4430 Tony Lindgren
  2020-12-30  8:42 ` [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling Tony Lindgren
@ 2020-12-30  8:42 ` Tony Lindgren
  2020-12-31  9:43   ` Pavel Machek
  1 sibling, 1 reply; 7+ messages in thread
From: Tony Lindgren @ 2020-12-30  8:42 UTC (permalink / raw)
  To: linux-omap
  Cc: Benoît Cousson, devicetree, Carl Philipp Klemm,
	Merlijn Wajer, Pavel Machek, Sebastian Reichel, Daniel Lezcano,
	Eduardo Valentin, Peter Ujfalusi

From: Carl Philipp Klemm <philipp@uvos.xyz>

The omap4430 HS HIGH performance devces support 1.2GHz opp, lower speed
variants do not. However for mapphone devices Motorola seems to have
decided that this does not really matter for the SoC variants they have
tested to use, and decided to clock all devices, including the ones with
STANDARD performance chips at 1.2GHz upon release of the 3.0.8 vendor
kernel shiped with Android 4.0. Therefore it seems safe to do the same,
but let's only do it for Motorola devices as the others have not been
tested.

Note that we prevent overheating with the passive cooling device
cpu_alert0 configured in the dts file that starts lowering the speed as
needed.

This also removes the "failed to find current OPP for freq 1200000000"
warning.

Cc: Merlijn Wajer <merlijn@wizzup.org>
Cc: Pavel Machek <pavel@ucw.cz>
Cc: Sebastian Reichel <sre@kernel.org>
Signed-off-by: Carl Philipp Klemm <philipp@uvos.xyz>
[tony@atomide.com: made motorola specific, updated comments]
Signed-off-by: Tony Lindgren <tony@atomide.com>
---
 arch/arm/boot/dts/motorola-mapphone-common.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)

diff --git a/arch/arm/boot/dts/motorola-mapphone-common.dtsi b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
--- a/arch/arm/boot/dts/motorola-mapphone-common.dtsi
+++ b/arch/arm/boot/dts/motorola-mapphone-common.dtsi
@@ -200,6 +200,21 @@ &cpu_alert0 {
         temperature = <80000>; /* millicelsius */
 };
 
+&cpu0 {
+        /*
+	 * Note that the 1.2GiHz mode is enabled for all SoC variants for
+	 * the Motorola Android Linux v3.0.8 based kernel.
+	 */
+        operating-points = <
+	        /* kHz    uV */
+	        300000  1025000
+	        600000  1200000
+	        800000  1313000
+	        1008000 1375000
+		1200000 1375000
+        >;
+};
+
 &dss {
 	status = "okay";
 };
-- 
2.29.2

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

* Re: [PATCH 3/3] ARM: dts: motorola-mapphone: Add 1.2GHz OPP
  2020-12-30  8:42 ` [PATCH 3/3] ARM: dts: motorola-mapphone: Add 1.2GHz OPP Tony Lindgren
@ 2020-12-31  9:43   ` Pavel Machek
  2021-01-01  6:06     ` Tony Lindgren
  0 siblings, 1 reply; 7+ messages in thread
From: Pavel Machek @ 2020-12-31  9:43 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap, Benoît Cousson, devicetree, Carl Philipp Klemm,
	Merlijn Wajer, Sebastian Reichel, Daniel Lezcano,
	Eduardo Valentin, Peter Ujfalusi

[-- Attachment #1: Type: text/plain, Size: 1387 bytes --]

Hi!

> From: Carl Philipp Klemm <philipp@uvos.xyz>
> 
> The omap4430 HS HIGH performance devces support 1.2GHz opp, lower speed
> variants do not. However for mapphone devices Motorola seems to have
> decided that this does not really matter for the SoC variants they have
> tested to use, and decided to clock all devices, including the ones with
> STANDARD performance chips at 1.2GHz upon release of the 3.0.8 vendor
> kernel shiped with Android 4.0. Therefore it seems safe to do the same,
> but let's only do it for Motorola devices as the others have not been
> tested.
> 
> Note that we prevent overheating with the passive cooling device
> cpu_alert0 configured in the dts file that starts lowering the speed as
> needed.
> 
> This also removes the "failed to find current OPP for freq 1200000000"
> warning.

> +&cpu0 {
> +        /*
> +	 * Note that the 1.2GiHz mode is enabled for all SoC variants for
> +	 * the Motorola Android Linux v3.0.8 based kernel.
> +	 */

I'm pretty sure it is GHz, not GiHz.

> +        operating-points = <
> +	        /* kHz    uV */
> +	        300000  1025000
> +	        600000  1200000
> +	        800000  1313000
> +	        1008000 1375000
> +		1200000 1375000
> +        >;

Is it intended to be 1.008GHz, or is it a typo?

Best regards,
								Pavel
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling
  2020-12-30  8:42 ` [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling Tony Lindgren
@ 2020-12-31 14:33   ` Pavel Machek
  2020-12-31 18:53   ` Pavel Machek
  1 sibling, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2020-12-31 14:33 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap, Benoît Cousson, devicetree, Carl Philipp Klemm,
	Merlijn Wajer, Sebastian Reichel, Daniel Lezcano,
	Eduardo Valentin, Peter Ujfalusi

[-- Attachment #1: Type: text/plain, Size: 532 bytes --]

Hi!

> The current cooling device temperature is too high at 100C as we have a
> battery on the device right next to the SoC as pointed out by Carl Philipp
> Klemm <philipp@uvos.xyz>. Let's configure the max temperature to
> 80C.

Well... I am hitting even the 100C limit under load quite easily,
IIRC. I believe my Droid idles around 80C.... so this is likely to
make it... less useful.

Let me re-try and get some more numbers...

Best regards,
								Pavel
								
-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 195 bytes --]

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

* Re: [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling
  2020-12-30  8:42 ` [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling Tony Lindgren
  2020-12-31 14:33   ` Pavel Machek
@ 2020-12-31 18:53   ` Pavel Machek
  1 sibling, 0 replies; 7+ messages in thread
From: Pavel Machek @ 2020-12-31 18:53 UTC (permalink / raw)
  To: Tony Lindgren
  Cc: linux-omap, Benoît Cousson, devicetree, Carl Philipp Klemm,
	Merlijn Wajer, Sebastian Reichel, Daniel Lezcano,
	Eduardo Valentin, Peter Ujfalusi

[-- Attachment #1: Type: text/plain, Size: 1305 bytes --]

Hi!

> The current cooling device temperature is too high at 100C as we have a
> battery on the device right next to the SoC as pointed out by Carl Philipp
> Klemm <philipp@uvos.xyz>. Let's configure the max temperature to
> 80C.

It is very possible I don't have power management set up correctly, as
it breaks the modem.

(Additional problem is that shutdown does not work for me, it reboots
instead, so emergency poweroff won't do much good).

Shortly after bootup with kernel 5.9, I was using for motmdm debugging.

19:03, uptime 4min, CPU temp rose from 41 to 43C. Battery and board
are at 28C, 30C. Let me plug in the charger. It draws 350mA from USB.

19:20, CPU still at 43C, board and battery at 30C. That's way better
than I remember.

I ran "cat /dev/zero"; within seconds, CPU is at 52C. It also went
down to 45C rather quickly.

Lets try three instances of cat /dev/zero. Again, 52C in 20 seconds
and it slowly climbs to 58.5C.

Let's try ofono build. 60C rather quickly, then 62C and 65C. It takes
few minutes to climb to 68.5C.

But... this is way better then I remember. Let's hope temperatures
don't climb back during some other use. (Also... machine seems cooler
to touch.)

Best regards,
								Pavel

-- 
http://www.livejournal.com/~pavelmachek

[-- Attachment #2: Digital signature --]
[-- Type: application/pgp-signature, Size: 181 bytes --]

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

* Re: [PATCH 3/3] ARM: dts: motorola-mapphone: Add 1.2GHz OPP
  2020-12-31  9:43   ` Pavel Machek
@ 2021-01-01  6:06     ` Tony Lindgren
  0 siblings, 0 replies; 7+ messages in thread
From: Tony Lindgren @ 2021-01-01  6:06 UTC (permalink / raw)
  To: Pavel Machek
  Cc: linux-omap, Benoît Cousson, devicetree, Carl Philipp Klemm,
	Merlijn Wajer, Sebastian Reichel, Daniel Lezcano,
	Eduardo Valentin, Peter Ujfalusi

* Pavel Machek <pavel@ucw.cz> [201231 09:43]:
> I'm pretty sure it is GHz, not GiHz.

Oops right, will fix.

> > +        operating-points = <
> > +	        /* kHz    uV */
> > +	        300000  1025000
> > +	        600000  1200000
> > +	        800000  1313000
> > +	        1008000 1375000
> > +		1200000 1375000
> > +        >;
> 
> Is it intended to be 1.008GHz, or is it a typo?

The "1008000 1375000" is already there for 4430 in general, we now
add also add "1200000 1375000" but only for moto devices that have
it tested. The voltage used is the same in both cases.

The rates come from what's available from dpll_mpu_ck without
reprogramming the dpll.

Regards,

Tony

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

end of thread, other threads:[~2021-01-01  6:07 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-12-30  8:42 [PATCH 1/3] ARM: dts: Configure missing thermal interrupt for 4430 Tony Lindgren
2020-12-30  8:42 ` [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling Tony Lindgren
2020-12-31 14:33   ` Pavel Machek
2020-12-31 18:53   ` Pavel Machek
2020-12-30  8:42 ` [PATCH 3/3] ARM: dts: motorola-mapphone: Add 1.2GHz OPP Tony Lindgren
2020-12-31  9:43   ` Pavel Machek
2021-01-01  6:06     ` Tony Lindgren

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.