diff --git a/arch/arm64/boot/dts/apple/t6050-gpu-g17c.dtsi b/arch/arm64/boot/dts/apple/t6050-gpu-g17c.dtsi new file mode 100644 index 000000000000..4fc4df0789b9 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-gpu-g17c.dtsi @@ -0,0 +1,367 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * T6050 M5 Max GPU (G17C, four clusters on one die) for the boot loader's GPU handoff. + * + * Split out of t6050-j716c-gpu-panel.dtsi unchanged, so every M5 Max board describes its GPU + * the same way. The values are those of the SoC (the GPU aperture, both GPU ASC mailboxes and + * the GPU PMGR states); everything a part or a firmware build sets (the memory reservations, + * the operating points, the CS/AFR tables, the power telemetry records) is left zero for the + * loader to fill from the ADT the Mac boots with. Nothing here starts either coprocessor: the + * GPU, its power states and both mailboxes stay disabled until the loader accepts the handoff. + * + * The loader addresses the GPU, its mailboxes and the GPU PMGR under /soc@2300000000, so the + * board must provide that bus (as t6050-j716c.dts does, or T6050_GPU_BUS before + * t6050-peripherals.dtsi) and include this file after t6050-peripherals.dtsi. + */ + +/* Replace the disabled inventory with the GPU driver's resource layout. */ +/delete-node/ &sgx; +/delete-node/ &gfx_asc; +/delete-node/ &gfx1_asc; + +/ { + reserved-memory { + #address-cells = <2>; + #size-cells = <2>; + ranges; + + 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_handoff: uat-handoff { + reg = <0 0 0 0>; + no-map; + status = "disabled"; + }; + + uat_l2_pagetables: uat-l2-pagetables { + reg = <0 0 0 0>; + no-map; + status = "disabled"; + }; + + 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"; + }; + }; + + /* Four clusters on one die: four main voltage lanes and one CS/AFR lane. */ + gpu_opp: opp-table-gpu { + compatible = "operating-points-v2"; + + opp00 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp01 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp02 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp03 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp04 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp05 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp06 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp07 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp08 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp09 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp10 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp11 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp12 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + + opp13 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0 0 0 0>; + opp-microvolt-sram = <0 0 0 0>; + }; + }; + + gpu_afr_opp: opp-table-afr { + compatible = "operating-points-v2"; + + opp00 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp01 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp02 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp03 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp04 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp05 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp06 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp07 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp08 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp09 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp10 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp11 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp12 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp13 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + }; + + gpu_cs_opp: opp-table-cs { + compatible = "operating-points-v2"; + + opp00 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp01 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp02 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp03 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp04 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp05 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp06 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp07 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp08 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp09 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp10 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp11 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp12 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + + opp13 { + opp-hz = /bits/ 64 <0>; + opp-microvolt = <0>; + }; + }; + + soc@2300000000 { + + gpu: gpu@2302600000 { + compatible = "apple,agx-g17c", "apple,agx-g17s"; + reg = <0x23 0x02600000 0x0 0x88000>, + <0x23 0x00000000 0x0 0x4000000>; + reg-names = "asc", "sgx"; + mboxes = <&gfx_mbox>, <&gfx1_mbox>; + power-domains = <&ps_gfx>; + /* Raises the DRAM and fabric floors while GPU work is in flight */ + apple,clpc = <&clpc>; + 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"; + operating-points-v2 = <&gpu_opp>; + apple,afr-opp = <&gpu_afr_opp>; + apple,cs-opp = <&gpu_cs_opp>; + apple,csafr-min-sram-microvolt = <0>; + /* Three power telemetry records, each an identifier and two words. */ + apple,aon-ptd = <0 0 0 0 0 0 0 0 0>; + status = "disabled"; + }; + + gfx_mbox: mailbox@2302600000 { + compatible = "apple,t6050-j775d-ascwrap-v6"; + reg = <0x23 0x02600000 0x0 0x88000>, + <0x23 0x02050000 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 0x02e00000 0x0 0x88000>, + <0x23 0x02850000 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 power states stay disabled until the loader accepts the GPU handoff. */ +&pmgr_gpx { + status = "okay"; +}; + +&ps_gpx { + apple,always-on; +}; + +&ps_afr { + apple,always-on; +}; diff --git a/arch/arm64/boot/dts/apple/t6050-gpu-g17s.dtsi b/arch/arm64/boot/dts/apple/t6050-gpu-g17s.dtsi new file mode 100644 index 000000000000..ac1bb69ebe90 --- /dev/null +++ b/arch/arm64/boot/dts/apple/t6050-gpu-g17s.dtsi @@ -0,0 +1,127 @@ +// SPDX-License-Identifier: GPL-2.0+ OR MIT +/* + * T6050 GPU in the G17S layout, for the boot loader's GPU handoff. + * + * Shared by the boards that describe the GPU this way (K114c, K116s, J873s, K114s). It is the + * common part of t6050-k114c-gpu.dtsi and t6050-k116s-gpu.dtsi, which keep only their board + * notes, and the GPU half of t6050-j714s-gpu-panel.dtsi. Every value is the SoC's: the + * GPU aperture (ADT sgx), both GPU ASCs (gfx-asc, gfx1-asc) and the GPX/AFR power states, + * the same in every T6050 ADT read so far. What a part or a firmware build sets (the six + * memory reservations) is left zero for the loader to fill from the ADT the Mac boots with. + * + * Everything stays disabled: the loader checks the ADT and the live GPU firmware build, fills + * the reservations, then enables the GPU PMGR, GPX, AFR, GFX, both mailboxes and the GPU, the + * GPU last. A loader that refuses, or one without the handoff, leaves the GPU off. + */ + +/ { + 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 { + /* + * "apple,agx-g17s" is what the loader checks and the driver binds + * (drivers/gpu/drm/asahi/driver.rs); the driver then picks its configuration + * from the GPU's ID registers. + */ + compatible = "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-j714c.dts b/arch/arm64/boot/dts/apple/t6050-j714c.dts index cf1d62c690fc..71c2c4dfe66b 100644 --- a/arch/arm64/boot/dts/apple/t6050-j714c.dts +++ b/arch/arm64/boot/dts/apple/t6050-j714c.dts @@ -15,6 +15,8 @@ /dts-v1/; #define T6050_J714C +/* The GPU in the M5 Max layout (t6050-gpu-g17c.dtsi), under its own bus */ +#define T6050_GPU_BUS #include "t6050-max.dtsi" / { @@ -255,6 +257,7 @@ }; #include "t6050-peripherals.dtsi" +#include "t6050-gpu-g17c.dtsi" /* * The PMP (ADT pmp0, /chosen, /arm-io/pmgr), as on the J714s. iBoot loads its firmware and the @@ -303,7 +306,7 @@ apple,pmp = <&pmp0>; }; -&sgx { +&gpu { power-domains = <&pmp0_gfx>; }; diff --git a/arch/arm64/boot/dts/apple/t6050-j716c-gpu-panel.dtsi b/arch/arm64/boot/dts/apple/t6050-j716c-gpu-panel.dtsi index 2b908e34fdaa..b1f3a48a27d5 100644 --- a/arch/arm64/boot/dts/apple/t6050-j716c-gpu-panel.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-j716c-gpu-panel.dtsi @@ -5,344 +5,10 @@ * dependent devices. A source DT alone must not start either coprocessor. */ -/* Replace the disabled inventory with the GPU driver's resource layout. */ -/delete-node/ &sgx; -/delete-node/ &gfx_asc; -/delete-node/ &gfx1_asc; +/* The GPU: t6050-gpu-g17c.dtsi, shared with the other M5 Max boards. */ +#include "t6050-gpu-g17c.dtsi" / { - reserved-memory { - #address-cells = <2>; - #size-cells = <2>; - ranges; - - 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_handoff: uat-handoff { - reg = <0 0 0 0>; - no-map; - status = "disabled"; - }; - - uat_l2_pagetables: uat-l2-pagetables { - reg = <0 0 0 0>; - no-map; - status = "disabled"; - }; - - 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"; - }; - }; - - /* Four clusters on one die: four main voltage lanes and one CS/AFR lane. */ - gpu_opp: opp-table-gpu { - compatible = "operating-points-v2"; - - opp00 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp01 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp02 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp03 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp04 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp05 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp06 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp07 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp08 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp09 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp10 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp11 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp12 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - - opp13 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0 0 0 0>; - opp-microvolt-sram = <0 0 0 0>; - }; - }; - - gpu_afr_opp: opp-table-gpu-afr { - compatible = "operating-points-v2"; - - opp00 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp01 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp02 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp03 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp04 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp05 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp06 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp07 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp08 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp09 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp10 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp11 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp12 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp13 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - }; - - gpu_cs_opp: opp-table-gpu-cs { - compatible = "operating-points-v2"; - - opp00 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp01 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp02 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp03 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp04 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp05 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp06 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp07 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp08 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp09 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp10 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp11 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp12 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - - opp13 { - opp-hz = /bits/ 64 <0>; - opp-microvolt = <0>; - }; - }; - - soc@2300000000 { - - gpu: gpu@2302600000 { - compatible = "apple,agx-g17c", "apple,agx-g17s"; - reg = <0x23 0x02600000 0x0 0x88000>, - <0x23 0x00000000 0x0 0x4000000>; - reg-names = "asc", "sgx"; - mboxes = <&gfx_mbox>, <&gfx1_mbox>; - power-domains = <&ps_gfx>; - /* Raises the DRAM and fabric floors while GPU work is in flight */ - apple,clpc = <&clpc>; - 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"; - operating-points-v2 = <&gpu_opp>; - apple,afr-opp = <&gpu_afr_opp>; - apple,cs-opp = <&gpu_cs_opp>; - apple,csafr-min-sram-microvolt = <0>; - /* Three power telemetry records, each an identifier and two words. */ - apple,aon-ptd = <0 0 0 0 0 0 0 0 0>; - status = "disabled"; - }; - - gfx_mbox: mailbox@2302600000 { - compatible = "apple,t6050-j775d-ascwrap-v6"; - reg = <0x23 0x02600000 0x0 0x88000>, - <0x23 0x02050000 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 0x02e00000 0x0 0x88000>, - <0x23 0x02850000 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 loader verifies these clock identifiers and fills their rates. */ dcp_fw_clk361: clock-dcp-firmware-361 { compatible = "fixed-clock"; @@ -365,19 +31,6 @@ }; }; -/* The power states stay disabled until the loader accepts the GPU handoff. */ -&pmgr_gpx { - status = "okay"; -}; - -&ps_gpx { - apple,always-on; -}; - -&ps_afr { - apple,always-on; -}; - &dcp_dart { apple,dma-range = <0x100 0x0 0x300 0x0>; }; diff --git a/arch/arm64/boot/dts/apple/t6050-j873s.dts b/arch/arm64/boot/dts/apple/t6050-j873s.dts index 0a7976e50230..6ef82f23638d 100644 --- a/arch/arm64/boot/dts/apple/t6050-j873s.dts +++ b/arch/arm64/boot/dts/apple/t6050-j873s.dts @@ -34,3 +34,6 @@ #define T6050_J873S #include "t6050-peripherals.dtsi" + +/* The GPU in the M5 Pro layout */ +#include "t6050-gpu-g17s.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-k114c-gpu.dtsi b/arch/arm64/boot/dts/apple/t6050-k114c-gpu.dtsi index ceec5b22d2ae..cd3f544069a5 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114c-gpu.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k114c-gpu.dtsi @@ -9,99 +9,7 @@ * sgx and both GPU ASCs are the same as on the M5 Pro. */ -/ { - 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; -}; +#include "t6050-gpu-g17s.dtsi" /* * The G17 firmware stays live across suspend-to-idle, as the G16's does on T8132: keep @@ -110,16 +18,3 @@ &ps_gfx { apple,sleep-retained; }; - -&sgx { - compatible = "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-k114s.dts b/arch/arm64/boot/dts/apple/t6050-k114s.dts index caa609babef0..79fa200d3a9e 100644 --- a/arch/arm64/boot/dts/apple/t6050-k114s.dts +++ b/arch/arm64/boot/dts/apple/t6050-k114s.dts @@ -22,3 +22,6 @@ #define T6050_K114S #include "t6050-peripherals.dtsi" + +/* The GPU in the M5 Pro layout */ +#include "t6050-gpu-g17s.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-k116c.dts b/arch/arm64/boot/dts/apple/t6050-k116c.dts index ff9e875fb195..b1c009828404 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116c.dts +++ b/arch/arm64/boot/dts/apple/t6050-k116c.dts @@ -21,4 +21,8 @@ }; #define T6050_K116C +/* The GPU in the M5 Max layout (t6050-gpu-g17c.dtsi), under its own bus */ +#define T6050_GPU_BUS #include "t6050-peripherals.dtsi" + +#include "t6050-gpu-g17c.dtsi" diff --git a/arch/arm64/boot/dts/apple/t6050-k116s-gpu.dtsi b/arch/arm64/boot/dts/apple/t6050-k116s-gpu.dtsi index 7bc349759028..ab94211132d3 100644 --- a/arch/arm64/boot/dts/apple/t6050-k116s-gpu.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-k116s-gpu.dtsi @@ -2,150 +2,47 @@ /* * K116s GPU (AGX G17S, ADT /arm-io/sgx "gpu,t6050") for the boot loader hand-off. * - * It is the GPU half of t6050-j714s-gpu-panel.dtsi (integration/aurora 06c3db9c3752); the - * K116s tree already has its own display half. Everything stays disabled: a loader with the - * G17S hand-off fills the six reservations from the ADT and enables the GPU PMGR, GPX, AFR, - * GFX, both mailboxes and the GPU, the GPU last. Without such a loader (the enrolled aura - * 58d65df0 has none for this layout) this file changes nothing at run time except the two - * always-on marks, which sit on disabled nodes. + * The layout is t6050-gpu-g17s.dtsi, the GPU half of t6050-j714s-gpu-panel.dtsi + * (integration/aurora 06c3db9c3752); the K116s tree already has its own display half. + * Everything stays disabled: a loader with the G17S hand-off fills the six reservations from + * the ADT and enables the GPU PMGR, GPX, AFR, GFX, both mailboxes and the GPU, the GPU last. + * Without such a loader (the enrolled aura 58d65df0 has none for this layout) this file + * changes nothing at run time except the two always-on marks, which sit on disabled nodes. * - * Every value below was checked against the K116s 27.2 ADT. arm-io ranges add 0x2_0000_0000 - * to the 0x21_xxxx_xxxx bus addresses (bus 0x20_2000_0000 -> parent 0x22_2000_0000). - */ - -/ { - aliases { - /* The loader finds the GPU through this alias */ - gpu = &sgx; - }; - - reserved-memory { - /* - * Filled and enabled by the loader from the ADT. K116s 27.2 values, for - * reference only (never hard-code: iBoot places them): - * gpu-fw-text 0x100_00ff8000 + 0xa4000 gfx-asc __TEXT 0x50000, then - * gfx1-asc __TEXT 0x54000 at - * 0x100_01048000 - * gpu-fw-data 0x100_0251c000 + 0x184000 sgx gfx-data-base .. end of - * gfx1-data-shared-ro - * uat-ttbs 0x10f_fffa8000 + 0x4000 sgx gpu-region-base/-size - * uat-pagetables 0x10f_fff28000 + 0x80000 sgx gfx-shared-region-* - * uat-l2-pagetables 0x10f_fff24000 + 0x4000 sgx gfx-shared-l2-region-* - * uat-handoff 0x10f_fff20000 + 0x4000 sgx gfx-handoff-* - * The four UAT ranges are the J714s's (aura ec204ea50b5d message); the firmware - * segments differ (J714s 27.0: fw-text 0x100_00fd4000, fw-data 0x100_024f4000). - */ - 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: reg 0x21_02600000 + 0x88000 (wrapper), 0x21_02050000 + 8 (iop-vbar); - * interrupts [2798, 2797, 2800, 2799], of which the second and third are send-empty - * and recv-not-empty; role "GFX"; power-gates [614] = GFX_ASC. As J714s. - */ - 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"; - }; - - /* - * ADT gfx1-asc: reg 0x21_02e00000 + 0x88000, 0x21_02850000 (ADT size 0x60000; the - * driver uses the first 8 bytes as on J714s); interrupts [2802, 2801, 2804, 2803]; - * role "GFX1"; power-gates [657] = GFX_ASC1. - */ - 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"; - }; -}; - -/* + * Every value was checked against the K116s 27.2 ADT. arm-io ranges add 0x2_0000_0000 to the + * 0x21_xxxx_xxxx bus addresses (bus 0x20_2000_0000 -> parent 0x22_2000_0000). + * + * Reservations, filled and enabled by the loader from the ADT. K116s 27.2 values, for + * reference only (never hard-code: iBoot places them): + * gpu-fw-text 0x100_00ff8000 + 0xa4000 gfx-asc __TEXT 0x50000, then + * gfx1-asc __TEXT 0x54000 at + * 0x100_01048000 + * gpu-fw-data 0x100_0251c000 + 0x184000 sgx gfx-data-base .. end of + * gfx1-data-shared-ro + * uat-ttbs 0x10f_fffa8000 + 0x4000 sgx gpu-region-base/-size + * uat-pagetables 0x10f_fff28000 + 0x80000 sgx gfx-shared-region-* + * uat-l2-pagetables 0x10f_fff24000 + 0x4000 sgx gfx-shared-l2-region-* + * uat-handoff 0x10f_fff20000 + 0x4000 sgx gfx-handoff-* + * The four UAT ranges are the J714s's (aura ec204ea50b5d message); the firmware segments + * differ (J714s 27.0: fw-text 0x100_00fd4000, fw-data 0x100_024f4000). + * + * ADT gfx-asc: reg 0x21_02600000 + 0x88000 (wrapper), 0x21_02050000 + 8 (iop-vbar); + * interrupts [2798, 2797, 2800, 2799], of which the second and third are send-empty and + * recv-not-empty; role "GFX"; power-gates [614] = GFX_ASC. As J714s. + * ADT gfx1-asc: reg 0x21_02e00000 + 0x88000, 0x21_02850000 (ADT size 0x60000; the driver + * uses the first 8 bytes as on J714s); interrupts [2802, 2801, 2804, 2803]; role "GFX1"; + * power-gates [657] = GFX_ASC1. * ADT pmgr devices: GPX (id 359, reg +0x0), AFR (id 360, +0x100) and GFX (id 362, +0x110) * in the GPU PMGR (pmgr reg[51] 0x21_00e80000). The K116s ADT marks GPX and AFR critical, * GFX not, as the J714s file states for its board. + * ADT sgx reg[0] 0x21_00000000 + 0x3fdc000; the driver maps the first 16 MiB as "sgx". The + * driver uses the J714 tables for it, 5 mV below this unit's ADT voltages at eight of the + * fourteen states. */ -&ps_gpx { - apple,always-on; -}; -&ps_afr { - apple,always-on; -}; +#include "t6050-gpu-g17s.dtsi" &sgx { - /* - * "apple,agx-g17s" is what the loader checks and the driver binds - * (drivers/gpu/drm/asahi/driver.rs). The driver uses the J714 tables for it, - * 5 mV below this unit's ADT voltages at eight of the fourteen states. - */ - compatible = "apple,agx-g17s"; - /* ADT sgx reg[0] 0x21_00000000 + 0x3fdc000; 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"; /* * As t6050-j714s.dts: the GPU on the PMP's GFX report entry (report@f, on ps_gfx), * so the PMP is told the GPU is on only while it is powered. The K116s already diff --git a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi index 488f3c3ee6d6..84913ec161d2 100644 --- a/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi +++ b/arch/arm64/boot/dts/apple/t6050-peripherals.dtsi @@ -983,8 +983,28 @@ }; }; -#ifdef T6050_J716C +#ifdef T6050_GPU_BUS +/* + * The GPU aperture (ADT sgx, gfx-asc, gfx1-asc and the GPU PMGR, 0x23_0000_0000) as its own + * bus, as on J716c (t6050-j716c.dts): the M5 Max GPU handoff (t6050-gpu-g17c.dtsi) finds the + * GPU, both mailboxes and the GPU power states under /soc@2300000000. + */ +/ { + gpu_bus: soc@2300000000 { + compatible = "simple-bus"; + #address-cells = <2>; + #size-cells = <2>; + ranges = <0x23 0x0 0x23 0x0 0x0 0x4000000>; + interrupt-parent = <&aic>; + nonposted-mmio; + }; +}; + +#endif +#if defined(T6050_J716C) &j716c_gpu_bus { +#elif defined(T6050_GPU_BUS) +&gpu_bus { #else &{/soc} { #endif