Skip to content

arm: apple: reference m1n1's J713 AOP reservations from the OS tree - #13

Merged
RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
erikwb:j713/aop-import
Oct 29, 2026
Merged

RyanTheTide merged 1 commit into
aurora-silicon:aurora-wipfrom
erikwb:j713/aop-import

Conversation

@erikwb

@erikwb erikwb commented Oct 25, 2026

Copy link
Copy Markdown

Companion to aurora-silicon/m1n1#47: m1n1 now hands the J713 AOP over with its DAPF programmed, and its firmware segments and DAPF windows reserved in the control tree AOP's memory-region.

The importer already copies those reservations. This change makes it reference them from the OS tree's AOP, or disable the AOP there when m1n1 did not hand it over.

  • An OS AOP with its own memory-region (older kernels, whose driver programs the DAPF itself) keeps it.
  • An OS tree without an AOP: the reservations lose their owner tuple, as for an omitted display, instead of failing the import.

Host test: test_j713_aop_handoff covers:

  • a handoff;
  • an AOP m1n1 disabled, or never had;
  • a malformed reference (refused transactionally);
  • an OS tree with its own regions;
  • an OS AOP at another path;
  • an OS tree without an AOP.

Removing each part of the change makes the test fail.

Hardware: tested on a J713 with that m1n1 and the reworked aurora-silicon/linux#434. The AOP gets the 17 regions, starts, and audio works.

m1n1 now hands the J713 AOP over as on T6040: it programs the AOP DART's
DAPF, reserves the firmware segments (__ETEXT, and __OS_LOG, which iBoot
places anew at every boot) and the DAPF windows, and lists them in the
control tree AOP's memory-region, or disables the AOP. The importer
already copies those reservations; reference them from the OS tree's AOP
too, or disable the AOP there when m1n1 did not hand it over.

An OS tree whose AOP lists its own memory-region (older kernels, whose
driver programs the DAPF itself) keeps it. In an OS tree without an AOP,
the reservations have no owner, as for an omitted display.

The host test covers a handoff, an AOP m1n1 disabled or never had, a
malformed reference (refused without changes), an OS tree with its own
regions, an OS AOP at another path and an OS tree without an AOP.

Tested on J713 (MacBook Air 13" M4) with that m1n1 and a kernel taking the
T6040 AOP path: the AOP gets the 17 regions and starts, and the
microphones, headphone jack and speakers work.

Signed-off-by: Erik Bourget <[email protected]>
@erikwb

erikwb commented Oct 25, 2026

Copy link
Copy Markdown
Author

Clarification from further testing: this is only needed on the per-kernel DTB path (a devicetree line, or a UKI .dtb with the u-boot,j713-dtb-source marker).

On the bundled path, the kernel boots on m1n1's control tree, which already has the AOP's memory-region from m1n1#47. That's how an Omarchy install boots: its UKI has no .dtb section.

I tested a J713 that way with U-Boot built from the uboot-aurora recipe (7680260, without this change): the AOP starts and audio works.

Without this change, a per-kernel J713 DTB boots with the AOP refused ("No firmware memory-region from the bootloader"). That's safe, just without audio. So this is for development setups that boot per-kernel DTBs, not a blocker for installs.

@RyanTheTide

RyanTheTide commented Oct 25, 2026 •

Copy link
Copy Markdown
Contributor

The new AOP import runs on the transaction's scratch tree, translates memory-region phandles, disables the destination AOP when no valid control-tree handoff exists, and preserves an older OS tree's own regions. An omitted OS AOP loses its owner tuple. The importer remains explicitly J713/T8132-gated.

The Apple build passed, and the public importer host tests passed 5/5 with one private-capture test skipped. The supplemental sandbox build also passed after supplying compatible host tools in the task prefix. Its ut all run failed in bootflow/device-order tests and then aborted on a dlmalloc assertion; it is not a full sandbox-suite pass. The log is retained, and that broader suite still needs a clean run or a baseline comparison before it can be called green. No private captures were supplied.

The contributor's latest note correctly narrows the dependency. This is needed for per-kernel DTBs, while the bundled-tree path already uses m1n1's reservations and works without it. Merge after corrected m1n1 #47, before using Linux #434 through the per-kernel route. The packaged J713 audio boot in the PR is its hardware proof.

@erikwb

erikwb commented Oct 26, 2026

Copy link
Copy Markdown
Author

I re-ran the sandbox suite against a baseline to follow up on the ut all failure. The bootflow failures and the dlmalloc abort came from missing host tools, not from this PR. With the tools present, three video tests still fail, and those come from aurora-wip's own 50eac7d7141.

Host tools. U-Boot's pytest harness builds the bootstd disk images (test_ut_dm_init_bootstd) with qemu-img, cgpt and futility, and cgpt and futility come from vboot_reference. When a tool is missing, image setup stops partway. Every image after that point is never created (the Android mmc7/mmc8, EFI and RAUC mmc10 images), so the bootflow and bootdev tests fail. bootflow_android_image_v2 then ends in the do_check_chunk assertion. A bare u-boot -T -c "ut all" creates no images at all, so it fails the same way even on upstream.

Clean run. Each tree was built with sandbox_defconfig and NO_SDL=1, with SWIG 4.2.1 (4.5 can't build U-Boot's pylibfdt). The run was ./test/py/test.py --bd sandbox --build-dir build -k test_ut, with qemu-img 11.1.2 and cgpt/futility from vboot_reference 7204368. Results were identical on x86_64 (Arch, GCC 16.2.1) and natively on aarch64:

Tree Result
v2026.07 (ece349ade29) 921 passed, 1 skipped
aurora-wip at this PR's parent (12538ef5b45) 921 passed, 3 failed, 1 skipped
this PR (22adb96ab60) 921 passed, 3 failed, 1 skipped (same three tests)

This PR. The sandbox build doesn't compile j713_fdt.c (there is no APPLE_J713_FDT there), so the sandbox binary carries none of this PR's code.

The three failures are dm_test_video_bmp24_32, dm_test_video_bmp32 and dm_test_video_comp_bmp32. They pass on 50eac7d7141's parent and fail on 50eac7d7141 ("video: Set XRGB X bits for the U-Boot console") and on each later aurora-wip video commit I tried (9de1c1f0903, 538f4cedb7b, 26f50f0d86b). For example:

test/dm/video.c:511, dm_test_video_bmp32(): 2024 == video_compress_fb(uts, dev, false): Expected 0x7e8 (2024), got 0x594 (1428)

That commit sets the X byte to 0xff in video_index_to_colour(). As its message says, the BMP path still writes X = 0, so the cleared background and the drawn BMP now have different X bytes. The framebuffer then compresses to a different size from the one the tests hard-code. This looks like an expectation that needs refreshing rather than a console regression. I haven't changed those tests.

Results:

  • The importer host tests in this PR (test/py/tests/test_apple_j713_fdt.py) pass 5/5 on both machines, with the private-capture test skipped.
  • The packaged J713 boot in the PR body is still the hardware proof.

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