Skip to content

Commit 7a34879

Browse files
committed
Merge branches 'mediatek-mt2712', 'rockchip-rk3328' and 'uniphier-thermal' into thermal-soc
3 parents 6760f3f + eda519d + 86da439 commit 7a34879

File tree

6 files changed

+523
-0
lines changed

6 files changed

+523
-0
lines changed

Documentation/devicetree/bindings/thermal/rockchip-thermal.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ Required properties:
44
- compatible : should be "rockchip,<name>-tsadc"
55
"rockchip,rk3228-tsadc": found on RK3228 SoCs
66
"rockchip,rk3288-tsadc": found on RK3288 SoCs
7+
"rockchip,rk3328-tsadc": found on RK3328 SoCs
78
"rockchip,rk3368-tsadc": found on RK3368 SoCs
89
"rockchip,rk3399-tsadc": found on RK3399 SoCs
910
- reg : physical base address of the controller and length of memory mapped
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
* UniPhier Thermal bindings
2+
3+
This describes the devicetree bindings for thermal monitor supported by
4+
PVT(Process, Voltage and Temperature) monitoring unit implemented on Socionext
5+
UniPhier SoCs.
6+
7+
Required properties:
8+
- compatible :
9+
- "socionext,uniphier-pxs2-thermal" : For UniPhier PXs2 SoC
10+
- "socionext,uniphier-ld20-thermal" : For UniPhier LD20 SoC
11+
- interrupts : IRQ for the temperature alarm
12+
- #thermal-sensor-cells : Should be 0. See ./thermal.txt for details.
13+
14+
Optional properties:
15+
- socionext,tmod-calibration: A pair of calibrated values referred from PVT,
16+
in case that the values aren't set on SoC,
17+
like a reference board.
18+
19+
Example:
20+
21+
sysctrl@61840000 {
22+
compatible = "socionext,uniphier-ld20-sysctrl",
23+
"simple-mfd", "syscon";
24+
reg = <0x61840000 0x10000>;
25+
...
26+
pvtctl: pvtctl {
27+
compatible = "socionext,uniphier-ld20-thermal";
28+
interrupts = <0 3 1>;
29+
#thermal-sensor-cells = <0>;
30+
};
31+
...
32+
};
33+
34+
thermal-zones {
35+
cpu_thermal {
36+
polling-delay-passive = <250>; /* 250ms */
37+
polling-delay = <1000>; /* 1000ms */
38+
thermal-sensors = <&pvtctl>;
39+
40+
trips {
41+
cpu_crit: cpu_crit {
42+
temperature = <110000>; /* 110C */
43+
hysteresis = <2000>;
44+
type = "critical";
45+
};
46+
cpu_alert: cpu_alert {
47+
temperature = <100000>; /* 100C */
48+
hysteresis = <2000>;
49+
type = "passive";
50+
};
51+
};
52+
53+
cooling-maps {
54+
map0 {
55+
trip = <&cpu_alert>;
56+
cooling-device = <&cpu0 (-1) (-1)>;
57+
};
58+
map1 {
59+
trip = <&cpu_alert>;
60+
cooling-device = <&cpu2 (-1) (-1)>;
61+
};
62+
};
63+
};
64+
};

drivers/thermal/Kconfig

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -473,4 +473,12 @@ config ZX2967_THERMAL
473473
the primitive temperature sensor embedded in zx2967 SoCs.
474474
This sensor generates the real time die temperature.
475475

476+
config UNIPHIER_THERMAL
477+
tristate "Socionext UniPhier thermal driver"
478+
depends on ARCH_UNIPHIER || COMPILE_TEST
479+
depends on THERMAL_OF && MFD_SYSCON
480+
help
481+
Enable this to plug in UniPhier on-chip PVT thermal driver into the
482+
thermal framework. The driver supports CPU thermal zone temperature
483+
reporting and a couple of trip points.
476484
endif

drivers/thermal/Makefile

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,3 +59,4 @@ obj-$(CONFIG_HISI_THERMAL) += hisi_thermal.o
5959
obj-$(CONFIG_MTK_THERMAL) += mtk_thermal.o
6060
obj-$(CONFIG_GENERIC_ADC_THERMAL) += thermal-generic-adc.o
6161
obj-$(CONFIG_ZX2967_THERMAL) += zx2967_thermal.o
62+
obj-$(CONFIG_UNIPHIER_THERMAL) += uniphier_thermal.o

drivers/thermal/rockchip_thermal.c

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -320,6 +320,44 @@ static const struct tsadc_table rk3288_code_table[] = {
320320
{0, 125000},
321321
};
322322

323+
static const struct tsadc_table rk3328_code_table[] = {
324+
{0, -40000},
325+
{296, -40000},
326+
{304, -35000},
327+
{313, -30000},
328+
{331, -20000},
329+
{340, -15000},
330+
{349, -10000},
331+
{359, -5000},
332+
{368, 0},
333+
{378, 5000},
334+
{388, 10000},
335+
{398, 15000},
336+
{408, 20000},
337+
{418, 25000},
338+
{429, 30000},
339+
{440, 35000},
340+
{451, 40000},
341+
{462, 45000},
342+
{473, 50000},
343+
{485, 55000},
344+
{496, 60000},
345+
{508, 65000},
346+
{521, 70000},
347+
{533, 75000},
348+
{546, 80000},
349+
{559, 85000},
350+
{572, 90000},
351+
{586, 95000},
352+
{600, 100000},
353+
{614, 105000},
354+
{629, 110000},
355+
{644, 115000},
356+
{659, 120000},
357+
{675, 125000},
358+
{TSADCV2_DATA_MASK, 125000},
359+
};
360+
323361
static const struct tsadc_table rk3368_code_table[] = {
324362
{0, -40000},
325363
{106, -40000},
@@ -790,6 +828,29 @@ static const struct rockchip_tsadc_chip rk3288_tsadc_data = {
790828
},
791829
};
792830

831+
static const struct rockchip_tsadc_chip rk3328_tsadc_data = {
832+
.chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
833+
.chn_num = 1, /* one channels for tsadc */
834+
835+
.tshut_mode = TSHUT_MODE_CRU, /* default TSHUT via CRU */
836+
.tshut_temp = 95000,
837+
838+
.initialize = rk_tsadcv2_initialize,
839+
.irq_ack = rk_tsadcv3_irq_ack,
840+
.control = rk_tsadcv3_control,
841+
.get_temp = rk_tsadcv2_get_temp,
842+
.set_alarm_temp = rk_tsadcv2_alarm_temp,
843+
.set_tshut_temp = rk_tsadcv2_tshut_temp,
844+
.set_tshut_mode = rk_tsadcv2_tshut_mode,
845+
846+
.table = {
847+
.id = rk3328_code_table,
848+
.length = ARRAY_SIZE(rk3328_code_table),
849+
.data_mask = TSADCV2_DATA_MASK,
850+
.mode = ADC_INCREMENT,
851+
},
852+
};
853+
793854
static const struct rockchip_tsadc_chip rk3366_tsadc_data = {
794855
.chn_id[SENSOR_CPU] = 0, /* cpu sensor is channel 0 */
795856
.chn_id[SENSOR_GPU] = 1, /* gpu sensor is channel 1 */
@@ -874,6 +935,10 @@ static const struct of_device_id of_rockchip_thermal_match[] = {
874935
.compatible = "rockchip,rk3288-tsadc",
875936
.data = (void *)&rk3288_tsadc_data,
876937
},
938+
{
939+
.compatible = "rockchip,rk3328-tsadc",
940+
.data = (void *)&rk3328_tsadc_data,
941+
},
877942
{
878943
.compatible = "rockchip,rk3366-tsadc",
879944
.data = (void *)&rk3366_tsadc_data,

0 commit comments

Comments
 (0)