Skip to content

input: apple_mtp_kbd: leave the J604's MTP to Linux - #44

Merged
RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
aeries0x:j604-mtp-os-pr
Nov 10, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
aeries0x:j604-mtp-os-pr

Conversation

@aeries0x

Copy link
Copy Markdown

Summary

On a J604 (MacBook Pro 14-inch, M4) installed with the Aurora installer, the internal keyboard and trackpad never work
in Linux: rtkit-helper 394600000.mtp: RTKit: co-processor has crashed a few milliseconds after the RTKit init, on every
boot. The same kernel and device tree start the MTP fine when aura boots the kernel directly, without U-Boot.

The J604's iBoot hands the MTP over halted and Linux cold-starts it (aura #137, linux #1367). U-Boot gets there first:
stdio_add_devices() probes every keyboard, apple_mtp_kbd's probe boots the RTKit helper, and since only the J713 and
J614s have a live handoff, rtkit_helper_stop() takes the firmware to QUIESCED and clears the run bit at OS entry. The
firmware does not survive a second start. (start_keyboard = false in board_late_init() would not help here either:
it only skips mtpkbd start, the stdio probe has already run.)

The firmware's mailbox history in the Linux crash log shows both sessions:

Entries From What
#000-#75 U-Boot HELLO, EPMAP, STARTEP, buffers at DVA == PA (0x103d7530000, U-Boot's heap), AP power 0x20, the 13 syslog lines from "MTP Says Hello" on, oslog
#76-#79 U-Boot at OS entry AP power 0x10, IOP power 0x10 and its ack
#80-#127 Linux IOP power 0x220, HELLO again, buffers at DART IOVAs (0x3ffffffc000), IOReport, syslog init, oslog, then the crash (data abort, PC 0x1037c6c, before the first syslog line)

This is the J604's version of what #37 describes for the T8140: a firmware that has run cannot be started again, and one
nobody ran starts fine.

This PR adds the J604 to the boards whose keyboard probe returns -ENODEV, next to the J813. The helper is then never
probed. The cost is that U-Boot and GRUB have no internal keyboard on the J604; the default entry boots by
itself. A live handoff like the J713's would keep the keyboard, and I'm happy to
test one on the J604 if you prefer that direction.

Testing

J604 (Mac16,1), 26.6.2 stub, aura 1.0.0b8 Stage 1, installed with installer alpha.19. Stage 2 = aura main + #137 + #139

  • #141, a J604 DTB with linux #1367, and this U-Boot; kernel integration/aurora + #1367 + #1389.
  • U-Boot e1ef8b6 (the release's): MTP crash on 3 of 3 boots, one as released and two with mtpkbd start
    skipped for the J604 in board_late_init().
  • This branch (aurora-wip aab6ca9 + this commit): 2 of 2 boots (the second after 45 s powered off) reach "MTP Says
    Hello" (AppleMTPFirmwareMac-5340.61.4); "Apple MTP keyboard" and "Apple MTP multi-touch" register, and I logged in
    with the internal keyboard both times. An earlier build with the same effect (helper refused at bind) gave the same
    result on 1 boot.
  • apple_m1_defconfig builds without warnings (GCC, aarch64); test_apple_helper_handoff.py and
    test_apple_mtp_keyboard.py pass (9 tests).

I can only test the J604. The J715 is not in the J713's handoff either and may behave the same; I left it alone.

Assisted-by: LLM

On the J604 (MacBook Pro 14-inch, M4) iBoot hands the MTP over halted
and Linux cold-starts it. U-Boot starts it first: stdio_add_devices()
probes every keyboard, the MTP keyboard's probe boots the RTKit helper,
and with no live handoff for this board the helper is taken to QUIESCED
and stopped at OS entry. The firmware does not survive a second start:
Linux's RTKit boot crashes it a few milliseconds in (data abort in the
IOReport path), and the internal keyboard and trackpad are gone. The
firmware's mailbox history in the crash log shows both sessions, U-Boot's
ending in the QUIESCED request, then Linux's.

Refuse the keyboard on the J604, as for the J813. U-Boot and GRUB then
have no internal keyboard there, and Linux gets a firmware nobody ran.

Tested on a J604 (Mac16,1, 26.6.2 stub, aura 1.0.0b8 Stage 1) installed
with the Aurora installer: before, "RTKit: co-processor has crashed" on
every boot; with this change "MTP Says Hello" and working keyboard and
trackpad.

Assisted-by: LLM
Signed-off-by: Friedrich <[email protected]>
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