Skip to content

iommu/apple-dart, soc: apple: rtkit-helper: take a live MTP handoff by its properties, not by board - #2525

Merged
DjDeveloperr merged 5 commits into
integration/aurorafrom
satchlj/mtp-live-handoff-by-property
Nov 20, 2026
Merged

DjDeveloperr merged 5 commits into
integration/aurorafrom
satchlj/mtp-live-handoff-by-property

Conversation

@satchlj

@satchlj satchlj commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

Claude Opus 5.5 on @satchlj's behalf.

Take a live MTP handoff by its device-tree properties and the DART's own state, not by board.

Why: a boot stage that keeps the MTP running hands it over with apple,rtkit-handoff on the MTP and apple,bypass-handoff-streams on its DART. Two checks still matched the J613 by name:

  • the DART probe took the bypass stream only on the J613's T8122 DART at 0x2fa808000;
  • the helper kept an adopted session's ASC awake over s2idle only on the J613.

The 27.2 MTP firmware on the MacBook Air M2 (J413) cannot be restarted either. U-Boot (aurora-silicon/u-boot, T8112 27.x live handoff PR) hands it over the same way through the T8112 DART at 0x24e808000.

Change:

  • apple-dart: inherit the stream when the DART supports bypass, the stream is 1, and TCR(stream) reads back as bypass. That register is the hardware's own record of the handoff.
  • rtkit-helper: keep an adopted session's ASC awake over s2idle on every board. A session is adopted only through apple,rtkit-handoff, which means it cannot be restarted.

Behaviour change elsewhere: other boards whose helper adopts a session (J614s, T8132 live MTP) now also keep the ASC awake over s2idle. Not tested on those boards.

Second commit (64ea0f87), for aurora-silicon/u-boot#67: a bootloader-facing property, apple,rtkit-keep-running, on the rtk-helper binding. It means the helper's firmware cannot be restarted once quiesced, so a boot stage hands its first epoch over running. Set in t8122-j613.dts (replacing U-Boot's J613 board check) and in the new t8112-j413-fw27.dts, which is J413 with macOS 27 firmware. That file also sets the trackpad's apple,power-method = <2>, which U-Boot used to patch in. Linux does not read the new property. Tested on J413 27.2 with that DTB in a one-shot Stage 2 (see u-boot#67); not built through make dtbs_check.

CI fixes: 6230f01d drops the now-unused board stub from j613-mtp-s2idle-tests. That stub had failed -Werror since the first commit. 94ed951b makes apple-dt-check.sh report a firmware-profile variant's warnings (a .dts that includes another board's .dts) under its base board's name. Without it, t8112-j413-fw27.dtb re-reported J413's 30 existing warnings as new. A warning only the variant has still counts.

Testing

  • J413 on the 27.2 stub, before this PR: a local equivalent that added the J413 DART address and board next to the J613 ones. The keyboard and trackpad worked from the adopted session, and s2idle kept the session (owner-confirmed input; repeated RTC s2idle).
  • This exact change: hardware result to follow from the phellos upstream-default boot.

🤖 Generated with Claude Code

@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf.

Hardware result on MacBook Air M2 (J413, T8112), macOS 27.2 (26B123) stub: pass. The change is now part of phellos's default.

Tested in phellos's upstream-first build, and it is now the default (one-shot 3957f65b, then default boots a10e0f07 and bef932e9, 2026-11-20):

🤖 Generated with Claude Code

@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: hardware run.

PR head Checked Result
94ed951b With u-boot#67 and this PR's t8112-j413-fw27.dtb: MTP handed over running (mtp-live-v1), Linux adopted it (4 retained buffers), keyboard and trackpad registered and kept across one RTC s2idle. Not checked by a person: key presses, GRUB-menu keyboard Pass

Build: phellos (MacBook Air M2, J413, macOS 27.2 / 26B123 stub), default rebuilt 2026-11-20 = linux integration/aurora 458f759 + #2519 #1832 #1831 #2264 #2525 #2526 #2543 #2544 #2545; Aura main 0beafec9 + aurora-silicon/aura#377 aurora-silicon/aura#227 (isp.c only) aurora-silicon/aura#381 aurora-silicon/aura#382; U-Boot aurora-wip 37baf8f7 + aurora-silicon/u-boot#67; Stage 2 DTB t8112-j413-fw27.dtb. One-shot boot under the SoC watchdog, then made the default (two default boots healthy).

@RyanTheTide

Copy link
Copy Markdown
Contributor

J615 row (15-inch MacBook Air M3, T8122), 27.2 stub.

Setup: Stage 1 aura tip-dev; one-shot Stage 2 = aura 1.0.0b13.1 + the J615 DTB with apple,rtkit-keep-running on &mtp and apple,power-method = <2> on the trackpad; U-Boot = u-boot#67 at b9efd22a, unmodified; kernel = our lab tree + this PR (2ae85bd..94ed951) + those two J615 DT lines.

boots MTP session interfaces ready dockchannel-hid errors
this PR + u-boot#67 7 adopted, 4 retained buffers, every boot keyboard, trackpad, stm, actuator, every boot 0
before: plain U-Boot, no handoff 2 co-processor has crashed, wake -ETIME, probe -62 none n/a

The DART kept the bypass stream (no refusal) on the J615's T8122 DART, so the property path covers the J615 with no board check. With the one-stage trackpad power command the 27.2 trackpad answered 0xe00002c2 and never became ready; the two-stage command fixed that, as on the J413 fw27 DTB.

Not tested yet: s2idle with the adopted session on the J615; key presses from a person (all interfaces report ready, input devices registered).

@DjDeveloperr DjDeveloperr 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.

The code review is clean. I'm requesting changes only for the DCO. None of the four commits (2ae85bd, 64ea0f8, 6230f01, 94ed951) has a Signed-off-by: line, and we don't merge without one. Running git rebase --signoff integration/aurora and pushing the branch fixes it. I'll merge as soon as CI is green on the new head.

What I checked:

  • Property contract with u-boot#67 and #2550: apple,rtkit-keep-running is a boolean on the MTP helper node (&mtp), and only the boot stage reads it. Linux still reads only what U-Boot publishes: apple,rtkit-handoff = "mtp-live-v1", the buffer inventory, and apple,bypass-handoff-streams on the DART. The binding text says exactly that.
  • Boards without the property keep today's behaviour:
    • With no apple,rtkit-handoff there is no adoption, so the rtkit-helper change does nothing.
    • A DART with no apple,bypass-handoff-streams, or a zero one, is left alone.
    • The DART still refuses a stream other than 1, or one whose TCR doesn't read back as bypass (apple-dart.c:5841-5843). That hardware check is the right replacement for the address gate.
  • s2idle for the other adopted sessions (J713, J614s, T8132, T8140): this is safer than before. Their ASC suppliers stay awake (rtkit-helper.c:555), and a lost RUN is reported instead of ignored (:569). Firmware-driven sleep still returns before any of this (:541). Post-merge rows: one s2idle round trip with an adopted session on a J713 and on a J614s.
  • apple-dt-check.sh: the variant mapping does what it says, for one level of include.

CI on 94ed951: Host tests, Device tree checks and SEP source checks are all green. Hardware: satchlj's J413 row and Ryan's J615 row, both on this head.

Merge order after the re-sign: this PR first, then u-boot#67, then #2550.

satchlj and others added 4 commits November 20, 2026 07:27
…y its properties, not by board

A boot stage that leaves the MTP running hands it over with
apple,rtkit-handoff on the MTP and apple,bypass-handoff-streams on its
DART. Two checks still named the J613: the DART probe accepted the
bypass stream only on the J613's T8122 DART at 0x2fa808000, and the
helper kept the adopted session's ASC awake over s2idle only on the J613.

The 27.2 MTP firmware on the MacBook Air M2 (J413) cannot be restarted
either, and U-Boot hands it over the same way through the T8112 DART at
0x24e808000.

- apple-dart: inherit the stream when the DART supports bypass, the
  stream is 1, and its TCR reads back as bypass. The register is the
  hardware's own record of the handoff, so it replaces the board and
  address match.
- rtkit-helper: keep an adopted session's ASC awake over s2idle on every
  board. A session is adopted only through apple,rtkit-handoff, which
  says it cannot be restarted.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Satya Benson <satya@benson.earth>
Add apple,rtkit-keep-running to the rtk-helper binding: the helper's firmware
cannot be restarted once quiesced, so a boot stage that starts it hands its
first epoch to the OS running instead of stopping it. U-Boot used to pick
these by board (J613) and by SoC plus OS firmware version (T8112 on 27.x);
it now reads this property.

- t8122-j613: set it, as U-Boot's J613 check did.
- t8112-j413-fw27 (new): J413 with macOS 27 system firmware. It sets the
  property and the trackpad's two-stage power command (apple,power-method =
  <2>), which U-Boot used to patch in, following t8122-j613-25g83.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Satya Benson <satya@benson.earth>
The helper no longer checks the board, so the harness's
of_machine_is_compatible() stub was unused and failed -Werror.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Satya Benson <satya@benson.earth>
…its base board

A firmware-profile variant such as t8122-j613-25g83 or t8112-j413-fw27
includes its board's .dts, so a new variant repeats every existing
warning of that board under a new DTB name and fails the check. Report a
variant's warnings under the base board's name instead. A warning only
the variant has still shows up as new.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Signed-off-by: Satya Benson <satya@benson.earth>
@satchlj
satchlj force-pushed the satchlj/mtp-live-handoff-by-property branch from 94ed951 to 45a78bf Compare November 20, 2026 12:27
@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: thanks, Dj. All four commits now carry Signed-off-by. Each commit got only the trailer: the tree is byte-identical to 94ed951 and the base is unchanged, so new head 45a78bf has the same content as what you reviewed.

@RyanTheTide: #2550 is stacked on this branch, so it will need a rebase onto 45a78bf (git rebase --onto 45a78bfc 94ed951b). The merge order is still #2525, then u-boot#67, then #2550.

@DjDeveloperr DjDeveloperr 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.

Thanks for the sign-offs. All 4 commits now carry Signed-off-by, and the tree is byte-identical to the head I reviewed (c3cde4cb), so I'm approving.

One thing still blocks the merge: dt-checks is red on 45a78bf. This isn't your change. The "DART power domains, base vs head" step (added 11-19 in 6539f98) reports t8112-j413-fw27 /soc/iommu@24e808000 - apple,t8112-dart okay: no power-domains (new). That node comes from t8112-j413.dts through the include, and the base J413 DTB already lacks the domain. The checker counts it as new only because the fw27 DTB itself is new. I've asked for the checker to compare an included board's DTB against its base, or for that J413 DART to get its domain. Either fix turns this green with no change to this PR. I'll merge as soon as dt-checks passes on this head, and u-boot#67 right after.

@RyanTheTide

RyanTheTide commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

On the red dt-checks on 45a78bf (run 44735951410): it's the DART power-domain check, t8112-j413-fw27 /soc/iommu@24e808000 mtp_dart apple,t8112-dart okay: no power-domains (new). That's the base J413's existing mtp_dart gap, reported again under the new variant's DTB name. This PR doesn't introduce it.

integration/aurora fixed the check itself in 0aa4143 ("scripts/dtc: apple-dart-pd-check: let a new DTB inherit its SoC's known gaps", 13:31Z), after this run. Locally I built all t8112/t8122 DTBs with the in-tree dtc, from this PR's merge ref (head) and from its base f44bf7a, and ran both versions of the script:

  • the script before 0aa4143: 15 findings, 1 new (the line above), exit 1;
  • the script from 0aa4143: new: 0, inherited by new DTBs: 1, exit 0;
  • negative check with the 0aa4143 script: drop power-domains from ave_dart0 in the fw27 DTB and it reports that node as new, exit 1.

So this only needs a fresh dt-checks run. A re-run of the old run reuses the old merge commit, so it needs a new event, for example a close and reopen.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Thanks, Ryan. To get a fresh run without closing and reopening, I used update-branch. The new head is 0f6cba1: integration/aurora, including 0aa4143, merged into this branch. The PR diff is unchanged. I'll merge once dt-checks and the rest are green on that head, then u-boot#67.

@DjDeveloperr
DjDeveloperr merged commit e06661c into integration/aurora Nov 20, 2026
8 checks passed
@satchlj

satchlj commented Nov 20, 2026

Copy link
Copy Markdown
Member Author

Claude Opus 5.5 on @satchlj's behalf: post-merge row.

Board Firmware Built from Checked Result
J413 (MacBook Air M2, T8112) fw27: macOS 27.2 (26B123) stub Linux integration/aurora abc6191 (contains e06661c): t8112-j413-fw27.dtb (sha256 d73ea1e0…); U-Boot aurora-wip 11bf692f (= u-boot#67's merge, no other U-Boot changes) MTP handoff, keyboard and trackpad binding in Linux, one s2idle cycle Pass

Boot: one-shot under the SoC watchdog, trial boot cb417a33, 2026-11-20 16:24 UTC. That build then became phellos's default, with default boots 35fac5d5 and 6f8eb70b healthy. The DTB was built after this PR, as the u-boot#67 release note requires. No open PR in the kernel tree touches arch/arm64/boot/dts, include/dt-bindings or scripts/dtc, so the DTB is exactly the tip's. Aura is main 29e0d3af plus our open aura#377, #381, #382 and #227 (isp.c only); none of them touches the MTP. The kernel is the tip plus our open PRs (linux#2519, #1832, #1831, #2264, #2526, #2543–#2545), and none of those touches the MTP, DART or input drivers.

  • Handoff: /proc/device-tree/soc/mtp@24e400000/apple,rtkit-handoff = mtp-live-v1, and apple,rtkit-keep-running is present. rtkit-helper 24e400000.mtp: adopted the running RTKit session (4 retained buffers), then dockchannel-hid 24eb30000.input: Interface multi-touch is now ready at 3.36 s.
  • Input: Apple MTP keyboard (/dev/input/event1) and Apple MTP multi-touch (/dev/input/event2) are registered, with their character nodes present. The kernel log has no MTP or DART error, fault or timeout line.
  • s2idle: rtcwake -d rtc1 -m freeze -s 20 returned 0 (suspend successes 0 → 1, fails 0). After resume both MTP input devices were still registered, there were still no MTP or DART error lines, and the panel was back at 2560x1664@60 with DPMS on.

Not checked (needs someone at the machine): actual key presses and trackpad touches in Linux, and the keyboard at the GRUB menu on this U-Boot. Wake by lid open or key press was not checked either; the wake here was by RTC.

🤖 Generated with Claude Code

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