Skip to contentSkip to conversation

ARM: dts: Configure missing thermal interrupt for 4430

PATCH In review Tony Lindgren 2 participants 7 messages Dec 30, 2020 – Jan 1, 2021 Device tree bindings

lore
Share & tools
lore
#0 lore raw

PATCH 1/3 ARM: dts: Configure missing thermal interrupt for 4430

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 <[email protected]>
Cc Daniel Lezcano <[email protected]>
Cc Eduardo Valentin <[email protected]>
Cc Merlijn Wajer <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Peter Ujfalusi <[email protected]>
Cc Sebastian Reichel <[email protected]>
---
 arch/arm/boot/dts/omap443x.dtsi | 2 ++
 1 file changed, 2 insertions(+)
arch/arm/boot/dts/omap443x.dtsi +2 -0
@@ -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>;
 		};
Signature · 1 line
2.29.2
#1 lore raw

PATCH 2/3 ARM: dts: motorola-mapphone: Configure lower temperature passive cooling

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 <[email protected]>. 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 <[email protected]>
Cc Merlijn Wajer <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Sebastian Reichel <[email protected]>
---
 arch/arm/boot/dts/motorola-mapphone-common.dtsi | 8 ++++++++
 1 file changed, 8 insertions(+)
arch/arm/boot/dts/motorola-mapphone-common.dtsi +8 -0
@@ -192,6 +192,14 @@ backlight: backlight {
 	};
 };
 
+&cpu_thermal {
+	polling-delay = <10000>; /* milliseconds */
+};
+
+&cpu_alert0 {
+        temperature = <80000>; /* millicelsius */
+};
+
 &dss {
 	status = "okay";
 };
Signature · 1 line
2.29.2
#2 lore raw

Re: [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling

Hi!

Quoted 4 lines

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 <[email protected]>. 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

Signature · 1 line
http://www.livejournal.com/~pavelmachek
#3 lore raw

Re: [PATCH 2/3] ARM: dts: motorola-mapphone: Configure lower temperature passive cooling

In reply to Tony Lindgren

Hi!

Quoted 4 lines

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 <[email protected]>. 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

Signature · 1 line
http://www.livejournal.com/~pavelmachek
#4 lore raw

PATCH 3/3 ARM: dts: motorola-mapphone: Add 1.2GHz OPP

In reply to Tony Lindgren

From: Carl Philipp Klemm <[email protected]>

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 <[email protected]>
Cc Pavel Machek <[email protected]>
Cc Sebastian Reichel <[email protected]>
[[email protected]: made motorola specific, updated comments]
---
 arch/arm/boot/dts/motorola-mapphone-common.dtsi | 15 +++++++++++++++
 1 file changed, 15 insertions(+)
arch/arm/boot/dts/motorola-mapphone-common.dtsi +15 -0
@@ -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";
 };
Signature · 1 line
2.29.2
#5 lore raw

Re: [PATCH 3/3] ARM: dts: motorola-mapphone: Add 1.2GHz OPP

Hi!

Quoted 19 lines

From: Carl Philipp Klemm <[email protected]>

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 {

arch/arm/boot/dts/motorola-mapphone-common.dtsi &cpu_alert0 { · line 207

Quoted 4 lines
arch/arm/boot/dts/motorola-mapphone-common.dtsi +4 -0
+        /*
+	 * 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.

arch/arm/boot/dts/motorola-mapphone-common.dtsi &cpu_alert0 { · line 215

Quoted 8 lines
arch/arm/boot/dts/motorola-mapphone-common.dtsi +8 -0
+        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

Signature · 1 line
http://www.livejournal.com/~pavelmachek
#6 lore raw

Re: [PATCH 3/3] ARM: dts: motorola-mapphone: Add 1.2GHz OPP

Quoted 1 line · Pavel Machek

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

Oops right, will fix.

Quoted 10 lines

arch/arm/boot/dts/motorola-mapphone-common.dtsi &cpu_alert0 { · line 215

Quoted 8 lines
arch/arm/boot/dts/motorola-mapphone-common.dtsi +8 -0
+        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