Skip to content

input: apple_mtp_kbd: leave every T8142 MTP to the OS - #51

Open
m0d16l14n1 wants to merge 2 commits into
aurora-silicon:aurora-wipfrom
m0d16l14n1:j815/mtp-kbd
Open

m0d16l14n1 wants to merge 2 commits into
aurora-silicon:aurora-wipfrom
m0d16l14n1:j815/mtp-kbd

Conversation

@m0d16l14n1

@m0d16l14n1 m0d16l14n1 commented Nov 19, 2026 •

Copy link
Copy Markdown

The T8142 MTP (J813, J815, J704) cannot be started again once U-Boot shuts it down: iBoot loads and starts its firmware before the OS, and a second start fails, as seen on the J813.

Change: the MTP keyboard is skipped when its helper is an apple,t8142-mtp, the node's own compatible, instead of when the machine is the J813. The J815 and the next T8142 board get it without another line, and iBoot's running MTP reaches Linux untouched. The J604 and T6050 checks are unchanged.

Behaviour change: the J704 (MacBook Pro 14" M5) now leaves its MTP to the OS too, as the Airs do.

Overlap: #55 makes the same choice inside one MTP hand-off selector (apple,t8142-mtp → OS), and its description says it covers this PR. If #55 merges first, this one can be closed.

Not run through U-Boot on a J815 or J704 yet: aura boots Linux directly on the J815. On the J815, Linux's trackpad and keyboard work from iBoot's running MTP, the state this change preserves. Rebased onto aurora-wip 5445237; apple_mtp_kbd.o builds with apple_m1_defconfig.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for sorting out the J815 keyboard handoff.

This adds one more board to the MTP list (drivers/input/apple_mtp_kbd.c:450 of_machine_is_compatible("apple,j815")). We select behaviour by a hardware property rather than by the list of machines it was tested on, and here the list already disagrees with itself: J813/J815/J604 skip the driver, J713/J614s keep a running helper, T6050 is left as iBoot set it.

The underlying fact is the same on every MTP machine: the firmware does not survive an RTKit restart. Could the driver use one policy for every MTP (leave it running for the OS, or keep the helper running) selected by the MTP node itself, e.g. a DT property on the apple,mtp node that says the firmware cannot restart? That would cover the J815 and the next board without another line.

We can run rows on our A18 Pro and M4 Pro for a shared policy.

@RyanTheTide

Copy link
Copy Markdown
Contributor

apple_mtp_kbd_probe() in drivers/input/apple_mtp_kbd.c gains of_machine_is_compatible("apple,j815") next to j813 and j604, so the next T8142 board with the same MTP will hit the restart failure again until someone adds it. The reason given is a property of the MTP firmware, not of the board. Return -ENODEV based on the MTP node's compatible (apple,t8142-mtp, as the selector in #55 does) instead of a machine list. Until then this should stay a draft.

@RyanTheTide
RyanTheTide marked this pull request as draft November 20, 2026 23:56
@m0d16l14n1 m0d16l14n1 changed the title input: apple_mtp_kbd: leave the J815's MTP to Linux too input: apple_mtp_kbd: leave every T8142 MTP to the OS Nov 21, 2026
@m0d16l14n1

m0d16l14n1 commented Nov 21, 2026 •

Copy link
Copy Markdown
Author

@RyanTheTide reworked: the keyboard is now skipped when the helper is apple,t8142-mtp, not by machine. The J704 changes with this. #55 covers the same case, so if #55 lands first, this can be closed.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, this is the shape we asked for: the keyboard is skipped when its apple,helper-cpu is an apple,t8142-mtp, not by machine. Since the J704 now takes this path too, one J704 boot to the OS with a working keyboard would cover it. Agreed on #55: whichever lands first, the other can drop this case.

Assisted-by: LLM (Claude:Opus 5.5)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Looks good; approve once there is a J704 or J815 boot on this head (or once #55 lands, after which this can be closed).

No blockers in the code. drivers/input/apple_mtp_kbd.c:407-416 reads the keyboard's apple,helper-cpu and checks the MTP node's own compatible. The J704 (t8142-j704-peripherals.dtsi:191) and the J813/J815 (t8142-j813-j815.dtsi:275) both carry apple,t8142-mtp, so the machine list is gone for these boards, as asked. The j604/t6050 checks at :462-464 remain from before, and #55 replaces them.

One consequence to record in the commit and in the row: on the J704 (and every T8142 board) U-Boot now has no internal keyboard. That means no key input at the U-Boot prompt or in GRUB, unless GRUB's own driver or a USB keyboard takes over. It is the same trade-off as on the J813, and the right one when the firmware can't be restarted, but a row should show that a GRUB timeout boot still works with no keyboard.

The J704 run posted on #55 (head 59d31da) makes the same choice for apple,t8142-mtp. There, the MTP came up cleanly in Linux and the internal keyboard worked at the LUKS prompt. So the behaviour is already proven on that head, just not on this one.

HW row: J704 or J815, this head as Stage 2 after aura. U-Boot boots GRUB by timeout, and Linux shows MTP firmware hello, keyboard and trackpad registered, no RTKit crash dump, 0 failed units and 0 new kernel errors.

Assisted-by: LLM (Claude:Opus 5.5)

The J813's MTP is skipped because its firmware does not come back once
U-Boot shuts it down: iBoot loads and starts it before the OS, and it
cannot be started a second time. That is a property of the T8142 MTP,
not of the J813, and the J815 has the same one.

Select it by the helper's compatible (apple,t8142-mtp, which the J813,
J815 and J704 trees carry) instead of the j813 machine, so the J815 and
the next T8142 board keep iBoot's running MTP for Linux without another
line here. The J704 changes with this: its MTP is now left to the OS
too, as on the Airs.

The cost, the same as on the J813: on every T8142 board U-Boot has no
internal keyboard, so there is no key input at the U-Boot prompt or in
GRUB unless GRUB's own driver or a USB keyboard takes over. A GRUB menu
still boots its default entry on the timeout, and Linux, which adopts
the running MTP, gets the keyboard and trackpad.

Not run through U-Boot on a J815 or J704 yet (the J815 boots aura's
Stage 2 directly); the J813 keeps its behaviour.

Signed-off-by: Nick <[email protected]>
@m0d16l14n1

m0d16l14n1 commented Nov 22, 2026 •

Copy link
Copy Markdown
Author

@RyanTheTide thanks. The trade-off is in the commit message now (91e33f54, message-only, same tree). On every T8142 board U-Boot has no internal keyboard, so there's no key input at the U-Boot prompt or in GRUB unless GRUB's own driver or a USB keyboard takes over. A GRUB menu still boots its default entry on the timeout, and Linux, which adopts the running MTP, gets the keyboard and trackpad.

The J704/J815 row (U-Boot as Stage 2 after aura, GRUB timeout boot, MTP hello, keyboard and trackpad in Linux) is still owed. If #55 lands first, I'll close this one.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Re-review at 91e33f5. The code is unchanged from 6675f7c, and the commit message now records the trade-off we asked for: no internal keyboard in U-Boot or GRUB on any T8142 board, with GRUB booting its default entry on the timeout and Linux taking over the running MTP. Nothing new in the code.

What's left is the row. HW row: J704 or J815, this head as Stage 2 after aura. Pass: U-Boot boots GRUB by timeout with no key input; Linux shows the MTP firmware hello, keyboard and trackpad registered, no RTKit crash dump, 0 failed units and 0 new kernel errors. If #55 lands first, this can be closed as agreed.

Assisted-by: LLM (Claude:Opus 5.5)

scottjones added a commit to scottjones/omarchy-pkgs that referenced this pull request Nov 22, 2026
aurora-wip still gives the M5 (T8142) the generic Apple boot defaults:
bootflow over NVMe and USB, with "usb start" as preboot. Carry the
change that gives it the Aurora flow the M4s and the M5 Max use (EFI
path on the internal ESP, then the fallback image, then bootflow on
NVMe), with the MTP keyboard left to Linux. The J815 booted from NVMe
with it on 62ee470. Not yet sent upstream; the MTP driver half is
aurora-silicon/u-boot#51.

pkgver stays 2026.07.aurora8, which has not been published.

Co-Authored-By: Claude Opus 5.5 <[email protected]>
ryanrhughes pushed a commit to omacom/omarchy-pkgs that referenced this pull request Nov 22, 2026
…3231)

* uboot-aurora: pin aurora-wip at 5445237 for M5 NVMe boot

62ee470 can't boot from the NVMe on the M5 (T8142): it doesn't bind
the T8140/T8142 ANS controller or find the ESP on it. aurora-wip now
carries both fixes, aurora-silicon/u-boot#47 and #50, along with the
merged work since #32. The OpenSSL 4 host-tools config is kept.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

* uboot-aurora: carry the Aurora boot flow for T8142

aurora-wip still gives the M5 (T8142) the generic Apple boot defaults:
bootflow over NVMe and USB, with "usb start" as preboot. Carry the
change that gives it the Aurora flow the M4s and the M5 Max use (EFI
path on the internal ESP, then the fallback image, then bootflow on
NVMe), with the MTP keyboard left to Linux. The J815 booted from NVMe
with it on 62ee470. Not yet sent upstream; the MTP driver half is
aurora-silicon/u-boot#51.

pkgver stays 2026.07.aurora8, which has not been published.

Co-Authored-By: Claude Opus 5.5 <[email protected]>

---------

Co-authored-by: Claude Opus 5.5 <[email protected]>
ryanrhughes pushed a commit to omacom/omarchy-pkgs that referenced this pull request Nov 23, 2026
…eyboard (#3339)

Carry aurora-silicon/u-boot#51 (91e33f54) as aurora9. With aurora8 the
J815's MTP crashes when Linux starts it and there is no keyboard or
trackpad. Tested on a J815: two reboots, keyboard and trackpad present,
no MTP crash.

Co-authored-by: Claude Opus 5.5 <[email protected]>
@chrisdavedev

Copy link
Copy Markdown

J704 (MacBook Pro 14-inch, M5, apple,t8142-mtp) on this PR's head, 91e33f5 (apple_m1_defconfig), as the ESP Stage 2 payload after aura (aura 1.0.0b14-g3ff77894 → U-Boot → GRUB → Fedora 44, kernel 7.3.0-40.fc44.aurora, LUKS root), stub 26.6.2 (25G83). Four boots on this head (one KDE, three multi-user.target):

  • U-Boot 2026.07-g91e33f54d8f3 finds the SSD and boots GRUB. GRUB boots its default entry on the timeout with no key input, on every boot.
  • The MTP comes up in Linux (MTP Says Hello, AppleMTPFirmwareMac-5340.61.4 at 0.70 s, keyboard initialized at 0.71 s). There is no RTKit crash dump, no Failed to wake up coprocessor and no deferred probe pending.
  • The internal keyboard and the trackpad register at 1.11 s (394b30000.input, multi-touch ready at 1.58 s). On the multi-user.target boot, typing on the internal keyboard shows at the tty1 login prompt, and Caps Lock toggles its LED. Two more boots captured raw evdev from the internal devices. Apple MTP multi-touch shows touch contacts with motion (ABS_MT_POSITION_X -5896..6296, ABS_MT_POSITION_Y -7303..-12), pressure, BTN_LEFT clicks, and multi-finger contacts: ABS_MT_SLOT 0..2, 5 BTN_TOOL_DOUBLETAP and 1 BTN_TOOL_TRIPLETAP. Apple MTP keyboard shows 11 key presses with releases.
  • multi-user.target boot: 0 failed units and 0 new kernel errors. The only kernel err line is macsmc-input: Triggering forced shutdown! from holding the power button to end the run. The kernel warnings are the same as on the control boot (an unclean FAT and journal from earlier forced shutdowns, spi-nor spi0.0: supply vcc not found). This boot ran 46 s, and multi-user.target was still waiting on a one-shot debug unit of mine.
  • KDE boot (graphical.target): 0 failed system units. 2 failed user units, the kwallet portal and plasma-setup (core dump). Both also fail on the control boot, and both come from having no GPU driver on this setup.

Control: with the packaged U-Boot 2026.07 (Nov 10 build) in the same setup, the MTP crashes (RTKit crash dump, early AP readiness failed: -62, Failed to wake up coprocessor, then 394b30000.input: deferred probe pending), and there is no internal keyboard or trackpad.

This complements the J704 row on #55: that one was on MTP firmware 6300.85.6, this one on the 26.6.2 stub's 5340.61.4.

Setup differences, unrelated to the MTP: the display drivers (appledrm, apple_dcp, asahi) were blacklisted on these boots. The J704 DTB that aura carries has the PCIe port 2 DART (iommu@48a000000, SD reader) disabled. Without that, apple_dart_probe takes an SError at about 1.8 s on this tree.

Tested by me on the hardware.

Assisted-by: LLM (Claude:Opus 5.5)

@m0d16l14n1

Copy link
Copy Markdown
Author

Thanks @chrisdavedev for the J704 row at 91e33f54. That is the row this PR was waiting for.

I've merged aurora-wip into the branch, at 931d73d8 (a normal merge, no force push). The only conflict was the probe's skip condition, where aurora-wip (da9bad5) added apple_mtp_halted_for_os() and J813. The merge keeps both: apple_mtp_kbd_t8142(dev) || apple_mtp_halted_for_os() || t6050. J813 is covered by the T8142 check, so nothing changes on any T8142 board relative to the tested head, and aurora-wip's halted-handoff path stays as it was for J604/J715. drivers/input/apple_mtp_kbd.o builds with apple_m1_defconfig.

Marking ready for review.

@m0d16l14n1
m0d16l14n1 marked this pull request as ready for review November 26, 2026 11:48
@github-actions github-actions Bot added needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks required sections (bot) labels Nov 26, 2026
@github-actions

github-actions Bot commented Nov 26, 2026 •

Copy link
Copy Markdown

Merge readiness at 931d73d8: not ready yet

Check Detail
CI at head ok no CI for this change (the hardware row is the gate)
Review no needs one approving review from Core or Omarchy Mac (not the author)
Requested changes ok none
Hardware row at head ok comment at 931d73d8
Conflicts ok none
PR text adopt when you next edit add a 'Tested:' line; a 'Risk:' line (door and Macs) (guide)

Areas: none matched in CODEOWNERS

Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks required sections (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants