arm64: dts: rockchip: add tsadc and thermal basic config for rk3328
authorRocky Hao <rocky.hao@rock-chips.com>
Fri, 24 Feb 2017 06:55:04 +0000 (14:55 +0800)
committerHuang, Tao <huangtao@rock-chips.com>
Mon, 27 Feb 2017 10:53:23 +0000 (18:53 +0800)
Change-Id: Ic0d417093c54fea5948fd79cab276ebe7aea0f2e
Signed-off-by: Rocky Hao <rocky.hao@rock-chips.com>
arch/arm64/boot/dts/rockchip/rk3328-evb.dts
arch/arm64/boot/dts/rockchip/rk3328.dtsi

index 923786c23f87b3b81f817cd9e4d9825444ca72f4..004d739543e8e671eabac674bbd4a9516493a827 100644 (file)
        pmuio-supply = <&vcc_io>;
 };
 
+&tsadc {
+       status = "okay";
+};
+
 &u2phy {
        otg-vbus-gpios = <&gpio0 27 GPIO_ACTIVE_HIGH>;
        status = "okay";
index af169ca376fad6be4da376ca341367b5d6256888..7a998af7cdc58c3a7b8d04aa5d04fd659c8ec739 100644 (file)
@@ -47,6 +47,7 @@
 #include <dt-bindings/pinctrl/rockchip.h>
 #include <dt-bindings/soc/rockchip,boot-mode.h>
 #include <dt-bindings/power/rk3328-power.h>
+#include <dt-bindings/thermal/thermal.h>
 
 / {
        compatible = "rockchip,rk3328";
                };
        };
 
+       thermal-zones {
+               soc_thermal: soc-thermal {
+                       polling-delay-passive = <20>; /* milliseconds */
+                       polling-delay = <1000>; /* milliseconds */
+                       sustainable-power = <1000>; /* milliwatts */
+
+                       thermal-sensors = <&tsadc 0>;
+
+                       trips {
+                               threshold: trip-point@0 {
+                                       temperature = <70000>; /* millicelsius */
+                                       hysteresis = <2000>; /* millicelsius */
+                                       type = "passive";
+                               };
+                               target: trip-point@1 {
+                                       temperature = <85000>; /* millicelsius */
+                                       hysteresis = <2000>; /* millicelsius */
+                                       type = "passive";
+                               };
+                               soc_crit: soc-crit {
+                                       temperature = <95000>; /* millicelsius */
+                                       hysteresis = <2000>; /* millicelsius */
+                                       type = "critical";
+                               };
+                       };
+
+               };
+
+       };
+
+       tsadc: tsadc@ff250000 {
+               compatible = "rockchip,rk3328-tsadc";
+               reg = <0x0 0xff250000 0x0 0x100>;
+               interrupts = <GIC_SPI 58 IRQ_TYPE_LEVEL_HIGH 0>;
+               rockchip,grf = <&grf>;
+               clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
+               clock-names = "tsadc", "apb_pclk";
+               assigned-clocks = <&cru SCLK_TSADC>;
+               assigned-clock-rates = <50000>;
+               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 = <100000>;
+               status = "disabled";
+       };
+
        uart0: serial@ff110000 {
                compatible = "rockchip,rk3328-uart", "snps,dw-apb-uart";
                reg = <0x0 0xff110000 0x0 0x100>;
                        };
                };
 
+               tsadc {
+                       otp_gpio: otp-gpio {
+                               rockchip,pins = <2 13 RK_FUNC_GPIO &pcfg_pull_none>;
+                       };
+
+                       otp_out: otp-out {
+                               rockchip,pins = <2 13 RK_FUNC_1 &pcfg_pull_none>;
+                       };
+               };
+
                uart0 {
                        uart0_xfer: uart0-xfer {
                                rockchip,pins =