1 From 498e2f7a6e69dcbca24715de2b4b97569fdfeff4 Mon Sep 17 00:00:00 2001
2 From: Balsam CHIHI <bchihi@baylibre.com>
3 Date: Thu, 9 Feb 2023 11:56:24 +0100
4 Subject: [PATCH] dt-bindings: thermal: mediatek: Add LVTS thermal controllers
6 Add LVTS thermal controllers dt-binding definition for mt8192 and mt8195.
8 Signed-off-by: Balsam CHIHI <bchihi@baylibre.com>
9 Reviewed-by: Rob Herring <robh@kernel.org>
10 Link: https://lore.kernel.org/r/20230209105628.50294-3-bchihi@baylibre.com
11 Signed-off-by: Daniel Lezcano <daniel.lezcano@linaro.org>
12 Signed-off-by: Rafael J. Wysocki <rafael.j.wysocki@intel.com>
14 .../thermal/mediatek,lvts-thermal.yaml | 142 ++++++++++++++++++
15 .../thermal/mediatek,lvts-thermal.h | 19 +++
16 2 files changed, 161 insertions(+)
17 create mode 100644 Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml
18 create mode 100644 include/dt-bindings/thermal/mediatek,lvts-thermal.h
21 +++ b/Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml
23 +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
26 +$id: http://devicetree.org/schemas/thermal/mediatek,lvts-thermal.yaml#
27 +$schema: http://devicetree.org/meta-schemas/core.yaml#
29 +title: MediaTek SoC Low Voltage Thermal Sensor (LVTS)
32 + - Balsam CHIHI <bchihi@baylibre.com>
35 + LVTS is a thermal management architecture composed of three subsystems,
36 + a Sensing device - Thermal Sensing Micro Circuit Unit (TSMCU),
37 + a Converter - Low Voltage Thermal Sensor converter (LVTS), and
38 + a Digital controller (LVTS_CTRL).
43 + - mediatek,mt8192-lvts-ap
44 + - mediatek,mt8192-lvts-mcu
45 + - mediatek,mt8195-lvts-ap
46 + - mediatek,mt8195-lvts-mcu
59 + description: LVTS reset for clearing temporary data on AP/MCU.
64 + - description: Calibration eFuse data 1 for LVTS
65 + - description: Calibration eFuse data 2 for LVTS
70 + - const: lvts-calib-data-1
71 + - const: lvts-calib-data-2
73 + "#thermal-sensor-cells":
77 + - $ref: thermal-sensor.yaml#
84 + - mediatek,mt8192-lvts-ap
85 + - mediatek,mt8192-lvts-mcu
99 + - mediatek,mt8195-lvts-ap
100 + - mediatek,mt8195-lvts-mcu
117 + - "#thermal-sensor-cells"
119 +additionalProperties: false
123 + #include <dt-bindings/interrupt-controller/arm-gic.h>
124 + #include <dt-bindings/clock/mt8195-clk.h>
125 + #include <dt-bindings/reset/mt8195-resets.h>
126 + #include <dt-bindings/thermal/mediatek,lvts-thermal.h>
129 + #address-cells = <2>;
132 + lvts_mcu: thermal-sensor@11278000 {
133 + compatible = "mediatek,mt8195-lvts-mcu";
134 + reg = <0 0x11278000 0 0x1000>;
135 + interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH 0>;
136 + clocks = <&infracfg_ao CLK_INFRA_AO_THERM>;
137 + resets = <&infracfg_ao MT8195_INFRA_RST4_THERM_CTRL_MCU_SWRST>;
138 + nvmem-cells = <&lvts_efuse_data1 &lvts_efuse_data2>;
139 + nvmem-cell-names = "lvts-calib-data-1", "lvts-calib-data-2";
140 + #thermal-sensor-cells = <1>;
144 + thermal_zones: thermal-zones {
146 + polling-delay = <1000>;
147 + polling-delay-passive = <250>;
148 + thermal-sensors = <&lvts_mcu MT8195_MCU_LITTLE_CPU0>;
151 + cpu0_alert: trip-alert {
152 + temperature = <85000>;
153 + hysteresis = <2000>;
157 + cpu0_crit: trip-crit {
158 + temperature = <100000>;
159 + hysteresis = <2000>;
166 +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h
168 +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
170 + * Copyright (c) 2023 MediaTek Inc.
171 + * Author: Balsam CHIHI <bchihi@baylibre.com>
174 +#ifndef __MEDIATEK_LVTS_DT_H
175 +#define __MEDIATEK_LVTS_DT_H
177 +#define MT8195_MCU_BIG_CPU0 0
178 +#define MT8195_MCU_BIG_CPU1 1
179 +#define MT8195_MCU_BIG_CPU2 2
180 +#define MT8195_MCU_BIG_CPU3 3
181 +#define MT8195_MCU_LITTLE_CPU0 4
182 +#define MT8195_MCU_LITTLE_CPU1 5
183 +#define MT8195_MCU_LITTLE_CPU2 6
184 +#define MT8195_MCU_LITTLE_CPU3 7
186 +#endif /* __MEDIATEK_LVTS_DT_H */