Skip to content

dapf: hand off the MTP filter on the J604 too - #137

Merged
RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
aeries0x:j604-mtp-dapf
Nov 10, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:mainfrom
aeries0x:j604-mtp-dapf

Conversation

@aeries0x

@aeries0x aeries0x commented Nov 9, 2026 •

Copy link
Copy Markdown
Contributor

Summary

On the J604 (base M4 MacBook Pro 14") the internal keyboard and trackpad stay dead: dapf_init_fdt() runs the T8132
DAPF handoff only for apple,j713, and the J604's iBoot leaves the MTP stopped (its ASC CPU_CONTROL already reads 0
in the first-stage loader, an m1n1 stage 1 on a stub the installer didn't make), so nothing programs the MTP's DART filter before Linux cold-starts it.

  • Accept apple,j604 too. Its tree includes the same t8132-laptop.dtsi handoff contract as the J713.
  • On T8132 the MTP has no PMGR power state, so the consumer is reported as inactive and skipped. A tree can now list
    such a consumer in the new /chosen property linux-enablement-mac,dapf-halted-handoff. If its CPU is seen stopped
    (asc_cpu_running(), as kboot checks the AOP's), aura programs its filter with the halted-consumer writer the J713
    AOP already uses, and Linux cold-starts it. Without the property the MTP is skipped as before.
  • Accepting the J604 also runs the rest of the J713 table there: the PMP is powered as t8132-jxxx.dtsi requests
    (dart-pmp has no DAPF instance, so its filter is untouched), the AOP stays with kboot's J713-only handoff, and the
    ISP isn't requested.

The matching tree change is aurora-silicon/linux#1367 (the property, and the MTP on DART stream 0 as on the M4 Pro/Max).

Testing

  • tests/python/test_m4_dapf_power.py covers the new property and the run check; the rest of the Python suite passes
    too.
  • J604 (Mac16,1), macOS 26.6.2 firmware: the loader logs "Programming /arm-io/dart-mtp for the halted /arm-io/mtp" and
    9 slices, the MTP cold-starts ("MTP Says Hello", firmware 5340.61.4), and the internal keyboard and trackpad work at
    the login. One caveat: current aura main doesn't serve its USB proxy on my J604 when chainloaded (a separate issue
    I'm looking into), so this boot ran the identical dapf.c change on aura b6b4592 plus local ports of Boot every T8132 board, not only the J713 #104 and kboot_gpu_m4: publish the G16 handoff on the 26.6.2 firmware on every M4 Mac #106.

J715

Two J715 owners in #general report the internal keyboard and trackpad dead on an installer build. I left the J715
out: whether its iBoot runs the MTP like the J713's or leaves it stopped like the J604's decides what it needs, and I
can't test it. If it is the J604's case, the same tree property plus apple,j715 here should cover it.

Assisted-by: LLM

@aeries0x

Copy link
Copy Markdown
Contributor Author

A note on scope, found on an installer-made J604 install: the cold start in this PR works only if no earlier stage has
run the MTP. The release U-Boot does (stdio probes the MTP keyboard and stops it QUIESCED at OS entry), and Linux's start
then crashes the firmware. aurora-silicon/u-boot#44 keeps U-Boot off the J604's MTP; with it the installed system has
its keyboard and trackpad. Nothing changes in this PR.

@RyanTheTide RyanTheTide left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Two existing host tests fail with this change (both pass on main):

  • tests/python/test_j713_aop_dapf.py::test_j713_aop_dapf
  • tests/python/test_j713_dapf_instance.py::test_j713_instance_and_power_flow

Both harnesses compile dapf_init_j713() from src/dapf.c without asc.h, so the new block fails with unknown type name 'asc_dev_t' and implicit declarations of asc_init(), asc_cpu_running() and asc_free(). They need the same asc_* stubs that tests/python/test_m4_dapf_power.py gets here (and a requests_halted-style case if they should cover the new path). python3 -m pytest tests/python/test_j713_aop_dapf.py tests/python/test_j713_dapf_instance.py tests/python/test_m4_dapf_power.py reproduces it.

dapf_init_fdt() runs the T8132 DAPF handoff only for apple,j713, so on
the J604 (MacBook Pro 14-inch, base M4) the MTP's DART filter is never
programmed and the internal keyboard and trackpad stay dead. Its tree
states the same handoff contract as the J713 (t8132-laptop.dtsi), so
accept it as well.

The J604's iBoot leaves the MTP stopped, where the J713's runs it (its
ASC CPU_CONTROL already reads 0 in the first-stage loader), and on
T8132 the MTP has no PMGR power state, so the consumer is reported as
inactive and skipped. A tree can now list such a consumer in
linux-enablement-mac,dapf-halted-handoff: if its CPU is seen stopped
(asc_cpu_running(), as kboot checks the AOP's), aura programs its
filter with the halted-consumer writer the J713 AOP already uses, and
Linux cold-starts it. Without the property the MTP is skipped as
before.

Tested on a J604 (macOS 26.6.2 firmware) with the same dapf.c change on
an older aura base and the J604 tree change that sets the property: the
loader programs 9 slices for dart-mtp, the MTP cold-starts, and the
internal keyboard and trackpad work. test_m4_dapf_power.py covers the
new property and the run check; the J713 DAPF harnesses get asc stubs,
and test_j713_dapf_instance.py checks that a running or missing ASC
keeps the MTP away from the halted writer.

Assisted-by: LLM
Signed-off-by: Friedrich <261542475+aeries0x@users.noreply.github.com>
@aeries0x

Copy link
Copy Markdown
Contributor Author

Thanks, that was my mistake: after the last change I only re-ran test_m4_dapf_power.py.

Both J713 harnesses get asc_* stubs now. In test_j713_aop_dapf.py they abort if called, since the J713 tree asks for no halted handoff. test_j713_dapf_instance.py gets a halted_requested mask and checks that the MTP stays away from the halted writer when its ASC is missing or its CPU is running, plus a control that drops the run check. The positive case (CPU seen stopped, halted writer runs) stays in test_m4_dapf_power.py. The three DAPF tests and the full suite pass locally (apart from the two test_loadobjs.py cases that fail on main too), and format-check and both builds are clean. The workflows on this PR still wait for approval.

@RyanTheTide
RyanTheTide merged commit 1f02add into aurora-silicon:main Nov 10, 2026
9 checks passed
@KartofellFirst

Copy link
Copy Markdown

I have a 15" M4 Air with dead keyboard and other issues, if I'll provide the hardware can we fix it? @aeries0x

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.

3 participants