imx: imx8dx/qxp: enable thermal
authorPeng Fan <peng.fan@nxp.com>
Sun, 5 May 2019 13:24:00 +0000 (13:24 +0000)
committerStefano Babic <sbabic@denx.de>
Fri, 19 Jul 2019 13:17:13 +0000 (15:17 +0200)
Add thermal dts node
Enable thermal in defconfig

Signed-off-by: Peng Fan <peng.fan@nxp.com>
arch/arm/dts/fsl-imx8dx.dtsi
configs/imx8qxp_mek_defconfig

index 715abb413d8e803a6d095c11f2d44f26e3a0846d..4fc87a9fc82b7c49ee9c1604c63eb6330a2d5d5d 100644 (file)
@@ -11,6 +11,7 @@
 #include <dt-bindings/input/input.h>
 #include <dt-bindings/pinctrl/pads-imx8qxp.h>
 #include <dt-bindings/gpio/gpio.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        model = "Freescale i.MX8DX";
                power-domains = <&pd_conn_enet1>;
                status = "disabled";
        };
+
+       tsens: thermal-sensor {
+               compatible = "nxp,imx8qxp-sc-tsens";
+               /* number of the temp sensor on the chip */
+               tsens-num = <2>;
+               #thermal-sensor-cells = <1>;
+       };
+
+       thermal_zones: thermal-zones {
+               /* cpu thermal */
+               cpu-thermal0 {
+                       polling-delay-passive = <250>;
+                       polling-delay = <2000>;
+                       /*the slope and offset of the temp sensor */
+                       thermal-sensors = <&tsens 0>;
+                       trips {
+                               cpu_alert0: trip0 {
+                                       temperature = <107000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               cpu_crit0: trip1 {
+                                       temperature = <127000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+                       cooling-maps {
+                               map0 {
+                                       trip = <&cpu_alert0>;
+                                       cooling-device =
+                                       <&A35_0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+                               };
+                       };
+               };
+
+               drc-thermal0 {
+                       polling-delay-passive = <250>;
+                       polling-delay = <2000>;
+                       thermal-sensors = <&tsens 1>;
+                       status = "disabled";
+                       trips {
+                               drc_alert0: trip0 {
+                                       temperature = <107000>;
+                                       hysteresis = <2000>;
+                                       type = "passive";
+                               };
+                               drc_crit0: trip1 {
+                                       temperature = <127000>;
+                                       hysteresis = <2000>;
+                                       type = "critical";
+                               };
+                       };
+               };
+       };
 };
 
 &A35_0 {
index 39e5f5e71d217fa625ebc944995c837f1237322c..cf83a671f7b947168ca87f2a3d940b2c041e9a78 100644 (file)
@@ -78,5 +78,7 @@ CONFIG_DM_REGULATOR_GPIO=y
 CONFIG_SPL_DM_REGULATOR_GPIO=y
 CONFIG_DM_SERIAL=y
 CONFIG_FSL_LPUART=y
+CONFIG_DM_THERMAL=y
+CONFIG_IMX_SCU_THERMAL=y
 CONFIG_SPL_TINY_MEMSET=y
 # CONFIG_EFI_LOADER is not set