Skip to content

soc: apple: mcc: let the T6050 system level cache allocate - #896

Closed
funkzy wants to merge 2 commits into
aurora-silicon:aurora-wipfrom
funkzy:pr/t6050-mcc
Closed

funkzy wants to merge 2 commits into
aurora-silicon:aurora-wipfrom
funkzy:pr/t6050-mcc

Conversation

@funkzy

@funkzy funkzy commented Nov 3, 2026

Copy link
Copy Markdown
Contributor

Summary

The boot loader leaves the T6050's system level cache enabled and powered but not allocating: on the M5 Ultra
(J775D) all 64 planes read twelve ways enabled and twelve powered (0x2800 = 0x8000000c, 0x2804 = 0x0c000c00),
the flush engine idle and the allocation-disable word at 1. The cache holds nothing, so every miss in an agent's own caches goes to DRAM. apple-mcc already lets the
cache allocate on T8140 and T6040 through the same per-plane words; this adds T6050.

What it changes

  • apple,t6050-mcc, with up to 64 reg entries (eight AMCCs of four planes on each of two dies).
  • MCC_MAX_PLANES 16 to 64.
  • The way fields are the shared ones (MCC_CACHE_WAYS_ENABLED, five bits): the raw words above read twelve in it.
  • On T6050 (the match data) a boot-DMA device whose node is not enabled is skipped: it never binds, so the driver
    would wait for it forever. J775D's display node is enabled only when the boot loader hands the display over.

The sequence is the T8140 one: check each plane's ways and flush engine, clear the allocation-disable word and read
it back; on shutdown or removal set it, flush and wait.

Why

Allocation changes where lines live, not which accesses see them, and the driver flushes before it stops
allocating. With the cache allocating, a scratch-heavy 512x512 render in 2x2 passes takes 51.5-55.8 ms per submit
instead of 202-273 ms, and the GPU firmware's scheduling pass 390 us instead of 650.

What else sees it

Only a device tree with apple,t6050-mcc binds the new entry. T8140, T8132 and T6040 keep their plane counts and
their boot-DMA wait as it was. T6040's boot-DMA device (the display) and T8132's (the PMP) are also enabled by the
boot loader, so the same skip could apply there; it is left to T6050, where it was tested. No drm/asahi code
changes.

Testing (J775D, M5 Ultra)

The kernel: our J775D series (integration/aurora's lineage, as on the Studio every day) with this PR's code and
that of the other T6050 PRs sent with it in place of the series' own forms, booted once on 2026-11-03 and restarted
at the end. (The first form, with a seven-bit way field, is in the series kernel the machine boots by default.)

  • "system level cache allocation enabled on 64 planes" at 1.30 s, with the display handed over by the boot loader
    (its node enabled, its DCP bound).
  • The desktop ran on the external display; no panic, BUG, Oops, WARNING or SError line. The machine restarted
    cleanly at the end (the driver stops allocating and flushes at shutdown).
  • The render timings above were measured with the first form, which reads the same twelve ways and enables the
    same 64 planes.
  • Builds on aurora-wip: 0 errors, 0 warnings, also with the KUnit suite built in. checkpatch --strict: clean.

Not tested

  • Other T605x machines (M5 Pro/Max, which run as APIF guests) and other T6050 boards.
  • A removal or shutdown flush under load: the shutdown path runs at every reboot, idle.
  • A J775D boot without the display handover, the case the skip is for.

Dependencies

None in git. The J775D DT node (a bus over both dies' AMCC ranges, the display as the boot-DMA device) comes with
the J775D board.

ewb: if J716c boots without SPTM one day, its cache should need only its own node and plane count here.

funkzy and others added 2 commits November 2, 2026 14:19
T6050 (M5 Ultra) has the T8140 memory cache controller's per-plane
allocation and flush controls, with eight AMCCs of four planes on each
die: 64 planes on two dies. Add apple,t6050-mcc and allow up to 64 reg
entries.

Signed-off-by: Jeff Queisser <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
The boot loader leaves the T6050's system level cache enabled and
powered but not allocating. On the M5 Ultra (J775D) all 64 planes (eight
AMCCs of four planes on each die) read twelve ways enabled and twelve
powered (0x2800 = 0x8000000c, 0x2804 = 0x0c000c00), the flush engine
idle, and the allocation-disable word (0x82c) at 1. The cache holds no
data, so everything that misses an agent's own caches goes to DRAM. The
GPU's scratch-heavy fragment passes slowed with the number of tiles in
flight, and the GPU firmware's own scheduling pass took 650 us instead
of 390.

apple-mcc already lets the cache allocate on T8140 and T6040 through the
same per-plane words. T6050 uses the same sequence and the same fields
(check each plane's ways and flush engine, clear 0x82c and read it back;
on shutdown or removal set it, flush and wait), with two changes:
- up to 64 planes, not 16 (MCC_MAX_PLANES and the binding's reg
  maxItems);
- a boot-DMA device whose node is not enabled is skipped (the
  "apple,t6050-mcc" match data): it never binds, so the cache would
  otherwise wait for it forever. J775D's display node is enabled only
  when the boot loader hands the display over.

The system level cache sits in front of DRAM in the memory controllers.
Allocation changes where lines live, not which accesses see them, and
the driver flushes it before it stops allocating.

Only a device tree with "apple,t6050-mcc" binds the new entry. T8140,
T8132 and T6040 keep their plane counts and their boot-DMA wait as it
was: T6040's display and T8132's PMP are also enabled by the boot
loader, but the skip was tested only on T6050.

Testing: on J775D, "system level cache allocation enabled on 64 planes"
at 0.71 s and 0x82c reads 0 on all 64. A scratch-heavy 512x512 render
in 2x2 passes took 51.5-55.8 ms per submit (202-273 ms without), and the
GPU's Vulkan clients, its fault recovery and the desktop ran as before.

Signed-off-by: Jeff Queisser <[email protected]>
Co-Authored-By: Claude Opus 5.5 <[email protected]>
@funkzy

funkzy commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Closing: this change now lives in the funkzy/j775d branch of aurora-silicon/linux-aurora (the J775D series as built and booted, 681521644671), which dj merges directly; no PR flow for it any more.

@funkzy funkzy closed this Nov 3, 2026
satchlj added a commit that referenced this pull request Nov 21, 2026
The T6050 memory cache controller has up to 64 planes: eight AMCCs
of four planes per die, on up to two dies. The binding already
describes this layout, but apple-mcc has no match for the controller.
The boot loader leaves the ways enabled and powered with allocation
disabled, so a miss in an agent's own caches goes to DRAM.

T6050 uses the T8140 sequence: check each plane's ways and flush
engine, clear the allocation-disable word and read it back. On
shutdown, removal or deep sleep, disable allocation and flush. Add
the match and raise MCC_MAX_PLANES to the binding's limit of 64.

Wait for a driver to take over every client the DT lists in
apple,boot-dma-devices. A disabled display node can still be scanning
out the boot framebuffer, so its status cannot establish that it is
safe to enable allocation. The loader must drop a client from the
list only once it knows that client's boot DMA is quiescent.

Based on #896 by Jeff Queisser, which measured the effect on J775D.

Signed-off-by: Satya Benson <[email protected]>
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.

1 participant