Skip to content

arm64: dts: apple: t8142: share the AOP, ambient light and lid angle with every M5 - #2329

Open
RyanTheTide wants to merge 2 commits into
integration/aurorafrom
dtfill/t8142-aop-shared
Open

RyanTheTide wants to merge 2 commits into
integration/aurorafrom
dtfill/t8142-aop-shared

Conversation

@RyanTheTide

Copy link
Copy Markdown
Contributor

Problem

The MacBook Pro 14-inch M5 (J704) has no AOP, so no ambient light sensor (True Tone) and no lid angle. The AOP core, its two mailboxes and dart-aop were described in the J813/J815 sound file, and the als/las services in each Air board file. The J704, J813 and J815 ADTs agree on all of them:

  • /arm-io/aop: reg, interrupts 490-493.
  • aop-exclave-mailbox: interrupts 497/494.
  • dart-aop: interrupt 528.
  • Every /arm-io/aop/iop-aop-nub service, als included.
  • All three carry the lid sensor's i2c1 mogul-las chip.

Change

  • Move aop_mbox, aop_setup_mbox and aop with its als and las services into t8142-peripherals.dtsi, on by default.
  • Enable aop_dart in t8142.dtsi.
  • t8142-j813-audio.dtsi keeps only &aop { aop_audio } and the rest of the sound description.
  • Drop the per-board als/las blocks.

The AOP runs without its audio child (the J815 does so today), and the driver creates a service device only when the firmware announces that service.

Testing

cpp + dtc before and after:

  • J813 and J815: the same tree apart from node order and aop_dart losing its now redundant status = "okay".
  • J704: gains the AOP, both mailboxes, dart-aop, als and las.

dt-validate -m reports nothing new on any of the three boards.

Still to run

  • @term-guy (J704):
    • dmesg | grep -i aop: the AOP boots and lists its services, with no DART fault or SError.
    • /sys/bus/iio/devices/*/in_illuminance_raw changes between covered and under a lamp.
    • The lid angle follows the lid at about 30, 90 and 120 degrees.
    • After an s2idle cycle, ALS still reports.
  • J813/J815: ALS, lid angle and J813 sound unchanged.
Details

Assisted-by: LLM (Claude:Opus 5.5)

The AOP core, its mailboxes and dart-aop were described in the J813/J815
sound file (t8142-j813-audio.dtsi) and the ambient light and lid angle
services in each board file, so the MacBook Pro J704 had none of them.
The J704, J813 and J815 ADTs agree on /arm-io/aop (reg, interrupts
490-493, iop,ascwrap-v6), aop-exclave-mailbox (0x3d067c000, interrupts
497/494), dart-aop (0x390fc0000, interrupt 528) and every
/arm-io/aop/iop-aop-nub service, als included, and all three carry the
lid angle sensor's i2c1 "mogul-las" authentication chip.

Move aop_mbox, aop_setup_mbox, the aop node and its als and las
services to t8142-peripherals.dtsi and enable aop_dart in t8142.dtsi,
so every T8142 board gets them. The AOP core runs without its audio
child (J815 runs so today), and aop registers a service child only when
its firmware announces the service. t8142-j813-audio.dtsi keeps only
&aop { aop_audio }. dart-aop and aop have no ADT power-gates: AOP_DART
sits in the AOP's own always-on power tree, so the DART names no power
domain (the AOP DARTs are exempt from the DART power-domain rule).

J813 and J815 compile to the same tree apart from node order, phandle
numbers and aop_dart losing its now redundant status = "okay". J704
gains the AOP, both mailboxes, dart-aop, als and las.

The moved nodes are Thomas Glanzmann's (AOP, mailboxes, dart-aop:
"t8142-j813: Sound through the AOP"), Diljit Singh's and Nick's (als),
and Nick's (las).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@sithglan

Copy link
Copy Markdown
Contributor

J813 row. The kernel is #2325's head with #1899/#1900 and IIO_AOP_SENSOR_ALS/LAS=m, which the J813 config didn't build. I booted it twice, changing only the DTB: first #2325's (integration's J813 AOP description), then this PR's head 79be7f191ef4.

  • AOP: apple_aop 390c00000.aop starts its RTKit on both, and aop-sensors-las and aop-sensors-als register on both. The probe and log lines for the AOP, the sensors and the sound card are identical between the two boots. No AOP or DART faults.
  • Lid angle: in_angl_raw 109 on the baseline and 108 with this PR, for the same lid position.
  • ALS: registers, but reports no data with either DTB: no apple/aop-als-cal.bin. The installer collects that file from macOS, and this machine doesn't have it. That's unrelated to this change.
  • Sound: card 1: AppleJ813, Primary and Secondary, as before. One second of silence plays on each PCM without errors.

Not run: the covered/lamp ALS comparison and the lid at 30/90/120 degrees. The first needs the calibration file, and both need someone at the machine.

@term-guy

Copy link
Copy Markdown
Contributor

J704 (MacBook Pro 14" M5), macOS 27.0 stub (26A428). Kernel: our J704 7.3.0 (integration/aurora be8d4cd + J704 GPU/DCP commits) on the installed Aurora Fedora, IIO_AOP_SENSOR_ALS/LAS=m. DTB: our J704 tree with this PR's J704 delta applied (aop_dart enabled; aop_mbox, aop_setup_mbox, aop with als/las), checked property by property against this branch's J704 tree.

  • AOP: apple_aop 390c00000.aop starts RTKit; both mailboxes and dart-aop bind; aop-sensors-als and aop-sensors-las register. No DART faults or SErrors.
  • ALS: the installer's apple/aop-als-cal.bin is present here, so it reports: ~84 lux in the room, 0 covered, 3478 lux under a phone flashlight (in_illuminance_input; in_colortemp_input ~5850 K).
  • Lid angle: in_angl_raw 107 → ~20 nearly closed → 94 at ~90° → 120–131 at ~120° → 87.
  • s2idle: echo freeze > /sys/power/state, woken by a key after 10 s (the J704's macsmc-rtc isn't a wakeup source, so rtcwake can't be used); ALS reports 52–60 lux right after resume.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Thanks @sithglan and @term-guy.

  • J704 (term-guy): this is the board the PR is for, and every item asked for is covered. The AOP boots, both mailboxes and dart-aop bind, ALS follows covered/room/flashlight, the lid angle follows the lid, and ALS still reports after an s2idle cycle. No DART faults or SErrors.
  • J813 (sithglan): booting arm64: dts: apple: t8142: Neural Engine, video encoder and JPEG on every M5 #2325's DTB and then this head's gave identical AOP, sensor and sound probe logs, the same lid angle and the same AppleJ813 card with working playback, so moving the nodes changes nothing there. ALS without apple/aop-als-cal.bin reports nothing on either DTB, as expected. The installer provides that file.
  • Config note: the sensors need IIO_AOP_SENSOR_ALS/IIO_AOP_SENSOR_LAS, which the J813 config doesn't build yet. That's separate from this change.
  • Still open: a J815 row (@m0d16l14n1) showing ALS and lid angle unchanged. I'll keep this as a draft until then.

@m0d16l14n1

Copy link
Copy Markdown
Contributor

J815 (MacBook Air 15" M5) row: ALS and lid angle unchanged. Kernel: integration/aurora 2c35f5094de1 + this head 79be7f191ef4, #2325, #2328, #2330, #2383, #2384, #2385 at their current heads. The installer's apple/aop-als-cal.bin is present.

  • Device tree: with this PR, the J815 DTB is identical node for node to our previous J815 DTB, which described als and las in the board file, apart from phandle numbers. The board-level copies were dropped as duplicates of the new SoC-level nodes.
  • AOP: apple_aop 390c00000.aop starts RTKit, and aop-sensors-als, aop-sensors-las and aop-sensors-accel register. No AOP or DART faults. The RTKit: crashlog endpoint not in the endpoint map info line is there, as on every earlier J815 boot.
  • ALS: 338 lux in the room light (5 samples, 337.9 to 338.2). Three boots with this PR read 285 to 338 lux; a boot from earlier the same day without it read 295 lux, in the same room.
  • Lid angle: in_angl_raw 112 to 122 on boots with this PR, and 110 on two boots without it, each at whatever position the lid was in.

Probes and log lines match the boots without this PR.

Conflict: t8142-j815.dts (kept integration's J815 audio nodes, dropped the board's &aop als/las block now shared in t8142-peripherals.dtsi).

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merged integration/aurora (d1b022d); conflict in t8142-j815.dts resolved (kept the new J815 audio nodes, dropped the board als/las block now in t8142-peripherals.dtsi); t8142-j704/j813/j815 dtbs build, J813/J815 differ from integration only by aop_dart's implicit status=okay (plus phandle numbering).

@RyanTheTide
RyanTheTide marked this pull request as ready for review November 22, 2026 10:34

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

Formal §1–§6 pre-PR review at verified live head f35c2412fdc158c463390dd2d167c5f40b90af90 against live integration/aurora (70a00e583b03, not superseded; MERGEABLE/CLEAN).

§1–§6 Checklist Verification

  • §1 No model gating & multi-board coverage: Pass. Moves aop_mbox, aop_setup_mbox, aop (with aop_als and aop_las) into t8142-peripherals.dtsi and enables aop_dart in t8142.dtsi, sharing them across all three T8142 boards (j704, j813, j815) while leaving only &aop { aop_audio } in t8142-j813-audio.dtsi. Confirmed in drivers/soc/apple/aop.rs:1633-1666 (register_service()) that children are only instantiated for services announced by firmware. Verified against live integration/aurora (70a00e583b03): newer additions in t8142.dtsi (#cooling-cells, pmp_report), t8142-peripherals.dtsi (aes/ps_sio/ps_aes), t8142-j813.dts (thermal zones), and t8142-j815.dts (hpm5) are completely disjoint.
  • §2 Production-ready, no hacks: Pass. Pure device-tree deduplication/enablement, works on default kernel command line.
  • §3 Safety: Pass. aop_dart sits in the AOP's always-on power domain with no ADT power gates and passed apple-dart-pd-check.py in CI.
  • §4 Clean-room & attribution: Pass. Both commits (79be7f191ef4 and merge commit f35c2412fdc1) carry human author/committer and human Signed-off-by: only (zero AI commit trailers); PR body discloses assistance.
  • §5 Evidence: Pass. Functional commit 79be7f191ef4 (identical 5-file DT delta to f35c2412fdc1, which only merges integration/aurora d1b022dc keeping J815 audio) is verified on hardware across all three T8142 boards:
    • J704 (term-guy): AOP RTKit, both mailboxes, dart-aop, ALS (0 / ~84 / 3478 lux, ~5850 K), lid angle (107 -> ~20 -> 94 -> 120–131 -> 87), and s2idle resume with ALS active; 0 DART faults/SErrors.
    • J813 (sithglan): A/B boot vs base DTB: identical AOP/sensor/sound probe logs, lid angle unchanged (109 vs 108), AppleJ813 playback clean; 0 AOP/DART faults.
    • J815 (m0d16l14n1): DTB identical node-for-node, AOP/ALS/LAS/accel register cleanly, ALS (285–338 vs 295 lux) and lid angle (112–122 vs 110) unchanged; 0 AOP/DART faults.
  • §6 Live CI & naming: Pass. Both applicable workflows (dt-checks — CHECK_DTBS, dt_binding_check, apple-adt-coverage, apple-dart-pd-check — and host-tests) completed SUCCESS on exact head f35c2412fdc1.

Ready for MERGETRAIN-LINUX4.

Assisted-by: LLM (Gemini 4 Neon)

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.

5 participants