Skip to content

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

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

Ryan1202 wants to merge 3 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
jannau force-pushed the bits/000-devicetree branch from 128734c to d7da162 Compare August 23, 2026 22:01
@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

@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
@jannau
jannau force-pushed the bits/000-devicetree branch from 4bb4117 to e2932d4 Compare November 2, 2026 17:37
@Ryan1202 Ryan1202 closed this Nov 3, 2026
@Ryan1202
Ryan1202 deleted the bits-000-devicetree branch November 3, 2026 14:45
@Ryan1202
Ryan1202 restored the bits-000-devicetree branch November 3, 2026 15:02
@Ryan1202 Ryan1202 reopened this Nov 3, 2026
@Ryan1202
Ryan1202 force-pushed the bits-000-devicetree branch from 59d106e to f1a4d7d Compare November 3, 2026 15:24
@Ryan1202

Ryan1202 commented Nov 3, 2026

Copy link
Copy Markdown
Author

Hi @jannau and @svenpeter42 ,

I've rebased onto the latest bits/000-devicetree. The PR should now be ready for review.

Would you have a chance to take a look? Thanks!

@jannau
jannau force-pushed the bits/000-devicetree branch from e2932d4 to c46abf5 Compare November 5, 2026 21:21
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 f1a4d7d to 5aa41c9 Compare November 7, 2026 11:46
@yuyuyureka yuyuyureka mentioned this pull request Nov 8, 2026
3 tasks done
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 12, 2026
A scheduler of one credit left the engine idle while the host built the
next call. The firmware gives each process 32 call slots
(CREATE_PROCESS's pool; a PROCEDURE_CALL takes one before its 0x300)
and asserts on a 33rd without refusing it ("No resource for new
Procedure call", CAneProgramManagerH15.cpp:368; ane_fw_t603x_1483
sub_47484 0x476e4, sub_48580 0x489d8). The kext counts against
RESOURCE_INFO_GET's +0x10 and +0x14, 32 each, under its 64 overall
(AppleH11ANEInterface firmwareResourceIsAvailable 0xfffffe0009791830):
the scheduler's limit is 32, a firmware that reports less is logged,
and the lab's debugfs run, which bypasses the scheduler, waits for an
empty queue.

j514m, macOS 27.2's compiled models through anetest, 2026-11-12
(test kernels AsahiLinux#567 and AsahiLinux#568): big5's bursts of 200 calls at 2.27 ms a
call against 3.1 ms at one in flight (+37 %), conv16 1,913 and res4
1,825 calls a second (1,812-1,821 and 1,618-1,622 before). At a limit
of 64 big5 asserts the firmware as the RE says; conv16, whose calls end
sooner, never reaches 33.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 12, 2026
A call the firmware never answered left it in an assert's loop, and the
restart failed: STOP and POWER_DOWN only waited out their timeouts, the
fences signalled while the engine still ran, and the put that was to
power-cycle it only queued its domains' idle (rpm_suspend_suppliers),
so the next resume found ANE_CPU still powered, RUN did not restart it
and the handshake read SCRATCH 0.

In the kext's order now: a firmware that stopped answering gets no STOP
or POWER_DOWN (ane_fw_kill), the engine is powered off before the lost
calls' fences signal, each power domain is idled and checked
suspended (pm_runtime_barrier, then pm_runtime_idle for one whose
queued idle was cancelled), as DisableANEClocksAndPower does before
each ANE_Init (AppleH11ANEInterface 0xfffffe00097867a0), and a boot
with no handshake gets one more power cycle and boot.

j514m, the scheduler's limit raised to 64 to force the firmware's
assert with big5's bursts, then conv16 after each: with the domains
idled but no barrier (test kernel AsahiLinux#567), pm_runtime_idle returned
-EAGAIN on a domain still suspending and each restart needed its second
boot; with the barrier (AsahiLinux#568, 2026-11-12), 3 asserts, 3 timeouts, 3
restarts at the first boot, no domain left on, conv16's 200 calls at
0.52 ms each after every restart.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 13, 2026
A scheduler of one credit left the engine idle while the host built the
next call. The firmware gives each process 32 call slots
(CREATE_PROCESS's pool; a PROCEDURE_CALL takes one before its 0x300)
and asserts on a 33rd without refusing it ("No resource for new
Procedure call", CAneProgramManagerH15.cpp:368; ane_fw_t603x_1483
sub_47484 0x476e4, sub_48580 0x489d8). The kext counts against
RESOURCE_INFO_GET's +0x10 and +0x14, 32 each, under its 64 overall
(AppleH11ANEInterface firmwareResourceIsAvailable 0xfffffe0009791830):
the scheduler's limit is 32, a firmware that reports less is logged,
and the lab's debugfs run, which bypasses the scheduler, waits for an
empty queue.

j514m, macOS 27.2's compiled models through anetest, 2026-11-12
(test kernels AsahiLinux#567 and AsahiLinux#568): big5's bursts of 200 calls at 2.27 ms a
call against 3.1 ms at one in flight (+37 %), conv16 1,913 and res4
1,825 calls a second (1,812-1,821 and 1,618-1,622 before). At a limit
of 64 big5 asserts the firmware as the RE says; conv16, whose calls end
sooner, never reaches 33.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 13, 2026
A call the firmware never answered left it in an assert's loop, and the
restart failed: STOP and POWER_DOWN only waited out their timeouts, the
fences signalled while the engine still ran, and the put that was to
power-cycle it only queued its domains' idle (rpm_suspend_suppliers),
so the next resume found ANE_CPU still powered, RUN did not restart it
and the handshake read SCRATCH 0.

In the kext's order now: a firmware that stopped answering gets no STOP
or POWER_DOWN (ane_fw_kill), the engine is powered off before the lost
calls' fences signal, each power domain is idled and checked
suspended (pm_runtime_barrier, then pm_runtime_idle for one whose
queued idle was cancelled), as DisableANEClocksAndPower does before
each ANE_Init (AppleH11ANEInterface 0xfffffe00097867a0), and a boot
with no handshake gets one more power cycle and boot.

j514m, the scheduler's limit raised to 64 to force the firmware's
assert with big5's bursts, then conv16 after each: with the domains
idled but no barrier (test kernel AsahiLinux#567), pm_runtime_idle returned
-EAGAIN on a domain still suspending and each restart needed its second
boot; with the barrier (AsahiLinux#568, 2026-11-12), 3 asserts, 3 timeouts, 3
restarts at the first boot, no domain left on, conv16's 200 calls at
0.52 ms each after every restart.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 14, 2026
A scheduler of one credit left the engine idle while the host built the
next call. The firmware gives each process 32 call slots
(CREATE_PROCESS's pool; a PROCEDURE_CALL takes one before its 0x300)
and asserts on a 33rd without refusing it ("No resource for new
Procedure call", CAneProgramManagerH15.cpp:368; ane_fw_t603x_1483
sub_47484 0x476e4, sub_48580 0x489d8). The kext counts against
RESOURCE_INFO_GET's +0x10 and +0x14, 32 each, under its 64 overall
(AppleH11ANEInterface firmwareResourceIsAvailable 0xfffffe0009791830):
the scheduler's limit is 32, a firmware that reports less is logged,
and the lab's debugfs run, which bypasses the scheduler, waits for an
empty queue.

j514m, macOS 27.2's compiled models through anetest, 2026-11-12
(test kernels AsahiLinux#567 and AsahiLinux#568): big5's bursts of 200 calls at 2.27 ms a
call against 3.1 ms at one in flight (+37 %), conv16 1,913 and res4
1,825 calls a second (1,812-1,821 and 1,618-1,622 before). At a limit
of 64 big5 asserts the firmware as the RE says; conv16, whose calls end
sooner, never reaches 33.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 14, 2026
A call the firmware never answered left it in an assert's loop, and the
restart failed: STOP and POWER_DOWN only waited out their timeouts, the
fences signalled while the engine still ran, and the put that was to
power-cycle it only queued its domains' idle (rpm_suspend_suppliers),
so the next resume found ANE_CPU still powered, RUN did not restart it
and the handshake read SCRATCH 0.

In the kext's order now: a firmware that stopped answering gets no STOP
or POWER_DOWN (ane_fw_kill), the engine is powered off before the lost
calls' fences signal, each power domain is idled and checked
suspended (pm_runtime_barrier, then pm_runtime_idle for one whose
queued idle was cancelled), as DisableANEClocksAndPower does before
each ANE_Init (AppleH11ANEInterface 0xfffffe00097867a0), and a boot
with no handshake gets one more power cycle and boot.

j514m, the scheduler's limit raised to 64 to force the firmware's
assert with big5's bursts, then conv16 after each: with the domains
idled but no barrier (test kernel AsahiLinux#567), pm_runtime_idle returned
-EAGAIN on a domain still suspending and each restart needed its second
boot; with the barrier (AsahiLinux#568, 2026-11-12), 3 asserts, 3 timeouts, 3
restarts at the first boot, no domain left on, conv16's 200 calls at
0.52 ms each after every restart.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 19, 2026
A scheduler of one credit left the engine idle while the host built the
next call. The firmware gives each process 32 call slots
(CREATE_PROCESS's pool; a PROCEDURE_CALL takes one before its 0x300)
and asserts on a 33rd without refusing it ("No resource for new
Procedure call", CAneProgramManagerH15.cpp:368; ane_fw_t603x_1483
sub_47484 0x476e4, sub_48580 0x489d8). The kext counts against
RESOURCE_INFO_GET's +0x10 and +0x14, 32 each, under its 64 overall
(AppleH11ANEInterface firmwareResourceIsAvailable 0xfffffe0009791830):
the scheduler's limit is 32, a firmware that reports less is logged,
and the lab's debugfs run, which bypasses the scheduler, waits for an
empty queue.

j514m, macOS 27.2's compiled models through anetest, 2026-11-12
(test kernels AsahiLinux#567 and AsahiLinux#568): big5's bursts of 200 calls at 2.27 ms a
call against 3.1 ms at one in flight (+37 %), conv16 1,913 and res4
1,825 calls a second (1,812-1,821 and 1,618-1,622 before). At a limit
of 64 big5 asserts the firmware as the RE says; conv16, whose calls end
sooner, never reaches 33.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 19, 2026
A call the firmware never answered left it in an assert's loop, and the
restart failed: STOP and POWER_DOWN only waited out their timeouts, the
fences signalled while the engine still ran, and the put that was to
power-cycle it only queued its domains' idle (rpm_suspend_suppliers),
so the next resume found ANE_CPU still powered, RUN did not restart it
and the handshake read SCRATCH 0.

In the kext's order now: a firmware that stopped answering gets no STOP
or POWER_DOWN (ane_fw_kill), the engine is powered off before the lost
calls' fences signal, each power domain is idled and checked
suspended (pm_runtime_barrier, then pm_runtime_idle for one whose
queued idle was cancelled), as DisableANEClocksAndPower does before
each ANE_Init (AppleH11ANEInterface 0xfffffe00097867a0), and a boot
with no handshake gets one more power cycle and boot.

j514m, the scheduler's limit raised to 64 to force the firmware's
assert with big5's bursts, then conv16 after each: with the domains
idled but no barrier (test kernel AsahiLinux#567), pm_runtime_idle returned
-EAGAIN on a domain still suspending and each restart needed its second
boot; with the barrier (AsahiLinux#568, 2026-11-12), 3 asserts, 3 timeouts, 3
restarts at the first boot, no domain left on, conv16's 200 calls at
0.52 ms each after every restart.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 19, 2026
A scheduler of one credit left the engine idle while the host built the
next call. The firmware gives each process 32 call slots
(CREATE_PROCESS's pool; a PROCEDURE_CALL takes one before its 0x300)
and asserts on a 33rd without refusing it ("No resource for new
Procedure call", CAneProgramManagerH15.cpp:368; ane_fw_t603x_1483
sub_47484 0x476e4, sub_48580 0x489d8). The kext counts against
RESOURCE_INFO_GET's +0x10 and +0x14, 32 each, under its 64 overall
(AppleH11ANEInterface firmwareResourceIsAvailable 0xfffffe0009791830):
the scheduler's limit is 32, a firmware that reports less is logged,
and the lab's debugfs run, which bypasses the scheduler, waits for an
empty queue.

j514m, macOS 27.2's compiled models through anetest, 2026-11-12
(test kernels AsahiLinux#567 and AsahiLinux#568): big5's bursts of 200 calls at 2.27 ms a
call against 3.1 ms at one in flight (+37 %), conv16 1,913 and res4
1,825 calls a second (1,812-1,821 and 1,618-1,622 before). At a limit
of 64 big5 asserts the firmware as the RE says; conv16, whose calls end
sooner, never reaches 33.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 19, 2026
A call the firmware never answered left it in an assert's loop, and the
restart failed: STOP and POWER_DOWN only waited out their timeouts, the
fences signalled while the engine still ran, and the put that was to
power-cycle it only queued its domains' idle (rpm_suspend_suppliers),
so the next resume found ANE_CPU still powered, RUN did not restart it
and the handshake read SCRATCH 0.

In the kext's order now: a firmware that stopped answering gets no STOP
or POWER_DOWN (ane_fw_kill), the engine is powered off before the lost
calls' fences signal, each power domain is idled and checked
suspended (pm_runtime_barrier, then pm_runtime_idle for one whose
queued idle was cancelled), as DisableANEClocksAndPower does before
each ANE_Init (AppleH11ANEInterface 0xfffffe00097867a0), and a boot
with no handshake gets one more power cycle and boot.

j514m, the scheduler's limit raised to 64 to force the firmware's
assert with big5's bursts, then conv16 after each: with the domains
idled but no barrier (test kernel AsahiLinux#567), pm_runtime_idle returned
-EAGAIN on a domain still suspending and each restart needed its second
boot; with the barrier (AsahiLinux#568, 2026-11-12), 3 asserts, 3 timeouts, 3
restarts at the first boot, no domain left on, conv16's 200 calls at
0.52 ms each after every restart.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
A scheduler of one credit left the engine idle while the host built the
next call. The firmware gives each process 32 call slots
(CREATE_PROCESS's pool; a PROCEDURE_CALL takes one before its 0x300)
and asserts on a 33rd without refusing it ("No resource for new
Procedure call", CAneProgramManagerH15.cpp:368; ane_fw_t603x_1483
sub_47484 0x476e4, sub_48580 0x489d8). The kext counts against
RESOURCE_INFO_GET's +0x10 and +0x14, 32 each, under its 64 overall
(AppleH11ANEInterface firmwareResourceIsAvailable 0xfffffe0009791830):
the scheduler's limit is 32, a firmware that reports less is logged,
and the lab's debugfs run, which bypasses the scheduler, waits for an
empty queue.

j514m, macOS 27.2's compiled models through anetest, 2026-11-12
(test kernels AsahiLinux#567 and AsahiLinux#568): big5's bursts of 200 calls at 2.27 ms a
call against 3.1 ms at one in flight (+37 %), conv16 1,913 and res4
1,825 calls a second (1,812-1,821 and 1,618-1,622 before). At a limit
of 64 big5 asserts the firmware as the RE says; conv16, whose calls end
sooner, never reaches 33.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
A call the firmware never answered left it in an assert's loop, and the
restart failed: STOP and POWER_DOWN only waited out their timeouts, the
fences signalled while the engine still ran, and the put that was to
power-cycle it only queued its domains' idle (rpm_suspend_suppliers),
so the next resume found ANE_CPU still powered, RUN did not restart it
and the handshake read SCRATCH 0.

In the kext's order now: a firmware that stopped answering gets no STOP
or POWER_DOWN (ane_fw_kill), the engine is powered off before the lost
calls' fences signal, each power domain is idled and checked
suspended (pm_runtime_barrier, then pm_runtime_idle for one whose
queued idle was cancelled), as DisableANEClocksAndPower does before
each ANE_Init (AppleH11ANEInterface 0xfffffe00097867a0), and a boot
with no handshake gets one more power cycle and boot.

j514m, the scheduler's limit raised to 64 to force the firmware's
assert with big5's bursts, then conv16 after each: with the domains
idled but no barrier (test kernel AsahiLinux#567), pm_runtime_idle returned
-EAGAIN on a domain still suspending and each restart needed its second
boot; with the barrier (AsahiLinux#568, 2026-11-12), 3 asserts, 3 timeouts, 3
restarts at the first boot, no domain left on, conv16's 200 calls at
0.52 ms each after every restart.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
A scheduler of one credit left the engine idle while the host built the
next call. The firmware gives each process 32 call slots
(CREATE_PROCESS's pool; a PROCEDURE_CALL takes one before its 0x300)
and asserts on a 33rd without refusing it ("No resource for new
Procedure call", CAneProgramManagerH15.cpp:368; ane_fw_t603x_1483
sub_47484 0x476e4, sub_48580 0x489d8). The kext counts against
RESOURCE_INFO_GET's +0x10 and +0x14, 32 each, under its 64 overall
(AppleH11ANEInterface firmwareResourceIsAvailable 0xfffffe0009791830):
the scheduler's limit is 32, a firmware that reports less is logged,
and the lab's debugfs run, which bypasses the scheduler, waits for an
empty queue.

j514m, macOS 27.2's compiled models through anetest, 2026-11-12
(test kernels AsahiLinux#567 and AsahiLinux#568): big5's bursts of 200 calls at 2.27 ms a
call against 3.1 ms at one in flight (+37 %), conv16 1,913 and res4
1,825 calls a second (1,812-1,821 and 1,618-1,622 before). At a limit
of 64 big5 asserts the firmware as the RE says; conv16, whose calls end
sooner, never reaches 33.
hitori-chan added a commit to hitori-chan/linux that referenced this pull request Nov 20, 2026
A call the firmware never answered left it in an assert's loop, and the
restart failed: STOP and POWER_DOWN only waited out their timeouts, the
fences signalled while the engine still ran, and the put that was to
power-cycle it only queued its domains' idle (rpm_suspend_suppliers),
so the next resume found ANE_CPU still powered, RUN did not restart it
and the handshake read SCRATCH 0.

In the kext's order now: a firmware that stopped answering gets no STOP
or POWER_DOWN (ane_fw_kill), the engine is powered off before the lost
calls' fences signal, each power domain is idled and checked
suspended (pm_runtime_barrier, then pm_runtime_idle for one whose
queued idle was cancelled), as DisableANEClocksAndPower does before
each ANE_Init (AppleH11ANEInterface 0xfffffe00097867a0), and a boot
with no handshake gets one more power cycle and boot.

j514m, the scheduler's limit raised to 64 to force the firmware's
assert with big5's bursts, then conv16 after each: with the domains
idled but no barrier (test kernel AsahiLinux#567), pm_runtime_idle returned
-EAGAIN on a domain still suspending and each restart needed its second
boot; with the barrier (AsahiLinux#568, 2026-11-12), 3 asserts, 3 timeouts, 3
restarts at the first boot, no domain left on, conv16's 200 calls at
0.52 ms each after every restart.
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.

2 participants