Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

arm64: dts: mediatek: mt8192: Add thermal nodes and thermal zones

Add thermal nodes and thermal zones for the mt8192.

The mt8192 SoC has several hotspots around the CPUs.
Specify the targeted temperature threshold to apply the mitigation
and define the associated cooling devices.

Signed-off-by: Balsam CHIHI <bchihi@baylibre.com>
Reviewed-by: Nícolas F. R. A. Prado <nfraprado@collabora.com>
[bero@baylibre.com: cosmetic changes, reduce lvts_ap size]
Signed-off-by: Bernhard Rosenkränzer <bero@baylibre.com>
Reviewed-by: Alexandre Mergnat <amergnat@baylibre.com>
Reviewed-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>
Signed-off-by: AngeloGioacchino Del Regno <angelogioacchino.delregno@collabora.com>

authored by

Balsam CHIHI and committed by
AngeloGioacchino Del Regno
c7a72805 89ce5a09

+454
+454
arch/arm64/boot/dts/mediatek/mt8192.dtsi
··· 14 14 #include <dt-bindings/phy/phy.h> 15 15 #include <dt-bindings/power/mt8192-power.h> 16 16 #include <dt-bindings/reset/mt8192-resets.h> 17 + #include <dt-bindings/thermal/thermal.h> 18 + #include <dt-bindings/thermal/mediatek,lvts-thermal.h> 17 19 18 20 / { 19 21 compatible = "mediatek,mt8192"; ··· 74 72 next-level-cache = <&l2_0>; 75 73 performance-domains = <&performance 0>; 76 74 capacity-dmips-mhz = <427>; 75 + #cooling-cells = <2>; 77 76 }; 78 77 79 78 cpu1: cpu@100 { ··· 93 90 next-level-cache = <&l2_0>; 94 91 performance-domains = <&performance 0>; 95 92 capacity-dmips-mhz = <427>; 93 + #cooling-cells = <2>; 96 94 }; 97 95 98 96 cpu2: cpu@200 { ··· 112 108 next-level-cache = <&l2_0>; 113 109 performance-domains = <&performance 0>; 114 110 capacity-dmips-mhz = <427>; 111 + #cooling-cells = <2>; 115 112 }; 116 113 117 114 cpu3: cpu@300 { ··· 131 126 next-level-cache = <&l2_0>; 132 127 performance-domains = <&performance 0>; 133 128 capacity-dmips-mhz = <427>; 129 + #cooling-cells = <2>; 134 130 }; 135 131 136 132 cpu4: cpu@400 { ··· 150 144 next-level-cache = <&l2_1>; 151 145 performance-domains = <&performance 1>; 152 146 capacity-dmips-mhz = <1024>; 147 + #cooling-cells = <2>; 153 148 }; 154 149 155 150 cpu5: cpu@500 { ··· 169 162 next-level-cache = <&l2_1>; 170 163 performance-domains = <&performance 1>; 171 164 capacity-dmips-mhz = <1024>; 165 + #cooling-cells = <2>; 172 166 }; 173 167 174 168 cpu6: cpu@600 { ··· 188 180 next-level-cache = <&l2_1>; 189 181 performance-domains = <&performance 1>; 190 182 capacity-dmips-mhz = <1024>; 183 + #cooling-cells = <2>; 191 184 }; 192 185 193 186 cpu7: cpu@700 { ··· 207 198 next-level-cache = <&l2_1>; 208 199 performance-domains = <&performance 1>; 209 200 capacity-dmips-mhz = <1024>; 201 + #cooling-cells = <2>; 210 202 }; 211 203 212 204 cpu-map { ··· 798 788 status = "disabled"; 799 789 }; 800 790 791 + lvts_ap: thermal-sensor@1100b000 { 792 + compatible = "mediatek,mt8192-lvts-ap"; 793 + reg = <0 0x1100b000 0 0xc00>; 794 + interrupts = <GIC_SPI 169 IRQ_TYPE_LEVEL_HIGH 0>; 795 + clocks = <&infracfg CLK_INFRA_THERM>; 796 + resets = <&infracfg MT8192_INFRA_RST0_THERM_CTRL_SWRST>; 797 + nvmem-cells = <&lvts_e_data1>; 798 + nvmem-cell-names = "lvts-calib-data-1"; 799 + #thermal-sensor-cells = <1>; 800 + }; 801 + 801 802 pwm0: pwm@1100e000 { 802 803 compatible = "mediatek,mt8183-disp-pwm"; 803 804 reg = <0 0x1100e000 0 0x1000>; ··· 1133 1112 #address-cells = <1>; 1134 1113 #size-cells = <0>; 1135 1114 status = "disabled"; 1115 + }; 1116 + 1117 + lvts_mcu: thermal-sensor@11278000 { 1118 + compatible = "mediatek,mt8192-lvts-mcu"; 1119 + reg = <0 0x11278000 0 0x1000>; 1120 + interrupts = <GIC_SPI 170 IRQ_TYPE_LEVEL_HIGH 0>; 1121 + clocks = <&infracfg CLK_INFRA_THERM>; 1122 + resets = <&infracfg MT8192_INFRA_RST4_THERM_CTRL_MCU_SWRST>; 1123 + nvmem-cells = <&lvts_e_data1>; 1124 + nvmem-cell-names = "lvts-calib-data-1"; 1125 + #thermal-sensor-cells = <1>; 1136 1126 }; 1137 1127 1138 1128 efuse: efuse@11c10000 { ··· 1929 1897 <&mdpsys CLK_MDP_SMI0>; 1930 1898 clock-names = "apb", "smi"; 1931 1899 power-domains = <&spm MT8192_POWER_DOMAIN_MDP>; 1900 + }; 1901 + }; 1902 + 1903 + thermal_zones: thermal-zones { 1904 + cpu0-thermal { 1905 + polling-delay = <1000>; 1906 + polling-delay-passive = <250>; 1907 + thermal-sensors = <&lvts_mcu MT8192_MCU_LITTLE_CPU0>; 1908 + 1909 + trips { 1910 + cpu0_alert: trip-alert { 1911 + temperature = <85000>; 1912 + hysteresis = <2000>; 1913 + type = "passive"; 1914 + }; 1915 + 1916 + cpu0_crit: trip-crit { 1917 + temperature = <100000>; 1918 + hysteresis = <2000>; 1919 + type = "critical"; 1920 + }; 1921 + }; 1922 + 1923 + cooling-maps { 1924 + map0 { 1925 + trip = <&cpu0_alert>; 1926 + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 1927 + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 1928 + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 1929 + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; 1930 + }; 1931 + }; 1932 + }; 1933 + 1934 + cpu1-thermal { 1935 + polling-delay = <1000>; 1936 + polling-delay-passive = <250>; 1937 + thermal-sensors = <&lvts_mcu MT8192_MCU_LITTLE_CPU1>; 1938 + 1939 + trips { 1940 + cpu1_alert: trip-alert { 1941 + temperature = <85000>; 1942 + hysteresis = <2000>; 1943 + type = "passive"; 1944 + }; 1945 + 1946 + cpu1_crit: trip-crit { 1947 + temperature = <100000>; 1948 + hysteresis = <2000>; 1949 + type = "critical"; 1950 + }; 1951 + }; 1952 + 1953 + cooling-maps { 1954 + map0 { 1955 + trip = <&cpu1_alert>; 1956 + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 1957 + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 1958 + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 1959 + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; 1960 + }; 1961 + }; 1962 + }; 1963 + 1964 + cpu2-thermal { 1965 + polling-delay = <1000>; 1966 + polling-delay-passive = <250>; 1967 + thermal-sensors = <&lvts_mcu MT8192_MCU_LITTLE_CPU2>; 1968 + 1969 + trips { 1970 + cpu2_alert: trip-alert { 1971 + temperature = <85000>; 1972 + hysteresis = <2000>; 1973 + type = "passive"; 1974 + }; 1975 + 1976 + cpu2_crit: trip-crit { 1977 + temperature = <100000>; 1978 + hysteresis = <2000>; 1979 + type = "critical"; 1980 + }; 1981 + }; 1982 + 1983 + cooling-maps { 1984 + map0 { 1985 + trip = <&cpu2_alert>; 1986 + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 1987 + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 1988 + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 1989 + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; 1990 + }; 1991 + }; 1992 + }; 1993 + 1994 + cpu3-thermal { 1995 + polling-delay = <1000>; 1996 + polling-delay-passive = <250>; 1997 + thermal-sensors = <&lvts_mcu MT8192_MCU_LITTLE_CPU3>; 1998 + 1999 + trips { 2000 + cpu3_alert: trip-alert { 2001 + temperature = <85000>; 2002 + hysteresis = <2000>; 2003 + type = "passive"; 2004 + }; 2005 + 2006 + cpu3_crit: trip-crit { 2007 + temperature = <100000>; 2008 + hysteresis = <2000>; 2009 + type = "critical"; 2010 + }; 2011 + }; 2012 + 2013 + cooling-maps { 2014 + map0 { 2015 + trip = <&cpu3_alert>; 2016 + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2017 + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2018 + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2019 + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; 2020 + }; 2021 + }; 2022 + }; 2023 + 2024 + cpu4-thermal { 2025 + polling-delay = <1000>; 2026 + polling-delay-passive = <250>; 2027 + thermal-sensors = <&lvts_mcu MT8192_MCU_BIG_CPU0>; 2028 + 2029 + trips { 2030 + cpu4_alert: trip-alert { 2031 + temperature = <85000>; 2032 + hysteresis = <2000>; 2033 + type = "passive"; 2034 + }; 2035 + 2036 + cpu4_crit: trip-crit { 2037 + temperature = <100000>; 2038 + hysteresis = <2000>; 2039 + type = "critical"; 2040 + }; 2041 + }; 2042 + 2043 + cooling-maps { 2044 + map0 { 2045 + trip = <&cpu4_alert>; 2046 + cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2047 + <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2048 + <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2049 + <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; 2050 + }; 2051 + }; 2052 + }; 2053 + 2054 + cpu5-thermal { 2055 + polling-delay = <1000>; 2056 + polling-delay-passive = <250>; 2057 + thermal-sensors = <&lvts_mcu MT8192_MCU_BIG_CPU1>; 2058 + 2059 + trips { 2060 + cpu5_alert: trip-alert { 2061 + temperature = <85000>; 2062 + hysteresis = <2000>; 2063 + type = "passive"; 2064 + }; 2065 + 2066 + cpu5_crit: trip-crit { 2067 + temperature = <100000>; 2068 + hysteresis = <2000>; 2069 + type = "critical"; 2070 + }; 2071 + }; 2072 + 2073 + cooling-maps { 2074 + map0 { 2075 + trip = <&cpu5_alert>; 2076 + cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2077 + <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2078 + <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2079 + <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; 2080 + }; 2081 + }; 2082 + }; 2083 + 2084 + cpu6-thermal { 2085 + polling-delay = <1000>; 2086 + polling-delay-passive = <250>; 2087 + thermal-sensors = <&lvts_mcu MT8192_MCU_BIG_CPU2>; 2088 + 2089 + trips { 2090 + cpu6_alert: trip-alert { 2091 + temperature = <85000>; 2092 + hysteresis = <2000>; 2093 + type = "passive"; 2094 + }; 2095 + 2096 + cpu6_crit: trip-crit { 2097 + temperature = <100000>; 2098 + hysteresis = <2000>; 2099 + type = "critical"; 2100 + }; 2101 + }; 2102 + 2103 + cooling-maps { 2104 + map0 { 2105 + trip = <&cpu6_alert>; 2106 + cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2107 + <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2108 + <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2109 + <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; 2110 + }; 2111 + }; 2112 + }; 2113 + 2114 + cpu7-thermal { 2115 + polling-delay = <1000>; 2116 + polling-delay-passive = <250>; 2117 + thermal-sensors = <&lvts_mcu MT8192_MCU_BIG_CPU3>; 2118 + 2119 + trips { 2120 + cpu7_alert: trip-alert { 2121 + temperature = <85000>; 2122 + hysteresis = <2000>; 2123 + type = "passive"; 2124 + }; 2125 + 2126 + cpu7_crit: trip-crit { 2127 + temperature = <100000>; 2128 + hysteresis = <2000>; 2129 + type = "critical"; 2130 + }; 2131 + }; 2132 + 2133 + cooling-maps { 2134 + map0 { 2135 + trip = <&cpu7_alert>; 2136 + cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2137 + <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2138 + <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, 2139 + <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; 2140 + }; 2141 + }; 2142 + }; 2143 + 2144 + vpu0-thermal { 2145 + polling-delay = <1000>; 2146 + polling-delay-passive = <250>; 2147 + thermal-sensors = <&lvts_ap MT8192_AP_VPU0>; 2148 + 2149 + trips { 2150 + vpu0_alert: trip-alert { 2151 + temperature = <85000>; 2152 + hysteresis = <2000>; 2153 + type = "passive"; 2154 + }; 2155 + 2156 + vpu0_crit: trip-crit { 2157 + temperature = <100000>; 2158 + hysteresis = <2000>; 2159 + type = "critical"; 2160 + }; 2161 + }; 2162 + }; 2163 + 2164 + vpu1-thermal { 2165 + polling-delay = <1000>; 2166 + polling-delay-passive = <250>; 2167 + thermal-sensors = <&lvts_ap MT8192_AP_VPU1>; 2168 + 2169 + trips { 2170 + vpu1_alert: trip-alert { 2171 + temperature = <85000>; 2172 + hysteresis = <2000>; 2173 + type = "passive"; 2174 + }; 2175 + 2176 + vpu1_crit: trip-crit { 2177 + temperature = <100000>; 2178 + hysteresis = <2000>; 2179 + type = "critical"; 2180 + }; 2181 + }; 2182 + }; 2183 + 2184 + gpu0-thermal { 2185 + polling-delay = <1000>; 2186 + polling-delay-passive = <250>; 2187 + thermal-sensors = <&lvts_ap MT8192_AP_GPU0>; 2188 + 2189 + trips { 2190 + gpu0_alert: trip-alert { 2191 + temperature = <85000>; 2192 + hysteresis = <2000>; 2193 + type = "passive"; 2194 + }; 2195 + 2196 + gpu0_crit: trip-crit { 2197 + temperature = <100000>; 2198 + hysteresis = <2000>; 2199 + type = "critical"; 2200 + }; 2201 + }; 2202 + }; 2203 + 2204 + gpu1-thermal { 2205 + polling-delay = <1000>; 2206 + polling-delay-passive = <250>; 2207 + thermal-sensors = <&lvts_ap MT8192_AP_GPU1>; 2208 + 2209 + trips { 2210 + gpu1_alert: trip-alert { 2211 + temperature = <85000>; 2212 + hysteresis = <2000>; 2213 + type = "passive"; 2214 + }; 2215 + 2216 + gpu1_crit: trip-crit { 2217 + temperature = <100000>; 2218 + hysteresis = <2000>; 2219 + type = "critical"; 2220 + }; 2221 + }; 2222 + }; 2223 + 2224 + infra-thermal { 2225 + polling-delay = <1000>; 2226 + polling-delay-passive = <250>; 2227 + thermal-sensors = <&lvts_ap MT8192_AP_INFRA>; 2228 + 2229 + trips { 2230 + infra_alert: trip-alert { 2231 + temperature = <85000>; 2232 + hysteresis = <2000>; 2233 + type = "passive"; 2234 + }; 2235 + 2236 + infra_crit: trip-crit { 2237 + temperature = <100000>; 2238 + hysteresis = <2000>; 2239 + type = "critical"; 2240 + }; 2241 + }; 2242 + }; 2243 + 2244 + cam-thermal { 2245 + polling-delay = <1000>; 2246 + polling-delay-passive = <250>; 2247 + thermal-sensors = <&lvts_ap MT8192_AP_CAM>; 2248 + 2249 + trips { 2250 + cam_alert: trip-alert { 2251 + temperature = <85000>; 2252 + hysteresis = <2000>; 2253 + type = "passive"; 2254 + }; 2255 + 2256 + cam_crit: trip-crit { 2257 + temperature = <100000>; 2258 + hysteresis = <2000>; 2259 + type = "critical"; 2260 + }; 2261 + }; 2262 + }; 2263 + 2264 + md0-thermal { 2265 + polling-delay = <1000>; 2266 + polling-delay-passive = <250>; 2267 + thermal-sensors = <&lvts_ap MT8192_AP_MD0>; 2268 + 2269 + trips { 2270 + md0_alert: trip-alert { 2271 + temperature = <85000>; 2272 + hysteresis = <2000>; 2273 + type = "passive"; 2274 + }; 2275 + 2276 + md0_crit: trip-crit { 2277 + temperature = <100000>; 2278 + hysteresis = <2000>; 2279 + type = "critical"; 2280 + }; 2281 + }; 2282 + }; 2283 + 2284 + md1-thermal { 2285 + polling-delay = <1000>; 2286 + polling-delay-passive = <250>; 2287 + thermal-sensors = <&lvts_ap MT8192_AP_MD1>; 2288 + 2289 + trips { 2290 + md1_alert: trip-alert { 2291 + temperature = <85000>; 2292 + hysteresis = <2000>; 2293 + type = "passive"; 2294 + }; 2295 + 2296 + md1_crit: trip-crit { 2297 + temperature = <100000>; 2298 + hysteresis = <2000>; 2299 + type = "critical"; 2300 + }; 2301 + }; 2302 + }; 2303 + 2304 + md2-thermal { 2305 + polling-delay = <1000>; 2306 + polling-delay-passive = <250>; 2307 + thermal-sensors = <&lvts_ap MT8192_AP_MD2>; 2308 + 2309 + trips { 2310 + md2_alert: trip-alert { 2311 + temperature = <85000>; 2312 + hysteresis = <2000>; 2313 + type = "passive"; 2314 + }; 2315 + 2316 + md2_crit: trip-crit { 2317 + temperature = <100000>; 2318 + hysteresis = <2000>; 2319 + type = "critical"; 2320 + }; 2321 + }; 1932 2322 }; 1933 2323 }; 1934 2324 };