From 6322be51cf9846dadf8d6ad3c91ffa1f9a099427 Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 19:22:01 +0700 Subject: [PATCH 1/3] dt-bindings: hwmon: apple,smc-hwmon: Name the SoC die thermal sensor A node with apple,discover-temperatures has no stable channel indices, so a thermal zone cannot name one of its temperature channels. Let such a node be a thermal sensor provider for one sensor, 1000: the hottest of its apple,soc-die-keys readings. A zone on it replaces the driver's tripless macsmc_soc_die zone. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml b/Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml index b0b1dac1225ee..7a52d89338b33 100644 --- a/Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml +++ b/Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml @@ -90,7 +90,10 @@ properties: const: 1 description: The cell is the zero-based index of a temperature channel, counting - the temperature-* child nodes in order. + the temperature-* child nodes in order. With + apple,discover-temperatures, whose channel indices are not stable, the + only sensor is 1000, the hottest of the apple,soc-die-keys readings; + a thermal zone on it replaces the macsmc_soc_die zone. "#cooling-cells": const: 3 From f18473c276723377e9bb994274e76410ed4cdfeb Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 19:22:52 +0700 Subject: [PATCH 2/3] hwmon: macsmc: offer the SoC die zone to a device tree thermal zone A board that discovers its SMC temperatures (apple,discover-temperatures, as the M5 Airs do) has no stable channel indices, so a device tree thermal zone cannot name one of its temperature channels, and the hottest-die zone is registered without trips. Such a board then has no thermal policy of its own. When the node is a thermal sensor provider, offer the hottest-die reading as sensor 1000, above any channel index the hwmon core registers. A zone on it gets the board's trips and cooling maps and replaces the tripless macsmc_soc_die zone; without one the driver registers that zone as before. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- drivers/hwmon/macsmc-hwmon.c | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) diff --git a/drivers/hwmon/macsmc-hwmon.c b/drivers/hwmon/macsmc-hwmon.c index c519c70755c00..fa821387acdc7 100644 --- a/drivers/hwmon/macsmc-hwmon.c +++ b/drivers/hwmon/macsmc-hwmon.c @@ -1354,6 +1354,12 @@ static void macsmc_hwmon_populate_fan_configs(u32 *configs, const struct macsmc_ */ #if IS_ENABLED(CONFIG_THERMAL) #define MACSMC_SOC_DIE_ZONE "macsmc_soc_die" +/* + * The thermal sensor ID of the SoC die zone for a device tree thermal zone, on + * a node that discovers its temperatures and is a thermal sensor provider. It + * is above any temperature channel index, which the hwmon core registers. + */ +#define MACSMC_SOC_DIE_SENSOR_ID 1000 #define MACSMC_DIE_MIN_MC -40000 #define MACSMC_DIE_MAX_MC 150000 @@ -1425,6 +1431,24 @@ static int macsmc_hwmon_die_register(struct macsmc_hwmon *hwmon) key >> 24, (key >> 16) & 0xff, (key >> 8) & 0xff, key & 0xff); } + /* + * A board with a device tree zone on the die sensor gets that zone, with its trips and + * cooling maps. Its lifetime is managed by the OF helper. + */ + if (of_property_present(hwmon->dev->of_node, "#thermal-sensor-cells")) { + tz = devm_thermal_of_zone_register(hwmon->dev, MACSMC_SOC_DIE_SENSOR_ID, hwmon, + &macsmc_hwmon_die_ops); + if (!IS_ERR(tz)) { + dev_info(hwmon->dev, "SoC die zone %s (device tree): hottest of%s (%u of %u keys)\n", + thermal_zone_device_type(tz), keys, hwmon->die_count, + hwmon->die_listed); + return 0; + } + if (PTR_ERR(tz) != -ENODEV) + dev_warn(hwmon->dev, + "cannot register the device tree SoC die zone (%pe)\n", tz); + } + tz = thermal_tripless_zone_device_register(MACSMC_SOC_DIE_ZONE, hwmon, &macsmc_hwmon_die_ops, NULL); if (IS_ERR(tz)) { From 8d5e6d53ce093fa5042a9958973ca06b7f99c13c Mon Sep 17 00:00:00 2001 From: Nick Date: Sat, 14 Nov 2026 19:20:39 +0700 Subject: [PATCH 3/3] arm64: dts: apple: t8142-j815: Slow the CPUs on the hottest die reading The J815 has no fan and no thermal zone with trips: its SoC die zone (the hottest of the 26 apple,soc-die-keys) only reports. Make the SMC hwmon node a thermal sensor provider and give the board one zone on the die sensor, with the power allocator and the clusters' energy model: switch-on at 60 C, control at 100 C, critical at 115 C, and both CPU clusters as cooling devices (the E cluster weighted 3:1, as on J700). Sustainable power is an estimate, 9000 mW: the J815 ADT's clpc pkg-sustainable-power-target is 12.5 W against the J700's 5.5 W, where macOS holds the J700 CPUs at 4.1-4.3 W (about 76%). The control point is below the J700's 105 C until a J815 soak gives its own value. Assisted-by: Claude Opus 5.5 Signed-off-by: Nick --- arch/arm64/boot/dts/apple/t8142-j815.dts | 81 +++++++++++++++++++++++- 1 file changed, 80 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/apple/t8142-j815.dts b/arch/arm64/boot/dts/apple/t8142-j815.dts index c45d185c87c4c..d90ff5c021768 100644 --- a/arch/arm64/boot/dts/apple/t8142-j815.dts +++ b/arch/arm64/boot/dts/apple/t8142-j815.dts @@ -20,6 +20,7 @@ /dts-v1/; #include "t8142.dtsi" +#include / { compatible = "apple,j815", "apple,t8142", "apple,arm-platform"; @@ -44,63 +45,139 @@ status = "disabled"; }; }; + + /* + * The J815 has no fan. One zone on the hottest SoC die reading (the 26 + * apple,soc-die-keys below) slows the CPU clusters as the die heats, + * with the power allocator and the clusters' energy model. + * + * Sustainable power is an estimate to be tuned by a soak: the J815 + * ADT's clpc pkg-sustainable-power-target is 12.5 W (0xc8000, 16.16), + * the J700's 5.5 W, where macOS holds the J700 CPUs at 4.1-4.3 W + * (about 76%, the J700 zones' 4200). The same share of 12.5 W gives + * the 9000 mW here. The control point is held below the 105 C the + * fanless J700 runs at, until a J815 soak under macOS gives its own + * value; the PMP and SMC still enforce the hardware limits. + */ + thermal-zones { + soc-die-thermal { + polling-delay-passive = <500>; + polling-delay = <1000>; + thermal-sensors = <&smc_hwmon 1000>; + sustainable-power = <9000>; + + trips { + soc_die_alert: trip-alert { + temperature = <60000>; + hysteresis = <2000>; + type = "passive"; + }; + + soc_die_control: trip-control { + temperature = <100000>; + hysteresis = <2000>; + type = "passive"; + }; + + trip-critical { + temperature = <115000>; + hysteresis = <0>; + type = "critical"; + }; + }; + + cooling-maps { + map-p { + trip = <&soc_die_control>; + cooling-device = + <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu8 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu9 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <1024>; + }; + + map-e { + trip = <&soc_die_control>; + cooling-device = + <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>, + <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + contribution = <3072>; + }; + }; + }; + }; }; &cpu0 { + #cooling-cells = <2>; operating-points-v2 = <&ecluster_opp>; performance-domains = <&cpufreq_e>; status = "okay"; }; &cpu1 { + #cooling-cells = <2>; operating-points-v2 = <&ecluster_opp>; performance-domains = <&cpufreq_e>; status = "okay"; }; &cpu2 { + #cooling-cells = <2>; operating-points-v2 = <&ecluster_opp>; performance-domains = <&cpufreq_e>; status = "okay"; }; &cpu3 { + #cooling-cells = <2>; operating-points-v2 = <&ecluster_opp>; performance-domains = <&cpufreq_e>; status = "okay"; }; &cpu4 { + #cooling-cells = <2>; operating-points-v2 = <&ecluster_opp>; performance-domains = <&cpufreq_e>; status = "okay"; }; &cpu5 { + #cooling-cells = <2>; operating-points-v2 = <&ecluster_opp>; performance-domains = <&cpufreq_e>; status = "okay"; }; &cpu6 { + #cooling-cells = <2>; operating-points-v2 = <&pcluster_opp>; performance-domains = <&cpufreq_p>; status = "okay"; }; &cpu7 { + #cooling-cells = <2>; operating-points-v2 = <&pcluster_opp>; performance-domains = <&cpufreq_p>; status = "okay"; }; &cpu8 { + #cooling-cells = <2>; operating-points-v2 = <&pcluster_opp>; performance-domains = <&cpufreq_p>; status = "okay"; }; &cpu9 { + #cooling-cells = <2>; operating-points-v2 = <&pcluster_opp>; performance-domains = <&cpufreq_p>; status = "okay"; @@ -236,7 +313,9 @@ * thermal zone. */ &smc { - hwmon { + smc_hwmon: hwmon { + /* Sensor 1000 is the hottest of the die keys (soc-die-thermal). */ + #thermal-sensor-cells = <1>; apple,soc-die-keys = "Te04", "Te08", "Te0C", "Te0R", "Tp00", "Tp04", "Tp0C", "Tp0G", "Tp0O", "Tp0R", "Tp0X", "Tp0a", "Tp0p", "Tp0u",