ARM: dts: omap3: Add cpu trips and cooling map for omap34/36 families
authorAdam Ford <aford173@gmail.com>
Tue, 18 Aug 2020 12:57:20 +0000 (07:57 -0500)
committerTony Lindgren <tony@atomide.com>
Wed, 19 Aug 2020 07:32:43 +0000 (10:32 +0300)
Currently, OMAP3_THERMAL is disabled by default, so the bandgap sensor
is unavailable, and enabling it will somewhat increase power consumption.
However for boards which operate near their thermal limit, OMAP3_THERMAL
can be enabled and monitored to keep the processor from either running
too fast, or shutdown when it's deemed to be operating at an unsafe
thermal limit at the expense of increased power consumption.

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

This patch expands the thermal information to include the limits of
80C for alert and 90C critical based on commercial temperature rating.
It sets the coolings-cells for the 34xx and 36xx CPU's which will start
to throttle back their maximum frequency when the bangap sensor reads
above the alert temerature of 80C.

For boards who which to increase the temperatures for extended
temperature ratings, these can be changed on their respective
device trees with something like:

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

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

Signed-off-by: Adam Ford <aford173@gmail.com>
Tested-by: H. Nikolaus Schaller <hns@goldelico.com> # on GTA04A5 with dm3730cbp100
Signed-off-by: Tony Lindgren <tony@atomide.com>
arch/arm/boot/dts/omap3-cpu-thermal.dtsi
arch/arm/boot/dts/omap34xx.dtsi
arch/arm/boot/dts/omap36xx.dtsi

index aee46fa8c0551a99763dc4a0b009f8da055ec401..1ed837859374514c4b3e48659a7ed5841d6c0bd2 100644 (file)
@@ -17,4 +17,25 @@ cpu_thermal: cpu_thermal {
 
                        /* sensor       ID */
        thermal-sensors = <&bandgap     0>;
+
+       cpu_trips: trips {
+               cpu_alert0: cpu_alert {
+                       temperature = <80000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "passive";
+               };
+               cpu_crit: cpu_crit {
+                       temperature = <90000>; /* millicelsius */
+                       hysteresis = <2000>; /* millicelsius */
+                       type = "critical";
+               };
+       };
+
+       cpu_cooling_maps: cooling-maps {
+               map0 {
+                       trip = <&cpu_alert0>;
+                       cooling-device =
+                               <&cpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
 };
index 9c3ee4ac81659c4cf37c7a4891a589fa6954cef3..c0dcc75833a8e45b07c45aed68fa06f7c4b8e348 100644 (file)
@@ -20,6 +20,7 @@
                        operating-points-v2 = <&cpu0_opp_table>;
 
                        clock-latency = <300000>; /* From legacy driver */
+                       #cooling-cells = <2>;
                };
        };
 
index 9c3beefc0fe08dd9f05b2c585b1119330d778e3d..fadbf308feff7beffc11147f7158c410ffbeef79 100644 (file)
@@ -25,6 +25,7 @@
 
                        vbb-supply = <&abb_mpu_iva>;
                        clock-latency = <300000>; /* From omap-cpufreq driver */
+                       #cooling-cells = <2>;
                };
        };