Skip to content

dt-bindings: mailbox: apple,mailbox: T8152 post-office mailboxes for ANS, DCP, MTP and SEP - #2105

Closed
LiamRay11 wants to merge 1 commit into
aurora-silicon:mainfrom
LiamRay11:j804/t8152-mailboxes
Closed

LiamRay11 wants to merge 1 commit into
aurora-silicon:mainfrom
LiamRay11:j804/t8152-mailboxes

Conversation

@LiamRay11

Copy link
Copy Markdown
Contributor

Summary

On T8152 (M6), the NVMe (ANS), display (DCP), keyboard/trackpad (MTP) and SEP coprocessors use windows of the same post-office block as the SMC. That block has counted FIFOs sharing one status register, and interrupt masking is left to the interrupt controller. apple,t8152-smc-mailbox already describes this register layout. This PR adds a compatible for each of these coprocessors, with apple,t8152-smc-mailbox as the fallback.

Why bindings only

The bring-up tree added four identical entries to the driver's match table, all pointing at apple_mbox_t8152_smc_hw. A fallback compatible gives the same result without a code change. If the windows ever differ, the specific compatible is still there to key on. If reviewers prefer driver match entries, or a single generic apple,t8152-po-mailbox, that is an easy change.

Changes

  • Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml: one new oneOf branch: apple,t8152-{ans,dcp,mtp,sep}-mailbox followed by apple,t8152-smc-mailbox. The existing T8152 conditions on interrupts (send-empty, recv-not-empty) apply through contains. Also adds an example.

Testing

On hardware: MacBook Pro 14-inch (M6, J804), 2026-11-16, tested by LiamRay11.

  • What ran: kernel 7.3.0 built from integration/aurora bf423bf0e with all nine J804 linux PRs merged (t8152-mailboxes, dart-gen3, dt-board, centauri, g18-fast-retire, cfg80211-stale-scan, smc, cs42l84-jack, and an NVMe PR that is not sent yet), plus retest-only device-tree changes that are not part of these PRs: SSD nodes (ANS mailbox, SART, NVMe), PCIe port 0 with the N1 Wi-Fi, the USB0 gadget console, and a read-only NVRAM partition. Those nodes were needed to reach the root filesystem and SSH.
  • Booted through aura on the installed root filesystem. A systemctl reboot from this kernel (watchdog restart) returned to the installed system.

Results for this PR:

  • The ANS mailbox node (apple,t8152-ans-mailbox, apple,t8152-smc-mailbox) bound through the fallback, with no driver match entry. NVMe ran through it: the namespaces came up, two cold reads of the same large file gave equal hashes, and a package-manager integrity check reported 0 altered files.
  • The DCP, MTP and SEP windows have no nodes in that tree, so they were not exercised on this kernel. On an earlier base with single-compatible nodes, all four windows carried traffic: NVMe, the keyboard and trackpad, and Touch ID ran through them, and the DCP driver exchanged its messages.

Checks on this base: no code change. scripts/dtc/apple-dt-check.sh (base bf423bf0e, head = this series together with j804/dt-board, j804/dart-gen3 and the J804 NVMe change): 137 Apple DTBs built at both, 0 new CHECK_DTBS warnings (8 removed: the J873g apple,t8152-pmgr/-pmgr-pwrstate ones), and dt_binding_check passes for every changed binding.

integration/aurora has since moved to 677be395b; this branch still merges into it without conflicts.

Dependencies

None. The users of these compatibles are the J804 NVMe, MTP, DCP and SEP nodes in later PRs. The ISP and PMP windows are not included: their consumers are not proposed yet.

🤖 Generated with Claude Code

…mailboxes

On T8152 the NVMe (ANS), display (DCP), keyboard and trackpad (MTP)
and SEP coprocessors talk through windows of the same post-office
block as the SMC: counted FIFOs sharing one status register, with
interrupt masking left to the interrupt controller. The register
layout is the one apple,t8152-smc-mailbox already describes.

Add a compatible per coprocessor, each with apple,t8152-smc-mailbox as
its fallback, so the existing driver match serves them without a code
change and a later difference can still be keyed on the specific
compatible.

All four carry traffic on a MacBook Pro (M6, J804), with the
single-compatible form of these nodes: NVMe, the keyboard and
trackpad, and Touch ID run through them, and the DCP driver exchanges
its messages through the DCP window.

Signed-off-by: LiamRay11 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>

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

Test report, 2026-11-17: Apple Mac mini M6 (J873g/T8152, board 0x24). PR revision tested: 31fe98769029f1fbdd7e5e74e93672a372b63018.

Host validation used the combined #2105–2108/#2110–2112 series (54742c617db4 on 677be395b9d2) with Clang 22. All changed driver objects built with W=1 and no new warnings; two pre-existing DART unused-helper warnings were unchanged.

The changed mailbox binding passed dt_binding_check as part of validation of all ten changed bindings in the related series. All 137 Apple DTBs built at both base and combined head: zero new warning lines and eight removed. This is schema/DT build coverage; no new mailbox endpoint was independently exercised on hardware.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks, LiamRay11. Using apple,t8152-smc-mailbox as the fallback instead of four identical match entries is the right shape, and the J804 NVMe result through the fallback is useful evidence.

One thing to sort out before this can go in: #1797 adds apple,t8152-ans-mailbox as a standalone compatible with interrupts: false, plus a driver match entry for a polled ANS mailbox that only accepts the J873g's window (drivers/soc/apple/mailbox.c:1599-1604 in that PR). The two binding hunks conflict in apple,mailbox.yaml. If both merged as they are, the J804 ANS node would match #1797's entry first and fail to probe. We have asked on #1797 to switch the J873g node to your two-compatible form with its interrupts and to drop the polled entry. Nothing needs to change here, but please keep an eye on that thread in case its binding changes in a way that touches this one.

The binding has no code of its own, so the remaining row is for the windows that have not run on this base yet:

  • J804, MTP node as "apple,t8152-mtp-mailbox", "apple,t8152-smc-mailbox" (with the MTP DT nodes): evtest on the keyboard and trackpad devices shows key, multitouch and Force Touch click events, with no mailbox errors in dmesg.
  • If you have the DCP or SEP nodes: the DCP brings up the internal panel, and the SEP endpoints start.

After that we will run a no-regression row for the shared mailbox driver on our A18 Pro (Neo) and M4 Pro.

sithglan pushed a commit to sithglan/aurora-linux that referenced this pull request Nov 19, 2026
…mailboxes

On T8152 the NVMe (ANS), display (DCP), keyboard and trackpad (MTP)
and SEP coprocessors talk through windows of the same post-office
block as the SMC: counted FIFOs sharing one status register, with
interrupt masking left to the interrupt controller. The register
layout is the one apple,t8152-smc-mailbox already describes.

Add a compatible per coprocessor, each with apple,t8152-smc-mailbox as
its fallback, so the existing driver match serves them without a code
change and a later difference can still be keyed on the specific
compatible.

All four carry traffic on a MacBook Pro (M6, J804), with the
single-compatible form of these nodes: NVMe, the keyboard and
trackpad, and Touch ID run through them, and the DCP driver exchanges
its messages through the DCP window.

Signed-off-by: LiamRay11 <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
[Thomas: taken from aurora-silicon#2105 for the J873g ANS node;
 placed before the T8152 ASCWrap v8 entry this branch adds]
Signed-off-by: Thomas Glanzmann <[email protected]>
@sithglan

Copy link
Copy Markdown
Contributor

For the overlap with #1797: as of fad2b80d3dd1 it describes the J873g ANS node as "apple,t8152-ans-mailbox", "apple,t8152-smc-mailbox" with the send-empty/recv-not-empty pair (302, 262), and it no longer has the standalone binding entry or the polled driver profile. Your binding commit is in that branch unchanged, with the T8152 ASCWrap v8 entry placed after it, so the two merge cleanly whichever lands first. Nothing needs to change here.

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train adversarial review (MERGETRAIN-LINUX2) at 31fe987: NO BLOCKERS.

Code read only, nothing built here. Before the merge it still needs Dj's verdict at this head; the missing rows are listed below.

Full review

#2105 dt-bindings: mailbox: apple,mailbox: T8152 post-office mailboxes for ANS, DCP, MTP and SEP @31fe9876

VERDICT: NO BLOCKERS

Code checks out:

  • apple,mailbox.yaml:30-39: each new compatible needs apple,t8152-smc-mailbox as its fallback. So the existing match (drivers/soc/apple/mailbox.c:1955, apple_mbox_t8152_smc_hw: counted FIFO, RX +0, TX +0x10, status +0x20, no mailbox IRQ controls) binds them with no code change.
  • The contains: const: apple,t8152-smc-mailbox conditional (yaml:174-187) applies to the new nodes, so they must have exactly send-empty and recv-not-empty. The 4-interrupt default branch (yaml:228-247) excludes them through the same fallback.
  • The iommus/apple,dma-range exclusion (yaml:206-209) applies too. The new example is valid against all of this.
  • No in-tree node uses the new compatibles yet (the only T8152 user is the SMC node, t8152-j873g.dts:244), so this changes nothing at runtime.

Nits:

  • Commit 31fe987 carries Co-Authored-By: Claude Opus 5.5 (already pushed; leave it). The human Signed-off-by is a GitHub handle, which needs a real name before any upstream send.
  • The commit text says these are "windows of the same post-office block as the SMC". The SMC window is at 0x30c710080 (t8152-j873g.dts:245), but the example ANS window is at 0x316020300, in the 0x316020000 bank. That is the same register layout in a different bank.
  • Two comments disagree about that bank: mailbox.c:76-79 and t8152-j873-gpu.dtsi:120-121 say the rest of the 0x316020000 bank belongs to PMP, DCP, DCPEXT and SCALER0, while this example puts ANS at +0x300. One of them is wrong. Fix whichever it is when the ANS node lands, because the GPU provider's exclusive window checks (mailbox.c:1448-1455) assume that ownership map.

Missing rows:

  • No node in the two-compatible form has run on hardware. J804 ran the single-compatible form, and sithglan's J873g report is schema/DTB build only.
  • Needed with the DT PRs: J804 MTP (evtest keyboard, trackpad and Force Touch clicks, no mailbox errors), ANS (root on NVMe) and, if present, DCP panel bring-up and SEP endpoint start.
  • After that, a no-regression row for the shared mailbox driver on Neo and J616s, as Ryan asked.

sithglan pushed a commit to sithglan/aurora-linux that referenced this pull request Nov 22, 2026
…mailboxes

On T8152 the NVMe (ANS), display (DCP), keyboard and trackpad (MTP)
and SEP coprocessors talk through windows of the same post-office
block as the SMC: counted FIFOs sharing one status register, with
interrupt masking left to the interrupt controller. The register
layout is the one apple,t8152-smc-mailbox already describes.

Add a compatible per coprocessor, each with apple,t8152-smc-mailbox as
its fallback, so the existing driver match serves them without a code
change and a later difference can still be keyed on the specific
compatible.

All four carry traffic on a MacBook Pro (M6, J804), with the
single-compatible form of these nodes: NVMe, the keyboard and
trackpad, and Touch ID run through them, and the DCP driver exchanges
its messages through the DCP window.

Signed-off-by: LiamRay11 <[email protected]>
[Thomas: taken from aurora-silicon#2105 for the J873g ANS node;
 placed before the T8152 ASCWrap v8 entry this branch adds]
Signed-off-by: Thomas Glanzmann <[email protected]>
@github-actions github-actions Bot added merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot) labels Nov 24, 2026

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

Verdict: HOLD at 31fe98769029
Blockers:

  • Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml:30-39, :257-270: Merge conflict (mergeable_state: dirty) against main (83950d093e1b) because both hunks are already landed verbatim on main in commit c96f8d562763 (merged via #1797, merge commit daa9e2de18bd). Close this PR as superseded by #1797 (rebasing onto main produces an empty diff).
  • Commit 31fe98769029 and PR description (§4): The commit message ends with a non-human co-author trailer and the PR description ends with a tool-generator footer line; both violate §4. If this branch is ever rebased rather than closed, drop both lines (note that c96f8d562763 on main already omitted the trailer).

Checked: DT schema validity (compatible oneOf, allOf interrupt/property constraints, additionalProperties: false, example), mergeability and overlap against main, CI checks (dt-checks, host-tests), and commit/PR hygiene (§1–§6).

Evidence
  • Head SHA: 31fe98769029f1fbdd7e5e74e93672a372b63018 (fork PR LiamRay11:j804/t8152-mailboxes, state: open, mergeable: false, mergeable_state: dirty against main 83950d093e1b).
  • Superseded on main: Commit c96f8d562763abe640920b2011cdfe1a97fd7679 (authored by LiamRay11, merged in #1797 at daa9e2de18bd on 2026-11-23) already contains the exact apple,t8152-{ans,dcp,mtp,sep}-mailbox + apple,t8152-smc-mailbox oneOf branch and mailbox@316020300 example in Documentation/devicetree/bindings/mailbox/apple,mailbox.yaml.
  • Schema: Valid; contains matches apple,t8152-smc-mailbox for the 2-interrupt (send-empty, recv-not-empty) constraint, excludes it from the 4-interrupt default and iommus/apple,dma-range rules, and keeps additionalProperties: false.
  • CI at 31fe98769029: dt-checks SUCCESS (run 43992611229), host-tests SUCCESS (run 43992611196) — both ran 2026-11-17 before #1797 landed on main.
  • Checklist §1–§6: §1–§3 pass (fallback binding, no model gating/hacks/hardcoded safety values); §4 fails on commit trailer and PR body footer (no Apple IP issues); §5 hardware note: J804 ANS fallback tested on combined tree, DCP/MTP/SEP fallback and regression rows not yet run at PR head (moot if closed as superseded); §6 passes (uses aura, no forbidden naming).

@github-actions github-actions Bot added changes-requested A reviewer requested changes (bot) merge-conflict Conflicts with the base branch (bot) and removed merge-conflict Conflicts with the base branch (bot) labels Nov 24, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

changes-requested A reviewer requested changes (bot) merge-conflict Conflicts with the base branch (bot) needs-hw-row No hardware row at the PR head (bot) needs-review No approving review from Core or Omarchy Mac yet (bot) needs-template PR body lacks Tested or Risk (bot)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants