xref: /freebsd/sys/contrib/device-tree/Bindings/thermal/rockchip-thermal.txt (revision c66ec88fed842fbaad62c30d510644ceb7bd2d71)
1*c66ec88fSEmmanuel Vadot* Temperature Sensor ADC (TSADC) on rockchip SoCs
2*c66ec88fSEmmanuel Vadot
3*c66ec88fSEmmanuel VadotRequired properties:
4*c66ec88fSEmmanuel Vadot- compatible : should be "rockchip,<name>-tsadc"
5*c66ec88fSEmmanuel Vadot   "rockchip,px30-tsadc":   found on PX30 SoCs
6*c66ec88fSEmmanuel Vadot   "rockchip,rv1108-tsadc": found on RV1108 SoCs
7*c66ec88fSEmmanuel Vadot   "rockchip,rk3228-tsadc": found on RK3228 SoCs
8*c66ec88fSEmmanuel Vadot   "rockchip,rk3288-tsadc": found on RK3288 SoCs
9*c66ec88fSEmmanuel Vadot   "rockchip,rk3328-tsadc": found on RK3328 SoCs
10*c66ec88fSEmmanuel Vadot   "rockchip,rk3368-tsadc": found on RK3368 SoCs
11*c66ec88fSEmmanuel Vadot   "rockchip,rk3399-tsadc": found on RK3399 SoCs
12*c66ec88fSEmmanuel Vadot- reg : physical base address of the controller and length of memory mapped
13*c66ec88fSEmmanuel Vadot	region.
14*c66ec88fSEmmanuel Vadot- interrupts : The interrupt number to the cpu. The interrupt specifier format
15*c66ec88fSEmmanuel Vadot	       depends on the interrupt controller.
16*c66ec88fSEmmanuel Vadot- clocks : Must contain an entry for each entry in clock-names.
17*c66ec88fSEmmanuel Vadot- clock-names : Shall be "tsadc" for the converter-clock, and "apb_pclk" for
18*c66ec88fSEmmanuel Vadot		the peripheral clock.
19*c66ec88fSEmmanuel Vadot- resets : Must contain an entry for each entry in reset-names.
20*c66ec88fSEmmanuel Vadot	   See ../reset/reset.txt for details.
21*c66ec88fSEmmanuel Vadot- reset-names : Must include the name "tsadc-apb".
22*c66ec88fSEmmanuel Vadot- pinctrl-names : The pin control state names;
23*c66ec88fSEmmanuel Vadot- pinctrl-0 : The "init" pinctrl state, it will be set before device probe.
24*c66ec88fSEmmanuel Vadot- pinctrl-1 : The "default" pinctrl state, it will be set after reset the
25*c66ec88fSEmmanuel Vadot	      TSADC controller.
26*c66ec88fSEmmanuel Vadot- pinctrl-2 : The "sleep" pinctrl state, it will be in for suspend.
27*c66ec88fSEmmanuel Vadot- #thermal-sensor-cells : Should be 1. See Documentation/devicetree/bindings/thermal/thermal-sensor.yaml for a description.
28*c66ec88fSEmmanuel Vadot
29*c66ec88fSEmmanuel VadotOptional properties:
30*c66ec88fSEmmanuel Vadot- rockchip,hw-tshut-temp : The hardware-controlled shutdown temperature value.
31*c66ec88fSEmmanuel Vadot- rockchip,hw-tshut-mode : The hardware-controlled shutdown mode 0:CRU 1:GPIO.
32*c66ec88fSEmmanuel Vadot- rockchip,hw-tshut-polarity : The hardware-controlled active polarity 0:LOW
33*c66ec88fSEmmanuel Vadot			       1:HIGH.
34*c66ec88fSEmmanuel Vadot- rockchip,grf : The phandle of the syscon node for the general register file.
35*c66ec88fSEmmanuel Vadot
36*c66ec88fSEmmanuel VadotExiample:
37*c66ec88fSEmmanuel Vadottsadc: tsadc@ff280000 {
38*c66ec88fSEmmanuel Vadot	compatible = "rockchip,rk3288-tsadc";
39*c66ec88fSEmmanuel Vadot	reg = <0xff280000 0x100>;
40*c66ec88fSEmmanuel Vadot	interrupts = <GIC_SPI 37 IRQ_TYPE_LEVEL_HIGH>;
41*c66ec88fSEmmanuel Vadot	clocks = <&cru SCLK_TSADC>, <&cru PCLK_TSADC>;
42*c66ec88fSEmmanuel Vadot	clock-names = "tsadc", "apb_pclk";
43*c66ec88fSEmmanuel Vadot	resets = <&cru SRST_TSADC>;
44*c66ec88fSEmmanuel Vadot	reset-names = "tsadc-apb";
45*c66ec88fSEmmanuel Vadot	pinctrl-names = "init", "default", "sleep";
46*c66ec88fSEmmanuel Vadot	pinctrl-0 = <&otp_gpio>;
47*c66ec88fSEmmanuel Vadot	pinctrl-1 = <&otp_out>;
48*c66ec88fSEmmanuel Vadot	pinctrl-2 = <&otp_gpio>;
49*c66ec88fSEmmanuel Vadot	#thermal-sensor-cells = <1>;
50*c66ec88fSEmmanuel Vadot	rockchip,hw-tshut-temp = <95000>;
51*c66ec88fSEmmanuel Vadot	rockchip,hw-tshut-mode = <0>;
52*c66ec88fSEmmanuel Vadot	rockchip,hw-tshut-polarity = <0>;
53*c66ec88fSEmmanuel Vadot};
54*c66ec88fSEmmanuel Vadot
55*c66ec88fSEmmanuel VadotExample: referring to thermal sensors:
56*c66ec88fSEmmanuel Vadotthermal-zones {
57*c66ec88fSEmmanuel Vadot	cpu_thermal: cpu_thermal {
58*c66ec88fSEmmanuel Vadot		polling-delay-passive = <1000>; /* milliseconds */
59*c66ec88fSEmmanuel Vadot		polling-delay = <5000>; /* milliseconds */
60*c66ec88fSEmmanuel Vadot
61*c66ec88fSEmmanuel Vadot		/* sensor	ID */
62*c66ec88fSEmmanuel Vadot		thermal-sensors = <&tsadc	1>;
63*c66ec88fSEmmanuel Vadot
64*c66ec88fSEmmanuel Vadot		trips {
65*c66ec88fSEmmanuel Vadot			cpu_alert0: cpu_alert {
66*c66ec88fSEmmanuel Vadot				temperature = <70000>; /* millicelsius */
67*c66ec88fSEmmanuel Vadot				hysteresis = <2000>; /* millicelsius */
68*c66ec88fSEmmanuel Vadot				type = "passive";
69*c66ec88fSEmmanuel Vadot			};
70*c66ec88fSEmmanuel Vadot			cpu_crit: cpu_crit {
71*c66ec88fSEmmanuel Vadot				temperature = <90000>; /* millicelsius */
72*c66ec88fSEmmanuel Vadot				hysteresis = <2000>; /* millicelsius */
73*c66ec88fSEmmanuel Vadot				type = "critical";
74*c66ec88fSEmmanuel Vadot			};
75*c66ec88fSEmmanuel Vadot		};
76*c66ec88fSEmmanuel Vadot
77*c66ec88fSEmmanuel Vadot		cooling-maps {
78*c66ec88fSEmmanuel Vadot			map0 {
79*c66ec88fSEmmanuel Vadot				trip = <&cpu_alert0>;
80*c66ec88fSEmmanuel Vadot				cooling-device =
81*c66ec88fSEmmanuel Vadot				    <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
82*c66ec88fSEmmanuel Vadot			};
83*c66ec88fSEmmanuel Vadot		};
84*c66ec88fSEmmanuel Vadot	};
85*c66ec88fSEmmanuel Vadot};
86