ARM64: dts: rockchip: add the thermal main info found on rk3399
authorCaesar Wang <wxt@rock-chips.com>
Thu, 10 Mar 2016 09:58:36 +0000 (17:58 +0800)
committerCaesar Wang <wxt@rock-chips.com>
Mon, 14 Mar 2016 03:16:00 +0000 (11:16 +0800)
This patch adds the thermal needed main information for rk3399 SoCS.

Basically has the following content:

1) TSADC controller:
    Add the needed attributes for rk3399 TSADC controller.
    Especially for the TSHUT, in some cases if we are unable to shut it down
    in orderly fashion (says: kernel is stuck holding a lock or similar), then
    hardware TSHUT will reset it.
    If the temperature is over 95C over a period of time the thermal shutdown
    of the tsadc is invoked with can either reset the entire chip via the CRU,
    or notify the PMIC via a GPIO. This should be set in the specific board.

2) Thermal zones:
    Add the needed device mode for thermal generic framework.
    Detail in Documentation/devicetree/bindings/thermal/thermal.txt.

Change-Id: I1361beeb85e6d4a134b4640c16440452aa950e16
Signed-off-by: Caesar Wang <wxt@rock-chips.com>
arch/arm64/boot/dts/rockchip/rk3399.dtsi

index fa6be22ca942eca9ae06f3dbe54ea90a43d216f1..f24bb14d2d5489cbf4cc136eca3e6acd31bd97cc 100644 (file)
@@ -44,6 +44,7 @@
 #include <dt-bindings/interrupt-controller/arm-gic.h>
 #include <dt-bindings/interrupt-controller/irq.h>
 #include <dt-bindings/pinctrl/rockchip.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        compatible = "rockchip,rk3399";
@@ -92,6 +93,8 @@
                        device_type = "cpu";
                        compatible = "arm,cortex-a53", "arm,armv8";
                        reg = <0x0 0x0>;
+
+                       #cooling-cells = <2>; /* min followed by max */
                };
 
                cpu_l1: cpu@1 {
                        device_type = "cpu";
                        compatible = "arm,cortex-a72", "arm,armv8";
                        reg = <0x0 0x100>;
+
+                       #cooling-cells = <2>; /* min followed by max */
                };
 
                cpu_b1: cpu@101 {
                status = "disabled";
        };
 
+       thermal-zones {
+               #include "rk3368-thermal.dtsi"
+       };
+
+       tsadc: tsadc@ff260000 {
+               compatible = "rockchip,rk3399-tsadc";
+               reg = <0x0 0xff260000 0x0 0x100>;
+               interrupts = <GIC_SPI 97 IRQ_TYPE_LEVEL_HIGH>;
+               clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
+               clock-names = "tsadc", "apb_pclk";
+               resets = <&cru SRST_TSADC>;
+               reset-names = "tsadc-apb";
+               pinctrl-names = "init", "default", "sleep";
+               pinctrl-0 = <&otp_gpio>;
+               pinctrl-1 = <&otp_out>;
+               pinctrl-2 = <&otp_gpio>;
+               #thermal-sensor-cells = <1>;
+               rockchip,hw-tshut-temp = <95000>;
+               status = "disabled";
+       };
+
        pmugrf: syscon@ff320000 {
                compatible = "rockchip,rk3399-pmugrf", "syscon";
                reg = <0x0 0xff320000 0x0 0x1000>;
                        };
                };
 
+               tsadc {
+                       otp_gpio: otp-gpio {
+                               rockchip,pins = <1 6 RK_FUNC_GPIO &pcfg_pull_none>;
+                       };
+
+                       otp_out: otp-out {
+                               rockchip,pins = <1 6 RK_FUNC_1 &pcfg_pull_none>;
+                       };
+               };
+
                uart0 {
                        uart0_xfer: uart0-xfer {
                                rockchip,pins =