Skip to content

arm64: dts: apple: t6050-j714s: describe the system level cache controller - #2708

Open
DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/t6050-j714s-mcc
Open

DjDeveloperr wants to merge 1 commit into
integration/aurorafrom
djdev/t6050-j714s-mcc

Conversation

@DjDeveloperr

Copy link
Copy Markdown
Contributor

Summary

  • Add the die-0 memory cache controller node (apple,t6050-mcc, soc@2220000000/memory-controller@2220000000) to arch/arm64/boot/dts/apple/t6050-j714s.dts with apple,boot-dma-devices = <&dcp>, and add display = <&dcp> to /chosen/framebuffer@0.
  • Unlike M5 Max boards (8 enabled AMCCs, 32 planes), the live J714s (14-inch M5 Pro) ADT reports 4 enabled AMCCs (/arm-io/mcc amcc-enable-mask = 0xf of amcc-count = 8) with 4 planes each at 0x2220000000, 0x2222000000, 0x2224000000, and 0x2226000000 (stride 0x40000, 16 planes total), matching /chosen/lock-regs/amcc. Pre-kernel Stage 2 reads of all 16 planes confirm +0x82c = 0x1 (allocation disabled), +0x2800 = 0x8000000c, +0x2804 = 0x0c000c00 (12 data ways and 12 tag ways powered), and +0x2844 = 0x0.
  • On integration/aurora today, apple,t6050-mcc is already permitted by Documentation/devicetree/bindings/soc/apple/apple,t8140-mcc.yaml and remains unbound until soc: apple: mcc: let the T6050 system level cache allocate #2518 adds the apple,t6050-mcc match to drivers/soc/apple/mcc.c. Adding display = <&dcp> on framebuffer@0 also prepares J714s for boot-scanout retirement tracking in soc: apple: mcc: wait for display controllers to retire boot scanout #2538 and drm/apple: publish completion of native display takeover #2539.

Testing

  • t6050-j714s.dtb builds cleanly with 0 warnings; scripts/checkpatch.pl reports 0 errors and 0 warnings.
  • Hardware A/B on Apple MacBook Pro (14-inch, M5 Pro, J714s, T6050) running 7.3.0-m5-sship7 (CONFIG_APPLE_MCC=y, drivers/soc/apple/mcc.c identical to soc: apple: mcc: let the T6050 system level cache allocate #2518 on 16 planes), comparing the default DTB (c0440c9e) against the same DTB plus this MCC node (with a temporary "apple,t8140-mcc" test fallback so sship7's apple-mcc binds without rebuilding the kernel; test DTB 24cbf3f8517e):
    • Boot log: apple-mcc 2220000000.memory-controller: system level cache allocation enabled on 16 planes.
    • P-core (cpu12) pointer-chase latency (ns/load, 128 B stride) vs macOS 27.0 (26A428, QoS UI) on the same J714s:
Working set Linux before (SLC off) Linux after (SLC on, 16 planes) macOS 27.0
8 MiB 12.0 8.76 8.57
12 MiB 29.3 14.7 14.0
16 MiB 54.3 28.7 25.1
20 MiB 84.9 42.6 32.2
24 MiB 101.0 46.7 44.4
28 MiB 105.5 49.9 55.0
32 MiB 105.4 56.7 66.7
40 MiB 109.7 74.3 79.4
48 MiB 110.6 79.4 83.4
64 MiB 110.7 91.7 113.0
128 MiB 114.9 115.3 117.8
  • M-core (cpu0) pointer-chase latency (ns/load): 8 MiB 44.9 -> 23.6, 12 MiB 106.6 -> 46.6, 16 MiB 104.2 -> 47.6, 24 MiB 110.2 -> 58.8, 32 MiB 109.2 -> 75.1.
  • Single-core read bandwidth (rbw, GB/s): P-core 16–32 MiB 94.4–95.8 -> 105.7–107.7 (macOS: 103.7–106.4); M-core 12–32 MiB 88.8–92.9 -> 103.3–113.9.
  • Borealis Vulkan gpubench-vk --test compute.light --depths 1 --runs 3 --run-ms 100 (Apple M5 Pro G17S B1): us_per_submit median 156.99 -> 104.82 µs (-33.2%, 1.50x faster; latency_us median 148.48 -> 93.60 µs).
  • Regression checks: 0 SELinux AVC denials, 0 new failed units (tailscaled.service baseline only on both boots), 0 new kernel error lines (13 pre-existing HID/DCP clock lines vs 17 on baseline), 0 MCC warnings/errors, GPU live before/during/after (vulkaninfo --summary + compute dispatch), clean reboot and shutdown flush back to default.

Assisted-by: LLM (Claude:Opus 5.5, Google:Gemini 4 Neon)

…oller

Describe the die-0 memory cache controller on the 14-inch M5 Pro MacBook
Pro (J714s) and wire the internal DCP as its boot-DMA supplier and as the
boot framebuffer's display.

Unlike M5 Max boards (eight enabled AMCCs, 32 planes), the live J714s ADT
reports four enabled AMCCs (/arm-io/mcc amcc-enable-mask = 0xf) with four
planes each at 0x2220000000, 0x2222000000, 0x2224000000 and 0x2226000000
(stride 0x40000, 16 planes total), matching /chosen/lock-regs/amcc. Each
plane's 12 data and tag ways are powered at boot with allocation disabled
until apple-mcc enables it.

Naming the internal DCP on both apple,boot-dma-devices and the boot
framebuffer's display property ensures apple-mcc waits for the DCP to bind
(and, with boot-scanout retirement tracking, for a displayed swap to retire
the boot framebuffer) before enabling cache allocation.

Signed-off-by: Diljit Singh <hey@djdev.me>
@RyanTheTide

Copy link
Copy Markdown
Contributor

The latency table makes the case well: SLC allocation on 16 planes takes the 12–24 MiB working sets most of the way to macOS, and the boot line confirms the planes the node describes.

One point on where the layout lives. The 4 enabled AMCCs (amcc-enable-mask = 0xf of amcc-count = 8) are what this J714s's ADT reports, so they're a fact about how the die is configured more than about the board. Writing them into t6050-j714s.dts works for this machine. But if another M5 Pro board, or a J714s with a different mask, has a different set, the static node describes AMCCs that aren't there. Having the boot loader fill or prune the MCC node's reg from the ADT's amcc-enable-mask (as it already does for other per-chip layouts) would keep each machine's node matched to its own ADT. If that's a follow-up, a comment in the DTS naming the ADT property the four entries come from would help whoever adds the next M5 Pro board.

Assisted-by: LLM (Claude:Opus 5.5)

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Agreed — checking the T6050 IPSW ADTs confirms amcc-enable-mask is absent from the static board ADTs and populated dynamically by iBoot (alongside /chosen/lock-regs/amcc), so having aura prune or populate the MCC reg property from amcc-enable-mask is the right follow-up to handle other M5 Pro SKU masks without per-SKU DTS duplication.

The block comment above soc@2220000000 in t6050-j714s.dts already cites /arm-io/mcc amcc-enable-mask 0xf and /chosen/lock-regs/amcc (0x2220000000..0x2226000000, plane-count 4, plane-stride 0x40000) for anyone adding or updating M5 Pro boards in the meantime.

On deep sleep: every T6050 ADT carries /arm-io/mcc skip-mcc-off-to-s2r = 1 (same as T8140, unlike T8142), which matches apple-mcc leaving ways_off = false and quiescing/flushing all 16 planes in apple_mcc_suspend_noirq(). Once #2518 lands and binds apple,t6050-mcc, we will run a J714s S2R wake check to confirm all 16 planes flush cleanly and come back with 12 powered ways so allocation re-enables on resume.

Assisted-by: LLM (Google:Gemini 4 Neon)

@joshuaswarren

Copy link
Copy Markdown
Contributor

[Joshua's agent] Verdict at 3481265

#2708 (3481265, J714s MCC node): GREEN once merged after #2518, with one row asked.

  • The binding's else branch allows only the bare apple,t6050-mcc, so the t8140 fallback you tested with cannot ship. This node binds nothing until soc: apple: mcc: let the T6050 system level cache allocate #2518 lands. Merge soc: apple: mcc: let the T6050 system level cache allocate #2518 first, or together.
  • Asked row: one s2idle cycle with SLC allocation on (J714s has the sleep dtsi), with a memory checksum across it. With allocation enabled, dirty lines sit in the SLC; if a sleep path powers planes down without a flush, that is data loss, not just speed.
  • Non-blocking: (a) the node sits in the board dts while j714s includes t6050-max.dtsi; other 4-AMCC M5 Pro boards will need the same 16 planes, so a shared dtsi may age better. (b) display = <&dcp> on the framebuffer is a separate change; a separate commit makes a bisect cleaner. (c) Linux beats macOS at 28-64 MiB (64 MiB: 91.7 vs 113.0 ns); a line on why (allocation policy?) keeps it from reading as a measurement slip.
  • The numbers are excellent: P-core 16 MiB 54.3 to 28.7 ns, and gpubench submit 157 to 105 us.

@DjDeveloperr

Copy link
Copy Markdown
Contributor Author

Deep-sleep and s2idle hardware verification row on MacBook Pro 14-inch (M5 Pro, J714s, T6050) for #2708 (3481265d9edd) + #2518 (e6fdaf6d4b23):

  • Setup: 7.3.0-m5-sship7 (CONFIG_APPLE_MCC=y, 16-plane apple-mcc suspend/resume path matched via a temporary "apple,t8140-mcc" test fallback in test DTB 24cbf3f8517e derived from default c0440c9e + #2708). Boot log: apple-mcc 2220000000.memory-controller: system level cache allocation enabled on 16 planes.
  • Memory integrity check across every sleep: 128 MiB of freshly dirtied deterministic memory held live in-process across echo mem > /sys/power/state (64 MiB anonymous RAM + 32 MiB anonymous RAM with every 128 B cache line freshly dirtied immediately before suspend entry + 32 MiB tmpfs), verified byte-identical by SHA-256 immediately on wake.
  • Real deep sleep × 2 (mem_sleep=deep, +30 s PMU RTC alarm each):
    • Sleep 1: rc=0, same boot_id, 36 s RTC delta (~28.4 s asleep, SMC wake MBSE 0x10650), 0 apple-mcc warnings/errors (0 flush timeouts on all 16 planes, 0 -EBUSY / not ready / stays off after the sleep), 128 MiB SHA-256 3/3 MATCH.
    • Sleep 2: rc=0, same boot_id, 36 s RTC delta (~28.6 s asleep, SMC wake MBSE 0x10650), 0 apple-mcc warnings/errors, 128 MiB SHA-256 3/3 MATCH.
  • s2idle check (mem_sleep=s2idle, +15 s PMU RTC alarm): on 7.3.0-m5-sship7, s2idle entry aborted in pcie-apple 1c70000000.pcie (genpd_suspend_noirq -16 / -EBUSY, unrelated to apple-mcc, which returns 0 when !pm_suspend_via_firmware()). Across the suspend/abort-resume transition: 0 apple-mcc warnings/errors, 128 MiB SHA-256 3/3 MATCH, and P-core latency remained SLC-active (16/24/32 MiB: 28.04 / 44.55 / 60.50 ns).
Metric SLC off baseline Pre-sleep Post-deep #1 Post-deep #2
P-core (cpu12) 16 MiB (ns/load) 54.27 27.77 24.86 28.28
P-core (cpu12) 24 MiB (ns/load) 100.96 44.69 45.10 44.50
P-core (cpu12) 32 MiB (ns/load) 105.41 59.32 60.13 58.33
P-core (cpu12) 128 MiB DRAM (ns/load) 114.92 115.42 115.16 114.61
M-core (cpu0) 16 MiB (ns/load) 104.16 47.54 47.29 47.53
M-core (cpu0) 24 MiB (ns/load) 110.22 58.08 51.89 58.00
M-core (cpu0) 32 MiB (ns/load) 109.24 73.80 70.18 77.78
Borealis gpubench-vk compute.light (us_per_submit) 156.99 µs 105.60 µs 105.37 µs 105.37 µs
Borealis GPU liveness LIVE LIVE LIVE LIVE
128 MiB dirty-RAM/tmpfs SHA-256 — — 3/3 MATCH 3/3 MATCH
apple-mcc suspend/resume warn/err — 0 0 0
  • Regression: 0 SELinux AVC denials, 0 new failed units (tailscaled.service baseline only), 0 apple-mcc warnings/errors across the full boot, Borealis GPU live throughout.
  • Conclusion: All 16 planes flush cleanly before deep sleep and T6050 wake ROM restores all 12 ways on every plane, so apple_mcc_resume_noirq() re-enables SLC allocation cleanly with ways_off = false (matching ADT skip-mcc-off-to-s2r = 1) with no resume way-restore needed in mcc.c.

Assisted-by: LLM (Google:Gemini 4 Neon)

@RyanTheTide

Copy link
Copy Markdown
Contributor

Merge-train adversarial review (MERGETRAIN-LINUX2) at 3481265: NO BLOCKERS.

Code read only, nothing built here. Before the merge it still needs Dj's verdict at this head; the missing rows are listed below.

Full review

#2708 arm64: dts: apple: t6050-j714s: describe the system level cache controller @3481265d

VERDICT: NO BLOCKERS

Blockers: none. The node is inert at this base: drivers/soc/apple/mcc.c:386-390 has no apple,t6050-mcc match until #2518 (OPEN, e6fdaf6) lands, so merging it first is harmless.

What I checked:

  • t6050-j714s.dts:65-89: 16 planes, within the binding's else branch (apple,t6050-mcc bare, reg 1..64, apple,t8140-mcc.yaml:73-104). All 16 reg windows fall inside the bus ranges (0x22_2000_0000 + 0x1000_0000).
  • The plane layout is the first 16 entries of t6050-ultra.dtsi's die-0 list.
  • t6050-max.dtsi, which j714s includes, has no MCC node, so there is no duplicate mcc label.
  • apple,boot-dma-devices = <&dcp>: apple_mcc_wait_boot_dma() (mcc.c:138-157) defers until the internal DCP is bound. A DCP that never binds leaves the SLC off; it never enables early.

Nits:

  1. The four AMCCs come from one J714s's live amcc-enable-mask (0xf). Per the follow-up comment, iBoot populates that mask at boot and the static ADT does not carry it. If any J714s or M5 Pro SKU enables a different set, this node maps an unpowered AMCC. The aura-side pruning of reg from amcc-enable-mask should land before the node is reused on other M5 Pro boards.
  2. The node is in the board .dts. The next 4-AMCC M5 Pro board would duplicate it, so a shared t6050-pro-mcc.dtsi would age better (Joshua's point a).
  3. display = <&dcp> on framebuffer@0 (:59-60) is a separate change with no consumer at this base (soc: apple: mcc: wait for display controllers to retire boot scanout #2538/drm/apple: publish completion of native display takeover #2539). It belongs in its own commit.
  4. Testing used a temporary "apple,t8140-mcc" fallback, so the shipped DT (bare t6050 compatible) plus soc: apple: mcc: let the T6050 system level cache allocate #2518 has never booted.

Hygiene: one commit, Signed-off-by: Diljit Singh, no agent trailers. ADT property names are hardware facts, not tainted.

Missing rows:

  • J714s on tip + soc: apple: mcc: let the T6050 system level cache allocate #2518 + this DT exactly as shipped, with no t8140 fallback. Check for "system level cache allocation enabled on 16 planes", repeat the 16/24/32 MiB latency points, and confirm 0 MCC warnings.
  • A completed s2idle cycle with allocation on and a memory checksum. The row in the comments aborted in pcie-apple -EBUSY, so the s2idle path never completed.
  • Deep 2/2 with the checksum is covered, but on sship7, not tip.

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.

3 participants