Skip to contentSkip to conversation

Add support of New Amlogic temperature sensor for G12 SoCs

PATCH In review Guillaume La Roque 4 participants 18 messages Oct 4, 2019 – Oct 17, 2019

Subsystems (4)
lore
Share & tools
lore

Guillaume La Roque

author maintainer
#0 lore raw

v7 cover Add support of New Amlogic temperature sensor for G12 SoCs

This patchs series add support of New Amlogic temperature sensor and minimal thermal zone for SEI510 and ODROID-N2 boards.

First implementation was doing on IIO[1] but after comments i move on thermal framework. Formulas and calibration values come from amlogic.

Changes since v6:
- add missing critical trip point.

Changes since v5:
- fix patch 5 and 6 send twice

Changes since v4:
- Move thermal-zone in soc dtsi file
- Remove critical trip point and add passive one
- fix commit message
- use devm_platform_ioremap_resource instead of platform_get_resource

Changes since v3:
- Add cooling map and trip point for hot type
- move compatible on g12a instead of g12 to be aligned with others
- add all reviewer, sorry for this mistake

Changes since v2:
- fix yaml documention
- remove unneeded status variable for temperature-sensor node
- rework driver after Martin review
- add some information in commit message

Changes since v1:
- fix enum vs const in documentation
- fix error with thermal-sensor-cells value set to 1 instead of 0
- add some dependencies needed to add cooling-maps

Dependencies :
- patch 3,4 & 5: depends on Neil's patch and series :
- missing dwc2 phy-names[2]
- patchsets to add DVFS on G12a[3] which have deps on [4] and [5]

[1] https://lore.kernel.org/linux-amlogic/[email protected]/
[2] https://lore.kernel.org/linux-amlogic/[email protected]/
[3] https://lore.kernel.org/linux-amlogic/[email protected]/
[4] https://lore.kernel.org/linux-amlogic/[email protected]/
[5] https://lore.kernel.org/linux-amlogic/[email protected]/

Guillaume La Roque (7):
dt-bindings: thermal: Add DT bindings documentation for Amlogic
Thermal
thermal: amlogic: Add thermal driver to support G12 SoCs
arm64: dts: amlogic: g12: add temperature sensor
arm64: dts: meson: g12: Add minimal thermal zone
arm64: dts: amlogic: g12a: add cooling properties
arm64: dts: amlogic: g12b: add cooling properties
MAINTAINERS: add entry for Amlogic Thermal driver

 .../bindings/thermal/amlogic,thermal.yaml     |  54 +++
 MAINTAINERS                                   |   9 +
 .../boot/dts/amlogic/meson-g12-common.dtsi    |  77 ++++
 arch/arm64/boot/dts/amlogic/meson-g12a.dtsi   |  24 ++
 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi   |  29 ++
 drivers/thermal/Kconfig                       |  11 +
 drivers/thermal/Makefile                      |   1 +
 drivers/thermal/amlogic_thermal.c             | 333 ++++++++++++++++++
 8 files changed, 538 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml
 create mode 100644 drivers/thermal/amlogic_thermal.c
Signature · 1 line
2.17.1
author maintainer
#1 lore raw

PATCH v7 1/7 dt-bindings: thermal: Add DT bindings documentation for Amlogic Thermal

Adding the devicetree binding documentation for the Amlogic temperature sensor found in the Amlogic Meson G12A and G12B SoCs.

---
 .../bindings/thermal/amlogic,thermal.yaml     | 54 +++++++++++++++++++
 1 file changed, 54 insertions(+)
 create mode 100644 Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml
Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml new file +54 -0
new file mode 100644
index 000000000000..f761681e4c0d
@@ -0,0 +1,54 @@
+# SPDX-License-Identifier: (GPL-2.0 OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/amlogic,thermal.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Amlogic Thermal
+
+maintainers:
+  - Guillaume La Roque <[email protected]>
+
+description: Binding for Amlogic Thermal
+
+properties:
+  compatible:
+      items:
+        - enum:
+            - amlogic,g12a-cpu-thermal
+            - amlogic,g12a-ddr-thermal
+        - const: amlogic,g12a-thermal
+
+  reg:
+    maxItems: 1
+
+  interrupts:
+    maxItems: 1
+
+  clocks:
+    maxItems: 1
+
+  amlogic,ao-secure:
+    description: phandle to the ao-secure syscon
+    $ref: '/schemas/types.yaml#/definitions/phandle'
+
+
+required:
+  - compatible
+  - reg
+  - interrupts
+  - clocks
+  - amlogic,ao-secure
+
+examples:
+  - |
+        cpu_temp: temperature-sensor@ff634800 {
+                compatible = "amlogic,g12a-cpu-thermal",
+                             "amlogic,g12a-thermal";
+                reg = <0xff634800 0x50>;
+                interrupts = <0x0 0x24 0x0>;
+                clocks = <&clk 164>;
+                #thermal-sensor-cells = <0>;
+                amlogic,ao-secure = <&sec_AO>;
+        };
+...
Signature · 1 line
2.17.1
author maintainer
#2 lore raw

PATCH v7 2/7 thermal: amlogic: Add thermal driver to support G12 SoCs

In reply to Guillaume La Roque

Amlogic G12A and G12B SoCs integrate two thermal sensors
with the same design. One is located close to the DDR controller and the other one is located close to the PLLs (between the CPU and GPU).

The calibration data for each of the thermal sensors instance is stored in a different location within the AO region.

Implement reading the temperature from each thermal sensor.

The IP block has more functionality, which may be added to this driver in the future:
- chip reset when the temperature exceeds a configurable threshold
- up to four interrupts when the temperature has risen above a configurable threshold
- up to four interrupts when the temperature has fallen below a configurable threshold

---
 drivers/thermal/Kconfig           |  11 +
 drivers/thermal/Makefile          |   1 +
 drivers/thermal/amlogic_thermal.c | 333 ++++++++++++++++++++++++++++++
 3 files changed, 345 insertions(+)
 create mode 100644 drivers/thermal/amlogic_thermal.c
drivers/thermal/Kconfig +11 -0
index 9966364a6deb..0f31bb4bc372 100644
@@ -348,6 +348,17 @@ config MTK_THERMAL
 	  Enable this option if you want to have support for thermal management
 	  controller present in Mediatek SoCs
 
+config AMLOGIC_THERMAL
+	tristate "Amlogic Thermal Support"
+	default ARCH_MESON
+	depends on OF && ARCH_MESON
+	help
+	  If you say yes here you get support for Amlogic Thermal
+	  for G12 SoC Family.
+
+	  This driver can also be built as a module. If so, the module will
+	  be called amlogic_thermal.
+
 menu "Intel thermal drivers"
 depends on X86 || X86_INTEL_QUARK || COMPILE_TEST
 source "drivers/thermal/intel/Kconfig"
drivers/thermal/Makefile +1 -0
index 74a37c7f847a..baeb70bf0568 100644
@@ -54,3 +54,4 @@ obj-$(CONFIG_MTK_THERMAL)	+= mtk_thermal.o
 obj-$(CONFIG_GENERIC_ADC_THERMAL)	+= thermal-generic-adc.o
 obj-$(CONFIG_ZX2967_THERMAL)	+= zx2967_thermal.o
 obj-$(CONFIG_UNIPHIER_THERMAL)	+= uniphier_thermal.o
+obj-$(CONFIG_AMLOGIC_THERMAL)     += amlogic_thermal.o
drivers/thermal/amlogic_thermal.c new file +333 -0

333 lines not on this page · raw message

Signature · 1 line
2.17.1
author maintainer
#3 lore raw

PATCH v7 3/7 arm64: dts: amlogic: g12: add temperature sensor

In reply to Guillaume La Roque

Add cpu and ddr temperature sensors for G12 Socs

---
 .../boot/dts/amlogic/meson-g12-common.dtsi    | 20 +++++++++++++++++++
 1 file changed, 20 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +20 -0
index 38d70ce1cfc7..0660d9ef6a86 100644
@@ -1353,6 +1353,26 @@
 				};
 			};
 
+			cpu_temp: temperature-sensor@34800 {
+				compatible = "amlogic,g12a-cpu-thermal",
+					     "amlogic,g12a-thermal";
+				reg = <0x0 0x34800 0x0 0x50>;
+				interrupts = <GIC_SPI 35 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&clkc CLKID_TS>;
+				#thermal-sensor-cells = <0>;
+				amlogic,ao-secure = <&sec_AO>;
+			};
+
+			ddr_temp: temperature-sensor@34c00 {
+				compatible = "amlogic,g12a-ddr-thermal",
+					     "amlogic,g12a-thermal";
+				reg = <0x0 0x34c00 0x0 0x50>;
+				interrupts = <GIC_SPI 36 IRQ_TYPE_EDGE_RISING>;
+				clocks = <&clkc CLKID_TS>;
+				#thermal-sensor-cells = <0>;
+				amlogic,ao-secure = <&sec_AO>;
+			};
+
 			usb2_phy0: phy@36000 {
 				compatible = "amlogic,g12a-usb2-phy";
 				reg = <0x0 0x36000 0x0 0x2000>;
Signature · 1 line
2.17.1
author maintainer
#4 lore raw

PATCH v7 4/7 arm64: dts: meson: g12: Add minimal thermal zone

In reply to Guillaume La Roque

Add minimal thermal zone for two temperature sensor One is located close to the DDR and the other one is located close to the PLLs (between the CPU and GPU)

---
 .../boot/dts/amlogic/meson-g12-common.dtsi    | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +57 -0
index 0660d9ef6a86..a98c16e163c2 100644
@@ -12,6 +12,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
 #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
 	interrupt-parent = <&gic>;
@@ -94,6 +95,61 @@
 		#size-cells = <2>;
 		ranges;
 
+		thermal-zones {
+			cpu_thermal: cpu-thermal {
+				polling-delay = <1000>;
+				polling-delay-passive = <100>;
+				thermal-sensors = <&cpu_temp>;
+
+				trips {
+					cpu_passive: cpu-passive {
+						temperature = <85000>; /* millicelsius */
+						hysteresis = <2000>; /* millicelsius */
+						type = "passive";
+					};
+
+					cpu_hot: cpu-hot {
+						temperature = <95000>; /* millicelsius */
+						hysteresis = <2000>; /* millicelsius */
+						type = "hot";
+					};
+
+					cpu_critical: cpu-critical {
+						temperature = <110000>; /* millicelsius */
+						hysteresis = <2000>; /* millicelsius */
+						type = "critical";
+					};
+				};
+			};
+
+			ddr_thermal: ddr-thermal {
+				polling-delay = <1000>;
+				polling-delay-passive = <100>;
+				thermal-sensors = <&ddr_temp>;
+
+				trips {
+					ddr_passive: ddr-passive {
+						temperature = <85000>; /* millicelsius */
+						hysteresis = <2000>; /* millicelsius */
+						type = "passive";
+					};
+
+					ddr_critical: ddr-critical {
+						temperature = <110000>; /* millicelsius */
+						hysteresis = <2000>; /* millicelsius */
+						type = "critical";
+					};
+				};
+
+				cooling-maps {
+					map {
+						trip = <&ddr_passive>;
+						cooling-device = <&mali THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+					};
+				};
+			};
+		};
+
 		ethmac: ethernet@ff3f0000 {
 			compatible = "amlogic,meson-axg-dwmac",
 				     "snps,dwmac-3.70a",
@@ -2412,6 +2468,7 @@
 			assigned-clock-rates = <0>, /* Do Nothing */
 					       <800000000>,
 					       <0>; /* Do Nothing */
+			#cooling-cells = <2>;
 		};
 	};
 
Signature · 1 line
2.17.1
#5 lore raw

Re: [PATCH v7 4/7] arm64: dts: meson: g12: Add minimal thermal zone

Quoted 27 lines · Guillaume La Roque

Add minimal thermal zone for two temperature sensor One is located close to the DDR and the other one is located close to the PLLs (between the CPU and GPU)

---
 .../boot/dts/amlogic/meson-g12-common.dtsi    | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +1 -0
index 0660d9ef6a86..a98c16e163c2 100644
@@ -12,6 +12,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
 #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        interrupt-parent = <&gic>;

arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi line 101

Quoted 7 lines
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +4 -0
@@ -94,6 +95,61 @@
                #size-cells = <2>;
                ranges;
 
+               thermal-zones {
+                       cpu_thermal: cpu-thermal {
+                               polling-delay = <1000>;
+                               polling-delay-passive = <100>;

Ordinarily, you would need to set these delays to 0 in interrupt mode to prevent polling overhead. I've just submitted a patch to of-thermal that should fix this requirement. Could you check if it works for you?

Quoted 65 lines
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +52 -1
+                               thermal-sensors = <&cpu_temp>;
+
+                               trips {
+                                       cpu_passive: cpu-passive {
+                                               temperature = <85000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "passive";
+                                       };
+
+                                       cpu_hot: cpu-hot {
+                                               temperature = <95000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "hot";
+                                       };
+
+                                       cpu_critical: cpu-critical {
+                                               temperature = <110000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "critical";
+                                       };
+                               };
+                       };
+
+                       ddr_thermal: ddr-thermal {
+                               polling-delay = <1000>;
+                               polling-delay-passive = <100>;
+                               thermal-sensors = <&ddr_temp>;
+
+                               trips {
+                                       ddr_passive: ddr-passive {
+                                               temperature = <85000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "passive";
+                                       };
+
+                                       ddr_critical: ddr-critical {
+                                               temperature = <110000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "critical";
+                                       };
+                               };
+
+                               cooling-maps {
+                                       map {
+                                               trip = <&ddr_passive>;
+                                               cooling-device = <&mali THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                                       };
+                               };
+                       };
+               };
+
                ethmac: ethernet@ff3f0000 {
                        compatible = "amlogic,meson-axg-dwmac",
                                     "snps,dwmac-3.70a",
@@ -2412,6 +2468,7 @@
                        assigned-clock-rates = <0>, /* Do Nothing */
                                               <800000000>,
                                               <0>; /* Do Nothing */
+                       #cooling-cells = <2>;
                };
        };
 
--

2.17.1

author maintainer
#6 lore raw

Re: [PATCH v7 4/7] arm64: dts: meson: g12: Add minimal thermal zone

Hi,

Quoted 30 lines · Amit Kucheria
Quoted 29 lines · Guillaume La Roque

Add minimal thermal zone for two temperature sensor One is located close to the DDR and the other one is located close to the PLLs (between the CPU and GPU)

---
 .../boot/dts/amlogic/meson-g12-common.dtsi    | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +1 -0
index 0660d9ef6a86..a98c16e163c2 100644
@@ -12,6 +12,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
 #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        interrupt-parent = <&gic>;
@@ -94,6 +95,61 @@
                #size-cells = <2>;
                ranges;
 
Quoted 7 lines

arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi line 101

Quoted 4 lines
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +4 -0
+               thermal-zones {
+                       cpu_thermal: cpu-thermal {
+                               polling-delay = <1000>;
+                               polling-delay-passive = <100>;

Ordinarily, you would need to set these delays to 0 in interrupt mode to prevent polling overhead. I've just submitted a patch to of-thermal that should fix this requirement. Could you check if it works for you?

it's working for me.

thanks for your review.

Quoted 65 lines
Quoted 65 lines
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +52 -1
+                               thermal-sensors = <&cpu_temp>;
+
+                               trips {
+                                       cpu_passive: cpu-passive {
+                                               temperature = <85000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "passive";
+                                       };
+
+                                       cpu_hot: cpu-hot {
+                                               temperature = <95000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "hot";
+                                       };
+
+                                       cpu_critical: cpu-critical {
+                                               temperature = <110000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "critical";
+                                       };
+                               };
+                       };
+
+                       ddr_thermal: ddr-thermal {
+                               polling-delay = <1000>;
+                               polling-delay-passive = <100>;
+                               thermal-sensors = <&ddr_temp>;
+
+                               trips {
+                                       ddr_passive: ddr-passive {
+                                               temperature = <85000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "passive";
+                                       };
+
+                                       ddr_critical: ddr-critical {
+                                               temperature = <110000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "critical";
+                                       };
+                               };
+
+                               cooling-maps {
+                                       map {
+                                               trip = <&ddr_passive>;
+                                               cooling-device = <&mali THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                                       };
+                               };
+                       };
+               };
+
                ethmac: ethernet@ff3f0000 {
                        compatible = "amlogic,meson-axg-dwmac",
                                     "snps,dwmac-3.70a",
@@ -2412,6 +2468,7 @@
                        assigned-clock-rates = <0>, /* Do Nothing */
                                               <800000000>,
                                               <0>; /* Do Nothing */
+                       #cooling-cells = <2>;
                };
        };
 
--

2.17.1

Reviewed-by on v7 4/7
#7 lore raw

Re: [PATCH v7 4/7] arm64: dts: meson: g12: Add minimal thermal zone

In reply to Guillaume La Roque
Quoted 10 lines · Guillaume La Roque

Add minimal thermal zone for two temperature sensor One is located close to the DDR and the other one is located close to the PLLs (between the CPU and GPU)

Quoted 89 lines
---
 .../boot/dts/amlogic/meson-g12-common.dtsi    | 57 +++++++++++++++++++
 1 file changed, 57 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12-common.dtsi +57 -1
index 0660d9ef6a86..a98c16e163c2 100644
@@ -12,6 +12,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/reset/amlogic,meson-axg-audio-arb.h>
 #include <dt-bindings/reset/amlogic,meson-g12a-reset.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        interrupt-parent = <&gic>;
@@ -94,6 +95,61 @@
                #size-cells = <2>;
                ranges;
 
+               thermal-zones {
+                       cpu_thermal: cpu-thermal {
+                               polling-delay = <1000>;
+                               polling-delay-passive = <100>;
+                               thermal-sensors = <&cpu_temp>;
+
+                               trips {
+                                       cpu_passive: cpu-passive {
+                                               temperature = <85000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "passive";
+                                       };
+
+                                       cpu_hot: cpu-hot {
+                                               temperature = <95000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "hot";
+                                       };
+
+                                       cpu_critical: cpu-critical {
+                                               temperature = <110000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "critical";
+                                       };
+                               };
+                       };
+
+                       ddr_thermal: ddr-thermal {
+                               polling-delay = <1000>;
+                               polling-delay-passive = <100>;
+                               thermal-sensors = <&ddr_temp>;
+
+                               trips {
+                                       ddr_passive: ddr-passive {
+                                               temperature = <85000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "passive";
+                                       };
+
+                                       ddr_critical: ddr-critical {
+                                               temperature = <110000>; /* millicelsius */
+                                               hysteresis = <2000>; /* millicelsius */
+                                               type = "critical";
+                                       };
+                               };
+
+                               cooling-maps {
+                                       map {
+                                               trip = <&ddr_passive>;
+                                               cooling-device = <&mali THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                                       };
+                               };
+                       };
+               };
+
                ethmac: ethernet@ff3f0000 {
                        compatible = "amlogic,meson-axg-dwmac",
                                     "snps,dwmac-3.70a",
@@ -2412,6 +2468,7 @@
                        assigned-clock-rates = <0>, /* Do Nothing */
                                               <800000000>,
                                               <0>; /* Do Nothing */
+                       #cooling-cells = <2>;
                };
        };
 
--

2.17.1

maintainer
#8 lore raw

Re: [PATCH v7 4/7] arm64: dts: meson: g12: Add minimal thermal zone

In reply to Guillaume La Roque
Quoted 3 lines · Guillaume La Roque

Add minimal thermal zone for two temperature sensor One is located close to the DDR and the other one is located close to the PLLs (between the CPU and GPU)

nit: subject should be "arm64: dts: amlogic" (not meson).

I fixed it up when applying,

Kevin

maintainer
#9 lore raw

Re: [PATCH v7 4/7] arm64: dts: meson: g12: Add minimal thermal zone

Quoted 9 lines · Kevin Hilman
Quoted 3 lines · Guillaume La Roque

Add minimal thermal zone for two temperature sensor One is located close to the DDR and the other one is located close to the PLLs (between the CPU and GPU)

nit: subject should be "arm64: dts: amlogic" (not meson).

I fixed it up when applying,

I got it backwards, this one was right, the other ones with "amlogic" should be "meson". I (re)fixed it in my 'v5.5/dt64' branch.

Kevin

author maintainer
#10 lore raw

PATCH v7 5/7 arm64: dts: amlogic: g12a: add cooling properties

In reply to Guillaume La Roque

Add missing #colling-cells field for G12A SoC Add cooling-map for passive and hot trip point

---
 arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 24 +++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a.dtsi +24 -0
index 733a9d46fc4b..3ab6497548ca 100644
@@ -18,6 +18,7 @@
 			reg = <0x0 0x0>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu1: cpu@1 {
@@ -26,6 +27,7 @@
 			reg = <0x0 0x1>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu2: cpu@2 {
@@ -34,6 +36,7 @@
 			reg = <0x0 0x2>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu3: cpu@3 {
@@ -42,6 +45,7 @@
 			reg = <0x0 0x3>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		l2: l2-cache0 {
@@ -113,3 +117,23 @@
 &sd_emmc_a {
 	amlogic,dram-access-quirk;
 };
+
+&cpu_thermal {
+	cooling-maps {
+		map0 {
+			trip = <&cpu_passive>;
+			cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					<&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					<&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					<&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+		};
+
+		map1 {
+			trip = <&cpu_hot>;
+			cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					<&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					<&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					<&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+		};
+	};
+};
Signature · 1 line
2.17.1
Reviewed-by on v7 5/7
#11 lore raw

Re: [PATCH v7 5/7] arm64: dts: amlogic: g12a: add cooling properties

Quoted 8 lines · Guillaume La Roque

Add missing #colling-cells field for G12A SoC Add cooling-map for passive and hot trip point

Quoted 67 lines
---
 arch/arm64/boot/dts/amlogic/meson-g12a.dtsi | 24 +++++++++++++++++++++
 1 file changed, 24 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12a.dtsi +24 -1
index 733a9d46fc4b..3ab6497548ca 100644
@@ -18,6 +18,7 @@
                        reg = <0x0 0x0>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                cpu1: cpu@1 {
@@ -26,6 +27,7 @@
                        reg = <0x0 0x1>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                cpu2: cpu@2 {
@@ -34,6 +36,7 @@
                        reg = <0x0 0x2>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                cpu3: cpu@3 {
@@ -42,6 +45,7 @@
                        reg = <0x0 0x3>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                l2: l2-cache0 {
@@ -113,3 +117,23 @@
 &sd_emmc_a {
        amlogic,dram-access-quirk;
 };
+
+&cpu_thermal {
+       cooling-maps {
+               map0 {
+                       trip = <&cpu_passive>;
+                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+
+               map1 {
+                       trip = <&cpu_hot>;
+                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                       <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
+};
--

2.17.1

author maintainer
#12 lore raw

PATCH v7 6/7 arm64: dts: amlogic: g12b: add cooling properties

In reply to Guillaume La Roque

Add missing #colling-cells field for G12B SoC Add cooling-map for passive and hot trip point

---
 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi | 29 +++++++++++++++++++++
 1 file changed, 29 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12b.dtsi +29 -0
index 98ae8a7c8b41..4bb89bce758f 100644
@@ -49,6 +49,7 @@
 			reg = <0x0 0x0>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu1: cpu@1 {
@@ -57,6 +58,7 @@
 			reg = <0x0 0x1>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu100: cpu@100 {
@@ -65,6 +67,7 @@
 			reg = <0x0 0x100>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu101: cpu@101 {
@@ -73,6 +76,7 @@
 			reg = <0x0 0x101>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu102: cpu@102 {
@@ -81,6 +85,7 @@
 			reg = <0x0 0x102>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		cpu103: cpu@103 {
@@ -89,6 +94,7 @@
 			reg = <0x0 0x103>;
 			enable-method = "psci";
 			next-level-cache = <&l2>;
+			#cooling-cells = <2>;
 		};
 
 		l2: l2-cache0 {
@@ -219,3 +225,26 @@
 &sd_emmc_a {
 	amlogic,dram-access-quirk;
 };
+
+&cpu_thermal {
+	cooling-maps {
+		map0 {
+			trip = <&cpu_passive>;
+			cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+		};
+		map1 {
+			trip = <&cpu_hot>;
+			cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+					 <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+		};
+	};
+};
Signature · 1 line
2.17.1
Reviewed-by on v7 6/7
#13 lore raw

Re: [PATCH v7 6/7] arm64: dts: amlogic: g12b: add cooling properties

Quoted 8 lines · Guillaume La Roque

Add missing #colling-cells field for G12B SoC Add cooling-map for passive and hot trip point

Quoted 86 lines
---
 arch/arm64/boot/dts/amlogic/meson-g12b.dtsi | 29 +++++++++++++++++++++
 1 file changed, 29 insertions(+)
arch/arm64/boot/dts/amlogic/meson-g12b.dtsi +29 -1
index 98ae8a7c8b41..4bb89bce758f 100644
@@ -49,6 +49,7 @@
                        reg = <0x0 0x0>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                cpu1: cpu@1 {
@@ -57,6 +58,7 @@
                        reg = <0x0 0x1>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                cpu100: cpu@100 {
@@ -65,6 +67,7 @@
                        reg = <0x0 0x100>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                cpu101: cpu@101 {
@@ -73,6 +76,7 @@
                        reg = <0x0 0x101>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                cpu102: cpu@102 {
@@ -81,6 +85,7 @@
                        reg = <0x0 0x102>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                cpu103: cpu@103 {
@@ -89,6 +94,7 @@
                        reg = <0x0 0x103>;
                        enable-method = "psci";
                        next-level-cache = <&l2>;
+                       #cooling-cells = <2>;
                };
 
                l2: l2-cache0 {
@@ -219,3 +225,26 @@
 &sd_emmc_a {
        amlogic,dram-access-quirk;
 };
+
+&cpu_thermal {
+       cooling-maps {
+               map0 {
+                       trip = <&cpu_passive>;
+                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+               map1 {
+                       trip = <&cpu_hot>;
+                       cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu100 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu101 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu102 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+                                        <&cpu103 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+               };
+       };
+};
--

2.17.1

author maintainer
#14 lore raw

PATCH v7 7/7 MAINTAINERS: add entry for Amlogic Thermal driver

In reply to Guillaume La Roque

Add myself as maintainer for Amlogic Thermal driver.

---
 MAINTAINERS | 9 +++++++++
 1 file changed, 9 insertions(+)
MAINTAINERS +9 -0
index 390c3194ee93..bdc30d740342 100644
@@ -15932,6 +15932,15 @@ F:	Documentation/driver-api/thermal/cpu-cooling-api.rst
 F:	drivers/thermal/cpu_cooling.c
 F:	include/linux/cpu_cooling.h
 
+THERMAL DRIVER FOR AMLOGIC SOCS
+M:	Guillaume La Roque <[email protected]>
+L:	[email protected]
+L:	[email protected]
+W:	http://linux-meson.com/
+S:	Supported
+F:	drivers/thermal/amlogic_thermal.c
+F:	Documentation/devicetree/bindings/thermal/amlogic,thermal.yaml
+
 THINKPAD ACPI EXTRAS DRIVER
 M:	Henrique de Moraes Holschuh <[email protected]>
 L:	[email protected]
Signature · 1 line
2.17.1
maintainer
#15 lore raw
In reply to Guillaume La Roque

Eduardo,

Quoted 2 lines · Guillaume La Roque

This patchs series add support of New Amlogic temperature sensor and minimal thermal zone for SEI510 and ODROID-N2 boards.

[...]

Quoted 9 lines

Guillaume La Roque (7):
dt-bindings: thermal: Add DT bindings documentation for Amlogic
Thermal
thermal: amlogic: Add thermal driver to support G12 SoCs
arm64: dts: amlogic: g12: add temperature sensor
arm64: dts: meson: g12: Add minimal thermal zone
arm64: dts: amlogic: g12a: add cooling properties
arm64: dts: amlogic: g12b: add cooling properties
MAINTAINERS: add entry for Amlogic Thermal driver

This has now been thorougly reviewed/tested.

I've queued all the "arm64: dts:" patches via my amlogic tree for v5.5. Can you please queue up the driver, bindings and MAINTAINERS patch?

Thanks,

Kevin

#16 lore raw

Hi Kevin,

Quoted 19 lines · Kevin Hilman

Eduardo,

Quoted 2 lines · Guillaume La Roque

This patchs series add support of New Amlogic temperature sensor and minimal thermal zone for SEI510 and ODROID-N2 boards.

[...]

Quoted 9 lines

Guillaume La Roque (7):
dt-bindings: thermal: Add DT bindings documentation for Amlogic
Thermal
thermal: amlogic: Add thermal driver to support G12 SoCs
arm64: dts: amlogic: g12: add temperature sensor
arm64: dts: meson: g12: Add minimal thermal zone
arm64: dts: amlogic: g12a: add cooling properties
arm64: dts: amlogic: g12b: add cooling properties
MAINTAINERS: add entry for Amlogic Thermal driver

Quoted 4 lines

This has now been thorougly reviewed/tested.

I've queued all the "arm64: dts:" patches via my amlogic tree for v5.5. Can you please queue up the driver, bindings and MAINTAINERS patch?

1, 2, 7 right?

Signature · 5 lines
 <http://www.linaro.org/> Linaro.org │ Open source software for ARM SoCs

Follow Linaro:  <http://www.facebook.com/pages/Linaro> Facebook |
<http://twitter.com/#!/linaroorg> Twitter |
<http://www.linaro.org/linaro-blog/> Blog
maintainer
#17 lore raw

Hi Daniel,

Quoted 20 lines · Daniel Lezcano
Quoted 19 lines · Kevin Hilman

Eduardo,

Quoted 2 lines · Guillaume La Roque

This patchs series add support of New Amlogic temperature sensor and minimal thermal zone for SEI510 and ODROID-N2 boards.

[...]

Quoted 9 lines

Guillaume La Roque (7):
dt-bindings: thermal: Add DT bindings documentation for Amlogic
Thermal
thermal: amlogic: Add thermal driver to support G12 SoCs
arm64: dts: amlogic: g12: add temperature sensor
arm64: dts: meson: g12: Add minimal thermal zone
arm64: dts: amlogic: g12a: add cooling properties
arm64: dts: amlogic: g12b: add cooling properties
MAINTAINERS: add entry for Amlogic Thermal driver

Quoted 6 lines
Quoted 4 lines

This has now been thorougly reviewed/tested.

I've queued all the "arm64: dts:" patches via my amlogic tree for v5.5. Can you please queue up the driver, bindings and MAINTAINERS patch?

1, 2, 7 right?

Correct.

Thanks,

Kevin