Skip to content

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

Draft
RyanTheTide wants to merge 1 commit into
integration/aurorafrom
dtfill/t8142-aop-shared
Draft

RyanTheTide wants to merge 1 commit 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.

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