Skip to content

soc: apple: aop: start the T8122 AOP as on T6040 - #2569

Merged
RyanTheTide merged 5 commits into
integration/aurorafrom
aop/t8122-match
Nov 22, 2026
Merged

RyanTheTide merged 5 commits into
integration/aurorafrom
aop/t8122-match

Conversation

@RyanTheTide

@RyanTheTide RyanTheTide commented Nov 20, 2026 •

Copy link
Copy Markdown
Contributor

Problem

On the 15-inch MacBook Air M3 (J615, T8122) with the 27.2 firmware, apple_aop failed with -ETIME (RTKit endpoint discovery -62) on every boot, so there were no microphones, no ambient light sensor and no lid angle. The M3 AOP uses the M4 Pro layout: iBoot leaves it halted with __ETEXT, __EDATA and __OS_LOG in DRAM, and the 27.2 firmware reads its __EDATA base from the ED0p boot argument. The T8122 node fell back to the T6020 match data, which neither checks those segments nor patches ED0p, so the firmware read its data base as 0.

Change

  • dt-bindings: document apple,t8122-aop (with its apple,t6020-aop fallback) and the optional memory-region the bootloader adds (T6040, T8122 and T8132 nodes use it).
  • driver: match apple,t8122-aop with the T6040 data, as T8132 already does. It checks the bootloader-reserved segments, patches ED0p with the __EDATA IOVA (Artyom's 60f279c/b224fde7 support, already on integration/aurora) and halts the coprocessor again if its start fails.
  • driver: when the node has no reserved memory-region (a Stage 2 from before the AOP handoff), the T8122 block starts as its apple,t6020-aop fallback did before this PR. The choice comes from the node, not from the SoC or the firmware version. With the regions present nothing changes.

The bootloader half is aurora-silicon/aura#377 (merged), which reserves the segments.

Testing

  • J615, cold boot, kernel 7.3.0-aurora-j615d1 (lab tree) + this match entry and the two ED0p commits, Stage 2 with aura#395: "Validated external data region at IOVA 0x10000020000, size 0x4000", RTKit up at 0.79 s, "===( AOP IS READY )===" at 0.85 s. The lid angle reads 91-92 degrees, the ALS binds, and the AOP microphone card captures 3 channels of live room noise (about -68 dBFS, nothing played).
  • A hot reload after the stock module had already started the AOP times out as expected (a running ASC isn't restarted), so this needs the first probe.
  • checkpatch clean; dt_binding_check passes for the schema.
  • Head a360e3b: aop.o builds with CLIPPY=1 on the fleet78 release config; dt_binding_check for apple,aop.yaml passes, and dtbs_check on t8122-j615 adds nothing new (the three child-node warnings below were there before); the AOP host tests pass 4/4. aop-bootargs-tests.py now runs the selection itself (AopHwConfig::for_regions(), which probe calls): T8122 keeps its configuration with regions and takes T6020's without them, and every other block keeps its own either way. Inverting the condition, always keeping the matched configuration, or dropping the T8122 fallback each fail it.
  • The J615 default since 07:29 (fleet78, which carries b3228d8, plus a Stage 2 with aura#377) shows AOP, lid angle and ALS working. The regions-present path is the same code at this head.

Still to run

  • J615 row at this head on a fleet kernel with the aura#377 Stage 2: "AOP IS READY", lid angle, ALS, AOP mic level (nothing played). Then the same kernel on a Stage 2 without aura#377, which should log "No firmware memory-region from the bootloader: starting as the fallback block" and behave as before this PR.
  • J613 / other T8122 boards (same SoC path).
  • The child nodes (apple,t8122-aop-audio with apple,t6030-aop-audio, -als, -las) are not in the child bindings yet. The parent schema's select stays as it was so that this PR adds no dtbs_check warnings; widening it is a follow-up together with those child bindings.
Evidence

Lab traces (not tainted, our own logs): traces/audio/20261121-j615-aop272 (cold boot, step 6), with the batch-1 hot-reload log; segment addresses decoded from our own macOS ioreg of this J615.

Assisted-by: LLM (Claude:Opus 5.5)

The M3 (T8122) device trees describe the AOP as "apple,t8122-aop" with
the T6020 fallback. Its firmware's external code, data and log live in
DRAM, which the bootloader reserves and lists in memory-region with
their IOVAs. Document the compatible and the optional memory-region.

Signed-off-by: Ryan Murray <ryan@aurorasilicon.org>
On the M3 (T8122) iBoot leaves the AOP halted with its external code
(__ETEXT), data (__EDATA) and log (__OS_LOG) in DRAM, as on the M4 Pro,
and the 27.2 firmware reads its __EDATA base from the ED0p boot
argument. The T8122 node fell back to the T6020 match data, which
neither checks those segments nor patches ED0p, so the firmware read
its data base as 0 and never said hello: apple_aop failed with -ETIME
on every boot of the MacBook Air J615.

Match apple,t8122-aop with the T6040 data, as T8132 already does: check
the bootloader-reserved segments, patch ED0p with the __EDATA IOVA and
halt the coprocessor again if its start fails.

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

Copy link
Copy Markdown
Contributor Author

Looks good; approve once the J615 row is re-run with the open bootloader half.

  1. The body names aura#395 as the bootloader half, but Sync omacom #177 (G15, T6030 dock, platform fixes) onto 7.3 #395 is closed in favour of aura#377 (still open). The J615 row was taken with a Sync omacom #177 (G15, T6030 dock, platform fixes) onto 7.3 #395 Stage 2. Update the link, and re-run the row on a Stage 2 built from drm/asahi: G17 shared capacity, bounded ray-query jobs and timeout recovery on 7.3 #377, because the segment layout this driver checks (drivers/soc/apple/aop.rs:2103-2190) now comes from a different kboot path.
  2. drivers/soc/apple/aop.rs:3113: T8122 now always takes fw_regions: true, so with no memory-region the probe stops at aop.rs:2115-2117 with ENOENT. On the J615 with 27.2 that is no worse than today's -ETIME. It does change behaviour on every other T8122 board and firmware that runs a Stage 2 without drm/asahi: G17 shared capacity, bounded ray-query jobs and timeout recovery on 7.3 #377, and none of those has a row. Show the J613 result. If the old path worked there on any firmware, decide on the presence of memory-region (the bootloader's reservation is what tells the driver the segments are in DRAM), and keep the T6020 path when it is absent until a release has carried drm/asahi: G17 shared capacity, bounded ray-query jobs and timeout recovery on 7.3 #377.
  3. Nit: Documentation/devicetree/bindings/soc/apple/apple,aop.yaml: the memory-region description says "On T8122", but the T6040 and T8132 nodes use it too. Say "On T6040, T8122 and T8132" or leave the SoC out.

HW row: J615 and J613, fleet kernel with this commit, Stage 2 from aura#377, default cmdline, cold boot: "AOP IS READY", lid angle and ALS read, AOP mic capture (no playback), 0 AVC, 0 failed units, 0 new kernel errors. Plus the same kernel on a Stage 2 without #377 showing the clean refusal and nothing else new.

Assisted-by: LLM (Claude:Opus 5.5)

T6040 and T8132 AOP nodes carry the bootloader's firmware memory-region
too. Describe the property without naming one SoC, and say what a T8122
AOP does without it.

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

The T8122 AOP runs its external code, data and log from DRAM only when
the bootloader reserved them in memory-region (aura's AOP handoff). A
Stage 2 that predates that handoff reserves nothing, and the T6040
configuration then stops the probe with ENOENT, where the
apple,t6020-aop fallback the node also carries started it before.

Decide from the node: a block whose configuration needs firmware regions
and names a configuration for their absence takes that one when the
node has no reserved memory-region. T8122 names its apple,t6020-aop
fallback's. With the regions present nothing changes.

aop-bootargs-tests.py checks that the T8122 configuration checks its
regions and names T6020's as the one without them, and that no other
block names one; dropping the T8122 fallback fails it.

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

Copy link
Copy Markdown
Contributor Author

Pushed b3228d8..967846e (fast-forward), for the review of 11-21:

  1. The bootloader half is now kboot: one AOP firmware-segment path, chosen by the ADT and the DART's range aura#377, which is merged; the link is fixed in the description. The J615 default has run a Stage 2 with drm/asahi: G17 shared capacity, bounded ray-query jobs and timeout recovery on 7.3 #377 since this morning, and AOP, lid angle and ALS work there.
  2. Without a memory-region the T8122 block no longer stops with ENOENT. e103c6e/967846e2 give the configuration an optional without_fw_regions, and T8122 names T6020's, the configuration its apple,t6020-aop fallback ran before this PR. Probe takes it when the node has no reserved region, so a Stage 2 without drm/asahi: G17 shared capacity, bounded ray-query jobs and timeout recovery on 7.3 #377 behaves on every T8122 board exactly as before. The choice comes from the node, not the SoC or the firmware. aop-bootargs-tests.py checks the selection and fails if it is dropped.
  3. The binding text now names T6040, T8122 and T8132.

Build and tests: aop.o with CLIPPY=1 on the fleet78 release config, dt_binding_check (apple,aop.yaml), dtbs_check t8122-j615 (no new warnings), AOP host tests 4/4.

Still owed: the J615 row at this head, and the no-#377 Stage 2 row (queued), plus J613.

Move the choice of configuration into AopHwConfig::for_regions() so the
host test runs the code probe uses, not only the table. The test now
checks that T8122 keeps its configuration with regions and takes T6020's
without them, and that every other block, T8142, T8152 and T6050
included, keeps its own either way. Inverting the condition or always
keeping the matched configuration fails it.

Also: the doc comment of check_fw_regions() is back on it, the field
comment says the segments are left in DRAM but neither reserved nor
mapped, the binding describes when the property is absent rather than
what the driver does, and the probe message says it starts with the
fallback compatible's configuration. Before this series that start
ended in -ETIME on the J615 with 27.2 firmware; it is kept as it was
for any T8122 Stage 2 without the AOP handoff.

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

Copy link
Copy Markdown
Contributor Author

Pushed 967846e..a360e3b: an independent review found the host test only checked the table, not the choice probe makes. The choice is now AopHwConfig::for_regions(), which probe calls and the test runs; inverting the condition or always keeping the matched configuration fails it. The no-fallback check now covers T8142, T8152 and T6050 too. The remaining changes are comments: the doc comment of check_fw_regions() is back on it, the binding says when the property is absent, and the probe message names the fallback configuration. One note on intent: without the AOP handoff, that fallback start ended in -ETIME on the J615 with 27.2 firmware before this series, and it still does. It is kept on purpose, so that a T8122 board or firmware where the old path works, and which has no row yet (J613), doesn't change. AOP host tests 4/4, aop.o CLIPPY=1 clean, dt_binding_check passes.

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

Adversarial review at head a360e3b7c92eb1f5faa234667093caff2d00c801 against pre-pr-checklist.md.

Verdict: Code LGTM (0 code blockers); hold approval/merge pending the a360e3b7 hardware rows.

Checked

  • No model gating (Rule 1): apple,t8122-aop matches HW_CFG_T8122 (..HW_CFG_T6040, without_fw_regions: Some(&HW_CFG_T6020)). AopData::has_fw_regions() checks !np.is_null() && of_reserved_mem_region_count(np) > 0, and AopHwConfig::for_regions() selects the fallback purely from DT memory-region presence — no SoC, board, or firmware-version gate. The bootloader half (aurora-silicon/aura#377) is merged, so the chicken-and-egg ordering is satisfied.
  • Driver behavior & safety (Rules 2–3):
    • With memory-region present (has_fw_regions == true), probe() stays on HW_CFG_T8122 and runs bootargs_has_ed0p() + check_fw_regions(). Malformed or unmapped regions still fail cleanly (EINVAL/EIO/ENOENT) instead of silently falling back.
    • Without memory-region (or of_reserved_mem_region_count <= 0), for_regions(false) selects &HW_CFG_T6020 and logs a dev_info!, preserving pre-PR behavior on older Stage 2 builds.
  • Regression safety across M1/M2/M3/M4/M5/Neo: Every other config (T8103, T8112, T6000, T6020, T6040, T8132, T8140, T8152, T8142, T6050) sets without_fw_regions: None, so for_regions() unconditionally returns self. tools/asahi/aop-bootargs-tests.py exercises AopHwConfig::for_regions() across T8122 and all 10 other configs.
  • DT bindings & CI: Documentation/devicetree/bindings/soc/apple/apple,aop.yaml adds apple,t8122-aop with its apple,t6020-aop fallback and optional memory-region (1..8). Keeping select: unchanged until the T8122 child bindings (-audio, -als, -las) land avoids spurious dtbs_check warnings and is documented. All 8/8 CI checks pass (dt-checks, host-tests, source, rust-build, kunit, 3× DWC3/ATC).
  • Clean-room & attribution (Rule 4): All 5 commits carry human author/committer (Ryan Murray <ryan@aurorasilicon.org>) and Signed-off-by only; PR body ends with Assisted-by: LLM (Claude:Opus 5.5).

Remaining before approval/merge (Rule 5 — Hardware rows)

Commits 967846e2..a360e3b7 added has_fw_regions() / for_regions(), and a360e3b7 has not been booted on hardware yet:

  1. J615 at a360e3b7 on a default-cmdline kernel with an aura#377 Stage 2: confirm "AOP IS READY", lid angle, ALS, AOP mic capture (nothing played), and regression check (0 AVC denials, 0 failed units, 0 new kernel errors).
  2. J615 at a360e3b7 on a Stage 2 without aura#377: confirm the fallback dev_info! ("No firmware memory-region from the bootloader: starting with the fallback compatible's configuration") and unchanged pre-PR behavior.
  3. Second T8122 board (e.g., J613) row if available, since t8122.dtsi enables this path for all T8122 boards.

Minor non-blocking nits

  • Documentation/devicetree/bindings/soc/apple/apple,aop.yaml:56: the memory-region description mentions T6040 and T8132, which are covered by apple,t6041-aop.yaml (where maxItems: 18) rather than apple,aop.yaml.
  • PR body "Still to run" quotes the older log text ("starting as the fallback block"), whereas a360e3b7 logs "starting with the fallback compatible's configuration".

Assisted-by: LLM (Google:Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J615 row at b3228d8 with the aura#377 Stage 2: J615 production default, 7.3.0-aurora-fleet79 + Stage 2 aura main 7d8e91f8, default command line. a360e3b changes nothing on this path, because the node has its memory-region.

  • "Validated external data region at IOVA 0x10000020000, size 0x4000", then RTKit init and the AOP services.
  • The lid angle reads (raw 101). The ALS reads 46.6 lux at 4702 K.
  • Enforcing, 0 failed units, 0 AVC, 0 new kernel errors.
  • Not taken this time: the AOP mic level. My kit looked for the capture PCM by name and missed it. Still owed: that level row, and the no-drm/asahi: G17 shared capacity, bounded ray-query jobs and timeout recovery on 7.3 #377 Stage 2 boot.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

Merge-train adversarial review (MERGETRAIN-LINUX2) at a360e3b: 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

#2569 soc: apple: aop: start the T8122 AOP as on T6040 @a360e3b7

VERDICT: NO BLOCKERS. The no-region fallback has no hardware proof at all (see the rows below).

Checked and found OK:

  • The match uses the block compatible apple,t8122-aop (t8122.dtsi:1232) with no machine or firmware gate.
  • The fallback choice is derived from a DT property (memory-region present), which the rules allow.
  • of_reserved_mem_region_count() exists in this tree (drivers/of/of_reserved_mem.c:944).
  • for_regions() (aop.rs:3024) is pure. ptr::eq on &'static is correct for the "fallback taken" log.
  • After merging into the base, every HW_CFG literal compiles with the new field.

Nits / risks:

  1. aop.rs:3144 + 3302: the no-region fallback deliberately starts the AOP as T6020, although the PR itself says this path ended in -ETIME on J615 with 27.2.
    • More important: the commit text (a360e3b) says the segments iBoot left in DRAM are "neither reserved nor mapped". Starting a coprocessor whose firmware runs from DRAM that Linux has not reserved could let it DMA into kernel-owned pages, if the DART still has iBoot's mappings.
    • The T6040 config refuses with ENOENT (aop.rs:2125), which is the safer default.
    • The fallback exists only for Stage 2s that predate aura#377. Consider refusing instead, or show that the T6020 start on such a Stage 2 has no live DART mapping onto unreserved DRAM.
  2. has_fw_regions() counts any memory-region, not specifically the firmware segments. That is fine today; check_fw_regions() validates the contents.
  3. The binding adds memory-region without restricting it to the compatibles that use it, and select: is left unchanged, so T6040/T8132 AOP nodes are still not validated by this schema. The PR body acknowledges this as a follow-up.
  4. The comments name the firmware Mach-O segments (__ETEXT, __EDATA, __OS_LOG) and the boot-arg fourccs. These are already in the file, and they are firmware-format facts, not kext names. No new provenance problem.

Missing rows:

  • J615 at this head (967846e + a360e3b have never booted). Fleet78 carries only b3228d8.
  • J613 (the same SoC path, and its own firmware). The M3 J504 MacBook Pro and J433/J434 iMac are also unproven; the iMac has mics but no lid sensor.
  • Suspend/resume of the AOP on T8122 with the T6040 config (quiesce_on_unbind, halt_on_failed_start now apply to M3).

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J615 rows at head a360e3b, both boot-loader states (warm one-shots; default command line, kernel-only, no module parameters):

  • With the AOP segment hand-over (aura main incl. aura#377, the default boot chain): AOP up, aop-sensors-las (angle 101) and aop-sensors-als (11.3 lux) present, 0 AOP errors.
  • Without it (aura main 6affb8ec, before aura#377): the driver logs "No firmware memory-region from the bootloader: starting with the fallback compatible's configuration". RTKit endpoint discovery then times out (-62) and probe fails with -62 after about 1 s. That failure is clean: 0 oops, 0 failed units, SELinux enforcing, the rest of the system unaffected. On the same boot chain, the kernel before this PR failed AOP with -2.

So on the J615 the AOP needs the boot-loader hand-over, and the fallback fails safe. Both rows are warm boots; a true cold boot needs someone at the machine.

@RyanTheTide

Copy link
Copy Markdown
Contributor Author

J615 row at a360e3b with the AOP mic capture (warm one-shot, default command line, default boot chain whose Stage 2 includes aura#377; capture only, nothing played):

  • Validated external data region, then AOP IS READY at 0.80 s.
  • aop-sensors-als: 0.81 lux. aop-sensors-las: angle 103.
  • Mic capture, 3 s per PCM. hpai: FLOAT_LE at 48 kHz, 3/3 channels live, about -65 dBFS RMS (room noise). lpai: S32 at 16 kHz, 3/3 channels live.
  • 0 oops, 0 coprocessor crashes, 0 SELinux denials, 0 failed units. Compared with the J615's default boot just before it, this boot logs no new kernel errors.

Together with the earlier rows (both boot-loader states), row 1 is complete at this head on warm boots. A true cold boot and a second T8122 board (J613) are still owed.

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

Pre-PR Checklist Re-check — Upgrading to APPROVE (head a360e3b7c92e)

All code, binding, safety, attribution, and CI checks (8/8 green) were already clear at this head, and the requested a360e3b7 J615 hardware rows are now complete:

  • With aura#377 Stage 2 (default cmdline, a360e3b7): Validated external data region, AOP IS READY (0.80 s), aop-sensors-als (0.81 lux), aop-sensors-las (angle 103), 3/3 live mic channels on both hpai (FLOAT_LE 48 kHz, ~-65 dBFS RMS room noise) and lpai (S32 16 kHz), 0 oops, 0 coprocessor crashes, 0 SELinux denials, 0 failed units, and 0 new kernel errors.
  • Without aura#377 Stage 2 (6affb8ec, default cmdline, a360e3b7): Logs "No firmware memory-region from the bootloader: starting with the fallback compatible's configuration", fails safe cleanly (-62), 0 oops, 0 failed units, SELinux enforcing.

(Non-blocking follow-up coverage when available: physical cold boot at a360e3b7 and a second T8122 board such as J613, which is not in the author's lab.)

Assisted-by: LLM (Gemini 4 Neon)

@RyanTheTide
RyanTheTide merged commit 32bf9dd into integration/aurora Nov 22, 2026
8 checks passed
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