Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 32 additions & 0 deletions Documentation/devicetree/bindings/hwmon/apple,smc-hwmon.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,28 @@ properties:
compatible:
const: apple,smc-hwmon

apple,soc-die-keys:
$ref: /schemas/types.yaml#/definitions/string-array
minItems: 1
maxItems: 32
items:
pattern: "^[A-Za-z0-9]{4}$"
description:
SMC FourCC keys for SoC die temperature sensors. Each key must report a
readable four-byte floating-point temperature in degrees Celsius. The
hottest reading supplies the macsmc_soc_die thermal zone. These channels
follow the temperature-* children in the listed order and are labelled
"SoC die <key>". Keys absent from the running firmware or with an
unsupported format are skipped. These channels do not change the indices
used by thermal-sensors references to temperature-* children.

apple,thermal-pressure-key:
$ref: /schemas/types.yaml#/definitions/string
pattern: "^[A-Za-z0-9]{4}$"
description:
SMC FourCC key reporting the firmware thermal pressure level as a
readable signed 32-bit integer. This is exposed for monitoring only.

apple,discover-temperatures:
type: boolean
description:
Expand Down Expand Up @@ -95,6 +117,16 @@ patternProperties:
pattern: "^[A-Za-z0-9]{4}$"
description: Writeable key to enable/disable manual fan control

apple,fan-manual-control:
type: boolean
description:
The SMC firmware of this machine accepts a manual speed for this
fan from the host and returns it to firmware control when asked,
so the fan's target speed can be set from the OS. Requires
apple,fan-target and apple,fan-mode. Without it the fan is only
monitored, and driven by the thermal framework where the SMC
node is a cooling device.

"^power-[A-Za-z0-9]{4}$":
$ref: "#/$defs/sensor"
unevaluatedProperties: false
Expand Down
30 changes: 26 additions & 4 deletions Documentation/hwmon/macsmc-hwmon.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,28 @@ the desktop Macs), sensors present on any given machine are described
via Devicetree. The driver picks these up and registers them with
hwmon when probed.

Manual fan speed is supported via the fan_control module parameter. This
is disabled by default and marked as unsafe, as it cannot be proven that
the system will fail safe if overheating due to manual fan control being
used.
Manual fan speed is available on the fans whose Devicetree node has
apple,fan-manual-control, which a machine's Devicetree sets once its SMC
firmware is known to accept a manual speed and to take the fan back. On
those fans fanX_target is writable; writing 0 hands the fan back to the
firmware. The fan_control module parameter, disabled by default and marked
as unsafe, allows manual speeds on every fan with a mode key whatever the
Devicetree says. It cannot be proven that the system will fail safe if it
overheats under a manual fan speed.

SoC die temperatures are described by the ``apple,soc-die-keys`` string list
on the hwmon device node. The driver appends these temperature channels after
the ``temperature-*`` children, in list order, with labels ``SoC die <key>``.
Only readable four-byte floating-point keys are used. When thermal support is
enabled, their hottest reading supplies the ``macsmc_soc_die`` thermal zone.
A failed or implausible reading fails the zone read rather than reporting a
partial result. Keys absent from the firmware are skipped.

The optional ``apple,thermal-pressure-key`` on the same node describes a
readable signed 32-bit firmware thermal pressure level. Neither feature needs
a module parameter. Kernels using these properties need an updated device
tree; the former downstream per-board fallback and its ``soc_die_keys`` and
``board_keys`` parameters have been removed.

sysfs interface
---------------
Expand Down Expand Up @@ -69,3 +87,7 @@ tempX_input
tempX_label
Temperature sensor label

thermal_pressure_level
Firmware thermal pressure level, exposed read-only when the device tree
supplies a valid key. The integer is firmware-defined and is not a
temperature or a percentage.
8 changes: 8 additions & 0 deletions arch/arm64/boot/dts/apple/t6030-j516s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,11 @@
&isp {
apple,platform-id = <16>;
};

&smc_hwmon {
/* M3-family die keys, not yet confirmed on J516s; absent keys are skipped. */
apple,soc-die-keys = "Tf04", "Tf09", "Tf0A", "Tf0B", "Tf0D",
"Tf0E", "Tf14", "Tf18", "Tf19", "Tf1A",
"Tf24", "Tf25", "Tf2A", "Tf2B";
apple,thermal-pressure-key = "mTPL";
};
9 changes: 9 additions & 0 deletions arch/arm64/boot/dts/apple/t6031-j514c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,12 @@
compatible = "apple,j514-macaudio", "apple,j314-macaudio", "apple,macaudio";
model = "MacBook Pro J514";
};

&smc_hwmon {
/* Assumed to match J516c; unavailable firmware keys are skipped. */
apple,soc-die-keys = "Tf04", "Tf06", "Tf09", "Tf0A", "Tf0B",
"Tf14", "Tf16", "Tf19", "Tf1A", "Tf1B",
"Tf24", "Tf26", "Tf29", "Tf2A", "Tf2B",
"Tf34", "Tf36", "Tf39", "Tf3A", "Tf3B",
"Tf44", "Tf46", "Tf49", "Tf4A", "Tf4B";
};
9 changes: 9 additions & 0 deletions arch/arm64/boot/dts/apple/t6031-j516c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -53,3 +53,12 @@
compatible = "apple,j516-macaudio", "apple,j316-macaudio", "apple,macaudio";
model = "MacBook Pro J516";
};

&smc_hwmon {
/* M3 Max die keys; unavailable firmware keys are skipped. */
apple,soc-die-keys = "Tf04", "Tf06", "Tf09", "Tf0A", "Tf0B",
"Tf14", "Tf16", "Tf19", "Tf1A", "Tf1B",
"Tf24", "Tf26", "Tf29", "Tf2A", "Tf2B",
"Tf34", "Tf36", "Tf39", "Tf3A", "Tf3B",
"Tf44", "Tf46", "Tf49", "Tf4A", "Tf4B";
};
13 changes: 13 additions & 0 deletions arch/arm64/boot/dts/apple/t6040-j616s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -3868,6 +3868,19 @@
*/
&smc_hwmon {
#cooling-cells = <3>;

/*
* The SMC accepts a manual speed for both fans once its fan test
* key unlocks them, and returns them to system mode when the
* request is dropped.
*/
fan-F0Ac {
apple,fan-manual-control;
};

fan-F1Ac {
apple,fan-manual-control;
};
};

&pcie_dart {
Expand Down
Loading
Loading