016-v6.9-arm64-dts-allwinner-h616-Add-thermal-sensor-and-zones.patch 3.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138
  1. From f4318af40544b8e7ff5a6b667ede60e6cf808262 Mon Sep 17 00:00:00 2001
  2. From: Martin Botka <[email protected]>
  3. Date: Mon, 19 Feb 2024 15:36:39 +0000
  4. Subject: [PATCH] arm64: dts: allwinner: h616: Add thermal sensor and zones
  5. There are four thermal sensors:
  6. - CPU
  7. - GPU
  8. - VE
  9. - DRAM
  10. Add the thermal sensor configuration and the thermal zones.
  11. Signed-off-by: Martin Botka <[email protected]>
  12. Signed-off-by: Andre Przywara <[email protected]>
  13. Reviewed-by: Jernej Skrabec <[email protected]>
  14. Link: https://lore.kernel.org/r/[email protected]
  15. Signed-off-by: Jernej Skrabec <[email protected]>
  16. ---
  17. .../arm64/boot/dts/allwinner/sun50i-h616.dtsi | 88 +++++++++++++++++++
  18. 1 file changed, 88 insertions(+)
  19. --- a/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
  20. +++ b/arch/arm64/boot/dts/allwinner/sun50i-h616.dtsi
  21. @@ -9,6 +9,7 @@
  22. #include <dt-bindings/clock/sun6i-rtc.h>
  23. #include <dt-bindings/reset/sun50i-h616-ccu.h>
  24. #include <dt-bindings/reset/sun50i-h6-r-ccu.h>
  25. +#include <dt-bindings/thermal/thermal.h>
  26. / {
  27. interrupt-parent = <&gic>;
  28. @@ -138,6 +139,10 @@
  29. reg = <0x03006000 0x1000>;
  30. #address-cells = <1>;
  31. #size-cells = <1>;
  32. +
  33. + ths_calibration: thermal-sensor-calibration@14 {
  34. + reg = <0x14 0x8>;
  35. + };
  36. };
  37. watchdog: watchdog@30090a0 {
  38. @@ -511,6 +516,19 @@
  39. };
  40. };
  41. + ths: thermal-sensor@5070400 {
  42. + compatible = "allwinner,sun50i-h616-ths";
  43. + reg = <0x05070400 0x400>;
  44. + interrupts = <GIC_SPI 19 IRQ_TYPE_LEVEL_HIGH>;
  45. + clocks = <&ccu CLK_BUS_THS>;
  46. + clock-names = "bus";
  47. + resets = <&ccu RST_BUS_THS>;
  48. + nvmem-cells = <&ths_calibration>;
  49. + nvmem-cell-names = "calibration";
  50. + allwinner,sram = <&syscon>;
  51. + #thermal-sensor-cells = <1>;
  52. + };
  53. +
  54. usbotg: usb@5100000 {
  55. compatible = "allwinner,sun50i-h616-musb",
  56. "allwinner,sun8i-h3-musb";
  57. @@ -755,4 +773,74 @@
  58. #size-cells = <0>;
  59. };
  60. };
  61. +
  62. + thermal-zones {
  63. + cpu-thermal {
  64. + polling-delay-passive = <500>;
  65. + polling-delay = <1000>;
  66. + thermal-sensors = <&ths 2>;
  67. + sustainable-power = <1000>;
  68. +
  69. + trips {
  70. + cpu_threshold: cpu-trip-0 {
  71. + temperature = <60000>;
  72. + type = "passive";
  73. + hysteresis = <0>;
  74. + };
  75. + cpu_target: cpu-trip-1 {
  76. + temperature = <70000>;
  77. + type = "passive";
  78. + hysteresis = <0>;
  79. + };
  80. + cpu_critical: cpu-trip-2 {
  81. + temperature = <110000>;
  82. + type = "critical";
  83. + hysteresis = <0>;
  84. + };
  85. + };
  86. + };
  87. +
  88. + gpu-thermal {
  89. + polling-delay-passive = <500>;
  90. + polling-delay = <1000>;
  91. + thermal-sensors = <&ths 0>;
  92. + sustainable-power = <1100>;
  93. +
  94. + trips {
  95. + gpu_temp_critical: gpu-trip-0 {
  96. + temperature = <110000>;
  97. + type = "critical";
  98. + hysteresis = <0>;
  99. + };
  100. + };
  101. + };
  102. +
  103. + ve-thermal {
  104. + polling-delay-passive = <0>;
  105. + polling-delay = <0>;
  106. + thermal-sensors = <&ths 1>;
  107. +
  108. + trips {
  109. + ve_temp_critical: ve-trip-0 {
  110. + temperature = <110000>;
  111. + type = "critical";
  112. + hysteresis = <0>;
  113. + };
  114. + };
  115. + };
  116. +
  117. + ddr-thermal {
  118. + polling-delay-passive = <0>;
  119. + polling-delay = <0>;
  120. + thermal-sensors = <&ths 3>;
  121. +
  122. + trips {
  123. + ddr_temp_critical: ddr-trip-0 {
  124. + temperature = <110000>;
  125. + type = "critical";
  126. + hysteresis = <0>;
  127. + };
  128. + };
  129. + };
  130. + };
  131. };