Skip to content

kboot: hand the J773g's AOP over to the OS (stacked on #113) - #310

Open
DjDeveloperr wants to merge 5 commits into
mainfrom
j773g/aop-handoff-20261119
Open

DjDeveloperr wants to merge 5 commits into
mainfrom
j773g/aop-handoff-20261119

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Summary

Stacked on #113 (techmore's J773g gates). Only the last commit, kboot: hand the J773g's AOP over to the OS, is new; review that one.

#113 disables the AOP on every T8132 board except the J713 and J604. The J773g's tree states the same handoff contract (linux-enablement-mac,dapf-handoff lists /arm-io/aop), and its 26.6.2 ADT has the same AOP, DART and segment layout. Its headphone jack's audio runs on the AOP, as on the M4 Pro Mac mini, so with the AOP disabled the Mac mini has no sound card.

This qualifies a live J773g (kboot_is_j773g()) for the same handoff: DAPF, firmware segments and windows, with every refusal still disabling the AOP. The host test runs the J773g through the qualified path, refusals included. A J773g tree on any other machine still ends disabled and untouched. The updated test fails on #113 as it is and passes with this commit.

Testing (owner's Mac mini J773g, 26.6.2 stub, 2026-11-19)

The tested Stage 2 was the boot-HDMI test series (fdf6510) plus #113 (without its AOP-disable commit, whose effect this commit replaces for the J773g), #199, #258 and this handoff (1.0.0b13-g963eb02c). It ran as an aura-try trial with a J773g tree that describes the jack (linux#2236).

  • Linux: apple_aop 390c00000.aop: RTKit: syslog message: SPU_init.cpp:373: ===( AOP IS READY )===. Before, it was No firmware memory-region from the bootloader with probe -2.
  • card 0: AppleJack [Mac mini J773g Jack]. A sine speaker-test on the jack ran to completion with no kernel errors; nothing was plugged in, so it was not heard.
  • kboot: T8132 USB3 calibration, AOP handoff and absent-ISP rule by ADT property #113's USB3 calibration copy, from the same boot: no T8132 calibration incomplete, USB2 only on any of the four PHYs. Stock linux-aurora on stock aura showed it on all four.
  • Host tests: test_t8132_aop_gate.py, test_j773g_board_gate.py and test_j713_aop_dapf.py pass. The branch builds (USE_CLANG=1 BUILDSTD=1 RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1).

🤖 Generated with Claude Code

techmore and others added 5 commits November 7, 2026 15:57
The J773g admissions that follow were checked against one J773g ADT,
that of macOS 26.6.2: target-type J773gAP, board-id 0x2a, chip-id
0x8132 and iBoot mBoot-18000.161.10. Add kboot_is_j773g(), which is
true only when the live ADT, the OS firmware and the OS tree all match
that: the root compatible J773gAP, board-id 0x2a, os_firmware 26.6.2,
and an OS tree that is both apple,j773g and apple,t8132. A J713 tree on
a Mac mini, a Mac mini on 26.7, or any other T8132 board fails it.

It goes in a new kboot_t8132.c, which the T8132 rules that follow
share: kboot.c's code is linked into Stage 1's .init slot (aura-raw.ld),
which has 96 bytes left in the GCC build. The host test breaks each of
those facts in turn.

Booted six times on one J773g (26.6.2, Stage 1 1.0.0b8), loaded into RAM
through the Stage 1 proxy: each time the gate admitted the machine (the
USB3 calibration copy that uses it later in this series ran). A J713 or
a non-26.6.2 boot was not run.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The T8132 USB3 bundle (apple,tunable-usb3-*, the lane groups and the
optional AUX group) was copied only for the J713 and the J604. On
every other T8132 board the T8132 PHY nodes fell through to the older
t8122 tunable path, whose properties the T8132 PHY driver does not
read.

The J773g's 26.6.2 ADT has all 27 groups of the bundle and
tunable_AUX_TOP on each of atc-phy0..3 (compatible atc-phy,t8132), and
every record is a 32-bit write inside its group's window. Most groups
are byte for byte the J713's; the AUSPLL core, CIO3 PLL core, AUSCMN
SHM and both lanes' RX EQ groups are the machine's own. The J773g tree
describes atcphy0..3 as apple,t8132-atcphy with aliases.

Copy the bundle on a live J773g on 26.6.2 too. The copy is unchanged:
a missing or malformed required group still removes the whole bundle
and leaves USB2. This only fills properties: whether a port runs USB3
stays the tree's choice.

The existing J713 fixture exercises the T8132 USB3 copy and rejection
path. There is no J773g fixture: J773g-specific calibration data is not
covered by a host test.

Booted six times on one J773g (26.6.2, Stage 1 1.0.0b8): the tree
Linux received carried the bundle (seven apple,tunable-usb3-*
properties) on each of atcphy0..3. USB3 link speed was not tested.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
dt_set_t8132_aop() returned early on every T8132 board but the J713
and the J604 and left the OS tree's AOP node as it found it. The shared
M4 trees (t8132-jxxx.dtsi, so the J623, J624 and J773g) enable the AOP,
its DART and its mailbox, and ask for its handoff in
linux-enablement-mac,dapf-handoff, on the promise that the loader
"programs the AOP DART's DAPF and reserves its firmware and DAPF
windows ... or disables the AOP". On those boards aura did neither, so
Linux started an AOP whose DAPF was empty and whose __ETEXT and
__OS_LOG were not reserved.

Disable the AOP there, as the J713 and J604 path already does on any
failure, without reading the AOP or programming its DART. The J713 and
J604 path is unchanged.

The new host test runs the production gate on J713 and J604 trees
(handoff, every refused step, a running AOP, no request) and on J623,
J624, J715 and J773g trees with and without the request: the AOP ends
disabled and nothing touches it.

The shared source DTS enables the AOP, but the shipped 26.6.2 J773g OS
DT used for the normal boots has it disabled; the TEST-DTB boot changed
that node to `okay` and observed it return `disabled`. Booted on one
J773g (26.6.2) with a test tree that enables the AOP: Linux received the
AOP disabled and its DART as the tree had it. Not booted on the J623,
J624 or J715.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The J773g (Mac mini) has no camera: its 26.6.2 ADT has no isp, isp0 or
dart-isp node. t8132.dtsi describes the ISP and its three DARTs
disabled and the J773g tree leaves them so, but nothing in aura held
that: the J713 handoff only runs on the J713, and dt_set_isp() acts
only through an "isp" alias. A tree that enabled the ISP would have the
OS probe a camera and ISP power domains that are not there.

On T8132, when the ADT has neither isp nor isp0, disable every enabled
apple,t8132-isp node and the DARTs in its iommus list that no other
node uses. A tree that already leaves the ISP disabled is not changed,
and a Mac whose ADT has an ISP (the J713) is not touched.
The rule goes in kboot_t8132.c, out of Stage 1's full .init slot.

It runs before dt_set_isp(). On such a Mac that step cannot reserve
the ISP firmware and disables the node the isp alias names, but not its
DARTs; run after it, the rule would find the ISP already disabled and
leave those DARTs enabled.

The host tests cover an enabled ISP, a disabled one, a DART shared
with another device, a malformed iommus list, a Mac with isp or isp0
in its ADT, and another SoC. A second test runs the real dt_set_isp()
and the rule in kboot_prepare_dt()'s order.

Booted on one J773g (26.6.2) with a test tree that adds an enabled ISP
over three DARTs, one of them also used by another node: Linux received
the ISP and its two unshared DARTs disabled and the shared DART enabled.
The shipped 26.6.2 J773g OS DT used for normal boots has no ISP node;
the TEST-DTB boot added an enabled one.

Assisted-by: LLM
Signed-off-by: Sean Dolbec <sdolbec1@gmail.com>
The J773g tree states the same AOP handoff contract as the J713
(linux-enablement-mac,dapf-handoff lists /arm-io/aop), and its 26.6.2 ADT
has the same AOP, DART and firmware segment layout. But only the J713 and
J604 were qualified, so the Mac mini's AOP ended disabled. Its headphone
jack's audio runs on the AOP (the M4 Pro Mac mini's does too), so the
machine had no sound card.

Qualify a live J773g (kboot_is_j773g()) as well. The host test now runs
the J773g through the qualified path, every refusal included, and a J773g
tree on any other machine still ends disabled and untouched.

Signed-off-by: Diljit Singh <hey@djdev.me>
@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

The format-check failure here comes from src/sptm_virt_s2r.c, which this PR doesn't touch (main's own code under clang-format 20.1.8). This PR's own files pass. 🤖 Generated with Claude Code

@RyanTheTide

Copy link
Copy Markdown
Contributor

Thanks for the J773g AOP handoff.

Like #113 underneath it, this admits the handoff through kboot_is_j773g() (src/kboot.c:9035; the predicate at src/kboot_t8132.c:26-31 checks board-id 0x2a, J773gAP, OS 26.6.2 and the tree compatible) next to the existing apple,j713/apple,j604 list. We select behaviour by a hardware property, not by the boards it was tested on.

The handoff's needs are all in the ADT: the AOP's __ETEXT/__OS_LOG segments and its DAPF instance. Could dt_set_t8132_aop() run on any T8132 tree whose ADT AOP node has those (still disabling the AOP on any failure, which keeps it fail-closed), and drop the board list and the OS-version pin? A board that must stay off can carry a comment with the reason.

@techmore

Copy link
Copy Markdown
Contributor

#113 at 53be8212 removes the AOP board list and kboot_is_j773g(), which this PR is built on; the J773g now reaches the same handoff by property (tree request, halted AOP, ADT segments and DAPF).
On our J773g (27.2 stub, 2 boots) the loader completes the handoff, but that kernel has no AOP driver and nothing started the AOP; your 26.6.2 run is the only one where the firmware came up (AOP IS READY).

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.

3 participants