Skip to content

arm64: dts: apple: Add built-in keyboard support for M4 Macbook Pro - #567

Open
Ryan1202 wants to merge 192 commits into
AsahiLinux:bits/000-devicetreefrom
Ryan1202:bits-000-devicetree
Open

arm64: dts: apple: Add built-in keyboard support for M4 Macbook Pro#567
Ryan1202 wants to merge 192 commits into
AsahiLinux:bits/000-devicetreefrom
Ryan1202:bits-000-devicetree

Conversation

@Ryan1202

Copy link
Copy Markdown

Add device tree support required for the built-in keyboard on the M4 MacBook Pro (J604), including SMC, MTP, DockChannel and DART.

I wrote it based on the t8122 device tree. But unlike t8122, t8132 uses stream ID 0 instead of 1. I guess it's related to the sid field in /arm-io/dart-mtp in ADT.

The device tree changes were only tested as part of the asahi branch on an M4 MacBook Pro (J604).

jannau and others added 30 commits August 17, 2026 09:48
Contains minimal device trees for all M3 Max and Ultra Apple silicon
devices. Those are 14-inch and 16-inch MacBook Pros with M3 Max released
in November 2023 and Mac Studio with M3 Ultra released in 2025.
This does not include M3 Pro since it is separate SoC and not a smaller
variant of the M3 Max contrary to the M1 and M2 generations.
The smaller M3 Max variant (10 performance cores) has its own chip
variant (T6034) but is clearly the same design as T6031. Besides fewer
CPU performance cores and GPU cores it misses also on fourth of the
memory controllers and thus has an aggregated bus width of 384 bit
instead of 512 bit.
Both M3 Ultra variants (28 or 32 CPU cores) are based on T6031 judging
by the advertised memory bandwidth of 819GB/s.
This uses the same multi-die macros as t600x*.dtsi and t602x.dtsi to
support M3 Max and M3 Ultra without duplicating device nodes. Since the
M3 Pro can't use the same .dtsi files "t6031*.dtsi" are used to define
common nodes for T6031, T6032 and T6034.
The device trees have devices nodes for CPU cores, timer, interrupt
controller, power states, watchdog, serial, pin controller, i2c,
PWM based keyboard LED illumination and the boot framebuffer.

Signed-off-by: Janne Grunau <j@jannau.net>
Minimal device trees for the M3 Pro based 14-inch and 16-inch MacBook
Pro released in November 2023. The M3 Pro is a distinct SoC design and
not a cut down version of the Max variant like for M1 and M2 Pro.
The M3 Pro has only a single cluster with up to 6 performance cores and
one cluster with 6 efficiency cores.
While it no longer shares a common SoC .dtsi the devices itself are
still similar to the ones with M3 Max. It is still useful to share the
basic device composition in t603x-j514-j516.dtsi. For the M3 Pro based
devices additional overrides for diverging pin and irq numbers are
expected.
The device trees have devices nodes for CPU cores, timer, interrupt
controller, power states, watchdog, serial, pin controller, i2c,
PWM based keyboard LED illumination and the boot framebuffer.

Signed-off-by: Janne Grunau <j@jannau.net>
The core types of the M4 SoC no longer carry individual codenames.
Apple's device trees re-use the 'everest' and 'sawtooth' codenames from
the M3 generation for all later cores.

Instead, we use a combination of the SoC's codename ('Donan') and the
type of core ('e' and 'p' for the efficiency and performance cores
respectively) as compatible for these cores.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
…ible

The Apple t8132 (M4) SoC uses an AIC3 as interrupt controller, same as
the M3 predecessor.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
The watchdog on the Apple silicon t8132 (M4) SoC is compatible with the
existing driver. Add "apple,t8132-wdt" as SoC specific compatible under
"apple,t8103-wdt" used by the driver.

The M4 wdt block additionally has a secondary watchdog, which is
disabled by m1n1 and can safely be ignored by Linux.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
The PMGR blocks on Apple silicon M4 SoCs (t8132) are compatible with the
M1/M2/M3 predecessors. Add "apple,t8132-pmgr" as M4 specific compatible.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
The device power state management of the PMGR blocks on Apple's t8132
SoC (M4) is compatible with the existing driver.
Add "apple,t8132-pmgr-pwrstate" as SoC specific compatible under the
existing "apple,t8103-pmgr-pwrstate" used by the driver.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
The pin controller on the Apple silicon t8132 (M4) SoC is compatible
with the existing driver. Add "apple,t8132-pinctrl" as SoC specific
compatible under "apple,t8103-pinctrl" used by the driver.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
The i2c block on the Apple silicon t8132 (M4) SoC is compatible with the
existing driver. Add "apple,t8132-i2c" as SoC specific compatible under
"apple,t8103-i2c" used by the driver.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
The PWM controller on the Apple silicon t8132 (M4) SoC is compatible
with the existing driver. Add "apple,t8132-fpwm" as SoC specific
compatible under "apple,s5l-fpwm" used by the driver.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
The Apple devices with the t8132 SoC (M4) are very similar to their M3
predecessors.

In addition to the MacBook Pro and the various MacBook Air and iMac
variants, a Mac mini is offered again with the M4.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
Added device trees for the following devices:
- apple,j604 - MacBook Pro (14-inch, M4, 2024)
- apple,j623 - iMac (24-inch, 2x USB-C, M4, 2024)
- apple,j624 - iMac (24-inch, 4x USB-C, M4, 2024)
- apple,j713 - MacBook Air (13-inch, M4, 2025)
- apple,j715 - MacBook Air (15-inch, M4, 2025)
- apple,j773g - Mac mini (M4, 2024)

The device trees have a minimal set of devices limited to CPU cores,
interrupt controller, power states, watchdog, serial, pin controller,
i2c and framebuffer.
The device trees for the notebooks add a PWM controller for the keyboard
LED illumination.

Using the macOS 26.6b3 iBoot/firmware, the Mac mini reliably boots on a
single core using the stock kernel.
Booting with smp requires avoiding the wfi and wfit instructions
in the idle loop and `delay()` respectively, since those instructions
cause a loss of architectural state on the secondary cores, and even
then boot is unreliable.

Signed-off-by: Yureka Lilian <yureka@cyberchaos.dev>
The APCIE_PHY_SW power state is described in Apple's device tree as
child of the virtual storage and general purpose PCIe power tree.
Instead of supplementing them with their derived power states keep it
always on like macOS. This mirrors t602x-pgmr.dtsi ps_apcie_phy_sw.

Signed-off-by: Janne Grunau <j@jannau.net>
The DART is compatible with "apple,t8110-dart" introduced with Apple M1
Pro/Max and M2 devices.

Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
"apple,t8122-sart" is compatible to "apple,t6000-sart".

Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
The mailbox on M3 (t8122) is compatible with asc-mailbox-v4,
so add the t8122 compatible variant to enum section of the v4
mailbox section.

Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
apple,t8122-pcie is compatible to apple,t6020-pcie.

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Janne Grunau <j@jannau.net>
Adds the System Management Contorller (SMC) to the Apple
M3 SoC (t8122) device tree, including the SMC mailbox and
the SMC itself, with GPIO and hwmon children.

Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
On Apple Silicon, NVMe communication is mediated by a
coprocessor known as the ANS, and protected by its own
IOMMU known as the SART.

Add the following nodes to the M3 (t8122) device tree:
- Mailbox for the ANS coprocessor
- SART (IOMMU for the ANS coprocessor)
- The NVMe / ANS coprocessor itself

Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
This only includes the first port, because it's the only port that is
present on my hardware, and only includes the pwren gpio for J613.

Uses the t6020 base compatible as that is what the M3 hardware appears
to be compatible with, rather than the configuration applied by the
generic base compatible.

Signed-off-by: Alyssa Milburn <amilburn@zall.org>
Co-developed-by: Michael Reeves <michael.reeves077@gmail.com>
Signed-off-by: Michael Reeves <michael.reeves077@gmail.com>
The SPMI pmic provides nvmem cells for macsmc-reboot and macsmc-rtc.

Signed-off-by: Janne Grunau <j@jannau.net>
Adds device node for spmi and spmi-pmic, smc and nvme.

Signed-off-by: Janne Grunau <j@jannau.net>
Adds device node for spmi and spmi-pmic and smc.

Signed-off-by: Janne Grunau <j@jannau.net>
Add NVMe related devices nodes for all t6031, t6032 and t6034 based
devices.

Signed-off-by: Janne Grunau <j@jannau.net>
These devices have the no_ps flag on T6034 and should be ignored by Linux.

Signed-off-by: Yureka <yuka@yuka.dev>
Adds the pcie0 node on die0 of all M3 Max / Ultra chips (t6031/t6032/t6034).

Signed-off-by: Yureka <yuka@yuka.dev>
Signed-off-by: Janne Grunau <j@jannau.net>
WhatAmISupposedToPutHere and others added 19 commits August 23, 2026 22:19
Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
The additional isp power-states from 0x4000 to 0x4060 are not in Apple's
device tree and are copied from t8112.dtsi and adapted to macOS trace.

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
Change the "USB-C Left Rear" to "USB-C Left Back" to be consistent with
Apple's "port-location" property.

Signed-off-by: Janne Grunau <j@jannau.net>
All T602x DCPs support simultaneous scanout on surfaces 0, 1, and 3.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
All T600x DCPs support simultaneous scanout on surfaces 0 and 1.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
All T8103 DCPs support simultaneous scanout on surfaces 0 and 1.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
All T8112 DCPs support simultaneous scanout on surfaces 0, 1, and 3.

Signed-off-by: James Calligeros <jcalligeros99@gmail.com>
Add the reset controllers used to start the CIO (USB4/Thunderbolt)
blocks on t8103 and t600x. On t8103 each port comes with a dedicated
register page represented as a standalone node. On t600x a single
register shared by all ports of a die is located in the middle of the
PMGR MMIO region and represented as a sub-node of its syscon.

Signed-off-by: Sven Peter <sven@kernel.org>
Add the ACIO host router, NHI, DART and M3 mailbox nodes for both
Type-C ports on t8103 and connect the host routers to the Type-C
connectors.

Signed-off-by: Sven Peter <sven@kernel.org>
Add the ACIO host router, NHI, DART and mailbox nodes for both Type-C
ports on t8112 and connect the host routers to the Type-C connectors.

Signed-off-by: Sven Peter <sven@kernel.org>
Add the ACIO host router, NHI, DART and mailbox nodes for the four ATC
instances on each t600x and t602x die and connect the host routers to
the Type-C connectors on the MacBook Pro (j314/j316 and j414/j416), Mac
Studio (j375 and j475), Mac mini (j474) and Mac Pro (j180d) boards.

Signed-off-by: Sven Peter <sven@kernel.org>
depends on "iommu: apple-dart: Support specifying the DMA aperture in
the DT" series.

Signed-off-by: Janne Grunau <j@jannau.net>
Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
Signed-off-by: Sasha Finkelstein <k@chaosmail.tech>
NOT FOR UPSTREAM, drop in 2027-09

Signed-off-by: Janne Grunau <j@jannau.net>
@jannau
jannau force-pushed the bits/000-devicetree branch from 128734c to d7da162 Compare August 23, 2026 22:01
Signed-off-by: Janne Grunau <j@jannau.net>
@Ryan1202

Copy link
Copy Markdown
Author

Hi @jannau , I've noticed that bits/000-devicetree was force-pushed recently. So this PR now includes a lot of unrelated commits. Should I rebase my commits onto the latest branch?

@jannau

jannau commented Aug 29, 2026

Copy link
Copy Markdown
Member

yes, please rebase it. Github webui can't really handle force pushes. For merging it's not an issue as one can easily fetch the pull request and rebase/cherry-pick the commits but it is useless for leaving review comments.

@Ryan1202
Ryan1202 force-pushed the bits-000-devicetree branch from 676a38a to 49b0c17 Compare August 30, 2026 05:13
@Ryan1202

Copy link
Copy Markdown
Author

@jannau I've rebased it

Add the SMC mailbox, SMC and SMC GPIO controller nodes for t8132.

Tested on an M4 MacBook Pro (J604), where the SMC and GPIO controllers probe successfully.

Signed-off-by: Jiajun Wang <ryan1202@foxmail.com>
Add the MTP, mailbox, DART, DockChannel and HID transport nodes for t8132.

Unlike t8122, the MTP DART uses stream ID 0 on t8132.

Signed-off-by: Jiajun Wang <ryan1202@foxmail.com>
Tested on an M4 MacBook Pro (J604), the built-in keyboard works.

Signed-off-by: Jiajun Wang <ryan1202@foxmail.com>
@Ryan1202
Ryan1202 force-pushed the bits-000-devicetree branch from 49b0c17 to 59d106e Compare August 30, 2026 05:22
@jannau
jannau force-pushed the bits/000-devicetree branch from 5dd40d5 to c3da9f3 Compare September 8, 2026 18:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.