2
0

830-v6.4-07-dt-bindings-thermal-mediatek-Add-LVTS-thermal-contro.patch 5.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186
  1. From 498e2f7a6e69dcbca24715de2b4b97569fdfeff4 Mon Sep 17 00:00:00 2001
  2. From: Balsam CHIHI <[email protected]>
  3. Date: Thu, 9 Feb 2023 11:56:24 +0100
  4. Subject: [PATCH] dt-bindings: thermal: mediatek: Add LVTS thermal controllers
  5. Add LVTS thermal controllers dt-binding definition for mt8192 and mt8195.
  6. Signed-off-by: Balsam CHIHI <[email protected]>
  7. Reviewed-by: Rob Herring <[email protected]>
  8. Link: https://lore.kernel.org/r/[email protected]
  9. Signed-off-by: Daniel Lezcano <[email protected]>
  10. Signed-off-by: Rafael J. Wysocki <[email protected]>
  11. ---
  12. .../thermal/mediatek,lvts-thermal.yaml | 142 ++++++++++++++++++
  13. .../thermal/mediatek,lvts-thermal.h | 19 +++
  14. 2 files changed, 161 insertions(+)
  15. create mode 100644 Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml
  16. create mode 100644 include/dt-bindings/thermal/mediatek,lvts-thermal.h
  17. --- /dev/null
  18. +++ b/Documentation/devicetree/bindings/thermal/mediatek,lvts-thermal.yaml
  19. @@ -0,0 +1,142 @@
  20. +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
  21. +%YAML 1.2
  22. +---
  23. +$id: http://devicetree.org/schemas/thermal/mediatek,lvts-thermal.yaml#
  24. +$schema: http://devicetree.org/meta-schemas/core.yaml#
  25. +
  26. +title: MediaTek SoC Low Voltage Thermal Sensor (LVTS)
  27. +
  28. +maintainers:
  29. + - Balsam CHIHI <[email protected]>
  30. +
  31. +description: |
  32. + LVTS is a thermal management architecture composed of three subsystems,
  33. + a Sensing device - Thermal Sensing Micro Circuit Unit (TSMCU),
  34. + a Converter - Low Voltage Thermal Sensor converter (LVTS), and
  35. + a Digital controller (LVTS_CTRL).
  36. +
  37. +properties:
  38. + compatible:
  39. + enum:
  40. + - mediatek,mt8192-lvts-ap
  41. + - mediatek,mt8192-lvts-mcu
  42. + - mediatek,mt8195-lvts-ap
  43. + - mediatek,mt8195-lvts-mcu
  44. +
  45. + reg:
  46. + maxItems: 1
  47. +
  48. + interrupts:
  49. + maxItems: 1
  50. +
  51. + clocks:
  52. + maxItems: 1
  53. +
  54. + resets:
  55. + maxItems: 1
  56. + description: LVTS reset for clearing temporary data on AP/MCU.
  57. +
  58. + nvmem-cells:
  59. + minItems: 1
  60. + items:
  61. + - description: Calibration eFuse data 1 for LVTS
  62. + - description: Calibration eFuse data 2 for LVTS
  63. +
  64. + nvmem-cell-names:
  65. + minItems: 1
  66. + items:
  67. + - const: lvts-calib-data-1
  68. + - const: lvts-calib-data-2
  69. +
  70. + "#thermal-sensor-cells":
  71. + const: 1
  72. +
  73. +allOf:
  74. + - $ref: thermal-sensor.yaml#
  75. +
  76. + - if:
  77. + properties:
  78. + compatible:
  79. + contains:
  80. + enum:
  81. + - mediatek,mt8192-lvts-ap
  82. + - mediatek,mt8192-lvts-mcu
  83. + then:
  84. + properties:
  85. + nvmem-cells:
  86. + maxItems: 1
  87. +
  88. + nvmem-cell-names:
  89. + maxItems: 1
  90. +
  91. + - if:
  92. + properties:
  93. + compatible:
  94. + contains:
  95. + enum:
  96. + - mediatek,mt8195-lvts-ap
  97. + - mediatek,mt8195-lvts-mcu
  98. + then:
  99. + properties:
  100. + nvmem-cells:
  101. + minItems: 2
  102. +
  103. + nvmem-cell-names:
  104. + minItems: 2
  105. +
  106. +required:
  107. + - compatible
  108. + - reg
  109. + - interrupts
  110. + - clocks
  111. + - resets
  112. + - nvmem-cells
  113. + - nvmem-cell-names
  114. + - "#thermal-sensor-cells"
  115. +
  116. +additionalProperties: false
  117. +
  118. +examples:
  119. + - |
  120. + #include <dt-bindings/interrupt-controller/arm-gic.h>
  121. + #include <dt-bindings/clock/mt8195-clk.h>
  122. + #include <dt-bindings/reset/mt8195-resets.h>
  123. + #include <dt-bindings/thermal/mediatek,lvts-thermal.h>
  124. +
  125. + soc {
  126. + #address-cells = <2>;
  127. + #size-cells = <2>;
  128. +
  129. + lvts_mcu: thermal-sensor@11278000 {
  130. + compatible = "mediatek,mt8195-lvts-mcu";
  131. + reg = <0 0x11278000 0 0x1000>;
  132. + interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH 0>;
  133. + clocks = <&infracfg_ao CLK_INFRA_AO_THERM>;
  134. + resets = <&infracfg_ao MT8195_INFRA_RST4_THERM_CTRL_MCU_SWRST>;
  135. + nvmem-cells = <&lvts_efuse_data1 &lvts_efuse_data2>;
  136. + nvmem-cell-names = "lvts-calib-data-1", "lvts-calib-data-2";
  137. + #thermal-sensor-cells = <1>;
  138. + };
  139. + };
  140. +
  141. + thermal_zones: thermal-zones {
  142. + cpu0-thermal {
  143. + polling-delay = <1000>;
  144. + polling-delay-passive = <250>;
  145. + thermal-sensors = <&lvts_mcu MT8195_MCU_LITTLE_CPU0>;
  146. +
  147. + trips {
  148. + cpu0_alert: trip-alert {
  149. + temperature = <85000>;
  150. + hysteresis = <2000>;
  151. + type = "passive";
  152. + };
  153. +
  154. + cpu0_crit: trip-crit {
  155. + temperature = <100000>;
  156. + hysteresis = <2000>;
  157. + type = "critical";
  158. + };
  159. + };
  160. + };
  161. + };
  162. --- /dev/null
  163. +++ b/include/dt-bindings/thermal/mediatek,lvts-thermal.h
  164. @@ -0,0 +1,19 @@
  165. +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
  166. +/*
  167. + * Copyright (c) 2023 MediaTek Inc.
  168. + * Author: Balsam CHIHI <[email protected]>
  169. + */
  170. +
  171. +#ifndef __MEDIATEK_LVTS_DT_H
  172. +#define __MEDIATEK_LVTS_DT_H
  173. +
  174. +#define MT8195_MCU_BIG_CPU0 0
  175. +#define MT8195_MCU_BIG_CPU1 1
  176. +#define MT8195_MCU_BIG_CPU2 2
  177. +#define MT8195_MCU_BIG_CPU3 3
  178. +#define MT8195_MCU_LITTLE_CPU0 4
  179. +#define MT8195_MCU_LITTLE_CPU1 5
  180. +#define MT8195_MCU_LITTLE_CPU2 6
  181. +#define MT8195_MCU_LITTLE_CPU3 7
  182. +
  183. +#endif /* __MEDIATEK_LVTS_DT_H */