Skip to content

arm: apple: add J713/T8132 (M4 MacBook Air) boot support - #7

Merged
RyanTheTide merged 6 commits into
aurora-wipfrom
m4/pr1-basic-bringup
Oct 23, 2026
Merged

RyanTheTide merged 6 commits into
aurora-wipfrom
m4/pr1-basic-bringup

Conversation

@erykwieliczko

@erykwieliczko erykwieliczko commented Oct 20, 2026 •

Copy link
Copy Markdown
Member

Add the J713/T8132 (M4 MacBook Air) bootloader handoff used by Linux basic support #366, on top of aurora-wip.

Map T8132 I/O windows and every supplied DRAM bank, reuse the shared internal-ESP EFI boot flow, and retain the MTP helper's live buffer inventory for Linux. Enable the built-in keyboard for the U-Boot console and EFI input, preserving validated discovery and keyboard READY frames for Linux to adopt the live session and configure the trackpad. Publish the handoff transactionally; if a later candidate cannot describe an already-published session, reject that candidate and keep the earlier tree/session valid.

Import live firmware resources, reservations, CPU release slots, framebuffer and calibration into an explicitly selected per-kernel DTB through EFI fixup. Translate phandles while preserving static platform topology and ownership policy. Bound the import and scratch allocation; publish the completion marker after input fixup. APPLE_J713_FDT scopes the importer and its padding requirement to enabled configurations, preserving apple_j873_defconfig's existing input configuration and 12 KiB padding.

The added calibration commit carries per-machine Bluetooth address/calibration and banked USB3 PHY records. It rejects malformed supplied calibration transactionally, removes stale destination data, preserves explicitly USB2-only ports and handles optional AUX calibration independently. Missing Bluetooth source calibration keeps Bluetooth disabled. A rejected EFI fixup can leave the stub using its original firmware DTB, so validation checks both the requested OS source and the import completion marker.

The keyboard commit requires prepared J713 input before probing, preserves the original INIT/READY sequence and freezes the firmware buffer inventory after publication. Stopped helpers are safe to poll. Draining/replay are bounded and check FIFO space and observed competing writes. An incomplete first optional handoff disables input; damage to an already-published session explicitly stops OS entry, because generic EFI/direct-boot teardown ignores driver removal errors. This preserves the published DMA reservations and running session. No packet-atomic producer lock is claimed. J813 stays excluded and READY replay is specific to J713.

Use the matching m1n1 series, its documented ATC/Bluetooth control-DTB aliases, and apple_m1_defconfig. Keep the tested shared control DTB's legacy USB2 topology and radio SID16 profile; USB3 and managed radio SIDs 1/2 come from the per-kernel OS DTB.

Validation:

  • Final U-Boot cc47d3b7c86 built with warnings treated as errors. All 14 focused host tests passed, covering discovery and READY replay, command CRC and common key delivery, startup admission, stopped polling, immutable DMA inventory, partial/failed handoffs, FIFO capacity/interference and explicit refusal after published-session errors. Importer cases used captured M4 runtime data and an OS DTB and cover calibration validation, stale-data removal, USB2 fallback and optional AUX handling. Earlier series validation covered both Apple defconfigs and configuration-specific padding.
  • The preceding calibration tip, U-Boot 6c1d2d148020 and m1n1 cda8314d booted Linux 98a8f830df94 (7.2.10-m4_basic_usb3_bt1). Runtime versions, OS DT source/import completion markers, NVMe root, Wi-Fi, retained MTP devices and Bluetooth were verified. LE reception, three HCI power cycles and concurrent Wi-Fi passed without pending radio DART faults.
  • Earlier integrated USB3 testing at e9061708e7fd negotiated ATC1 at 5 Gbit/s and completed two direct, read-only 512 MiB reads at 132/132 MB/s with matching checksums and no new USB errors. On that exact basic boot, the drive was connected to ATC0: USB2 fallback passed two matching 512 MiB reads at 39 MB/s. A repeat ATC1 SuperSpeed test on the latest tip is pending the physical port move; no drive writes or writable mounts were used.
  • The final keyboard commit rebooted stable 7.1.12-AURORA-semi-dirtyroom-2026.10.12-6 and the separate native GPU/DCP kernel 49c5d9994fec (7.2.10-m4_asahi_rebase1). Both retained the live MTP session and reached ready for STM, keyboard and trackpad, without enable, checksum or sequence errors. The user confirmed typing at the U-Boot prompt, EFI menu navigation and Linux keyboard/trackpad operation on the stable boot. The native OpenGL 4.6 render/compute/geometry fixture passed on Apple M4 (Mesa 91ac7e2cd8), followed by 32 seconds of measured concurrent rendering/compute and two successful display blank/unblank cycles. Native display firmware qualification gaps remain unchanged. The user also confirmed normal display, built-in keyboard and trackpad operation after the native-kernel test.
  • Earlier basic and separate GPU/DCP candidates were reboot-tested with the preceding commits, including physical display/keyboard/trackpad checks and bounded native graphics regressions. The latest basic test uses software rendering. Shared raw DTBs and the stable fallback were preserved.

Opus reviewed the design and commits read-only; findings were fixed and the final review found no remaining blockers. Existing file licenses are unchanged.

J700 hardware behavior and a deliberately timed key release during FIFO replay remain unqualified. The shared FIFO has no established packet-atomic producer lock. DP/HDMI, repeated hot-plugging, suspend and complete native display power/clock/bandwidth qualification remain gaps. Bluetooth testing covers controller initialization, LE discovery and HCI power cycles, not individual profiles. Related: #6 also changes shared MTP publication and may need reconciliation when either series lands.

Describe the M4 I/O windows and every supplied DRAM bank, then reuse the
internal-ESP EFI flow and companion m1n1 ANS handoff. Leave J713 HID
discovery to Linux and cover split storage BAR and PCIe map containment.

Assisted-by: LLM
Initialize the shared RTKit helper with the qualified system endpoints,
service late startup requests and wait for a pending HID header without
consuming FIFO bytes. Retain the exact buffer inventory and DART bypass
only after publishing the complete handoff on a scratch device tree.

Optional first-publication failures disable input and continue boot.
Refuse a failed later candidate while preserving the prior published
session and device tree for EFI fallback. Build the startup path only
when the MTP helper is available. Linux owns HID discovery.

Assisted-by: LLM
Document companion bootloader/kernel dependencies, retained buffer
ownership and the bootloader console/input qualification limits.

Assisted-by: LLM
Let an explicitly marked J713 OS device tree retain its static topology
while importing this boot's validated firmware resources. Translate
phandles and prepare changes on a bounded scratch tree before publishing
the retained input session and completion marker.

Enable the importer through APPLE_J713_FDT in apple_m1_defconfig. Enforce
the resolved FDT padding minimum when that capability is enabled while
preserving other Apple defconfigs and the original fallback tree.

Include EFI fixup integration, protocol documentation and production-
importer host regressions with the implementation.

Assisted-by: LLM
Carry the boot source's per-machine Bluetooth address/calibration and
banked T8132 USB3 PHY calibration into matching per-kernel device trees.
Keep the OS topology and its admission policy authoritative: disable
Bluetooth if its source calibration is incomplete, discard stale PHY
calibration and retain explicitly USB2-only ports without extending
their resources. Validate each USB3 record against its target bank.

Import optional multifunction AUX calibration when available. Preserve
USB-only operation when the source does not provide that property.
Extend importer tests with source comparisons, bank/length/alignment
rejections, USB2 fallback and optional AUX cases.

Signed-off-by: Eryk Wieliczko <[email protected]>
Assisted-by: Codex:GPT-6
Use the shared announcing-interface transport on J713, which includes STM,
and enable only the discovered keyboard interface. Preserve validated INIT
packets and the original keyboard READY event for Linux. Retain the live
RTKit helper and DMA backing through the existing typed OS handoff.

Require prepared input before keyboard probing, avoid a failed helper boot
retry, and tolerate a stopped helper during EFI input polling. Freeze buffer
requests once the OS inventory is published. Bound draining and replay, check
FIFO space and observed writer interference, and refuse an incomplete cache
instead of silently dropping discovery. Stop explicitly on a damaged published
session, since EFI and booti ignore device removal errors. Keep J813 excluded.

Cover production discovery, command CRC, key delivery, readiness replay,
helper admission, stopped polling, immutable buffer inventories, failed and
partial handoffs, insufficient FIFO space, competing-producer detection and
nonreturning refusal after published handoff or DART retention failures.
MMIO, time and helper removal are host boundaries; real EFI input and Linux
keyboard/trackpad acceptance require the separate reboot test.

Signed-off-by: Eryk Wieliczko <[email protected]>
Assisted-by: Codex:GPT-6
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