Repository navigation
T8142 (M5) platform bring-up: PCIe, DAPF, DCP carveouts, CTRR, ATC PHY - #12
Closed
hishamMounir wants to merge 10 commits into
Closed
hishamMounir wants to merge 10 commits into
hishamMounir wants to merge 10 commits into
Conversation
Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
Instead of assuming the DT lists CPUs in the same order as the ADT, look up the live CPU with the node's MPIDR. Same result for in-order trees; lets a bring-up DT reorder CPUs (used to boot one specific E-core early on t8142). Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
t8142 has a second CTRR instance, covering the DeviceTree/TrustCache area below the bootloader. iBoot leaves it enabled on the secondary cores, so Linux crashes when it hands those pages to a secondary CPU and writes to them, the same way it does for the first instance. The first instance is already reserved for t8142 through the apple_sysregs_unlocked feature check. Name the second instance's two registers (encodings 3, 0, 11, 0, 2/3, next to the existing pair) and reserve that range too, gated on t8142 and skipped when the instance reads back zero, so the M4 targets are untouched. Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
Register layout and PHY init from macOS AppleT8142PCIe: 8 shared reg entries, the PHY-PHY block at reg[2] + 0x20000, the 100 MHz reference clock poll, the Gen4 PHY IP bit (_initializeGen4Phy) and PHY_CTRL bit 27 (_apcieGPInit). No fuse block. Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
Built only with -DJ704_WLAN_PWR. Linux has no SMC driver for t8142 yet, so m1n1 sets SMC GPIO gP13 = 0x01000001 (CMD_OUTPUT | 1, as macsmc-gpio does) before pcie_init so the BCM4388 enumerates. Adds smc_read_u32 to log the old value. Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
On t8142 the DAPF reg index used on earlier SoCs lands on a page shared with PMGR, and touching it raises an SError. The reg this SoC wants is identified by the ADT instance name instead, so look it up that way and keep the index path for the SoCs that use it. Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
Same region ids as t8112, all mapped in dart-dcp stream 23 on the M5. No disp0/piodma nodes yet; a no-op unless the DT has a "dcp" alias. Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
…ngs, skip iommu-addresses without phandle Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
t8142's atc-phy nodes carry the same tunable layout as t8122/t8132, so list the compatible in the fuse table (reverse-chronological, ahead of t8132) and select the t8122 tunable set for it. Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
A secondary that never takes a cross-CPU call leaves smp_call4() spinning with no output at all, which looks exactly like a dead board. Print the CPU, the call and the target state once after a second, flush the console, and then keep waiting as before, so the behaviour is unchanged apart from the message. This was written to chase a first-secondary wedge on J704 (M5) that shows up roughly one boot in three. Assisted-By: LLM Signed-off-by: Hisham Alkhudrawi <hisham.ma.mohammed@gmail.com>
hishamMounir
force-pushed
the
j704/t8142-bringup
branch
from
November 4, 2026 17:18
0058611 to
571ee4f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This series brings the bootloader up on T8142 (Apple M5), as seen on the 14"
MacBook Pro (Mac17,2 / J704). With it the tree reaches a usable proxy on that
machine and chainloads Linux from the internal SSD.
This is #12 again, rebased onto current
main(c22cd92).What is here
pcie: support t8142: needed for the internal NVMe and WLAN.kboot: raise WLAN_REG_ON (SMC gP13) before PCIe init: without it theWLAN device never appears on J704. Includes the small SMC write plumbing.
dapf: find the DAPF reg by its ADT instance name: on t8142 the regindex used on earlier SoCs lands on a page shared with PMGR and SErrors on
access. The index path is kept for the SoCs that use it.
kboot: reserve the second CTRR range on t8142:mainalready reservesthe first CTRR instance on t8142 through the
apple_sysregs_unlockedcheck(64b8646), so this only adds the second instance. It covers the
DeviceTree/TrustCache area below the bootloader. Its two registers are named
next to the existing pair (
3, 0, 11, 0, 2/3). The reservation is gated ont8142 and skipped when the instance reads back zero.
kboot: reserve the DCP carveoutsandsplit DCP mapping runs, reserve unlisted iBoot DCP mappings, skip iommu-addresses without phandle: iBootmaps some regions (t8142
dcp_data) in several IOVA runs, and Linux replacesa locked DART's tables with exactly what
iommu-addresseslists, so each runhas to be described. A run with no mapping now fails rather than silently
handing Linux a truncated list, once at least one run has been described.
kboot: match DT CPU nodes to running CPUs by MPIDR: index-basedmatching does not hold on this SoC.
kboot_atc: copy the atc-phy tunables on t8142: same tunable layout ast8122/t8132. It still applies cleanly on top of the 11-03 ATC rework.
pmgr_adt2dt: resolve no_ps parents to their nearest real ancestors.smp: log once when a call target hasn't taken a call after 1 s: asecondary that never takes a cross-CPU call otherwise looks exactly like a
dead board. Logs once, then waits as before.
Testing
J704 (Mac17,2, T8142, 16 GB), with the bootloader as the custom boot object of
a second macOS install. Linux boots from the internal SSD and the proxy runs
over USB-C from an M4 Mac mini. AIC3, pmgr (386 devices), framebuffer,
dockchannel UART, USB (3 DARTs, t8110), PCIe and NVMe all come up. It has been
this machine's default Linux boot path since 2026-10-19.
The limits of that testing:
been booted with these patches. On the rebased branch a full
m1n1.binbuilds and links with clang and the Rust target, with no warnings in any
touched file.
clang-formatwas not run.maps in several runs with a gap, which this machine has not produced.
Provenance
hypervisor traces and driver experiments. No Apple binary was disassembled for
any of them.
asahi_neoG17G profile and its m1n1 DRM-shimexperiments) is tainted. Apple GPU firmware was disassembled while
diagnosing it. None of it is in this series, and I will not send it to any
Gravity repo.
m5-linux-researchwas a reference during this bring-up. TheirT8142 GPU firmware memory handoff patch is not included. It is their work to
send.
🤖 Generated with Claude Code