Repository navigation
kboot: hand the T8132 AOP over by its properties, not by board (J773g audio) - #418
Conversation
RyanTheTide
left a comment
There was a problem hiding this comment.
No blockers. The handoff is now driven by properties alone, and every refusal still leaves the AOP disabled.
What I checked in dt_set_t8132_aop() (src/kboot.c:9108): with the board list gone, the handoff runs only when the OS tree asks for it in /chosen (linux-enablement-mac,dapf-handoff naming /arm-io/aop), the AOP's ASC can be opened and its CPU is halted, dapf_init_t8132_halted() programs the AOP DART's DAPF from the ADT, the ADT segments reserve, and the DAPF windows reserve. Each of those failing jumps to disable:, so a tree that doesn't ask for the handoff, or a missing ADT node or property, ends with status = "disabled" instead of an AOP enabled without its firmware regions. That is safer than before for any T8132 board outside the old list: those used to keep the AOP enabled with no memory-region, which is exactly the J773g failure. The __EDATA segment goes through the existing dt_reserve_asc_segments(), so no new address logic. Your J773g row (18 memory-region entries, AOP ready, both cards registered, the speaker tone through speakerguardd v2 with protection granted) is the evidence this needs.
Small things, no need to block on them:
- If the DAPF is programmed and a later reservation fails, the reserved-memory nodes already added stay in the tree next to a disabled AOP. That costs nothing at runtime. It would be worth a sentence in the comment so nobody "fixes" it into a half-enabled state.
- The comment above
dt_reserve_t8132_aop_windows()(src/kboot.c:9058) still says "The J713 AOP firmware". "The T8132 AOP firmware" would match the new contract. dt_set_aop_firmware()still chooses the path bychip_id == T8132. That is the SoC's AOP flavour, not a board gate, so it's fine for this PR.
HW row we can add: J713 (M4 Air), same head. Pass: aura logs "AOP handed off with its DAPF and firmware segments", Linux reaches AOP IS READY, the sound cards register as on main. A second boot of the J713 with /arm-io/aop removed from linux-enablement-mac,dapf-handoff should log "disabling the AOP: its handoff was not requested" and boot cleanly.
Assisted-by: LLM (Claude:Opus 5.5)
|
Blockers: 1. The code is right. I re-read
On the existing review's small points: the "J713 AOP firmware" comment at HW row: J713 (M4 Air), this exact head on main, default command line. Pass: "AOP handed off with its DAPF and firmware segments", Linux reaches Assisted-by: LLM (Claude:Opus 5.5) |
7d70783 to
009c4d3
Compare
|
Updated
Assisted-by: LLM (Gemini:4 Neon) |
RyanTheTide
left a comment
There was a problem hiding this comment.
No blockers. Thanks for the update; 009c4d3 is the same base as 7d70783 and the only code change is the comment.
Resolved since our last comment:
- Commit metadata: one human
Signed-off-by, no agent trailer, and the PR body ends with anAssisted-byline. - The comment above
dt_reserve_t8132_aop_windows()(src/kboot.c:9058) now says "T8132 AOP firmware".
Still open (nit, no need to block): if dapf_init_t8132_halted() and the segment reservation succeed and dt_reserve_t8132_aop_windows() then fails, the reserved-memory nodes already added stay in the tree next to a disabled AOP. That is harmless, but one sentence in the comment above dt_set_t8132_aop() (src/kboot.c:9097) would stop someone from later "fixing" it into a half-enabled AOP.
New, about #377 (open, also edits this area), for whichever of the two lands second:
- #377 adds a DART input-range check inside
dt_reserve_asc_segments_at()for everydram_onlycaller.dt_set_t8132_aop()callsdt_reserve_asc_segments("/arm-io/aop/iop-aop-nub", NULL, path, true, 0, true), so the T8132 segments go through that check too. It only applies whendt_device_dart_va_bits()matches the FDTiommusDART to the ADT node'siommu-parent. Here the ADT node isiop-aop-nub, not/arm-io/aop, so the check probably reports "unknown" and changes nothing. If it does match, though,__OS_LOG(whose IOVA is its physical DRAM address) could be reserved as "RAM only" with no IOVA, anddt_set_t8132_aop()would still log that the handoff succeeded. The J773g row was taken without #377. Fix: on the combined tree, check that the J773g/J713 boot log showsDART input range unknown(or a width that covers the log's address) for the AOP, nopast the DART's ... range, RAM onlyline for it, and the same 18memory-regionentries as your row. If it can match, either pass the T8132 path its own flag to skip the range check, or fail intodisable:when a T8132 segment is dropped. - #377 already selects this path by the
apple,t8132-aopcompatible instead ofchip_id == T8132, which settles the third point from our first review once it lands. There is no textual conflict: #377 changesdt_set_aop_firmware(), and this PR changes onlydt_set_t8132_aop().
HW row (unchanged, plus the #377 check): J713 (M4 Air) and the J773g, this head on main (and again with #377 merged if it lands first), default command line. Pass: "AOP handed off with its DAPF and firmware segments", AOP IS READY, the sound cards register as on main (no playback needed), the boot log shows no "RAM only" line for the AOP, 0 failed units, 0 new kernel errors. A second J713 boot with /arm-io/aop removed from linux-enablement-mac,dapf-handoff should log "disabling the AOP: its handoff was not requested" and boot cleanly.
Assisted-by: LLM (Claude:Opus 5.5)
|
No code change since our last review (009c4d3). Please drop the trailing "gfya" commit before merge. #377 has landed on main since then, so this now runs on a tree with the DART input-range check in Rows needed: J713 and J773g, this head on current main, default command line. Pass: the "DART input range unknown" line for the AOP and no "past the DART's ... range, RAM only" line for it, the same 18 Assisted-by: LLM (Claude:Opus 5.5) |
dt_set_t8132_aop() only ran on the J713 and J604 trees and returned early on any other T8132 board, leaving its AOP node enabled with no firmware memory-region. On the J773g (Mac mini), whose tree requests the AOP handoff in linux-enablement-mac,dapf-handoff like the laptops, the AOP driver then fails with "No firmware memory-region from the bootloader" (-ENOENT). Its headphone jack and speaker both run on the AOP's audio service, so the machine has no sound card on either the 26.6.2 or the 27.2 firmware. Everything the handoff needs is a property: the tree's request, a halted AOP, the ADT's firmware segments and the AOP DART's DAPF instance. Drop the board list, as asked in review of #310, and keep every refusal disabling the AOP, so the gate stays fail-closed. The same segment reservation also covers the 27.2 firmware's new __EDATA segment, which sits at its remap address right after __ETEXT (EC0p + 0x8000 on the J773g's 26B123 ADT). Signed-off-by: Diljit Singh <hey@djdev.me>
375b423 to
a7a8067
Compare
|
@RyanTheTide Dropped the trailing Remaining: J713 and J773g hardware rows on current Assisted-by: LLM (Gemini:4 Neon) |
|
Verdict: FINISH, then merge at Rows needed, on the default command line:
This branch is 127 commits behind main, and main now checks ASC segments against the DART's input range. Update the branch first and run both rows at the new head, so the rows cover that check. I moved the description into the What / Tested / Risk / Not yet layout and dropped the attribution line. Nothing else in it changed. Evidence
|
|
Merge readiness at
Areas: none matched in CODEOWNERS Updated by pr-readiness on pushes, edits, reviews and comments, and on a schedule. Rules: merge policy · labels. |
satchlj
left a comment
There was a problem hiding this comment.
Verdict at a7a8067a319b
REQUEST CHANGES — The code change and CI are completely clean, with zero code-level blockers. Holding approval solely on the exact-head J713 and J773g hardware verification rows explicitly noted as pending in the PR description.
Blockers
- Pending exact-head hardware verification (
a7a8067a319b): The PR description marks the J713 and J773g live boot rows asNot yet(Hardware row at head: no), specifically to confirm the post-#377DART input-range checks on real hardware with the allowlist removed. Please post exact-head J713 and J773g boot transcripts ata7a8067a319b(or re-request review once added).
Checked
- Changed files (1): Audited the full 48-line diff in
src/kboot.c. Removing theapple,j713/apple,j604board-compatible allowlist indt_set_t8132_aop()cleanly delegates eligibility to the runtime gates already in place (/chosenlinux-enablement-mac,dapf-handoff, halted AOP state, ADT segments, and DAPF setup), and every failure/refusal path continues to leave AOP disabled. - Metadata & CI:
16/16CI checks passing (SUCCESS); commit carries authorSigned-off-by:. - Untested scope: No live J713 or J773g bootloader hardware test performed during this review; code audit and CI checks only.
Evidence
- Head commit:
a7a8067a319b(1 file changed:src/kboot.c). - CI:
16/16SUCCESS. - Remaining gate: exact-head J713 and J773g hardware boot rows confirming AOP handoff and DART input-range validation.
|
@DjDeveloperr this code has been ready since your own 11-24 FINISH. The only things satchlj's change request holds on are the two rows, so let's split them:
Once both are posted I'll ask satchlj to re-review and request the App verdict at head. |
|
J713 (M4 Air) row at
@satchlj, this covers the J713 half of your row blocker. The J773g row is still open with @DjDeveloperr. |
There was a problem hiding this comment.
Verdict: MERGE at a7a8067 after the J773g peer and human re-review
The handoff is selected by the OS tree request and the ADT resources. The J713 trial exercises the integrated AOP handoff: the production memory-region count is preserved, audio devices and v2 protection register silently, and the configured Stage 2 was restored. This closes the J713 ask. Keep the J773g input-range coverage and existing human change request disposition.
|
Merging under the 6-point rule at
Thanks @DjDeveloperr. @satchlj, the remaining row is tracked in #572. @DjDeveloperr, if you can run the J773g one-shot on main, post it there. Revert: |
) src/kboot.c: aurora-silicon#418 dropped the J713/J604 board list from dt_set_t8132_aop() too. Keep this branch's reserve-then-program transaction and main's comment (with __EDATA and the J773g contract), reworded for the new order. Signed-off-by: Ryan Murray <81541646+RyanTheTide@users.noreply.github.com>
What:
dt_set_t8132_aop()ran the AOP handoff only on the J713 and J604 trees. The Mac mini (J773g) tree requests it too, so its AOP came up with no firmwarememory-region, the driver failed with -ENOENT, and neither the speaker nor the headphone jack card bound. Decide the handoff by its properties (the tree's request, a halted AOP, the ADT's segments and the AOP DART's DAPF instance) instead of the board; every refusal still disables the AOP.Tested: J773g (M4 mini) on 27.2 (26B123) firmware, with this patch on its 27.2 Linux route stage: AOP handed off with 18
memory-regionentries,AOP IS READY, both sound cards register, jack PCM runs at 48 kHz, one 3 s speaker tone through speakerguardd v2 at 5% volume with 0 frames over capacity. Host suite and builds clean, CI green.Risk: two-way · M4 (T8132): J713, J715, J604, J773g, J623, J624
Not yet: J713 and J773g rows built from this head on current main, which now checks AOP segments against the DART's input range. The J715 and the iMac (J623/J624) trees also request the handoff and have no row.
Details
dt_set_t8132_aop()only runs the AOP handoff on the J713 and J604 trees. On any other T8132 board it returns early and leaves the AOP node enabled with no firmwarememory-region. That includes the Mac mini (J773g), whose tree requests the handoff inlinux-enablement-mac,dapf-handoffjust like the laptops.On the J773g, Linux then logs
apple_aop 390c00000.aop: No firmware memory-region from the bootloaderand the probe fails with -ENOENT. Both of its sound cards, the headphone jack and the speaker, sit on the AOP's audio service, so neither ever binds.snd-soc-macaudiokeeps returning -EPROBE_DEFER forsoundandsound-jack. We measured this on the 27.2 (26B123) firmware boots dcp4 and dcp7 on 11-20; aura printed only the motion calibration lines for the AOP.Everything the handoff needs is a property: the tree's request, a halted AOP, the ADT's firmware segments and the AOP DART's DAPF instance. This PR drops the board list, which is what Ryan asked for in review of #310 (#310 (comment)), and keeps every refusal disabling the AOP, so the gate stays fail-closed.
The existing segment reservation also covers the new
__EDATAsegment in the 27.2 AOP firmware. In the J773g's 26B123 ADT:__ETEXTremaps to EC0p (0x10000000000, size 0x8000).__EDATAremaps to0x10000008000(size 0x2000, reserved as 0x4000).__OS_LOGstays at its physical address.On the kernel side, linux
60f279c2andb224fde7(astaff, already on integration/aurora) validate that region and patch the firmware'sED0pboot argument. The 26B123j773gaopimage has a single 8-byteED0pentry.Supersedes #310, which was stacked on #113 and pinned to the J773g's 26.6.2 path. #113 changes the same gate by property as part of its larger series; whichever of the two lands second only has to drop the duplicate hunk.
Evidence
tests/pythonsuite gives 834 passed and 10 failed. The same 10 tests (test_m3_defaults_optout,test_loadobjs,test_universal_boot) also fail on the unpatched base.git clang-format --diff HEAD~1reports nothing to change.USE_CLANG=1 BUILDSTD=1 RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1on main. Separately, the same commit on top of the J773g 27.2 Linux route stage (e2d4731) withCHAINLOADING=1, where onlykboot.odiffers from the base build (plus build-tag objects).dapf: Programmed 16 T8132 DAPF slices for /arm-io/dart-aop,ADT: segment asc-firmware@10000dc4000 uses non 16k aligned size: 0x002000(__EDATA),15 AOP DAPF windows reservedandAOP handed off with its DAPF and firmware segments.memory-regionentries:__ETEXTat EC0p,__EDATAat 0x10000008000,__OS_LOGand 15 DAPF windows. With linux 60f279c2 + b224fde7 the driver logsValidated external data region at IOVA 0x10000008000, size 0x4000, then===( AOP IS READY )===.AppleJ773g(speaker) andAppleJack. Before, they returned -EPROBE_DEFER forever.