Skip to content

T6050 (M5 Max, J714c): boot from disk through the Omarchy chain - #30

Open
edimoldovan wants to merge 10 commits into
omacom:integration/aurorafrom
edimoldovan:j714c/diskboot
Open

edimoldovan wants to merge 10 commits into
omacom:integration/aurorafrom
edimoldovan:j714c/diskboot

Conversation

@edimoldovan

@edimoldovan edimoldovan commented Nov 7, 2026 •

Copy link
Copy Markdown

This boots the 14-inch MacBook Pro with M5 Max (J714c, T6050) from disk the way Omarchy boots the other Macs: stage 1 m1n1, the ESP's m1n1 stage 2, U-Boot, Limine, then the EFI kernel. It replaces #26 and #27.

Requires the macOS 27.3 beta 1 system and OS firmware (iBoot mBoot-20457.60.65.0.1) on the Omarchy volume. On earlier firmware (mBoot-20457.41.3 tested) the secondary CPU cores do not start.

  • T6050: MTP DAPF, one release bit per CPU, room for the J714c's i2c nodes
  • nvme: the T6050 register window, the loader's heap kept for the live NVMe session, an opt-in coprocessor stop.
  • cpufreq: T6050 cluster 0, with T8142's command model.
  • usb: the free ports go to the next stage in USB 2.0 host mode, with up to three bring-up and flip attempts and a record in /chosen/apple,t6050-usbprep.
  • kboot: GPU handoff for T6050, which fills the OPP table and the UAT reserved-memory regions from the ADT.
  • payload: with boot= or an appended next stage, the stage 1 config gives only the proxy window, not its chainload target (from payload: the stage 1 config gives only the proxy window to boot= and an appended kernel #27).
  • dapf: the T6050 PMP DART.
  • payload: stage 2 sets /chosen/asahi,nvme-adopt, so U-Boot takes over the ANS session stage 1 left live instead of starting a second one, which the firmware refuses.

Builds: stage 1 with CHAINLOADING=1, stage 2 with RELEASE=1 CHAINLOADING=1 ESP_STAGE2=1.

Tested: the J714c runs this code as m1n1-aurora 1.6.1.aurora22-102. Stage 1 is installed with kmutil, stage 2 is on the ESP, and it boots from disk with no cable into an Omarchy login where 22 of 22 feature checks pass. On the rebase onto the current integration/aurora, the one conflict (payload.c, next to config_lost) keeps both sides. make format-check with clang-format 20.1.8 reports no new violations.

The U-Boot half, adopting the session, is on edimoldovan/u-boot j714c/t6050 (70e990818a).

🤖 Generated with Claude Code

edimoldovan and others added 9 commits November 7, 2026 21:47
kboot_boot programs only the MTP filter on T6050, dapf_init on reg 1 of
dart-mtp at 0x294810000: the firmware's first access is PMGR at
0x28830c000, entry 0 of the ADT dapf-instance-0, and without it the MTP
never sends HELLO. The AOP entry of dapf_init_all points at the block
shared by every DART at 0x2890fc000 and faults with an SError on T6050.

cpu_start_bit uses one bit per CPU index on T6050, as on T8142; the
4*cluster+core layout never releases cores 14-17 of its three 6-core
clusters.

The J714c ADT has nine i2c nodes; the i2c limit of
dt_disable_missing_devs is raised to 16.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
- nvme: admit the J714c ADT's 64 KiB nvme window at 0x45dcc0000 with
  nvmmu at 0x41dcc0000 and use the 0x30000 aperture, as for T8140.
- kboot: retain the loader's heap on T6050 as on T8140, so the live
  NVMe session's buffers survive into the next stage.
- nvme: a shutdown path that stops the coprocessor and leaves its
  firmware resident, behind nvme_t6050_stop_coproc (default off, the
  session is preserved for the next stage).

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Cluster table for the M5 Pro/Max: MCPU0 at 0x210e00000, default
P-state 4; the chip shares T8142's P-state register handling and keeps
the firmware voltage, PLL and throttling configuration.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Before starting the next stage on T6050, every USB port is brought up as
for the proxy (power, usb2phy, pipe handler, dwc3 device init) and
flipped to host: usb2phy host bits, gadget stopped, core soft reset,
port capability host, PHY auto-suspend off, pipe handler link detection
forced off (the parking the kernel PHY driver does for a USB 2.0-only
host).

On J714c the first flip never shows a plugged device; the second
shutdown, bring-up and flip shows it at once. usb_t6050_host_prep polls
PORTSC.CCS after each flip (50 ms the first time, 100 ms after that) and
redoes the bring-up and flip up to three times. A port without a device
stays in host mode after the last attempt.

usb_t6050_host_record, called after the display handoff, writes
/chosen/apple,t6050-usbprep with four words per port: attempts, PORTSC
after the prep, PORTSC before the jump, and ms until PORTSC.CCS. It goes
through the new kboot_set_chosen_u32s, which reopens the packed tree
from a copy, since kboot_prepare_dt has packed it. The P_VECTOR path
skips usb_hpm_restore_irqs on T6050.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Generalise dt_set_gpu_t8140 into dt_set_gpu_g17 parameterised by the G17
perf-state shape (count, active states, table count) and the accepted
compatibles, and call it for T6050 (apple,agx-t6050; 14/13/4) as well as
T8140. Fills the OPP table and the four UAT reserved-memory regions from the
ADT and leaves the node enabled when the data validates.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ainload target

A stage 1 with boot= loads the kernel, DTB and initramfs from the ESP
itself, so the secondaries start from the image iBoot loaded and their
locked RVBAR needs no relay. The embedded stage 1 config is the only
source of the USB proxy window, but a valid config also set the
chainload target, and boot= plus chainload= is refused. With boot= set,
the config now only provides the window.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Add /arm-io/dart-pmp0 to dapf_entries[] so dapf_init programs the T6050
PMP's DAPF filter. Without it the PMP ASC MMIO window stays fabric-gated
and AP access SYNC-faults. dart-pmp0 is dart,t8110 with a
dapf-instance-0 property, which dapf_init -> dapf_init_t8110 already
handles; the DAPF aperture is reg[1] (0x2841b0000). After
dapf_init("/arm-io/dart-pmp0", 1) the PMP ASC CPU_CONTROL reads cleanly,
where a raw read without the filter faults.

On the FDT path the kernel DT aliases pmp0 to the PMP's DART with
status = okay to match this entry.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
…ithout its chainload target

A stage 1 that carries its next stage (U-Boot as the kernel payload, with
its devicetree) uses the embedded config for the proxy window only, as
boot= does. The default stage 2 target would otherwise replace the
appended kernel.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Stage 1 reads m1n1/boot.bin with its own NVMe driver and hands the ANS
session over live (nvme.adopt=live-rtkit-v1). The ANS firmware takes
its RTKit handshake once per boot, so U-Boot must adopt that session
instead of starting one. Set /chosen/asahi,nvme-adopt for the appended
next stage; U-Boot's T6050 NVMe driver adopts when it is present.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@greptile-apps

greptile-apps Bot commented Nov 7, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The changes appear safe to merge, and the previous heap-reservation finding is fixed.

Summary

Adds T6050 disk boot through stage 1, stage 2, and U-Boot.

  • T6050 disk boots can carry the live NVMe session into the next stage.
  • T6050 USB ports stay ready as USB 2.0 hosts for the next stage.
  • T6050 secondary CPUs start and cluster 0 uses its supported frequency controls.
  • The T6050 kernel handoff includes its GPU data and all nine I²C nodes.
  • T6050 kernel handoff programs the MTP filter and identifies the PMP DART.
  • Late handoff allocations stay reserved from the next stage and kernel.

No new actionable issues were found in the changes since the previous review.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart LR
  A[Stage 1 loads stage 2] --> B[Prepare USB host ports]
  B --> C[Update boot arguments with final heap boundary]
  C --> D[Stage 2 prepares U-Boot and its device tree]
  D --> E[Prepare and record USB host ports]
  E --> F[Reserve final heap growth in device tree]
  F --> G[U-Boot adopts live NVMe session]
  G --> H[Limine and EFI kernel]
Loading

Reviews (2) · Last reviewed commit: "main: keep the heap the last steps befor..." · Reviewed by Greptile

Comment thread src/main.c Resolved
On T6050 the USB host flip runs after kboot_prepare_dt() reserved the
retained heap and after chainload_image() set the next stage's
top_of_kernel_data. Its dwc3 bring-up allocates DART tables, which can
extend the heap past that boundary, so the next stage could reuse memory
the USB DART still points at.

Right before the jump, kboot_retain_late_heap() reserves the heap added
since the reservation, and chainload_retain_late_heap() raises the staged
top_of_kernel_data over the heap added since the staging. When the late
reservation fails, m1n1 returns to the proxy, as the display handoff does.

Tested on J714c: stage 2 with this change (m1n1-aurora 1.6.1.aurora22-104)
boots from disk into Omarchy, 22 of 22 feature checks pass.

Signed-off-by: Eduard Moldovan <edimoldovan@gmail.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@joshuaswarren

Copy link
Copy Markdown

[Joshua's agent] @maralcbr @scottjones Could one of you review this? It is mergeable with no conflicts, and 8 commits behind integration/aurora.

It boots the 14-inch MacBook Pro with M5 Max (J714c, T6050) from disk through the Omarchy chain. Per the PR text, the J714c ran this code as m1n1-aurora 1.6.1.aurora22-102 and booted from disk with no cable into a login where 22 of 22 feature checks pass.

It needs the macOS 27.3 beta 1 firmware (mBoot-20457.60.65.0.1) on the Omarchy volume. On earlier firmware the secondary cores do not start.

This PR replaces #26 and #27. linux-aurora#404 named #26 as its dependency, so #30 is now the m1n1 side of that pair.

@joshuaswarren

Copy link
Copy Markdown

Gap analysis vs. a CTRR/chainload patch series we maintain for T6050 HV debugging. The series was authored against the AsahiLinux/m1n1 lineage and does not apply here — this branch already carries a parallel, more evolved implementation of most of it.

Already covered in this branch's own form

  • wdt dead-man switch for unattended HV runs → src/hv/hv_wdt.c (timeout/pet/suspend/resume/breadcrumbs, bark→reboot)
  • locked-RVBAR redirect for a relocated m1n1 → src/smp.c (RVBAR_LOCK, smp_reset_stacks)
  • chainload relocation / staying out of protected windows → src/chainload.c solves the same problem differently (footprint/run_base header protocol, heap-overlap checks, stub staging)
  • VM_TMR_FIQ_ENA guest-timer gating → src/hv/hv_exc.c hv_update_fiq()

Still missing — T6050 HV-debugging path only, not the normal boot path:

  1. hv sprr: emulate S3_0_C11_C9_0 for T6050 SPTM
  2. hv sprr: keep the SPRR pool out of T6050's MTE tag storage
  3. hv sprr: align the guest RAM top to 1 MiB for T6050 MTE
  4. MAX_CPUS 32→24, if the raw-image size cliff still reproduces (src/smp_asm.h still 32)

The sprr items target the AsahiLinux hv_sprr pool/top-of-RAM layout; this branch's src/hv/hv_sprr.c allocates via heapblock_alloc_aligned with a free list, so they need re-implementation rather than cherry-pick.

Recording as a known gap; no PR opened.

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