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
2 changes: 2 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j714c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -311,6 +311,8 @@

#include "t6050-max-atc2.dtsi"

#include "t6050-magsafe.dtsi"

/* The I2C power states have no described parent (SIO), as for i2c1 and i2c2 */
&ps_i2c3 {
/delete-property/ power-domains;
Expand Down
32 changes: 3 additions & 29 deletions arch/arm64/boot/dts/apple/t6050-j714s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -213,30 +213,14 @@
status = "okay";
};

/* The keyboard backlight: ADT pwm0/kbd-backlight, channel 0 at 25 kHz */
/ {
aliases {
/* The loader fills the keyboard layout from the ADT's keyboard node */
keyboard = &keyboard;
};

led-controller {
compatible = "pwm-leds";

led-0 {
pwms = <&fpwm0 0 40000>;
label = "kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
default-state = "keep";
};
};
};

&fpwm0 {
status = "okay";
};
#include "t6050-kbd-backlight.dtsi"

/*
* The keyboard and trackpad: the HID transport on the MTP's DockChannel FIFO
Expand Down Expand Up @@ -359,20 +343,10 @@
};
};
};

/*
* The MagSafe 3 port's PD controller (ADT hpm5, port-type 0x11). It has no USB data
* path, so it gets no connector node; tipd registers a Type-C port and a power supply
* for it, as on J616s. Its ADT features-supported is <3>, "Power In" only: no liquid
* detection (LDCM, feature 2 of the USB-C ports' <1 2 3>).
*/
hpm5: usb-pd@8 {
compatible = "apple,sn201202x";
reg = <0x8 SPMI_USID>;
apple,no-liquid-detection;
};
};

#include "t6050-magsafe.dtsi"

&usb_drd1 {
port {
usb_drd1_hs: endpoint {
Expand Down
14 changes: 6 additions & 8 deletions arch/arm64/boot/dts/apple/t6050-j716c-sleep.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -110,14 +110,12 @@
};
};

/* MagSafe's controller is separate from all three USB-C data ports. */
&nub_spmi_a0 {
hpm5: usb-pd@8 {
compatible = "apple,sn201202x";
reg = <0x8 SPMI_USID>;
apple,no-liquid-detection;
status = "disabled";
};
/*
* MagSafe's PD controller (t6050-magsafe.dtsi) is separate from all three USB-C data ports.
* It stays off until t6050-j716c-sleep-devices.dtsi enables it with the sleep.
*/
&hpm5 {
status = "disabled";
};

/* Split the two ASC mailboxes from their coprocessor banks for later use. */
Expand Down
3 changes: 3 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-j716c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,8 @@
};
};

#include "t6050-kbd-backlight.dtsi"

/*
* PCIe port 0: the N1 (Wi-Fi and Bluetooth), the only GP port this board uses besides the SD
* reader on port 1 (not yet described). The boot loader trains the link after the SMC releases
Expand Down Expand Up @@ -251,6 +253,7 @@

#include "t6050-j716c-display.dtsi"
#include "t6050-j716c-left-usb4.dtsi"
#include "t6050-magsafe.dtsi"
#include "t6050-j716c-sep.dtsi"

#include "t6050-j716c-sleep.dtsi"
Expand Down
23 changes: 4 additions & 19 deletions arch/arm64/boot/dts/apple/t6050-j716s.dts
Original file line number Diff line number Diff line change
Expand Up @@ -44,26 +44,9 @@
status = "disabled";
};
};

/* Keyboard backlight: ADT pwm0/kbd-backlight, channel 0 at 25 kHz */
led-controller {
compatible = "pwm-leds";

led-0 {
pwms = <&fpwm0 0 40000>;
label = "kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
default-state = "keep";
};
};
};

/* The keyboard backlight PWM (ADT pwm0) */
&fpwm0 {
status = "okay";
};
#include "t6050-kbd-backlight.dtsi"

/* A block t6050-die0.dtsi does not describe yet: the third HPM bus */
&die0 {
Expand Down Expand Up @@ -273,7 +256,7 @@
* ATC0 usb-drd0 left-back hpm0 nub-spmi-a0 0x0c (the debug port, not described)
* ATC1 usb-drd1 left-front hpm1 nub-spmi-a0 0x0a
* ATC2 usb-drd2 right hpm2 nub-spmi-a1 0x0c
* MagSafe hpm5 nub-spmi-a0 0x08 (not a USB-C connector)
* MagSafe hpm5 nub-spmi-a0 0x08 (t6050-magsafe.dtsi, no connector node)
* There is no usb-drd3 and no nub-spmi-a2, so ATC3's USB chain and that bus
* stay off.
*/
Expand Down Expand Up @@ -339,6 +322,8 @@
};
};

#include "t6050-magsafe.dtsi"

&usb_drd1 {
port {
usb_drd1_hs: endpoint {
Expand Down
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"
17 changes: 6 additions & 11 deletions arch/arm64/boot/dts/apple/t6050-k114-k116.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,16 @@
status = "disabled";
};
};
};

led-controller {
compatible = "pwm-leds";
#include "t6050-kbd-backlight.dtsi"

/* ADT /arm-io/pwm0/kbd-backlight: default-hz 25000 */
/ {
led-controller {
/* Here the keyboard light keeps its "apple::" name and no boot state */
led-0 {
pwms = <&fpwm0 0 40000>;
label = "apple::kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
/delete-property/ default-state;
};

/*
Expand Down Expand Up @@ -170,10 +169,6 @@
status = "okay";
};

&fpwm0 {
status = "okay";
};

&ps_fpwm1 {
status = "okay";
};
Expand Down
13 changes: 2 additions & 11 deletions arch/arm64/boot/dts/apple/t6050-k114c.dts
Original file line number Diff line number Diff line change
Expand Up @@ -387,19 +387,10 @@
};
};
};

/*
* The MagSafe 3 port's PD controller (ADT hpm5, port-type 0x11). It has no USB data
* path, so it gets no connector node; tipd registers a Type-C port and a power supply
* for it. Its ADT features-supported is <3>, "Power In" only: no liquid detection.
*/
hpm5: usb-pd@8 {
compatible = "apple,sn201202x";
reg = <0x8 SPMI_USID>;
apple,no-liquid-detection;
};
};

#include "t6050-magsafe.dtsi"

&atc1_phy_mbox {
status = "okay";
};
Expand Down
28 changes: 28 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-kbd-backlight.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* The keyboard backlight of the T6050 MacBook Pros. Each board's ADT has it
* as pwm0/kbd-backlight: channel 0 of fpwm0 at 25 kHz, a 40000 ns period.
*
* Copyright The Asahi Linux Contributors
*/

#include <dt-bindings/leds/common.h>

/ {
led-controller {
compatible = "pwm-leds";

led-0 {
pwms = <&fpwm0 0 40000>;
label = "kbd_backlight";
function = LED_FUNCTION_KBD_BACKLIGHT;
color = <LED_COLOR_ID_WHITE>;
max-brightness = <255>;
default-state = "keep";
};
};
};

&fpwm0 {
status = "okay";
};
19 changes: 19 additions & 0 deletions arch/arm64/boot/dts/apple/t6050-magsafe.dtsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
// SPDX-License-Identifier: GPL-2.0+ OR MIT
/*
* The M5 Pro/Max MacBook Pros' MagSafe 3 port: its PD controller, an SN201202x at SPMI address
* 0x8 on nub-spmi-a0 (ADT hpm5, port-type 0x11). Every 14" and 16" board's ADT has the same
* node. It has no USB data path, so it gets no connector node; tipd registers a Type-C port
* and a power supply for it, as on J616s. Its ADT features-supported is <3>, "Power In" only:
* no liquid detection (LDCM, feature 2 of the USB-C ports' <1 2 3>).
*
* The bus status is the board's. The boards that described the node before include this
* after their left-front port's PD controller (hpm1), where the node was.
*/

&nub_spmi_a0 {
hpm5: usb-pd@8 {
compatible = "apple,sn201202x";
reg = <0x8 SPMI_USID>;
apple,no-liquid-detection;
};
};
Loading