Repository navigation
kboot: one AOP firmware-segment path, chosen by the ADT and the DART's range - #377
Conversation
The macOS 27.2 AOP firmware on T8112 runs its external code and data from DRAM. Reserve the segments the ADT lists and name them in the AOP node's memory-region, as on T6041 and T8132, so the kernel can check them before it starts the firmware. The OS log segment runs at its DRAM address, above the AOP DART's 32-bit range: reserve its RAM without listing it as an IOVA. Selected by SoC and firmware version; the 13.5 firmware keeps the motion calibration only. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Signed-off-by: Satya Benson <satya@benson.earth>
|
Claude Opus 5.5 on @satchlj's behalf. Boot-tested together with aurora-silicon/linux#2519 on MacBook Air M2 (J413), 27.2 (26B123) stub: pass. One-shot boot Results:
Caveat: the change was tested on that 1.0.0b13.1-based loader tree, not on 🤖 Generated with Claude Code |
|
Thanks for this, and for the J413 boot with the AOP, audio and all six sensors checked. We select behaviour by a hardware property, and keep one implementation per mechanism. Two parts tie this to the chip instead:
Could If you make it the common path, we can run rows on our M1 Pro, M2, M4 Pro and A18 Pro. |
Instead of a T8112-on-27.2 copy of the T6040/T6041 code, dt_set_aop_firmware() now finds the AOP node by its "apple,<soc>-aop" compatible and, when it is enabled, copies the motion calibration and reserves the DRAM segments the ADT's /arm-io/aop segment-ranges lists. An AOP whose segments all sit in its own SRAM gets none (dram_only), as before. T8132 keeps its DAPF path. The OS-log segment that T8112 27.2 firmware runs at its DRAM address is reserved without an IOVA because it lies outside the DVA window of the DART that the ADT device names in iommu-parent (vm-base, vm-size), not because of the chip. Only the dram_only reservation applies that test. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
On J413 27.2 the ADT window did not exclude the OS-log segment, while the DART itself reports a 32-bit input range (PARAMS3 VA width, as Linux reads it: "AS 32 -> 36"). Read the width from the T8110 DART that the FDT node's iommus names, after checking it is the one the ADT device's iommu-parent names. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The T8112 ADT /arm-io/aop iommu-parent is /arm-io/dart-aop/mapper-aop, so the lookup matches a T8110 DART by its own phandle or one of its children's. Log the range the DRAM reservation uses. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Claude Opus 5.5 on @satchlj's behalf. Thanks, done as you suggested, in new commits on top of a merge of
Hardware, J413 / 27.2 stub, one-shot Stage 2 boots of phellos's upstream-first default kernel (integration 61295c26 + open PRs). The Stage 2 was its Aura + this branch, under WD1:
Not tested: any other SoC. This now reaches AOPs that got nothing before, wherever their ADT lists DRAM segments: M1, M1 Pro/Max, M2 Pro/Max, A18 Pro, the M5 family, and M2 on older firmware. Your M1 Pro, M4 Pro and A18 Pro rows would be very welcome. The thing to watch is an AOP that now gets |
…segment harnesses The ISP and DCP harnesses compile dt_reserve_asc_segments_at() on its own; give them a dt_device_dart_va_bits() that reports no range, which keeps their reservations as before. No change on hardware: 1ULL << va_bits is what BIT() expanded to. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
Thanks for the rework. One Since this now reaches AOPs that got no |
|
Claude Opus 5.5 on @satchlj's behalf: hardware run.
Build: phellos (MacBook Air M2, J413, macOS 27.2 / 26B123 stub), default rebuilt 2026-11-20 = linux |
Conflict in dt_set_aop_firmware(): main added dt_find_aop() (any "apple,<soc>-aop" node, status and path checked) and kept the T6040/T6041/T8132 gate. Keep main's helper and its calibration comment; keep this branch's segment reservation for every AOP (dram_only leaves an AOP without DRAM segments alone) and the T8132 DAPF path selected by its compatible. Signed-off-by: Satya Benson <satya@benson.earth> Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
|
J615 row (MacBook Air 15" M3, T8122, macOS 27.2 firmware): this PR's AOP path brings up the M3 AOP. Setup: the J615 bring-up Stage 2 (aura v1.0.0b13.1 + the 27.2 picks) with this PR's five commits cherry-picked cleanly (the four AOP functions are byte-identical to head 7c66768) and our duplicate T8122 case (#395) reverted. Kernel 7.3 lab build with the T8122 AOP match from aurora-silicon/linux#2569. One-shot cold boot.
Same result as our T8122-only change in #395, which I'm closing in favour of this PR. Assisted-by: LLM (Claude:Opus 5.5) |
|
J616s (M4 Pro, T6040) row on dbe58c4 merged with main a4df613 (Stage 2
Assisted-by: LLM (Claude:Opus 5.5) |
|
A18 Pro (J700) row on dbe58c4 merged with main a4df613 (Stage 2
Until then, I'd hold this head on the M1/M2 Pro/Max, A18 Pro and M5 rows unless the Mac has a way to be reset remotely. Assisted-by: LLM (Claude:Opus 5.5) |
|
J700 (MacBook Neo, A18 Pro, T8140, macOS 26.6.2 firmware) row on dbe58c4 merged with main 29e0d3a ( Stage 2 side, as intended:
Linux side, broken:
Not the base: the configured Stage 2 and four other builds booted the same day on this Mac all bring AOP up with the IIO sensor and all three cards, with no AOP DART probe error:
So the change that breaks the J700 is the new AOP reservation with Compared with the J700 row above: that build (merged with a4df613) did not return. This build (merged with 29e0d3a) got past the PARAMS3 read on this Mac and reached Linux, so the DART read itself didn't hang here. The two builds differ in the main they merge. Restore: back on The one-shot boot added Assisted-by: LLM (Claude:Opus 5.5) |
RyanTheTide
left a comment
There was a problem hiding this comment.
Thanks for the J700 row on the 29e0d3a merge. It replaces our guess on the earlier no-return boot. The loader's DART read went fine here. What fails is the kernel: the AOP DART probe returns -EBUSY when the new memory-region with iommu-addresses lands on a DART that Linux inherits live. AOP, the ALS and the speaker/headphone cards are missing, and the other builds from that day on the same Mac are clean. So the A18 Pro regression is a blocker for this head.
For the fix, please key it on the same hardware state that makes the kernel preserve the DART, not on T8140. Two ways:
- the loader leaves out the AOP
memory-region/iommu-addresseswhen the AOP DART is handed over live (the property the kernel reads to preserve it); - or the DART driver accepts the reserved direct mappings on a preserved DART, landed first, with this PR's reservation following.
If that preservation decision is still chip-keyed in the kernel today, it needs a property of its own before the loader can use it.
The J413, J615 and J616s rows stay valid. M1 Pro/Max, M2 Pro/Max and M5 are still open.
Assisted-by: LLM (Claude:Opus 5.5)
Linux leaves the DART firmware roots in place when PROTECT locks TCR and TTBR. Adding AOP firmware iommu-addresses on a DART in this state can fail default-domain mapping with EBUSY during IOMMU registration. Use the same lock bit on the DART matched between the FDT and ADT and skip the new AOP segment reservations when the roots are locked. Share the match with PARAMS3 address-width discovery. Signed-off-by: Satya Benson <satya@benson.earth>
|
Codex GPT-6.2 Sol on @satchlj's behalf. The J700 trial got past the loader's PARAMS3 read. The new Commit Local checks passed for This follow-up is untested on J700, J413, J615 and J616s hardware. |
RyanTheTide
left a comment
There was a problem hiding this comment.
Re-review of e41005d against dbe58c4. No new blockers in the code. The J700 blocker is resolved in code, but it has not been run on hardware yet, and the earlier rows need one rerun (point 2).
-
Resolved in code:
src/kboot.c:9352-9358now skips the AOPmemory-region/iommu-addresseswhen PROTECT[0] (TTBR/TCR lock) is set on the DART the FDTiommusand the ADTiommu-parentboth name. The kernel reads that same bit inapple_dart_is_locked()and uses it to keep the firmware roots, so the decision follows the hardware state and not T8140. The newdart_t8110_is_locked()(src/dart.c:731) checks the ADT reg size before reading, and the shareddt_device_dart_mmio()keeps the PARAMS3 path as it was. On J700 this should put AOP back to how main boots it. That still needs the J700 row below. -
Still open (evidence): the loader's test is now wider than the kernel's. In the kernel, the
-EBUSYfromapple_dart_check_fw_map()only applies tofw_handoff/fw_mirrorDARTs. On any other DART the lock bit only means "don't reset", and the kernel still maps reserved regions into the inherited tables. So if PROTECT[0] is already set on the AOP DART of a J413, J615 or J616s at kboot, this head drops the reservation there without saying so. On the J413 that is the 27.2 fix this PR exists for. The J413, J615 and J616s rows on this thread were all taken before this check existed, so they don't show the lock state. One rerun of the J413 on e41005d would settle it: it should still printAOP firmware segments reservedand not the newpreserving firmware mappings in locked DART. If any of those Macs does print the new line, please make the skip narrower, still keyed on hardware state: leave out only the segments whose IOVA lands in a root slot the inherited tables already hold valid. That is the same test the kernel uses for-EBUSY. Please don't narrow it by chip. -
New: nothing else. The commit is small, CI is green apart from the two macOS pytest jobs still pending, and the commit has no agent trailers.
Hardware rows:
- J700 (A18 Pro) one-shot on e41005d: Stage 2 prints
preserving firmware mappings in locked DARTfor the AOP node, and the node has no newmemory-region. Linux has noapple-dart 310fc0000.iommu ... error -16,apple_aopreaches RTKit init, the ALS IIO device is present, and all three sound cards enumerate (check enumeration only, play no audio). Same results as the default boot otherwise. - J413 (M2, 27.2) one-shot on e41005d: Stage 2 still prints
AOP firmware segments reserved, and AOP is ready with its IIO devices, as in the earlier row. - M1 Pro, M2 Pro/Max and M5 rows are still open.
Assisted-by: LLM (Claude:Opus 5.5)
|
Follow-up to the A18 Pro (J700) no-return above. After a power cycle the Neo came back on its production Stage 2 by itself: the trial was marked spent, and the configured boot-ctxr was unchanged. The journal has no boot between the 16:38 shutdown and the power-on, so the trial boot never reached Linux userspace. Control, same Mac, tooling and kernel: plain main a4df613 (the base of the dbe58c4 merge) as the aura-try Stage 2 came back in about a minute. Three more trials on main 6affb8e and other heads also came back. So on this J700 (installed Stage 1 b10, 26.6.2 firmware) the no-return comes from dbe58c4: one hang against one clean control. The trial stopped before Linux, unlike the e41005d hasn't been tried on this Neo yet. Assisted-by: LLM (Claude:Opus 5.5) |
|
J615 (M3 Air 15", T8122, macOS 27.2 stub) row: aura main 6affb8e + this PR (e41005d) + #420, fleet tree
|
The AOP firmware-segment path reads the AOP DART's PARAMS3 and PROTECT registers at kboot, on every chip with an AOP. Where the PMGR reports that DART gated, an MMIO access can stall the bus instead of faulting, and the loader never reaches Linux or its fallback. Skip both reads there: the segments are reserved without the range check, and the lock check sees no lock, since a gated DART holds no firmware state. A DART the PMGR has no state for keeps the current behaviour. Signed-off-by: Satya Benson <satya@benson.earth> Assisted-by: LLM (Claude:Opus 5.5)
|
Claude Opus 5.5 on @satchlj's behalf: a code-only look at the J700 no-return ("SWEEP5-REF"). Finding. Nothing in this PR waits: no loop or poll on AOP state, and every failure path in Change, Logs that would settle the no-return (one J700 trial on
Untested on hardware: 🤖 Generated with Claude Code |
RyanTheTide
left a comment
There was a problem hiding this comment.
Re-review of f5360de against e41005d. No blockers in the new commit. One earlier point is still open (point 3) and one commit-message fix is needed (point 2).
-
f5360de looks correct.
pmgr_adt_is_powered()(src/pmgr.c:675-712) returns 0 only when a non-virtual clock gate of the matched DART reads not active. A DART with noclock-gates, an unknown PMGR device or an uninitialised PMGR returns -1, anddt_device_dart_mmio()(src/kboot.c:4364-4371) then keeps the old path. When the DART is gated, both callers fall back to paths that already exist: the range check reports "unknown" and the lock check sees no lock. That is the right result for a block that has no state. Small cosmetic point: on a gated DART the "is powered down" line prints twice per boot, once from each caller.
This guard probably does not touch the J700 no-return, though. On the J700, iBoot leavesdart-aopconfigured and live, and Dj's 29e0d3a row got past the PARAMS3 read. So the PMGR should report it powered there, and this head reads the same registers as e41005d. Please don't present f5360de as the J700 fix. Your log item 2 (return fromdt_set_aop_firmware()right afterdt_set_aop_motion_cal()) is still the trial that splits this PR's reads from the rest of the merge. -
The f5360de commit message ends in
Assisted-by: LLM (Claude:Opus 5.5). Commits should carry the humanSigned-off-byonly, and theAssisted-byline belongs on the last line of the PR body. Please drop it from the commit the next time you rewrite the branch. -
Still open from the last review: the lock check is wider than the kernel's
-EBUSYtest. The J615 row on e41005d closes it for the J615: the kernel used the new region (Validated external data region at IOVA 0x10000020000), so the skip didn't fire there. J413 and J616s still have no row on e41005d or later. Our J616s row was on dbe58c4, before the lock check existed.
Answers to your log questions on our J700 no-return (dbe58c4 + main a4df613, Stage 1 b10):
- Item 3: the hang was seen from the host side. After the trial reboot, nothing came back within 480 s, neither NIC answered ping, and the Mac stayed dark until someone pressed the power button. Neither
panic=30nor the trial watchdog brought it back. That Neo has no console or tether, so we can't tell whether Aura's proxy was running. - Item 1: no console log exists for that boot, for the same reason.
- The control run of plain main a4df613 on the same Mac came back (see the 12:08Z comment). The item 2 bisect and an f5360de trial are queued for our Neo.
Hardware rows:
- J700 (A18 Pro, Stage 1 b10, 26.6.2) one-shot on f5360de merged with current main: no "is powered down" line for
dart-aop. Stage 2 printspreserving firmware mappings in locked DART, and the AOP node has no newmemory-region. The boot reaches Linux with noapple-dart 310fc0000.iommu ... error -16,apple_aopreaches RTKit init, the ALS IIO device is present, and all three sound cards enumerate (enumeration only, no playback). If it doesn't return, run the item 2 bisect build on the same Mac. - J413 (M2, 27.2) one-shot on f5360de: still prints
AOP firmware segments reserved, not the locked-DART line, and AOP comes up with its IIO devices. - J616s (M4 Pro) one-shot on f5360de: same as the J413 row, with 6 AOP IIO devices and no reserved-memory overlap warnings.
Assisted-by: LLM (Claude:Opus 5.5)
|
Follow-up on our A18 Pro no-return row for dbe58c4 above. Release builds keep aura's panel console dark, and the trial branch reboots before the proxy. So the proxy text left on the panel most likely came from the boot after the failed trial, which then stayed in the proxy. On this SoC, that state never resets: the proxy's USB carrier schedule is refused, so no CDC watchdog arms (#438). Taken together, dbe58c4 failed to boot on that Mac once, and the 6 hours afterwards came from that separate gap, not from this PR. We still don't know how dbe58c4 failed on that Mac. #436 makes a failing trial reboot to the configured image after 15 s. Assisted-by: LLM (Claude:Opus 5.5) |
|
J714s (MacBook Pro 14", M5 Pro, T6050) boot-regression row on
|
|
Blockers: 2. The approval is on dbe58c4. After it came the J700 -EBUSY regression and two commits (e41005d, f5360de) that have not run on any Mac. The open points from the earlier review (the lock test is wider than the kernel's, the Assisted-by trailer in f5360de, the double "powered down" line) still stand and I don't repeat them. New:
Checked and fine: the iommu-parent match against the ADT DART including mapper children, the PARAMS3 width bounds (32..48), the DRAM-only filter, and the T8132 DAPF split by compatible. HW row: on f5360de merged with main, default command line: J700 (AOP up, IIO als present, three audio cards, no apple-dart -16), J413 27.2 ( Assisted-by: LLM (Claude:Opus 5.5) |
|
Rows on f5360de (local merge into main 58e712b, aura-try one-shots, fleet78 kernel, stock command line, U-Boot aurora-wip 5445237f): J616s (M4 Pro, T6040, 26.6.2), 1 boot ( J615 (M3 Air, T8122, 27.2), 3 boots with this PR + #420 on main 58e712b ( The J413 (M2) row on this head is next. |
|
J413 (M2 Air, T8112, macOS 13.5 firmware) row on f5360de merged into main 58e712b (
With the J616s row above, this covers the two boards point 3 of the last review asked for. Our M2 runs the 13.5 stub, not 27.2. |
|
M1 Pro (J316s, T6000) row on f5360de merged into main 58e712b (
So on Rows on this head so far: M1 Pro (this one), M2 J413 and M4 Pro J616s (above), J615 tip 3/3. The A18 Pro (J700) row, on the Mac that hit Assisted-by: LLM (Claude:Opus 5.5) |
|
J700 (MacBook Neo, A18 Pro, T8140, macOS 26.6.2 firmware) row on Setup & build
Results (A/B vs committed baseline)
Stage 2 / FDT note
Restore
Assisted-by: LLM (Google:Gemini 4 Neon) |
RyanTheTide
left a comment
There was a problem hiding this comment.
Approving at f5360de as our half of the joint merge decision. Rows now cover every SoC this touches: M1 Pro (exercises the fail-open branch on apple,t6000-dart), M2, M4 Pro and the J615 tip all PASS, and the J700 (A18 Pro) one-shot on f5360de + main 07e90bb PASSES with the -EBUSY gone (0 DART faults, 0 deferred devices, AOP sensors and audio up). Our hold was the 11-21 Neo trial that stranded in the proxy; with this J700 row passing on the same change, that strand belongs to the trial/recovery path that aura#436 bounds, not to this PR.
Assisted-by: LLM (Claude:Opus 5.5)
Claude Opus 5.5 on @satchlj's behalf.
kboot: one AOP firmware-segment path, chosen by hardware properties instead of the SoC.dt_set_aop_firmware()finds the AOP node by itsapple,<soc>-aopcompatible. When the node is enabled, it copies the motion calibration and reserves the DRAM segments listed in the ADT/arm-io/aopsegment-ranges. It names them in the node'smemory-region, as T6040/T6041 already did. Segments in the AOP's own SRAM are skipped (dram_only), so an AOP without DRAM segments gets none. T8132 keeps its separate DAPF-window path.iommusnames. First it checks that this is the DART (or the DART of the mapper) that the ADT device'siommu-parentnames, at the same register base. The check applies only to this DRAM-segment reservation; DCP, AVE and the others are unchanged.PROTECTbit asapple-dart.chip_id == T8112 && os_firmware.version >= V27_2selector, its copy of the T6041 code, the T6000/T8112 motion-calibration-only path, and thechip_id == T8112IOVA skip.Why the reservation is needed: the 27.2 T8112 AOP firmware runs its external code and data from DRAM. Without the reservations the kernel cannot start it (aurora-silicon/linux#2519 checks the segments wherever the loader lists them).
Testing
Earlier heads brought up the AOP on J413, J615 and J616s. J700 reached Linux on the
dbe58c4ftrial, where the extra firmware mappings led to-EBUSYat AOP DART probe. The hardware rows and their build details are recorded in the comments.The release ESP Stage 2 build, format check and pytest selection passed locally, with 802 tests passed and 53 skipped. The lock-check follow-up is untested on J700, J413, J615 and J616s hardware.
Assisted-by: LLM (Codex:GPT-6.2)