Skip to content

main: T6050_NO_HOST_PREP build switch skips the USB host prep (edimoldovan; stacked on #30) - #39

Closed
TripleU613 wants to merge 10 commits into
omacom:integration/aurorafrom
TripleU613:t6050-no-host-prep
Closed

TripleU613 wants to merge 10 commits into
omacom:integration/aurorafrom
TripleU613:t6050-no-host-prep

Conversation

@TripleU613

Copy link
Copy Markdown

Stacked on #30 (edimoldovan:j714c/diskboot, head ad08bf5): this branch is #30 plus one commit. Rebase once #30 lands.

The commit is @edimoldovan's, unchanged: 103ab882d574 from edimoldovan/m1n1, cherry-picked with -x, author kept. It is proposed here because it isn't in any open omacom/m1n1 PR. @edimoldovan, please ack or say if you'd rather submit it yourself.

What it does: T6050_NO_HOST_PREP is a build switch, off by default. With it, stage 1 skips #30's T6050 USB host prep: the ports are left as the proxy left them, "T6050 host prep skipped" is printed, and /chosen/apple,t6050-usbprep is all zeros. A boot then shows whether the kernel's apple,t6050-usb2-phy driver sets up the USB-C ports on its own.

Validation (offline; not booted):

The commit carries no Signed-off-by (its original has none). Published with AI assistance (Claude Opus 5.5), as disclosed in the original commit's trailer.

edimoldovan and others added 10 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>
A test build (make EXTRA_CFLAGS="-Wstack-usage=2048 -DT6050_NO_HOST_PREP")
leaves the ports as the proxy left them and prints "T6050 host prep
skipped", so a boot shows whether the kernel's apple,t6050-usb2-phy driver
sets up the USB-C ports on its own. The /chosen/apple,t6050-usbprep record
is then all zeros.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
(cherry picked from commit 103ab88)
@greptile-apps

greptile-apps Bot commented Nov 8, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 4/5

[Medium impact] The changes affect boot and hardware handoff paths on T6050 devices.

The PR appears safe to merge, with a non-blocking cleanup for the unused NVMe stop path.

Findings

  1. P2 Stop path cannot run ▶

Summary

This stacked change adds T6050 boot support and an optional T6050_NO_HOST_PREP switch.

  • T6050 stage 1 can leave USB host setup to the kernel.
  • T6050 CPU setup uses its own cluster and start-bit layout.
  • T6050 GPU setup checks its own performance data.
  • T6050 can hand off a live NVMe session and its allocated memory.
  • Direct kernel boots skip the embedded chainload target.
  • T6050 device setup covers its I2C nodes and MTP filter.

Diagram

%%{init: {'theme': 'neutral'}}%%
flowchart TD
    A[Payload or proxy selects next stage] --> B[Shut down USB device links]
    B --> C{T6050_NO_HOST_PREP defined?}
    C -->|Yes| D[Skip host preparation]
    C -->|No| E[Prepare T6050 ports as USB hosts]
    D --> F[Finish display handoff]
    E --> F
    F --> G[Write USB preparation record when a tree exists]
    G --> H[Enter next stage]
Loading

Reviews (1) · Last reviewed commit: "main: T6050_NO_HOST_PREP build switch sk..." · Reviewed by Greptile

Comment thread src/nvme.c
Comment on lines +136 to +137
bool nvme_t6050_stop_coproc =
false; /* T6050: stop the coprocessor at shutdown (it does not restart) */

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

P2 Stop path cannot run

The new nvme_t6050_stop_coproc flag starts as false, and nothing sets it. Normal boots therefore cannot reach the added T6050 stop path. This leaves shutdown code to maintain without a supported way to use or test it. Remove the unused path or connect it to an explicit opt-in.

TripleU613 added a commit to betizzel/omarchy-m5 that referenced this pull request Nov 9, 2026
Capture the full commit series of omacom/linux-aurora#414, omacom/m1n1#39
and #40, rolotrealanis98/linux#1, rolotrealanis98/m5pro-linux#1 and #2,
and the unsubmitted m5pro-linux n1-loader-admission branch as git-am
mboxes, with an index. The PRs and their forks are being closed so this
repo is the single home for the work.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01H3rUWr3saGxDib7Zd5Ksyw
@TripleU613

Copy link
Copy Markdown
Author

Closing: consolidating all my M5/J714s work into one place, https://github.com/betizzel/omarchy-m5 (this series is preserved as a git-am mbox in patches/upstream-prs/). Thanks for the reviews.

@TripleU613 TripleU613 closed this Nov 9, 2026
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