Skip to content
Draft
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
37 changes: 37 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j775-hwmon.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* SMC hwmon keys shared by the T6050 Mac Studios (J775c M5 Max, J775d M5 Ultra):
* the DC input power and the two fans.
*
* Copyright The Asahi Linux Contributors
*/

/*
* The Studio's DC input. PSTR and PDTR read 0 on the Studio; PD0R is its DC input (36.5 W at an
* idle desktop).
*/
&smc_hwmon {
power-PD0R {
apple,key-id = "PD0R";
label = "DC Input Power";
};
};

#include "hwmon-fan-dual.dtsi"

/*
* The Studio's SMC has F0Ac/F0Mn/F0Mx/F0Tg and F1*, but its mode keys are F0md/F1md (ui8, flags 0xd0:
* readable, writable, a function key), not the F0Md/F1Md the dtsi names; with the dtsi's names fan
* creation failed on the missing key. With the real keys the fans can be set by the kernel's
* thermal policy (the M5 GPU governor, through macsmc_hwmon_fans_request()). No
* apple,fan-manual-control: userspace still only reads them.
*/
&smc_hwmon {
fan-F0Ac {
apple,fan-mode = "F0md";
};

fan-F1Ac {
apple,fan-mode = "F1md";
};
};
4 changes: 4 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j775c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,8 @@
* One T6050 die (t6050-max.dtsi). Nobody has booted Linux on this board
* yet: beyond the SoC this file only adds the board's hardware inventory
* (t6050-peripherals.dtsi), all of it disabled, from the board's ADT.
* The SMC hwmon keys (DC input power, two fans) are the J775d's
* (t6050-j775-hwmon.dtsi).
*
* Copyright The Asahi Linux Contributors
*/
Expand All @@ -32,5 +34,7 @@
status = "disabled";
};

#include "t6050-j775-hwmon.dtsi"

#define T6050_J775C
#include "t6050-peripherals.dtsi"
30 changes: 1 addition & 29 deletions arch/arm64/boot/dts/apple/t6050-j775d.dts
Original file line number Diff line number Diff line change
Expand Up @@ -284,35 +284,7 @@
status = "okay";
};

/*
* The Studio's DC input. PSTR and PDTR read 0 on the Studio; PD0R is its DC input (36.5 W at an
* idle desktop).
*/
&smc_hwmon {
power-PD0R {
apple,key-id = "PD0R";
label = "DC Input Power";
};
};

#include "hwmon-fan-dual.dtsi"

/*
* The Studio's SMC has F0Ac/F0Mn/F0Mx/F0Tg and F1*, but its mode keys are F0md/F1md (ui8, flags 0xd0:
* readable, writable, a function key), not the F0Md/F1Md the dtsi names; with the dtsi's names fan
* creation failed on the missing key. With the real keys the fans can be set by the kernel's
* thermal policy (the M5 GPU governor, through macsmc_hwmon_fans_request()). No
* apple,fan-manual-control: userspace still only reads them.
*/
&smc_hwmon {
fan-F0Ac {
apple,fan-mode = "F0md";
};

fan-F1Ac {
apple,fan-mode = "F1md";
};
};
#include "t6050-j775-hwmon.dtsi"

/*
* The boot NOR's NVRAM: the loader fills the partition from ADT /arm-io/qspi/spinor/anvram reg
Expand Down
26 changes: 26 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j873s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
* One T6050 die (t6050-max.dtsi). Nobody has booted Linux on this board
* yet: beyond the SoC this file only adds the board's hardware inventory
* (t6050-peripherals.dtsi), all of it disabled, from the board's ADT.
* The SMC hwmon keys (one fan) follow the other Mac minis.
*
* Copyright The Asahi Linux Contributors
*/
Expand All @@ -32,5 +33,30 @@
status = "disabled";
};

/*
* SMC sensors, as on the other Mac minis: the shared power, voltage and current
* keys and the single fan, plus every readable float T* key through
* apple,discover-temperatures in t6050-die0.dtsi. A key this SMC lacks only
* drops its channel.
*
* Discovery refuses to run once any temperature channel exists, so the shared
* temperature nodes go (their keys are discovered anyway), as on J714s/J716s.
*/
#include "hwmon-common.dtsi"
#include "hwmon-mini.dtsi"

&smc_hwmon {
/delete-node/ temperature-TH0x;
/delete-node/ temperature-TW0P;

/*
* The T6050 SMC spells the fan mode key F0md, as on J714s, J716s, K116s
* and J775d. No apple,fan-manual-control: the SMC drives the fan.
*/
fan-F0Ac {
apple,fan-mode = "F0md";
};
};

#define T6050_J873S
#include "t6050-peripherals.dtsi"
Loading