From b22b09b14d897d14b5639839371f09edc98414cc Mon Sep 17 00:00:00 2001 From: Jeff Queisser Date: Tue, 10 Nov 2026 23:52:03 -0800 Subject: [PATCH 1/3] arm64: dts: apple: t6050-ultra: Describe the CPU clusters and their L2s, for up to 1.5x faster and steadier light GPU submits on M5 Ultra The M5 Ultra's CPU nodes have no cpu-map and name no cache, so Linux sees thirty CPUs in one package with no clusters, and one L2 shared by all thirty. Two things follow on the J775D (Mac Studio): - parse_dt_topology() reads capacity-dmips-mhz only while it walks cpu-map, so the M and P core capacities that t6050-base.dtsi gives every T6050 CPU (dj's #1399) never reach the scheduler: every CPU reports cpu_capacity 1024. - With no last-level cache to group the CPUs by, the scheduler's cache-sharing domain is the whole package: a wakeup may pick any idle CPU of the thirty, on either die. Describe the six clusters the way the one-die description does, commit 68c10dd872af ("arm64: dts: apple: t6050: Describe the CPU clusters"): MPIDR Aff1 0, 1 and 2 are die 0's M0, M1 and P clusters and 0x10, 0x11 and 0x12 are die 1's, five cores each, as the ADT's cluster-id and die-id give them. The clusters are listed flat, cluster0-2 on die 0 and cluster3-5 on die 1, as the M1 and M2 Ultra descriptions (t6002.dtsi, t6022.dtsi) list theirs; the topology parser does not support clusters of clusters. The boot loader prunes the entries of cores it did not start. The capacities in t6050-base.dtsi are kept as they are. Add one L2 cache node per cluster and point each CPU's next-level-cache at its cluster's: the ADT gives each CPU an l2-cache-size of 8 MiB in the M clusters and 16 MiB in the P clusters. It gives no L1 sizes and no L2 geometry, so the nodes carry the level and the size only. They sit in /cpus as l2-cache-N, as in t6002.dtsi and t6022.dtsi. Both are in one commit because the gain needs both. With the cpu-map alone the clusters and capacities appear, but every CPU still reports its L2 as shared by all thirty, and the rows below read as without it (18.4-23.0 us at depth 8, on integration's head of 2026-11-10). Only t6050-j775d.dts includes t6050-ultra.dtsi, so the J775D is the only board whose device tree changes: the ten other T6050 board device trees (J714c, J714s, J716c, J716s, J775c, J873s, K114c, K114s, K116c, K116s) are byte-identical with and without the series. The one-die description (t6050-max.dtsi) has a cpu-map and no cache nodes; this commit leaves it unchanged. Testing, on J775D, integration/aurora's head of 2026-11-14 (the merge of #1901) with the J775D GPU described (its own pull request), two boots with and two without this commit, three passes of each row a boot: - cpu_capacity reads 754 on the twenty M cores and 1024 on the ten P cores (1024 on all thirty without); cluster_cpus_list reads six lists of five (thirty lists of one without); each CPU's L2 reads 8 MiB or 16 MiB shared by its own five (no size, shared by all thirty, without). - A light compute submit with 8 in flight takes 16.8-17.6 us against 20.1-23.5, and with 64 in flight 13.7-14.5 us against 16.1-24.0. A 720p fill with 4 in flight takes 43.3-45.4 us against 50.5-70.3. By the median of the six passes these are 1.31x, 1.52x and 1.40x. A single-triangle render with 8 in flight takes 31.9-32.5 us against 30.9-37.6, and with 32 in flight 29.1-29.9 us against 28.2-38.0: steadier rather than faster. Single submits and the heavy compute rows are unchanged, and a semaphore hop between two queues takes 42.3-46.5 us against 45.0-49.1. - The GPU's compute and chained-submit checks, 46 concurrent clients and a 628-case render CTS subset (571 pass, 57 not supported) read the same either way, with no GPU recovery, fault or timeout in the kernel log. Signed-off-by: Jeff Queisser --- arch/arm64/boot/dts/apple/t6050-ultra.dtsi | 283 +++++++++++++++++++++ 1 file changed, 283 insertions(+) diff --git a/arch/arm64/boot/dts/apple/t6050-ultra.dtsi b/arch/arm64/boot/dts/apple/t6050-ultra.dtsi index 90bf4bb29be0e..eefdfdbdc5dee 100644 --- a/arch/arm64/boot/dts/apple/t6050-ultra.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-ultra.dtsi @@ -57,6 +57,168 @@ T6050_P_CPU(cpu32, 11202, cpufreq_pc_die1); T6050_P_CPU(cpu33, 11203, cpufreq_pc_die1); T6050_P_CPU(cpu34, 11204, cpufreq_pc_die1); + + /* + * The clusters are MPIDR Aff1 (die 0's M0, M1 and P, then die 1's), each with its + * own L2. They are listed flat, as on the other two-die parts. The boot loader + * prunes the entries of cores it did not start. + */ + cpu-map { + cluster0 { + core0 { + cpu = <&cpu0>; + }; + core1 { + cpu = <&cpu1>; + }; + core2 { + cpu = <&cpu2>; + }; + core3 { + cpu = <&cpu3>; + }; + core4 { + cpu = <&cpu4>; + }; + }; + + cluster1 { + core0 { + cpu = <&cpu6>; + }; + core1 { + cpu = <&cpu7>; + }; + core2 { + cpu = <&cpu8>; + }; + core3 { + cpu = <&cpu9>; + }; + core4 { + cpu = <&cpu10>; + }; + }; + + cluster2 { + core0 { + cpu = <&cpu12>; + }; + core1 { + cpu = <&cpu13>; + }; + core2 { + cpu = <&cpu14>; + }; + core3 { + cpu = <&cpu15>; + }; + core4 { + cpu = <&cpu16>; + }; + }; + + cluster3 { + core0 { + cpu = <&cpu18>; + }; + core1 { + cpu = <&cpu19>; + }; + core2 { + cpu = <&cpu20>; + }; + core3 { + cpu = <&cpu21>; + }; + core4 { + cpu = <&cpu22>; + }; + }; + + cluster4 { + core0 { + cpu = <&cpu24>; + }; + core1 { + cpu = <&cpu25>; + }; + core2 { + cpu = <&cpu26>; + }; + core3 { + cpu = <&cpu27>; + }; + core4 { + cpu = <&cpu28>; + }; + }; + + cluster5 { + core0 { + cpu = <&cpu30>; + }; + core1 { + cpu = <&cpu31>; + }; + core2 { + cpu = <&cpu32>; + }; + core3 { + cpu = <&cpu33>; + }; + core4 { + cpu = <&cpu34>; + }; + }; + }; + + /* + * One L2 per cluster: the ADT gives each CPU an l2-cache-size of 8 MiB in the M + * clusters and 16 MiB in the P clusters. It gives no L1 sizes and no L2 geometry, + * so the nodes carry the level and the size only. + */ + l2_cache_0: l2-cache-0 { + compatible = "cache"; + cache-level = <2>; + cache-unified; + cache-size = <0x800000>; + }; + + l2_cache_1: l2-cache-1 { + compatible = "cache"; + cache-level = <2>; + cache-unified; + cache-size = <0x800000>; + }; + + l2_cache_2: l2-cache-2 { + compatible = "cache"; + cache-level = <2>; + cache-unified; + cache-size = <0x1000000>; + }; + + l2_cache_3: l2-cache-3 { + compatible = "cache"; + cache-level = <2>; + cache-unified; + cache-size = <0x800000>; + }; + + l2_cache_4: l2-cache-4 { + compatible = "cache"; + cache-level = <2>; + cache-unified; + cache-size = <0x800000>; + }; + + l2_cache_5: l2-cache-5 { + compatible = "cache"; + cache-level = <2>; + cache-unified; + cache-size = <0x1000000>; + }; }; /* Die 1 MMIO. The boot loader needs each die's bus. */ @@ -69,6 +231,127 @@ }; }; +/* Each CPU's next-level cache is its cluster's L2 (cluster N, l2_cache_N). */ +&cpu0 { + next-level-cache = <&l2_cache_0>; +}; + +&cpu1 { + next-level-cache = <&l2_cache_0>; +}; + +&cpu2 { + next-level-cache = <&l2_cache_0>; +}; + +&cpu3 { + next-level-cache = <&l2_cache_0>; +}; + +&cpu4 { + next-level-cache = <&l2_cache_0>; +}; + +&cpu6 { + next-level-cache = <&l2_cache_1>; +}; + +&cpu7 { + next-level-cache = <&l2_cache_1>; +}; + +&cpu8 { + next-level-cache = <&l2_cache_1>; +}; + +&cpu9 { + next-level-cache = <&l2_cache_1>; +}; + +&cpu10 { + next-level-cache = <&l2_cache_1>; +}; + +&cpu12 { + next-level-cache = <&l2_cache_2>; +}; + +&cpu13 { + next-level-cache = <&l2_cache_2>; +}; + +&cpu14 { + next-level-cache = <&l2_cache_2>; +}; + +&cpu15 { + next-level-cache = <&l2_cache_2>; +}; + +&cpu16 { + next-level-cache = <&l2_cache_2>; +}; + +&cpu18 { + next-level-cache = <&l2_cache_3>; +}; + +&cpu19 { + next-level-cache = <&l2_cache_3>; +}; + +&cpu20 { + next-level-cache = <&l2_cache_3>; +}; + +&cpu21 { + next-level-cache = <&l2_cache_3>; +}; + +&cpu22 { + next-level-cache = <&l2_cache_3>; +}; + +&cpu24 { + next-level-cache = <&l2_cache_4>; +}; + +&cpu25 { + next-level-cache = <&l2_cache_4>; +}; + +&cpu26 { + next-level-cache = <&l2_cache_4>; +}; + +&cpu27 { + next-level-cache = <&l2_cache_4>; +}; + +&cpu28 { + next-level-cache = <&l2_cache_4>; +}; + +&cpu30 { + next-level-cache = <&l2_cache_5>; +}; + +&cpu31 { + next-level-cache = <&l2_cache_5>; +}; + +&cpu32 { + next-level-cache = <&l2_cache_5>; +}; + +&cpu33 { + next-level-cache = <&l2_cache_5>; +}; + +&cpu34 { + next-level-cache = <&l2_cache_5>; +}; + #define DIE #define DIE_NO 0 #define DIE_UNIT_PREFIX From 8cc01a58400b078c77bbc17b23a9032fe0f670d5 Mon Sep 17 00:00:00 2001 From: Jeff Queisser Date: Wed, 11 Nov 2026 21:44:49 -0800 Subject: [PATCH 2/3] dt-bindings: gpu: apple,agx: Accept the M5 Ultra's GPU (apple,agx-g17d), so the Mac Studio's GPU can be described The M5 Ultra has the T6050's GPU on two dies (G17D). The driver matches the family name "apple,agx-g17s" and tells the M5 parts apart by the GPU's ID registers, so the Ultra needs no entry of its own there, but its device tree should say which part it is. Allow "apple,agx-g17d" with "apple,agx-g17s" as its fallback, beside the M5 Max's "apple,agx-g17c" that ewb's commit 4c7fdf1d3b57 ("dt-bindings: gpu: apple: Describe the J716c GPU and panel handoff") added: his entry becomes a list of two names, the form the G13 and G14 parts already use (apple,agx-g13c and apple,agx-g13d, apple,agx-g14c and apple,agx-g14d). The M5 Ultra's GPU node has the M5 Pro's hand-off shape: one "sgx" range, the two firmware mailboxes and the six reserved regions, and no operating-point tables. Since sithglan's commit 8f418a490a97 ("dt-bindings: gpu: apple,agx: Tell the two G17S layouts apart") that entry applies to a node whose only compatible is "apple,agx-g17s", so apply it to a node with "apple,agx-g17d" as well. A node with only "apple,agx-g17s" and a "apple,agx-g17c" node take the entries they took before, and no existing device tree uses the new name. Signed-off-by: Jeff Queisser --- .../devicetree/bindings/gpu/apple,agx.yaml | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/Documentation/devicetree/bindings/gpu/apple,agx.yaml b/Documentation/devicetree/bindings/gpu/apple,agx.yaml index 7794c0e13b939..1829e74c57287 100644 --- a/Documentation/devicetree/bindings/gpu/apple,agx.yaml +++ b/Documentation/devicetree/bindings/gpu/apple,agx.yaml @@ -25,7 +25,9 @@ properties: - apple,agx-t8140 - apple,agx-t8142 - items: - - const: apple,agx-g17c + - enum: + - apple,agx-g17c + - apple,agx-g17d - const: apple,agx-g17s - items: - const: apple,agx-t8103 @@ -267,12 +269,15 @@ allOf: - if: properties: compatible: - const: apple,agx-g17s + anyOf: + - const: apple,agx-g17s + - contains: + const: apple,agx-g17d then: description: - The M5 Pro GPU uses one MMIO range and two firmware mailbox roles. - Its firmware graph supplies the performance tables, so it has no - operating-point table in the board DT. + The M5 Pro and M5 Ultra GPUs use one MMIO range and two firmware + mailbox roles. Their firmware graph supplies the performance tables, + so they have no operating-point table in the board DT. properties: reg: maxItems: 1 From 9da1fd9ba1afc94a9ce31be3ca945830c510e5c0 Mon Sep 17 00:00:00 2001 From: Jeff Queisser Date: Tue, 10 Nov 2026 23:07:02 -0800 Subject: [PATCH 3/3] arm64: dts: apple: t6050-j775d: Give the Mac Studio (M5 Ultra) a working GPU: describe it for the boot loader's handoff The GPU driver has the M5 Ultra's configuration, but the J775D device tree leaves the GPU and both GPU coprocessor nodes of the inventory disabled, with no mailboxes and no reservations, so the Mac Studio boots without a render node and its desktop session cannot start. Add t6050-j775d-gpu.dtsi in the shape of dj's t6050-j714s-gpu-panel.dtsi, commit 32a31cfb06e7 ("arm64: dts: apple: t6050-j714s: Describe the GPU and panel handoff"): the "gpu" alias, the six reservations the boot loader fills, the two firmware mailboxes in place of the inventory's coprocessor nodes, GPX and AFR held on, and the GPU node's handoff properties. The J775D ADT gives the same addresses and interrupts as J714s's: both firmware roles and their mailboxes are on die 0. Two things differ from the J714s file: - no panel or display part: the Studio's display chain is described already; - the part's name, "apple,agx-g17d", with the "apple,agx-g17s" fallback the driver and the boot loader match. The GPU part now reads much the same in four board files: the J714s, J716c and K114c GPU files and this one. It could be one shared file that they include; this leaves the others as they are. Everything stays disabled in the source: the boot loader enables the nodes after checking the ADT and the GPU firmware build. A loader that does not know the Ultra's build leaves the GPU off, as today. Only t6050-j775d.dts includes the new file. Testing, on J775D, integration/aurora's head of 2026-11-14 (the merge of #1901) with this series, in six boots: one through aura main with the loader's own pull request ("kboot: T6050: hand the M5 Ultra's GPU to Linux instead of refusing its firmware build"), the kernel uploaded over USB, and five through a boot loader that also hands over the display. In each the loader reports the GPU enabled, the driver probes 2300000000.gpu with both firmware roles' initdata acknowledged, and a render node appears, where integration's head has none; the compute and chained-submit checks pass, 46 concurrent clients pass, and a 628-case render CTS subset reads 571 pass and 57 not supported, with no GPU recovery, fault or timeout in the kernel log. The ten other T6050 board device trees (J714c, J714s, J716c, J716s, J775c, J873s, K114c, K114s, K116c, K116s) and T8142's J704, J813 and J815 are byte-identical with and without the series. Signed-off-by: Jeff Queisser --- .../arm64/boot/dts/apple/t6050-j775d-gpu.dtsi | 120 ++++++++++++++++++ arch/arm64/boot/dts/apple/t6050-j775d.dts | 2 + 2 files changed, 122 insertions(+) create mode 100644 arch/arm64/boot/dts/apple/t6050-j775d-gpu.dtsi diff --git a/arch/arm64/boot/dts/apple/t6050-j775d-gpu.dtsi b/arch/arm64/boot/dts/apple/t6050-j775d-gpu.dtsi new file mode 100644 index 0000000000000..8b64a03432d96 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-j775d-gpu.dtsi @@ -0,0 +1,120 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * J775D GPU (G17D), for the boot loader's GPU handoff, as + * t6050-j714s-gpu-panel.dtsi describes the J714s's. Everything here stays + * disabled: the loader checks the ADT and the live GPU firmware state, fills + * the GPU reservations, and only then enables the nodes, the GPU last. A + * loader without the handoff, or one whose checks fail, leaves the GPU off. + * + * Values are from the J775DAP 27.0 ADT (sgx, gfx-asc, gfx1-asc, pmgr). Both + * firmware roles, their mailboxes and the GPU node are die 0's, with the + * addresses and interrupts of a one-die T6050; die 1 adds only its power + * states (t6050-ultra.dtsi). + */ + +/ { + aliases { + /* The loader finds the GPU through this alias */ + gpu = &sgx; + }; + + reserved-memory { + /* Filled and enabled by the loader from the ADT */ + gpu_fw_text: gpu-fw-text { + reg = <0 0 0 0>; + no-map; + status = "disabled"; + }; + + gpu_fw_data: gpu-fw-data { + reg = <0 0 0 0>; + no-map; + status = "disabled"; + }; + + uat_ttbs: uat-ttbs { + reg = <0 0 0 0>; + no-map; + status = "disabled"; + }; + + uat_pagetables: uat-pagetables { + reg = <0 0 0 0>; + no-map; + status = "disabled"; + }; + + uat_l2_pagetables: uat-l2-pagetables { + reg = <0 0 0 0>; + no-map; + status = "disabled"; + }; + + uat_handoff: uat-handoff { + reg = <0 0 0 0>; + no-map; + status = "disabled"; + }; + }; +}; + +/* The inventory ASC nodes; the mailboxes below describe the same windows. */ +/delete-node/ &gfx_asc; +/delete-node/ &gfx1_asc; + +&{/soc} { + /* + * ADT gfx-asc and gfx1-asc at their physical windows: the wrapper, the + * 8-byte iop-vbar, and their second and third interrupts (send-empty, + * recv-not-empty), as T8140/T8142. + */ + gfx_mbox: mailbox@2302600000 { + compatible = "apple,t6050-j775d-ascwrap-v6"; + reg = <0x23 0x2600000 0x0 0x88000>, + <0x23 0x2050000 0x0 0x8>; + reg-names = "wrapper", "iop-vbar"; + interrupts = , + ; + interrupt-names = "send-empty", "recv-not-empty"; + apple,firmware-role = "GFX"; + power-domains = <&ps_gfx>; + #mbox-cells = <0>; + status = "disabled"; + }; + + gfx1_mbox: mailbox@2302e00000 { + compatible = "apple,t6050-j775d-ascwrap-v6"; + reg = <0x23 0x2e00000 0x0 0x88000>, + <0x23 0x2850000 0x0 0x8>; + reg-names = "wrapper", "iop-vbar"; + interrupts = , + ; + interrupt-names = "send-empty", "recv-not-empty"; + apple,firmware-role = "GFX1"; + power-domains = <&ps_gfx>; + #mbox-cells = <0>; + status = "disabled"; + }; +}; + +/* The ADT marks GPX and AFR, GFX's parents, critical. */ +&ps_gpx { + apple,always-on; +}; + +&ps_afr { + apple,always-on; +}; + +&sgx { + compatible = "apple,agx-g17d", "apple,agx-g17s"; + /* ADT sgx reg[0]; the driver maps the first 16 MiB as "sgx" */ + reg = <0x23 0x0 0x0 0x3fdc000>; + reg-names = "sgx"; + /delete-property/ interrupts; + mboxes = <&gfx_mbox>, <&gfx1_mbox>; + memory-region = <&uat_ttbs>, <&uat_pagetables>, <&uat_handoff>, + <&gpu_fw_data>, <&uat_l2_pagetables>, <&gpu_fw_text>; + memory-region-names = "ttbs", "pagetables", "handoff", "fw-data", + "l2-pagetables", "fw-text"; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-j775d.dts b/arch/arm64/boot/dts/apple/t6050-j775d.dts index 68b4c324aca02..f3c9aa834e90a 100644 --- a/arch/arm64/boot/dts/apple/t6050-j775d.dts +++ b/arch/arm64/boot/dts/apple/t6050-j775d.dts @@ -696,3 +696,5 @@ #define T6050_J775D #include "t6050-peripherals.dtsi" + +#include "t6050-j775d-gpu.dtsi"