From c227616294dec5a8c3e6ba761a7dcb95639a9e8e Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Wed, 4 Nov 2026 07:56:06 +0000 Subject: [PATCH 1/5] dt-bindings: clock: google,gs101-acpm: add the paired GPU clock The Mali-G78 in gs101 is clocked from two ACPM DVFS domains, G3D for the shader cores and G3DL2 for the top level and L2, which have to move together. Add an ID for a clock that sets both, after the 14 DVFS domains, as gs201 has GS201_CLK_ACPM_GPU. Assisted-by: Claude Opus 5.5 Signed-off-by: saiththerobo --- include/dt-bindings/clock/google,gs101-acpm.h | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/include/dt-bindings/clock/google,gs101-acpm.h b/include/dt-bindings/clock/google,gs101-acpm.h index e2ba89e09f..0153c652bf 100644 --- a/include/dt-bindings/clock/google,gs101-acpm.h +++ b/include/dt-bindings/clock/google,gs101-acpm.h @@ -23,4 +23,10 @@ #define GS101_CLK_ACPM_DVFS_DISP 12 #define GS101_CLK_ACPM_DVFS_BO 13 +/* + * The GPU as one clock: its rate is the shader (G3D) rate, and setting it + * also moves the top/L2 domain (G3DL2) to the level paired with it. + */ +#define GS101_CLK_ACPM_GPU 14 + #endif /* _DT_BINDINGS_CLOCK_GOOGLE_GS101_ACPM_H */ From 711de979847f440cbf35da724d129871ab711eb7 Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Wed, 4 Nov 2026 07:56:16 +0000 Subject: [PATCH 2/5] clk: samsung: acpm: add a paired GPU clock for gs101 The Mali-G78 in gs101 is clocked from two DVFS domains, G3D for the shader cores and G3DL2 for the top level and L2. Google's driver moves them together from a fixed table and keeps G3DL2 at or above G3D throughout (gpu_dvfs_set_new_level() in pixel_gpu_dvfs.c: "When clocking down we must set G3D CLK first"). Setting the two clocks one after the other from the GPU driver can't keep that order in both directions. Add gs101 a "gpu" clock as gs201 and zumapro have: its rate is the shader rate, and setting it moves G3DL2 to the paired level, raising it first going up and lowering it last going down. The pairs are Google's gs101 table (gpu_dvfs_table_v2 up to gpu_dvfs_max_freq, 800 MHz), with the 151 and 202 MHz rows that stock's 250 MHz gpu_dvfs_min_freq leaves out. Unlike gs201's, the clock is writable from the start: the levels were run on a Pixel 6 Pro (raven) through devfreq. The other gs101 clocks are unchanged. Assisted-by: Claude Opus 5.5 Signed-off-by: saiththerobo --- drivers/clk/samsung/clk-acpm.c | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c index 82dae93f4f..93f4b89b64 100644 --- a/drivers/clk/samsung/clk-acpm.c +++ b/drivers/clk/samsung/clk-acpm.c @@ -102,9 +102,42 @@ static const struct acpm_clk_variant gs101_acpm_clks[] = { ACPM_CLK("bo"), }; +/* + * gs101 GPU operating points: shader (G3D) rate and the top/L2 (G3DL2) rate + * paired with it, in kHz, from Google's gs101 GPU DVFS table + * (gpu_dvfs_table_v2 in gs101-gpu.dtsi, the levels up to its + * gpu_dvfs_max_freq of 800 MHz). Stock's gpu_dvfs_min_freq of 250 MHz + * leaves out the 151 and 202 MHz rows; they are kept, as gs201's are. + */ +static const struct acpm_clk_pair gs101_gpu_pairs[] = { + { 151000, 302000 }, + { 202000, 302000 }, + { 251000, 434000 }, + { 302000, 434000 }, + { 351000, 603000 }, + { 400000, 603000 }, + { 471000, 603000 }, + { 510000, 750000 }, + { 572000, 750000 }, + { 701000, 885000 }, + { 762000, 996000 }, +}; + +static const struct acpm_clk_paired gs101_acpm_paired[] = { + { + .name = "gpu", + .id = 5, /* G3D: shader cores */ + .id2 = 6, /* G3DL2: top level and L2 */ + .pairs = gs101_gpu_pairs, + .nr_pairs = ARRAY_SIZE(gs101_gpu_pairs), + }, +}; + static const struct acpm_clk_driver_data acpm_clk_gs101 = { .clks = gs101_acpm_clks, .nr_clks = ARRAY_SIZE(gs101_acpm_clks), + .paired = gs101_acpm_paired, + .nr_paired = ARRAY_SIZE(gs101_acpm_paired), .mbox_chan_id = 0, }; From 49963c41935d47ec09cae88306d8944dcbd919eb Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Wed, 4 Nov 2026 07:56:27 +0000 Subject: [PATCH 3/5] drm/panfrost: let firmware-managed GPUs scale through devfreq On gs101 the APM firmware (ACPM) sets the G3D voltages together with the G3D and G3D L2 clock rates, so the four GPU rails need no OPP voltages, and panfrost skipped devfreq altogether because the GPU has more than one supply: the GPU ran at the 151 MHz the bootloader left. Add GPU_PM_FW_DVFS for such GPUs: devfreq then sets rates only. The L2 clock is the clock provider's business: on gs101 one ACPM clock moves both domains together, in the order the firmware needs. Assisted-by: Claude Opus 5.5 Signed-off-by: saiththerobo --- drivers/gpu/drm/panfrost/panfrost_devfreq.c | 5 +++-- drivers/gpu/drm/panfrost/panfrost_device.h | 5 ++++- drivers/gpu/drm/panfrost/panfrost_drv.c | 6 +++++- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/drivers/gpu/drm/panfrost/panfrost_devfreq.c b/drivers/gpu/drm/panfrost/panfrost_devfreq.c index b51c307788..bc113f58cb 100644 --- a/drivers/gpu/drm/panfrost/panfrost_devfreq.c +++ b/drivers/gpu/drm/panfrost/panfrost_devfreq.c @@ -126,8 +126,9 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) struct thermal_cooling_device *cooling; struct panfrost_devfreq *pfdevfreq = &pfdev->pfdevfreq; unsigned long freq = ULONG_MAX; + bool fw_dvfs = pfdev->comp->pm_features & BIT(GPU_PM_FW_DVFS); - if (pfdev->comp->num_supplies > 1) { + if (pfdev->comp->num_supplies > 1 && !fw_dvfs) { /* * GPUs with more than 1 supply require platform-specific handling: * continue without devfreq @@ -140,7 +141,7 @@ int panfrost_devfreq_init(struct panfrost_device *pfdev) if (ret) return ret; - ret = devm_pm_opp_set_regulators(dev, pfdev->comp->supply_names); + ret = fw_dvfs ? 0 : devm_pm_opp_set_regulators(dev, pfdev->comp->supply_names); if (ret) { /* Continue if the optional regulator is missing */ if (ret != -ENODEV) { diff --git a/drivers/gpu/drm/panfrost/panfrost_device.h b/drivers/gpu/drm/panfrost/panfrost_device.h index 1fe1554f26..681d43667c 100644 --- a/drivers/gpu/drm/panfrost/panfrost_device.h +++ b/drivers/gpu/drm/panfrost/panfrost_device.h @@ -43,11 +43,14 @@ enum panfrost_drv_comp_bits { * @GPU_PM_VREG_OFF: Allow turning off regulators during system suspend * @GPU_PM_RT: Allow disabling clocks and asserting the reset control during * system runtime suspend + * @GPU_PM_FW_DVFS: Firmware sets the GPU voltages with the clock rates, so + * devfreq sets rates only, whatever the number of supplies */ enum panfrost_gpu_pm { GPU_PM_CLK_DIS, GPU_PM_VREG_OFF, - GPU_PM_RT + GPU_PM_RT, + GPU_PM_FW_DVFS, }; /** diff --git a/drivers/gpu/drm/panfrost/panfrost_drv.c b/drivers/gpu/drm/panfrost/panfrost_drv.c index c7ba908745..ead8412b46 100644 --- a/drivers/gpu/drm/panfrost/panfrost_drv.c +++ b/drivers/gpu/drm/panfrost/panfrost_drv.c @@ -1079,13 +1079,17 @@ static const struct panfrost_compatible default_data = { .pm_domain_names = NULL, }; -/* gs101 (Pixel 6): the G3D rails, all always-on; no DVFS yet */ +/* + * gs101 (Pixel 6): the G3D rails, all always-on. The APM firmware (ACPM) + * sets their voltages with the G3D and G3D L2 clock rates. + */ static const char * const gs101_supplies[] = { "mali", "g3d-l2", "g3d-m", "int-m", NULL }; static const struct panfrost_compatible gs101_data = { .num_supplies = ARRAY_SIZE(gs101_supplies) - 1, .supply_names = gs101_supplies, .num_pm_domains = 1, /* optional */ .pm_domain_names = NULL, + .pm_features = BIT(GPU_PM_FW_DVFS), .gpu_quirks = BIT(GPU_QUIRK_FORCE_AARCH64_PGTABLE), }; From 5ea16dabcbbf75170e5815fe244c0dba11413b91 Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Wed, 4 Nov 2026 07:56:37 +0000 Subject: [PATCH 4/5] arm64: dts: exynos: gs101: scale the GPU through ACPM Use the ACPM GPU clock for the Mali-G78 instead of the fixed oscillator stand-in, with Google's gs101 levels (gpu_dvfs_table_v2 capped at gpu_dvfs_max_freq, 800 MHz) as the OPP table. Setting the clock moves G3D and pairs G3DL2 with it, and ACPM applies the voltages, so the table has rates only. Stock's gpu_dvfs_min_freq is 250 MHz; the 151 and 202 MHz levels are kept, as gs201's are. Stock also raises the memory interface (MIF) to 845 MHz for the top three levels; that isn't done here. Assisted-by: Claude Opus 5.5 Signed-off-by: saiththerobo --- arch/arm64/boot/dts/exynos/google/gs101.dtsi | 62 ++++++++++++++++++-- 1 file changed, 57 insertions(+), 5 deletions(-) diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi index bf3a00cb4e..29a8272e9d 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi +++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi @@ -214,6 +214,59 @@ }; }; + /* + * Google's gs101 GPU levels (gpu_dvfs_table_v2, capped at their + * gpu_dvfs_max_freq of 800 MHz), as shader clock rates. The ACPM GPU + * clock moves the L2 clock to its paired level and sets the voltages. + */ + gpu_opp_table: opp-table-gpu { + compatible = "operating-points-v2"; + + opp-151000000 { + opp-hz = /bits/ 64 <151000000>; + }; + + opp-202000000 { + opp-hz = /bits/ 64 <202000000>; + }; + + opp-251000000 { + opp-hz = /bits/ 64 <251000000>; + }; + + opp-302000000 { + opp-hz = /bits/ 64 <302000000>; + }; + + opp-351000000 { + opp-hz = /bits/ 64 <351000000>; + }; + + opp-400000000 { + opp-hz = /bits/ 64 <400000000>; + }; + + opp-471000000 { + opp-hz = /bits/ 64 <471000000>; + }; + + opp-510000000 { + opp-hz = /bits/ 64 <510000000>; + }; + + opp-572000000 { + opp-hz = /bits/ 64 <572000000>; + }; + + opp-701000000 { + opp-hz = /bits/ 64 <701000000>; + }; + + opp-762000000 { + opp-hz = /bits/ 64 <762000000>; + }; + }; + cpucl0_opp_table: opp-table-0 { compatible = "operating-points-v2"; opp-shared; @@ -2073,11 +2126,10 @@ gpu: gpu@1c500000 { compatible = "google,gs101-mali", "arm,mali-valhall-jm"; reg = <0x1c500000 0x5000>; - /* - * TODO: placeholder until a CMU_G3D driver exists. ABL - * leaves the G3D clock running; this is not that clock. - */ - clocks = <&ext_24_5m>; + /* The shader clock, with L2 paired, set by the APM firmware */ + clocks = <&acpm_ipc GS101_CLK_ACPM_GPU>; + clock-names = "core"; + operating-points-v2 = <&gpu_opp_table>; interrupt-names = "job", "mmu", "gpu"; interrupts = , , From 11ca05cf1884ce442bc9236f82e3fa4c3b42f725 Mon Sep 17 00:00:00 2001 From: saiththerobo Date: Tue, 20 Oct 2026 08:00:31 +0100 Subject: [PATCH 5/5] arm64: dts: exynos: gs101: cool the GPU MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Under a busy shell the Pixel 6 Pro's big cluster reached the 110 °C critical trip and the phone shut down, and nothing slowed the GPU, which heats the whole die. Make the GPU a cooling device, give gpu-thermal passive trips at 80 and 90 °C bound to it, and let the big cluster's second trip slow the GPU too. Assisted-by: Claude Opus 5.5 Signed-off-by: saiththerobo --- arch/arm64/boot/dts/exynos/google/gs101.dtsi | 31 ++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi index 29a8272e9d..ad1816b74f 100644 --- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi +++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi @@ -2130,6 +2130,7 @@ clocks = <&acpm_ipc GS101_CLK_ACPM_GPU>; clock-names = "core"; operating-points-v2 = <&gpu_opp_table>; + #cooling-cells = <2>; interrupt-names = "job", "mmu", "gpu"; interrupts = , , @@ -2194,6 +2195,12 @@ cooling-device = <&cpu6 10 THERMAL_NO_LIMIT>, <&cpu7 10 THERMAL_NO_LIMIT>; }; + + /* the GPU heats the whole die: slow it too */ + map2 { + trip = <&big_hotter>; + cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; }; }; @@ -2289,12 +2296,36 @@ thermal-sensors = <&acpm_tmu 3>; trips { + gpu_hot: gpu-hot { + temperature = <80000>; + hysteresis = <5000>; + type = "passive"; + }; + + gpu_hotter: gpu-hotter { + temperature = <90000>; + hysteresis = <5000>; + type = "passive"; + }; + gpu_crit: gpu-crit { temperature = <110000>; hysteresis = <0>; type = "critical"; }; }; + + cooling-maps { + map0 { + trip = <&gpu_hot>; + cooling-device = <&gpu THERMAL_NO_LIMIT THERMAL_NO_LIMIT>; + }; + + map1 { + trip = <&gpu_hotter>; + cooling-device = <&gpu 5 THERMAL_NO_LIMIT>; + }; + }; }; isp-thermal {