From cf4ae8bbf18b1aea4393f9f65aa1eefc3611041c Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 12:42:39 -0400 Subject: [PATCH 01/13] dt-bindings: clock: google: Add the Tensor G3 G3D CMU Document zuma's (Tensor G3) CMU_G3D, which clocks the GPU, and the CMU_TOP clocks it takes: the G3D GLB, NOCD and SWITCH paths and the shared PLL dividers behind them. The inputs and their order are those of zumapro's CMU_G3D, which has the same layout. Assisted-by: LLM Signed-off-by: Brett-Michael Green --- .../bindings/clock/google,zuma-clock.yaml | 28 +++++++++++++-- include/dt-bindings/clock/google,zuma.h | 36 +++++++++++++++++++ 2 files changed, 61 insertions(+), 3 deletions(-) diff --git a/Documentation/devicetree/bindings/clock/google,zuma-clock.yaml b/Documentation/devicetree/bindings/clock/google,zuma-clock.yaml index b4f1245065..01127c9c34 100644 --- a/Documentation/devicetree/bindings/clock/google,zuma-clock.yaml +++ b/Documentation/devicetree/bindings/clock/google,zuma-clock.yaml @@ -10,13 +10,16 @@ maintainers: - Brett-Michael Green description: | - CMU_TOP supplies the HSI0 NoC and peripheral clocks to CMU_HSI0 from its - shared PLLs. CMU_HSI0 supplies USI2, the touchscreen's SPI, from the HSI0 - peripheral clock; its NoC path also takes the board-level HSI0 ALT clock. + CMU_TOP supplies the HSI0 NoC and peripheral clocks to CMU_HSI0, and the + G3D clocks to CMU_G3D, from its shared PLLs. CMU_HSI0 supplies USI2, the + touchscreen's SPI, from the HSI0 peripheral clock; its NoC path also takes + the board-level HSI0 ALT clock. CMU_TOP also supplies the PERIC1 NoC and USI input clocks to CMU_PERIC1, which supplies USI11, the I2C bus of the battery, charger and USB-C chips. CMU_APM supplies the APM mailbox, its internal memory and the always-on GPIO banks from the always-on ALV PLL and the oscillator. + CMU_G3D supplies the GPU from its own two PLLs and from the G3D GLB, NOCD + and SWITCH clocks of CMU_TOP. The external oscillator supplies the PLL reference and the oscillator mux paths. Clock identifiers are defined in dt-bindings/clock/google,zuma.h. @@ -26,6 +29,7 @@ properties: enum: - google,zuma-cmu-top - google,zuma-cmu-apm + - google,zuma-cmu-g3d - google,zuma-cmu-hsi0 - google,zuma-cmu-peric0 - google,zuma-cmu-peric1 @@ -84,6 +88,24 @@ allOf: - const: bus - const: peri - const: alt + - if: + properties: + compatible: + const: google,zuma-cmu-g3d + then: + properties: + clocks: + items: + - description: External oscillator reference clock + - description: G3D NoC clock from CMU_TOP + - description: G3D global clock from CMU_TOP + - description: G3D switch clock from CMU_TOP + clock-names: + items: + - const: oscclk + - const: bus + - const: glb + - const: switch - if: properties: compatible: diff --git a/include/dt-bindings/clock/google,zuma.h b/include/dt-bindings/clock/google,zuma.h index 05db2859f4..a0f2e2f8a9 100644 --- a/include/dt-bindings/clock/google,zuma.h +++ b/include/dt-bindings/clock/google,zuma.h @@ -33,6 +33,21 @@ #define CLK_DOUT_PERIC0_NOC 26 #define CLK_DOUT_PERIC0_IP 27 +/* CMU_TOP: the G3D paths, and the shared PLL dividers they take. */ +#define CLK_SHARED0_D2 28 +#define CLK_SHARED0_D3 29 +#define CLK_SHARED1_D2 30 +#define CLK_SHARED1_D3 31 +#define CLK_MOUT_G3D_GLB 32 +#define CLK_MOUT_G3D_NOCD 33 +#define CLK_MOUT_G3D_SWITCH 34 +#define CLK_GOUT_G3D_GLB 35 +#define CLK_GOUT_G3D_NOCD 36 +#define CLK_GOUT_G3D_SWITCH 37 +#define CLK_DOUT_G3D_GLB 38 +#define CLK_DOUT_G3D_NOCD 39 +#define CLK_DOUT_G3D_SWITCH 40 + /* CMU_HSI0: USI2, the touchscreen's SPI, and USI3, the GNSS receiver's SPI. */ #define CLK_GOUT_HSI0_ALT 1 #define CLK_MOUT_HSI0_NOC_USER 2 @@ -104,4 +119,25 @@ #define CLK_GOUT_PERIC0_USI14_PCLK 7 #define CLK_GOUT_PERIC0_USI14_RSTNSYNC 8 +/* CMU_G3D: the GPU. */ +#define CLK_FOUT_G3D 1 +#define CLK_FOUT_G3D_L2 2 +#define CLK_MOUT_G3D_SWITCH_USER 3 +#define CLK_MOUT_G3D_GLB_USER 4 +#define CLK_MOUT_G3D_NOCD_USER 5 +#define CLK_MOUT_G3D_L2_GLB 6 +#define CLK_MOUT_G3D_STACKS 7 +#define CLK_MOUT_G3D_TOP 8 +#define CLK_DOUT_G3D_L2_GLB 9 +#define CLK_DOUT_G3D_STACKS 10 +#define CLK_DOUT_G3D_TOP 11 +#define CLK_MOUT_G3D_COREGROUP_USER 12 +#define CLK_MOUT_G3D_STACKS_USER 13 +#define CLK_MOUT_G3D_TOP_USER 14 +#define CLK_DOUT_G3D_NOCP 15 +#define CLK_GOUT_G3D_CMU 16 +#define CLK_GOUT_G3D_CORE 17 +#define CLK_GOUT_G3D_COREGROUP 18 +#define CLK_GOUT_G3D_STACKS 19 + #endif /* _DT_BINDINGS_CLOCK_GOOGLE_ZUMA_H */ From 2a3ecb693d7150280bebefa5f567759c6d6d634b Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 12:43:52 -0400 Subject: [PATCH 02/13] clk: samsung: zuma: Add CMU_G3D Describe the GPU's clocks on zuma (Tensor G3): CMU_TOP's G3D GLB, NOCD and SWITCH paths, with the shared PLL dividers they select from, and CMU_G3D at 0x1ee00000, with its two PLLs, muxes, dividers and the GPU's core, coregroup and stacks gates. As on zumapro, firmware sets these up and keeps G3D on, and the GPU's rate changes go through ACPM, so everything here is read-only. Google's zuma CMUCAL tables give the same offsets, field widths and parents as zumapro's CMU_G3D: the PLLs have PLL0822x's M/P/S layout, and the L2_GLB and STACKS dividers have no ratio field. Link: https://android.googlesource.com/kernel/google-modules/soc/gs/+/refs/heads/android-gs-shusky-6.1-android16/drivers/soc/google/cal-if/zuma/cmucal-sfr.c Assisted-by: LLM Signed-off-by: Brett-Michael Green --- drivers/clk/samsung/clk-zuma.c | 158 ++++++++++++++++++++++++++++++--- 1 file changed, 148 insertions(+), 10 deletions(-) diff --git a/drivers/clk/samsung/clk-zuma.c b/drivers/clk/samsung/clk-zuma.c index 03648acdb1..a0b45be30c 100644 --- a/drivers/clk/samsung/clk-zuma.c +++ b/drivers/clk/samsung/clk-zuma.c @@ -1,16 +1,16 @@ // SPDX-License-Identifier: GPL-2.0-only /* - * Google Tensor G3 (zuma) clocks for the touchscreen, its PMIC and the - * battery bus. + * Google Tensor G3 (zuma) clocks for the touchscreen, its PMIC, the battery + * bus and the GPU. * * Register layout and parents derived from Google's GPL CMUCAL tables in * cal-if/zuma/cmucal-{sfr,node}.c, Copyright 2022 Samsung Electronics Co., Ltd. - * Only the path from CMU_TOP to HSI0's USI2 is described, with CMU_APM's - * clocks for the APM mailbox, its SRAM and the always-on GPIO banks, and - * the path from CMU_TOP to PERIC1's USI11 (the battery, charger and USB-C - * I2C bus). PLLs, - * muxes and dividers keep their firmware settings, except USI2's own - * divider, which sets the SPI rate. No PLL rate table is supplied. + * Only the paths from CMU_TOP to HSI0's USI2 and to CMU_G3D are described, + * with CMU_APM's clocks for the APM mailbox, its SRAM and the always-on GPIO + * banks, and the path from CMU_TOP to PERIC1's USI11 (the battery, charger + * and USB-C I2C bus). PLLs, muxes and dividers keep their firmware settings, + * except USI2's own divider, which sets the SPI rate. No PLL rate table is + * supplied. */ #include @@ -44,6 +44,10 @@ static const struct samsung_fixed_factor_clock top_factors[] __initconst = { FFACTOR(CLK_SHARED1_D4, "zuma_shared1_d4", "zuma_shared1", 1, 4, 0), FFACTOR(CLK_SHARED2_D2, "zuma_shared2_d2", "zuma_shared2", 1, 2, 0), FFACTOR(CLK_SHARED3_D2, "zuma_shared3_d2", "zuma_shared3", 1, 2, 0), + FFACTOR(CLK_SHARED0_D2, "zuma_shared0_d2", "zuma_shared0", 1, 2, 0), + FFACTOR(CLK_SHARED0_D3, "zuma_shared0_d3", "zuma_shared0", 1, 3, 0), + FFACTOR(CLK_SHARED1_D2, "zuma_shared1_d2", "zuma_shared1", 1, 2, 0), + FFACTOR(CLK_SHARED1_D3, "zuma_shared1_d3", "zuma_shared1", 1, 3, 0), }; PNAME(mout_peric1_parents) = { @@ -58,6 +62,17 @@ PNAME(mout_hsi0_peri_parents) = { "zuma_shared0_d4", "zuma_shared2_d2", "zuma_shared3_d2", "zuma_spare", }; +/* NOCD takes the same sources as GLB. */ +PNAME(mout_g3d_glb_parents) = { + "zuma_shared0_d2", "zuma_shared1_d2", "zuma_shared2", "zuma_shared3", + "zuma_shared0_d3", "zuma_shared1_d3", "zuma_shared0_d4", "zuma_spare", +}; + +PNAME(mout_g3d_switch_parents) = { + "zuma_shared2", "zuma_shared0_d3", "zuma_shared3", "zuma_shared1_d3", + "zuma_shared0_d4", "zuma_shared1_d4", "zuma_spare", "zuma_spare", +}; + static const struct samsung_mux_clock top_muxes[] __initconst = { MUX_F(CLK_MOUT_HSI0_NOC, "zuma_mout_hsi0_noc", mout_hsi0_noc_parents, 0x1094, 0, 3, 0, CLK_MUX_READ_ONLY), @@ -71,9 +86,18 @@ static const struct samsung_mux_clock top_muxes[] __initconst = { 0x10f0, 0, 2, 0, CLK_MUX_READ_ONLY), MUX_F(CLK_MOUT_PERIC0_IP, "zuma_mout_peric0_ip", mout_peric1_parents, 0x10ec, 0, 2, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_GLB, "zuma_mout_g3d_glb", mout_g3d_glb_parents, + 0x106c, 0, 3, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_NOCD, "zuma_mout_g3d_nocd", mout_g3d_glb_parents, + 0x1070, 0, 3, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_SWITCH, "zuma_mout_g3d_switch", + mout_g3d_switch_parents, 0x1074, 0, 3, 0, CLK_MUX_READ_ONLY), }; -/* The hardware order is mux -> gate -> divider. HSI0 and PERIC1 are firmware-owned. */ +/* + * The hardware order is mux -> gate -> divider. The HSI0, PERIC0, PERIC1 and + * G3D paths are firmware-owned. + */ static const struct samsung_gate_clock top_ro_gates[] __initconst = { GATE(CLK_GOUT_HSI0_NOC, "zuma_gout_hsi0_noc", "zuma_mout_hsi0_noc", 0x20bc, 21, CLK_IGNORE_UNUSED, 0), @@ -87,6 +111,12 @@ static const struct samsung_gate_clock top_ro_gates[] __initconst = { 0x2114, 21, CLK_IGNORE_UNUSED, 0), GATE(CLK_GOUT_PERIC0_IP, "zuma_gout_peric0_ip", "zuma_mout_peric0_ip", 0x2110, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_GLB, "zuma_gout_g3d_glb", "zuma_mout_g3d_glb", + 0x2094, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_NOCD, "zuma_gout_g3d_nocd", "zuma_mout_g3d_nocd", + 0x2098, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_SWITCH, "zuma_gout_g3d_switch", "zuma_mout_g3d_switch", + 0x209c, 21, CLK_IGNORE_UNUSED, 0), }; static const struct samsung_div_clock top_dividers[] __initconst = { @@ -102,6 +132,12 @@ static const struct samsung_div_clock top_dividers[] __initconst = { 0x18e8, 0, 4, 0, CLK_DIVIDER_READ_ONLY), DIV_F(CLK_DOUT_PERIC0_IP, "zuma_dout_peric0_ip", "zuma_gout_peric0_ip", 0x18e4, 0, 4, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_G3D_GLB, "zuma_dout_g3d_glb", "zuma_gout_g3d_glb", + 0x1864, 0, 4, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_G3D_NOCD, "zuma_dout_g3d_nocd", "zuma_gout_g3d_nocd", + 0x1868, 0, 4, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_G3D_SWITCH, "zuma_dout_g3d_switch", "zuma_gout_g3d_switch", + 0x186c, 0, 3, 0, CLK_DIVIDER_READ_ONLY), }; static const struct samsung_cmu_info top_cmu __initconst = { @@ -115,7 +151,7 @@ static const struct samsung_cmu_info top_cmu __initconst = { .nr_ro_gate_clks = ARRAY_SIZE(top_ro_gates), .div_clks = top_dividers, .nr_div_clks = ARRAY_SIZE(top_dividers), - .nr_clk_ids = CLK_DOUT_PERIC0_IP + 1, + .nr_clk_ids = CLK_DOUT_G3D_SWITCH + 1, }; static void __init zuma_top_init(struct device_node *np) @@ -402,6 +438,107 @@ static const struct samsung_cmu_info peric0_cmu __initconst = { .clk_name = "bus", }; +/* + * CMU_G3D, 0x1ee00000. Firmware sets it up and keeps its domain on: the + * PLLs, muxes and dividers are read-only (the PLLs use the PLL0822x M/P/S + * layout, with no rate table), and the GPU's gates are read-only gates. The + * GPU's own rate changes go through the ACPM firmware, not this CMU. + */ +PNAME(mout_g3d_switch_user_parents) = { "oscclk", "zuma_dout_g3d_switch" }; + +PNAME(mout_g3d_glb_user_parents) = { "oscclk", "zuma_dout_g3d_glb" }; + +PNAME(mout_g3d_nocd_user_parents) = { "oscclk", "zuma_dout_g3d_nocd" }; + +PNAME(mout_g3d_l2_glb_parents) = { + "zuma_fout_g3d_l2", "zuma_mout_g3d_glb_user", +}; + +PNAME(mout_g3d_stacks_parents) = { + "zuma_fout_g3d", "zuma_mout_g3d_switch_user", +}; + +PNAME(mout_g3d_top_parents) = { + "zuma_mout_g3d_stacks", "zuma_mout_g3d_nocd_user", + "zuma_mout_g3d_l2_glb", "oscclk", +}; + +PNAME(mout_g3d_coregroup_user_parents) = { "oscclk", "zuma_dout_g3d_l2_glb" }; + +PNAME(mout_g3d_stacks_user_parents) = { "oscclk", "zuma_dout_g3d_stacks" }; + +PNAME(mout_g3d_top_user_parents) = { "oscclk", "zuma_dout_g3d_top" }; + +static const struct samsung_pll_clock g3d_plls[] __initconst = { + PLL(pll_0822x, CLK_FOUT_G3D, "zuma_fout_g3d", "oscclk", + 0x000, 0x10c, NULL), + PLL(pll_0822x, CLK_FOUT_G3D_L2, "zuma_fout_g3d_l2", "oscclk", + 0x008, 0x18c, NULL), +}; + +static const struct samsung_mux_clock g3d_muxes[] __initconst = { + MUX_F(CLK_MOUT_G3D_SWITCH_USER, "zuma_mout_g3d_switch_user", + mout_g3d_switch_user_parents, 0x620, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_GLB_USER, "zuma_mout_g3d_glb_user", + mout_g3d_glb_user_parents, 0x600, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_NOCD_USER, "zuma_mout_g3d_nocd_user", + mout_g3d_nocd_user_parents, 0x610, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_L2_GLB, "zuma_mout_g3d_l2_glb", + mout_g3d_l2_glb_parents, 0x1000, 0, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_STACKS, "zuma_mout_g3d_stacks", + mout_g3d_stacks_parents, 0x1004, 0, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_TOP, "zuma_mout_g3d_top", mout_g3d_top_parents, + 0x1008, 0, 2, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_COREGROUP_USER, "zuma_mout_g3d_coregroup_user", + mout_g3d_coregroup_user_parents, 0x630, 4, 1, 0, + CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_STACKS_USER, "zuma_mout_g3d_stacks_user", + mout_g3d_stacks_user_parents, 0x640, 4, 1, 0, CLK_MUX_READ_ONLY), + MUX_F(CLK_MOUT_G3D_TOP_USER, "zuma_mout_g3d_top_user", + mout_g3d_top_user_parents, 0x650, 4, 1, 0, CLK_MUX_READ_ONLY), +}; + +/* CAL exposes no ratio field for these two paths: they are pass-through. */ +static const struct samsung_fixed_factor_clock g3d_factors[] __initconst = { + FFACTOR(CLK_DOUT_G3D_L2_GLB, "zuma_dout_g3d_l2_glb", + "zuma_mout_g3d_l2_glb", 1, 1, 0), + FFACTOR(CLK_DOUT_G3D_STACKS, "zuma_dout_g3d_stacks", + "zuma_mout_g3d_stacks", 1, 1, 0), +}; + +static const struct samsung_div_clock g3d_dividers[] __initconst = { + DIV_F(CLK_DOUT_G3D_TOP, "zuma_dout_g3d_top", "zuma_mout_g3d_top", + 0x1814, 0, 3, 0, CLK_DIVIDER_READ_ONLY), + DIV_F(CLK_DOUT_G3D_NOCP, "zuma_dout_g3d_nocp", "zuma_dout_g3d_l2_glb", + 0x1808, 0, 3, 0, CLK_DIVIDER_READ_ONLY), +}; + +static const struct samsung_gate_clock g3d_ro_gates[] __initconst = { + GATE(CLK_GOUT_G3D_CMU, "zuma_gout_g3d_cmu", "zuma_dout_g3d_nocp", + 0x2018, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_CORE, "zuma_gout_g3d_core", "zuma_mout_g3d_top_user", + 0x201c, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_COREGROUP, "zuma_gout_g3d_coregroup", + "zuma_mout_g3d_coregroup_user", 0x2020, 21, CLK_IGNORE_UNUSED, 0), + GATE(CLK_GOUT_G3D_STACKS, "zuma_gout_g3d_stacks", + "zuma_mout_g3d_stacks_user", 0x2024, 21, CLK_IGNORE_UNUSED, 0), +}; + +static const struct samsung_cmu_info g3d_cmu __initconst = { + .pll_clks = g3d_plls, + .nr_pll_clks = ARRAY_SIZE(g3d_plls), + .mux_clks = g3d_muxes, + .nr_mux_clks = ARRAY_SIZE(g3d_muxes), + .fixed_factor_clks = g3d_factors, + .nr_fixed_factor_clks = ARRAY_SIZE(g3d_factors), + .div_clks = g3d_dividers, + .nr_div_clks = ARRAY_SIZE(g3d_dividers), + .ro_gate_clks = g3d_ro_gates, + .nr_ro_gate_clks = ARRAY_SIZE(g3d_ro_gates), + .nr_clk_ids = CLK_GOUT_G3D_STACKS + 1, + .clk_name = "bus", +}; + static int __init zuma_cmu_probe(struct platform_device *pdev) { const struct samsung_cmu_info *cmu = device_get_match_data(&pdev->dev); @@ -412,6 +549,7 @@ static int __init zuma_cmu_probe(struct platform_device *pdev) static const struct of_device_id zuma_cmu_match[] = { { .compatible = "google,zuma-cmu-apm", .data = &apm_cmu }, + { .compatible = "google,zuma-cmu-g3d", .data = &g3d_cmu }, { .compatible = "google,zuma-cmu-hsi0", .data = &hsi0_cmu }, { .compatible = "google,zuma-cmu-peric0", .data = &peric0_cmu }, { .compatible = "google,zuma-cmu-peric1", .data = &peric1_cmu }, From 350537d6f739dee9d14b7afa7f07e86e4c568dac Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 12:44:04 -0400 Subject: [PATCH 03/13] dt-bindings: firmware: google,gs101-acpm-ipc: Add the Tensor G3 clock ids The Tensor G3 (zuma) ACPM firmware numbers its DVFS domains as Google's enum acpm_dvfs_id for zuma: MIF, INT, CPUCL0-2, DSU, BCI, G3D, G3DL2, TPU, INTCAM, TNR, CAM, MFC, DISP, AOC and BW, the same 17 as the Tensor G4's. Add their clock ids, and the paired GPU clock after them (17), as the gs201 and zumapro headers do, so device trees can name them. Link: https://android.googlesource.com/kernel/google-modules/soc/gs/+/refs/heads/android-gs-shusky-6.1-android16/drivers/soc/google/cal-if/zuma/acpm_dvfs_zuma.h Assisted-by: LLM Signed-off-by: Brett-Michael Green --- MAINTAINERS | 1 + include/dt-bindings/clock/google,zuma-acpm.h | 35 ++++++++++++++++++++ 2 files changed, 36 insertions(+) create mode 100644 include/dt-bindings/clock/google,zuma-acpm.h diff --git a/MAINTAINERS b/MAINTAINERS index 2c4ec69a7a..a44d4a1fbe 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11199,6 +11199,7 @@ F: drivers/thermal/samsung/gs101_acpm_tmu.c F: drivers/usb/dwc3/dwc3-google.c F: include/dt-bindings/clock/google,gs101* F: include/dt-bindings/clock/google,gs201* +F: include/dt-bindings/clock/google,zuma-acpm.h F: include/dt-bindings/clock/google,zuma.h F: include/dt-bindings/clock/google,zumapro* K: [gG]oogle.?[tT]ensor diff --git a/include/dt-bindings/clock/google,zuma-acpm.h b/include/dt-bindings/clock/google,zuma-acpm.h new file mode 100644 index 0000000000..d4dfb8af8f --- /dev/null +++ b/include/dt-bindings/clock/google,zuma-acpm.h @@ -0,0 +1,35 @@ +/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */ +/* + * Device Tree binding constants for the clocks of the Google Tensor G3 + * (zuma) ACPM firmware. + */ + +#ifndef _DT_BINDINGS_CLOCK_GOOGLE_ZUMA_ACPM_H +#define _DT_BINDINGS_CLOCK_GOOGLE_ZUMA_ACPM_H + +/* DVFS domains, numbered as in the firmware messages (enum acpm_dvfs_id). */ +#define ZUMA_CLK_ACPM_DVFS_MIF 0 +#define ZUMA_CLK_ACPM_DVFS_INT 1 +#define ZUMA_CLK_ACPM_DVFS_CPUCL0 2 +#define ZUMA_CLK_ACPM_DVFS_CPUCL1 3 +#define ZUMA_CLK_ACPM_DVFS_CPUCL2 4 +#define ZUMA_CLK_ACPM_DVFS_DSU 5 +#define ZUMA_CLK_ACPM_DVFS_BCI 6 +#define ZUMA_CLK_ACPM_DVFS_G3D 7 +#define ZUMA_CLK_ACPM_DVFS_G3DL2 8 +#define ZUMA_CLK_ACPM_DVFS_TPU 9 +#define ZUMA_CLK_ACPM_DVFS_INTCAM 10 +#define ZUMA_CLK_ACPM_DVFS_TNR 11 +#define ZUMA_CLK_ACPM_DVFS_CAM 12 +#define ZUMA_CLK_ACPM_DVFS_MFC 13 +#define ZUMA_CLK_ACPM_DVFS_DISP 14 +#define ZUMA_CLK_ACPM_DVFS_AOC 15 +#define ZUMA_CLK_ACPM_DVFS_BW 16 + +/* + * 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 ZUMA_CLK_ACPM_GPU 17 + +#endif /* _DT_BINDINGS_CLOCK_GOOGLE_ZUMA_ACPM_H */ From 80810babaf5c9db01d0329e5ea1aa52e1ea59594 Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 12:44:38 -0400 Subject: [PATCH 04/13] clk: samsung: acpm: Add Tensor G3 (zuma) with a paired GPU clock The ACPM protocol driver creates zuma-acpm-clk for the Tensor G3, but clk-acpm had no match for it. Add the zuma variant, built like the zumapro one: - the DVFS domains as clocks. zuma's are zumapro's 17, in the same order (Google's enum acpm_dvfs_id is zuma's), so G3D is 7 and G3DL2 is 8, as the Pixel 8 Pro's stock GPU node names them (gpu1_cmu_cal_id 0xb040007, gpu0_cmu_cal_id 0xb040008); - a paired gpu clock (17) that moves G3D and G3DL2 together. The Pixel 8 Pro's stock gpu_dvfs_table_v2 is the Pixel 9a's, pair for pair, so zumapro's table is reused, without its 940 MHz level: zuma's gpu_dvfs_max_freq is 890 MHz; - zuma_gpu_max_khz, 0 (read-only) by default, as on gs201 and zumapro. The firmware's DVFS channel is 0, as stock's cal_if node has it. Assisted-by: LLM Signed-off-by: Brett-Michael Green --- drivers/clk/samsung/clk-acpm.c | 37 ++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c index 93f4b89b64..14ec89df2d 100644 --- a/drivers/clk/samsung/clk-acpm.c +++ b/drivers/clk/samsung/clk-acpm.c @@ -240,6 +240,7 @@ static const struct acpm_clk_pair zumapro_gpu_pairs[] = { { 807000, 900000 }, { 850000, 900000 }, { 890000, 900000 }, + /* zuma's table stops above 890 MHz: keep this level last. */ { 940000, 950000 }, }; @@ -270,6 +271,39 @@ static const struct acpm_clk_driver_data acpm_clk_zumapro = { .mbox_chan_id = 0, }; +/* + * Tensor G3 (zuma): the same 17 DVFS domains as zumapro (Google's + * enum acpm_dvfs_id is zuma's), and the Pixel 8 Pro's GPU DVFS table (its + * stock gpu_dvfs_table_v2) is the 9a's, pair for pair. Stock stops at + * 890 MHz (gpu_dvfs_max_freq in Google's zuma-gpu.dtsi), so the 940 MHz + * level is left out. + */ +static unsigned int zuma_gpu_max_khz; +module_param(zuma_gpu_max_khz, uint, 0644); +MODULE_PARM_DESC(zuma_gpu_max_khz, + "zuma: highest GPU shader rate in kHz, 0 = read-only (default)"); + +static const struct acpm_clk_paired zuma_acpm_paired[] = { + { + .name = "gpu", + .id = 7, /* G3D: shader cores */ + .id2 = 8, /* G3DL2: top level and L2 */ + .pairs = zumapro_gpu_pairs, + .nr_pairs = ARRAY_SIZE(zumapro_gpu_pairs) - 1, /* not 940 MHz */ + .max_khz = &zuma_gpu_max_khz, + }, +}; + +static const struct acpm_clk_driver_data acpm_clk_zuma = { + .clks = zumapro_acpm_clks, + .nr_clks = ARRAY_SIZE(zumapro_acpm_clks), + .paired = zuma_acpm_paired, + .nr_paired = ARRAY_SIZE(zuma_acpm_paired), + /* Show the firmware's rate, not the last one asked for. */ + .flags = CLK_GET_RATE_NOCACHE, + .mbox_chan_id = 0, +}; + static unsigned long acpm_clk_recalc_rate(struct clk_hw *hw, unsigned long parent_rate) { @@ -509,6 +543,9 @@ static const struct platform_device_id acpm_clk_id[] = { }, { .name = "gs201-acpm-clk", .driver_data = (kernel_ulong_t)&acpm_clk_gs201, + }, { + .name = "zuma-acpm-clk", + .driver_data = (kernel_ulong_t)&acpm_clk_zuma, }, { .name = "zumapro-acpm-clk", .driver_data = (kernel_ulong_t)&acpm_clk_zumapro, From 8e9112d65090cd50f01233eb30f5b5f2f365995f Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 12:44:58 -0400 Subject: [PATCH 05/13] dt-bindings: gpu: mali-valhall-csf: Add the Tensor G3 GPU The Tensor G3 (zuma) has a Mali-G715, arch 11.8.10 r1p2 on the Pixel 8 Pro, like the Tensor G4's. Add its compatible, so that panthor can match its integration-specific cache hash, as it does zumapro's. Assisted-by: LLM Signed-off-by: Brett-Michael Green --- Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml | 1 + 1 file changed, 1 insertion(+) diff --git a/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml b/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml index e1951820af..353235e894 100644 --- a/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml +++ b/Documentation/devicetree/bindings/gpu/arm,mali-valhall-csf.yaml @@ -19,6 +19,7 @@ properties: - items: - enum: - google,gs201-mali # G710 + - google,zuma-mali # G715 - google,zumapro-mali # G715 family - mediatek,mt8196-mali - nxp,imx95-mali # G310 From bd2dd7b35cc3c03415ab10c4420dc5b0586eaeaf Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 12:45:00 -0400 Subject: [PATCH 06/13] drm/panthor: Add Tensor G3 cache hash configuration The Tensor G3 (zuma) integrates the same Mali-G715 as the Tensor G4, with the same ASN hash values: the Pixel 8 Pro's stock device tree has l2-hash-values = <0x36db6d 0x5b6db6 0x00>, from Google's zuma-gpu.dtsi, the source zumapro's match already cites. On zumapro, CSF startup fails with a GPU bus fault without them. Match google,zuma-mali with zumapro's SoC data. Link: https://android.googlesource.com/kernel/devices/google/zuma/+/42395e8adcb880aa336f0da6bb2a19ed53929c40/dts/zuma-gpu.dtsi Assisted-by: LLM Signed-off-by: Brett-Michael Green --- drivers/gpu/drm/panthor/panthor_drv.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/drivers/gpu/drm/panthor/panthor_drv.c b/drivers/gpu/drm/panthor/panthor_drv.c index 7641dd0069..09676fa7cf 100644 --- a/drivers/gpu/drm/panthor/panthor_drv.c +++ b/drivers/gpu/drm/panthor/panthor_drv.c @@ -1887,6 +1887,11 @@ static const struct panthor_soc_data soc_data_mediatek_mt8196 = { }; static const struct of_device_id dt_match[] = { + { + /* zuma's l2-hash-values are zumapro's. */ + .compatible = "google,zuma-mali", + .data = &soc_data_google_zumapro, + }, { .compatible = "google,zumapro-mali", .data = &soc_data_google_zumapro, From 4bf9cf6afb91d36e6bacdd905bce41c0b1661cf3 Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 12:45:40 -0400 Subject: [PATCH 07/13] arm64: dts: exynos: google: zuma: add CMU_G3D and the GPU Describe CMU_G3D and the Mali-G715 at 0x1f000000, both disabled, as zumapro does: the GPU's registers, its JOB, MMU and GPU interrupts (SPI 347, 348 and 346) and its size come from the Pixel 8 Pro's stock mali node, and its core, coregroup and stacks clocks from CMU_G3D. There is no power domain: stock's own power-domain driver reports pd-g3d on at probe, so the bootloader leaves G3D powered. Assisted-by: LLM Signed-off-by: Brett-Michael Green --- arch/arm64/boot/dts/exynos/google/zuma.dtsi | 26 +++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/zuma.dtsi b/arch/arm64/boot/dts/exynos/google/zuma.dtsi index 93a9ce3685..93bbbe6b78 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zuma.dtsi @@ -909,6 +909,32 @@ status = "disabled"; }; + /* The bootloader leaves G3D powered; there's no power domain yet. */ + cmu_g3d: clock-controller@1ee00000 { + compatible = "google,zuma-cmu-g3d"; + reg = <0x1ee00000 0x8000>; + #clock-cells = <1>; + clocks = <&oscclk>, <&cmu_top CLK_DOUT_G3D_NOCD>, + <&cmu_top CLK_DOUT_G3D_GLB>, + <&cmu_top CLK_DOUT_G3D_SWITCH>; + clock-names = "oscclk", "bus", "glb", "switch"; + status = "disabled"; + }; + + gpu: gpu@1f000000 { + compatible = "google,zuma-mali", "arm,mali-valhall-csf"; + reg = <0x1f000000 0x480000>; + interrupts = , + , + ; + interrupt-names = "job", "mmu", "gpu"; + clocks = <&cmu_g3d CLK_GOUT_G3D_CORE>, + <&cmu_g3d CLK_GOUT_G3D_COREGROUP>, + <&cmu_g3d CLK_GOUT_G3D_STACKS>; + clock-names = "core", "coregroup", "stacks"; + status = "disabled"; + }; + cmu_top: clock-controller@26040000 { compatible = "google,zuma-cmu-top"; reg = <0x26040000 0x8000>; From 2f9a5e5529689fa11915c220508cace4f0773622 Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 12:46:07 -0400 Subject: [PATCH 08/13] arm64: dts: exynos: google: zuma-husky: enable the GPU Turn on CMU_G3D and the Mali-G715 on the Pixel 8 Pro: - core is ACPM's paired gpu clock (ZUMA_CLK_ACPM_GPU), which sets G3D and G3DL2 together through the GPU DVFS pairs; - coregroup and stacks stay on CMU_G3D's gates; - an OPP table with the shader rates 150-649 MHz. Stock goes up to 890 MHz. The levels from 723 MHz on are left out until a GPU thermal zone is in the device tree, as on the Pixel 9a, because nothing upstream throttles the GPU yet. Assisted-by: LLM Signed-off-by: Brett-Michael Green --- .../boot/dts/exynos/google/zuma-husky.dts | 64 +++++++++++++++++++ 1 file changed, 64 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts index 1cc3647435..54135a89c9 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts +++ b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts @@ -5,6 +5,7 @@ /dts-v1/; +#include #include #include #include @@ -161,6 +162,52 @@ constant-charge-current-max-microamp = <1485000>; }; + /* + * The GPU's levels: the shader rates of the Pixel 8 Pro's GPU DVFS + * table up to 649 MHz, each with its paired L2 rate through the ACPM + * "gpu" clock. The levels above, to 890 MHz, wait for a GPU thermal + * zone. + */ + gpu_opp: opp-table-gpu { + compatible = "operating-points-v2"; + + opp-150000000 { + opp-hz = /bits/ 64 <150000000>; + }; + + opp-302000000 { + opp-hz = /bits/ 64 <302000000>; + }; + + opp-337000000 { + opp-hz = /bits/ 64 <337000000>; + }; + + opp-376000000 { + opp-hz = /bits/ 64 <376000000>; + }; + + opp-419000000 { + opp-hz = /bits/ 64 <419000000>; + }; + + opp-467000000 { + opp-hz = /bits/ 64 <467000000>; + }; + + opp-521000000 { + opp-hz = /bits/ 64 <521000000>; + }; + + opp-580000000 { + opp-hz = /bits/ 64 <580000000>; + }; + + opp-649000000 { + opp-hz = /bits/ 64 <649000000>; + }; + }; + reserved-memory { #address-cells = <2>; #size-cells = <1>; @@ -259,6 +306,23 @@ }; }; +&cmu_g3d { + status = "okay"; +}; + +/* + * The GPU's core clock is ACPM's paired "gpu" clock, which sets the shader + * (G3D) and L2 (G3DL2) domains together; coregroup and stacks stay on + * CMU_G3D's gates. + */ +&gpu { + clocks = <&acpm_ipc ZUMA_CLK_ACPM_GPU>, + <&cmu_g3d CLK_GOUT_G3D_COREGROUP>, + <&cmu_g3d CLK_GOUT_G3D_STACKS>; + operating-points-v2 = <&gpu_opp>; + status = "okay"; +}; + /* * DECON0 takes the display over from simple-framebuffer and flips DPP0 * between scanout buffers. It scans out to DSIM0, so gs-decon can switch From 081e94c16e40a5354ae28342d7e83372dcb17169 Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 13:02:03 -0400 Subject: [PATCH 09/13] dt-bindings: firmware: google,gs101-acpm-ipc: Add the Tensor G3 TMU The Tensor G3 (zuma) reads its SoC temperatures through the same ACPM TMU service as gs101 and zumapro, with zumapro's seven sensors in the same order: the Pixel 8 Pro's stock device tree names them BIG, MID, LITTLE, G3D, ISP, TPU and AUR (ids 0-6) on ACPM channel 9. Add its compatible. Assisted-by: LLM Signed-off-by: Brett-Michael Green --- .../devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml b/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml index 154039cd40..f75969b1ca 100644 --- a/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml +++ b/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml @@ -78,7 +78,7 @@ properties: description: The SoC's thermal sensors, which the ACPM firmware reads on the kernel's behalf. Cells are the sensor index (0 big, 1 mid, 2 little - CPU cluster, 3 GPU, 4 ISP, 5 TPU, and on gs201 and zumapro 6 AUR). + CPU cluster, 3 GPU, 4 ISP, 5 TPU, and on gs201, zuma and zumapro 6 AUR). type: object $ref: /schemas/thermal/thermal-sensor.yaml# unevaluatedProperties: false @@ -88,6 +88,7 @@ properties: enum: - google,gs101-acpm-tmu - google,gs201-acpm-tmu + - google,zuma-acpm-tmu - google,zumapro-acpm-tmu "#thermal-sensor-cells": From cc9ca2220475336339242e5a66492e33b816842b Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 13:02:24 -0400 Subject: [PATCH 10/13] thermal: samsung: gs101_acpm_tmu: Add the Tensor G3 The Tensor G3 (zuma) TMU service is the Tensor G4's: ACPM channel 9 and seven sensors in the same order, BIG, MID, LITTLE, G3D, ISP, TPU and AUR, as the Pixel 8 Pro's stock device tree has them (acpm_tmu on channel 9, tmuctrl_0 to tmuctrl_6). Match google,zuma-acpm-tmu with zumapro's data. Assisted-by: LLM Signed-off-by: Brett-Michael Green --- drivers/thermal/samsung/Kconfig | 2 +- drivers/thermal/samsung/gs101_acpm_tmu.c | 6 ++++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/drivers/thermal/samsung/Kconfig b/drivers/thermal/samsung/Kconfig index 74fd917870..e58d851051 100644 --- a/drivers/thermal/samsung/Kconfig +++ b/drivers/thermal/samsung/Kconfig @@ -12,7 +12,7 @@ config EXYNOS_THERMAL data from the supported SoCs. config GS101_ACPM_THERMAL - tristate "Google gs101, Tensor G2 and Tensor G4 thermal sensors through ACPM" + tristate "Google gs101, Tensor G2, G3 and G4 thermal sensors through ACPM" depends on THERMAL_OF depends on EXYNOS_ACPM_PROTOCOL help diff --git a/drivers/thermal/samsung/gs101_acpm_tmu.c b/drivers/thermal/samsung/gs101_acpm_tmu.c index 7950e9b582..3a6a538990 100644 --- a/drivers/thermal/samsung/gs101_acpm_tmu.c +++ b/drivers/thermal/samsung/gs101_acpm_tmu.c @@ -17,8 +17,8 @@ #include /* - * The sensors: BIG, MID, LITTLE, G3D, ISP, TPU, and on gs201 and zumapro - * also AUR, in the firmware's order. + * The sensors: BIG, MID, LITTLE, G3D, ISP, TPU, and on gs201, zuma and + * zumapro also AUR, in the firmware's order. */ #define GS101_ACPM_TMU_MAX_SENSORS 7 @@ -115,6 +115,7 @@ static const struct gs101_tmu_data gs201_tmu_data = { .nr_sensors = 7, }; +/* zuma's TMU service is zumapro's: channel 9, the same seven sensors. */ static const struct gs101_tmu_data zumapro_tmu_data = { .acpm_chan = 9, .nr_sensors = 7, @@ -123,6 +124,7 @@ static const struct gs101_tmu_data zumapro_tmu_data = { static const struct of_device_id gs101_tmu_of_match[] = { { .compatible = "google,gs101-acpm-tmu", .data = &gs101_tmu_data }, { .compatible = "google,gs201-acpm-tmu", .data = &gs201_tmu_data }, + { .compatible = "google,zuma-acpm-tmu", .data = &zumapro_tmu_data }, { .compatible = "google,zumapro-acpm-tmu", .data = &zumapro_tmu_data }, { } }; From fd34332617a0b24877ffab43d3d437de29bde53d Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 13:03:23 -0400 Subject: [PATCH 11/13] arm64: dts: exynos: google: zuma: add the ACPM TMU and a GPU thermal zone Add zuma's TMU sensor under acpm_ipc and a gpu-thermal zone on its G3D sensor (3). It throttles panthor's devfreq from 85 C and shuts down at 105 C, as zumapro.dtsi does, below the stock Pixel 8 Pro's own GPU trips (passive from 100 C, hot at 115 C). For that, the GPU node gets #cooling-cells. Assisted-by: LLM Signed-off-by: Brett-Michael Green --- arch/arm64/boot/dts/exynos/google/zuma.dtsi | 40 +++++++++++++++++++++ 1 file changed, 40 insertions(+) diff --git a/arch/arm64/boot/dts/exynos/google/zuma.dtsi b/arch/arm64/boot/dts/exynos/google/zuma.dtsi index 93bbbe6b78..364df71d28 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zuma.dtsi @@ -161,6 +161,11 @@ #clock-cells = <1>; mboxes = <&ap2apm_mailbox>; shmem = <&apm_sram>; + + acpm_tmu: thermal-sensor { + compatible = "google,zuma-acpm-tmu"; + #thermal-sensor-cells = <1>; + }; }; }; @@ -169,6 +174,40 @@ method = "smc"; }; + thermal-zones { + /* + * Below stock's own GPU trips (passive from 100 C, hot at + * 115 C). + */ + gpu-thermal { + polling-delay-passive = <1000>; + polling-delay = <2000>; + thermal-sensors = <&acpm_tmu 3>; + + trips { + gpu_alert: gpu-alert { + temperature = <85000>; + hysteresis = <5000>; + type = "passive"; + }; + + gpu_crit: gpu-crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + /* panthor's devfreq cooling: step_wise walks the GPU down its OPPs. */ + cooling-maps { + map0 { + trip = <&gpu_alert>; + cooling-device = <&gpu 0xffffffff 0xffffffff>; + }; + }; + }; + }; + timer { compatible = "arm,armv8-timer"; interrupts = , @@ -932,6 +971,7 @@ <&cmu_g3d CLK_GOUT_G3D_COREGROUP>, <&cmu_g3d CLK_GOUT_G3D_STACKS>; clock-names = "core", "coregroup", "stacks"; + #cooling-cells = <2>; status = "disabled"; }; From a616fa3744f50f1eb396d16c2358605c0bcfd287 Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 13:03:24 -0400 Subject: [PATCH 12/13] arm64: dts: exynos: google: zuma-husky: Add the GPU's levels to 890 MHz With gpu-thermal throttling panthor's devfreq, add the Pixel 8 Pro's GPU levels from 723 to 890 MHz, stock's top (gpu_dvfs_max_freq). Assisted-by: LLM Signed-off-by: Brett-Michael Green --- .../boot/dts/exynos/google/zuma-husky.dts | 21 ++++++++++++++++--- 1 file changed, 18 insertions(+), 3 deletions(-) diff --git a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts index 54135a89c9..34b3855732 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts +++ b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts @@ -164,9 +164,8 @@ /* * The GPU's levels: the shader rates of the Pixel 8 Pro's GPU DVFS - * table up to 649 MHz, each with its paired L2 rate through the ACPM - * "gpu" clock. The levels above, to 890 MHz, wait for a GPU thermal - * zone. + * table, each with its paired L2 rate through the ACPM "gpu" clock, + * up to stock's 890 MHz. gpu-thermal throttles them. */ gpu_opp: opp-table-gpu { compatible = "operating-points-v2"; @@ -206,6 +205,22 @@ opp-649000000 { opp-hz = /bits/ 64 <649000000>; }; + + opp-723000000 { + opp-hz = /bits/ 64 <723000000>; + }; + + opp-807000000 { + opp-hz = /bits/ 64 <807000000>; + }; + + opp-850000000 { + opp-hz = /bits/ 64 <850000000>; + }; + + opp-890000000 { + opp-hz = /bits/ 64 <890000000>; + }; }; reserved-memory { From 6abc13cef66686f6a208f96b6a33ed86b3f0373b Mon Sep 17 00:00:00 2001 From: Brett-Michael Green Date: Sat, 31 Oct 2026 13:51:54 -0400 Subject: [PATCH 13/13] arm64: dts: exynos: google: zuma: Add CPU DVFS and thermal zones Run the three CPU clusters on their ACPM DVFS clocks (cpucl0-2) through cpufreq-dt, and add thermal zones for them on the ACPM TMU's big, mid and little sensors (0-2): - the operating points are the ACPM firmware's own levels, read from the ECT the bootloader leaves at 0x90000000, up to each cluster's max-freq in stock's exynos-acme domains: 1704 MHz little, 2367 MHz mid and 2914 MHz big. The ECT's little levels up to 1704 MHz are the ones stock's cpufreq statistics list; - the energy model is stock's: each level's opp-microwatt is its power in the default pixel-em profile of Google's zuma-b0-ipop.dts, which the Pixel 8 Pro's own device tree has too. A dynamic power coefficient can't be used, since the firmware sets the voltages and there is no opp-microvolt: with one, the energy model fails to register ("EM: invalid perf. state: -22"). The CPUs get #cooling-cells for cpufreq cooling; - the levels above stock's battery current limiter caps (1945 MHz mid, 2294 MHz big, from Google's zuma-shusky-bcl.dtsi) are turbo-mode, as on gs201: with no BCL driver nothing pulls the clusters down when the battery voltage droops, so they are only used with boost enabled. Those caps are the Pixel 8 Pro's, so the tables stay in zuma.dtsi but only zuma-husky.dts points its CPUs at them: the Pixel 8a's caps in Google's zuma-akita-bcl.dtsi are lower, and it needs its own; - a CPU zone throttles its cluster from 80 C, forces its lowest level from 95 C and is critical at 105 C, as zumapro.dtsi does. The TMU sensor and the zones are shared by all zuma boards. The ACPM clock ids header moves from the board to zuma.dtsi. Assisted-by: LLM Signed-off-by: Brett-Michael Green --- .../boot/dts/exynos/google/zuma-husky.dts | 38 +- arch/arm64/boot/dts/exynos/google/zuma.dtsi | 389 ++++++++++++++++++ 2 files changed, 426 insertions(+), 1 deletion(-) diff --git a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts index 34b3855732..6f1c0d8417 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma-husky.dts +++ b/arch/arm64/boot/dts/exynos/google/zuma-husky.dts @@ -5,7 +5,6 @@ /dts-v1/; -#include #include #include #include @@ -325,6 +324,43 @@ status = "okay"; }; +/* The CPU levels' turbo-mode marks are this phone's BCL caps (zuma.dtsi). */ +&cpu0 { + operating-points-v2 = <&cpucl0_opp>; +}; + +&cpu1 { + operating-points-v2 = <&cpucl0_opp>; +}; + +&cpu2 { + operating-points-v2 = <&cpucl0_opp>; +}; + +&cpu3 { + operating-points-v2 = <&cpucl0_opp>; +}; + +&cpu4 { + operating-points-v2 = <&cpucl1_opp>; +}; + +&cpu5 { + operating-points-v2 = <&cpucl1_opp>; +}; + +&cpu6 { + operating-points-v2 = <&cpucl1_opp>; +}; + +&cpu7 { + operating-points-v2 = <&cpucl1_opp>; +}; + +&cpu8 { + operating-points-v2 = <&cpucl2_opp>; +}; + /* * The GPU's core clock is ACPM's paired "gpu" clock, which sets the shader * (G3D) and L2 (G3DL2) domains together; coregroup and stacks stay on diff --git a/arch/arm64/boot/dts/exynos/google/zuma.dtsi b/arch/arm64/boot/dts/exynos/google/zuma.dtsi index 364df71d28..610a8901c8 100644 --- a/arch/arm64/boot/dts/exynos/google/zuma.dtsi +++ b/arch/arm64/boot/dts/exynos/google/zuma.dtsi @@ -12,6 +12,7 @@ */ #include +#include #include #include #include @@ -96,6 +97,8 @@ reg = <0x000>; enable-method = "psci"; capacity-dmips-mhz = <193>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMA_CLK_ACPM_DVFS_CPUCL0>; }; cpu1: cpu@100 { device_type = "cpu"; @@ -103,6 +106,8 @@ reg = <0x100>; enable-method = "psci"; capacity-dmips-mhz = <193>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMA_CLK_ACPM_DVFS_CPUCL0>; }; cpu2: cpu@200 { device_type = "cpu"; @@ -110,6 +115,8 @@ reg = <0x200>; enable-method = "psci"; capacity-dmips-mhz = <193>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMA_CLK_ACPM_DVFS_CPUCL0>; }; cpu3: cpu@300 { device_type = "cpu"; @@ -117,6 +124,8 @@ reg = <0x300>; enable-method = "psci"; capacity-dmips-mhz = <193>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMA_CLK_ACPM_DVFS_CPUCL0>; }; cpu4: cpu@400 { device_type = "cpu"; @@ -124,6 +133,8 @@ reg = <0x400>; enable-method = "psci"; capacity-dmips-mhz = <927>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMA_CLK_ACPM_DVFS_CPUCL1>; }; cpu5: cpu@500 { device_type = "cpu"; @@ -131,6 +142,8 @@ reg = <0x500>; enable-method = "psci"; capacity-dmips-mhz = <927>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMA_CLK_ACPM_DVFS_CPUCL1>; }; cpu6: cpu@600 { device_type = "cpu"; @@ -138,6 +151,8 @@ reg = <0x600>; enable-method = "psci"; capacity-dmips-mhz = <927>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMA_CLK_ACPM_DVFS_CPUCL1>; }; cpu7: cpu@700 { device_type = "cpu"; @@ -145,6 +160,8 @@ reg = <0x700>; enable-method = "psci"; capacity-dmips-mhz = <927>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMA_CLK_ACPM_DVFS_CPUCL1>; }; cpu8: cpu@800 { device_type = "cpu"; @@ -152,7 +169,261 @@ reg = <0x800>; enable-method = "psci"; capacity-dmips-mhz = <1024>; + #cooling-cells = <2>; + clocks = <&acpm_ipc ZUMA_CLK_ACPM_DVFS_CPUCL2>; + }; + }; + + /* + * CPU levels: the ACPM firmware's own DVFS levels, from the ECT that the + * bootloader leaves at 0x90000000, up to each cluster's max-freq in + * stock's exynos-acme domains (Google's zuma-cpu.dtsi). The levels + * above, listed in each table, are left out as stock leaves them. + * + * The firmware sets the rail voltages from its fused ASV tables, so + * there is no opp-microvolt, and the energy model can't be computed + * from a power coefficient. opp-microwatt is each level's power in + * stock's default energy model (the pixel-em profile in Google's + * zuma-b0-ipop.dts, the same in the Pixel 8 Pro's own device tree). + * + * Stock caps the mid and big clusters at 1945 and 2294 MHz whenever + * its battery current limiter (BCL) sees the battery voltage droop + * (freq_qos vdroop1/vdroop2/smpl_warn in Google's + * zuma-shusky-bcl.dtsi). There is no BCL driver here, so the levels + * above those caps are turbo-mode: off until boost is enabled + * (/sys/devices/system/cpu/cpufreq/boost). + * + * Those turbo-mode marks are the Pixel 8 Pro's caps, so the CPUs get + * operating-points-v2 in the board file. A board whose BCL caps are + * lower needs tables of its own. + */ + cpucl0_opp: opp-table-cpucl0 { + compatible = "operating-points-v2"; + opp-shared; + + opp-324000000 { + opp-hz = /bits/ 64 <324000000>; + opp-microwatt = <11000>; + }; + + opp-610000000 { + opp-hz = /bits/ 64 <610000000>; + opp-microwatt = <12000>; + }; + + opp-820000000 { + opp-hz = /bits/ 64 <820000000>; + opp-microwatt = <19000>; + }; + + opp-955000000 { + opp-hz = /bits/ 64 <955000000>; + opp-microwatt = <25000>; + }; + + opp-1098000000 { + opp-hz = /bits/ 64 <1098000000>; + opp-microwatt = <31000>; + }; + + opp-1197000000 { + opp-hz = /bits/ 64 <1197000000>; + opp-microwatt = <37000>; + }; + + opp-1328000000 { + opp-hz = /bits/ 64 <1328000000>; + opp-microwatt = <45000>; + }; + + opp-1425000000 { + opp-hz = /bits/ 64 <1425000000>; + opp-microwatt = <57000>; + }; + + opp-1548000000 { + opp-hz = /bits/ 64 <1548000000>; + opp-microwatt = <155000>; + }; + + opp-1704000000 { + opp-hz = /bits/ 64 <1704000000>; + opp-microwatt = <195000>; + }; + + /* 1785, 1950, 2024, 2098, 2147 and 2253 MHz stay off, as on stock. */ + }; + + cpucl1_opp: opp-table-cpucl1 { + compatible = "operating-points-v2"; + opp-shared; + + opp-402000000 { + opp-hz = /bits/ 64 <402000000>; + opp-microwatt = <59000>; + }; + + opp-578000000 { + opp-hz = /bits/ 64 <578000000>; + opp-microwatt = <85000>; + }; + + opp-697000000 { + opp-hz = /bits/ 64 <697000000>; + opp-microwatt = <106000>; + }; + + opp-712000000 { + opp-hz = /bits/ 64 <712000000>; + opp-microwatt = <114000>; + }; + + opp-910000000 { + opp-hz = /bits/ 64 <910000000>; + opp-microwatt = <156000>; + }; + + opp-1065000000 { + opp-hz = /bits/ 64 <1065000000>; + opp-microwatt = <208000>; + }; + + opp-1221000000 { + opp-hz = /bits/ 64 <1221000000>; + opp-microwatt = <266000>; + }; + + opp-1328000000 { + opp-hz = /bits/ 64 <1328000000>; + opp-microwatt = <320000>; + }; + + opp-1418000000 { + opp-hz = /bits/ 64 <1418000000>; + opp-microwatt = <368000>; }; + + opp-1572000000 { + opp-hz = /bits/ 64 <1572000000>; + opp-microwatt = <449000>; + }; + + opp-1836000000 { + opp-hz = /bits/ 64 <1836000000>; + opp-microwatt = <638000>; + }; + + opp-1945000000 { + opp-hz = /bits/ 64 <1945000000>; + opp-microwatt = <804000>; + }; + + opp-2130000000 { + opp-hz = /bits/ 64 <2130000000>; + opp-microwatt = <1042000>; + turbo-mode; + }; + + opp-2245000000 { + opp-hz = /bits/ 64 <2245000000>; + opp-microwatt = <1272000>; + turbo-mode; + }; + + opp-2367000000 { + opp-hz = /bits/ 64 <2367000000>; + opp-microwatt = <1514000>; + turbo-mode; + }; + + /* 2450 and 2600 MHz stay off, as on stock. */ + }; + + cpucl2_opp: opp-table-cpucl2 { + compatible = "operating-points-v2"; + opp-shared; + + opp-500000000 { + opp-hz = /bits/ 64 <500000000>; + opp-microwatt = <116000>; + }; + + opp-880000000 { + opp-hz = /bits/ 64 <880000000>; + opp-microwatt = <213000>; + }; + + opp-1164000000 { + opp-hz = /bits/ 64 <1164000000>; + opp-microwatt = <321000>; + }; + + opp-1298000000 { + opp-hz = /bits/ 64 <1298000000>; + opp-microwatt = <391000>; + }; + + opp-1557000000 { + opp-hz = /bits/ 64 <1557000000>; + opp-microwatt = <535000>; + }; + + opp-1745000000 { + opp-hz = /bits/ 64 <1745000000>; + opp-microwatt = <675000>; + }; + + opp-1885000000 { + opp-hz = /bits/ 64 <1885000000>; + opp-microwatt = <784000>; + }; + + opp-2049000000 { + opp-hz = /bits/ 64 <2049000000>; + opp-microwatt = <1034000>; + }; + + opp-2147000000 { + opp-hz = /bits/ 64 <2147000000>; + opp-microwatt = <1145000>; + }; + + opp-2294000000 { + opp-hz = /bits/ 64 <2294000000>; + opp-microwatt = <1363000>; + }; + + opp-2363000000 { + opp-hz = /bits/ 64 <2363000000>; + opp-microwatt = <1533000>; + turbo-mode; + }; + + opp-2556000000 { + opp-hz = /bits/ 64 <2556000000>; + opp-microwatt = <1911000>; + turbo-mode; + }; + + opp-2687000000 { + opp-hz = /bits/ 64 <2687000000>; + opp-microwatt = <2415000>; + turbo-mode; + }; + + opp-2850000000 { + opp-hz = /bits/ 64 <2850000000>; + opp-microwatt = <3175000>; + turbo-mode; + }; + + opp-2914000000 { + opp-hz = /bits/ 64 <2914000000>; + opp-microwatt = <3714000>; + turbo-mode; + }; + + /* 2943, 2970 and 3015 MHz stay off, as on stock. */ }; firmware { @@ -175,6 +446,124 @@ }; thermal-zones { + /* + * The CPU zones throttle their cluster from 80 C and force its + * lowest level from 95 C. + */ + big-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&acpm_tmu 0>; + + trips { + big_alert: big-alert { + temperature = <80000>; + hysteresis = <5000>; + type = "passive"; + }; + + big_hot: big-hot { + temperature = <95000>; + hysteresis = <10000>; + type = "passive"; + }; + + big_crit: big-crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&big_alert>; + cooling-device = <&cpu8 0xffffffff 0xffffffff>; + }; + + map1 { + trip = <&big_hot>; + cooling-device = <&cpu8 14 0xffffffff>; + }; + }; + }; + + mid-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&acpm_tmu 1>; + + trips { + mid_alert: mid-alert { + temperature = <80000>; + hysteresis = <5000>; + type = "passive"; + }; + + mid_hot: mid-hot { + temperature = <95000>; + hysteresis = <10000>; + type = "passive"; + }; + + mid_crit: mid-crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&mid_alert>; + cooling-device = <&cpu4 0xffffffff 0xffffffff>; + }; + + map1 { + trip = <&mid_hot>; + cooling-device = <&cpu4 14 0xffffffff>; + }; + }; + }; + + little-thermal { + polling-delay-passive = <250>; + polling-delay = <1000>; + thermal-sensors = <&acpm_tmu 2>; + + trips { + little_alert: little-alert { + temperature = <80000>; + hysteresis = <5000>; + type = "passive"; + }; + + little_hot: little-hot { + temperature = <95000>; + hysteresis = <10000>; + type = "passive"; + }; + + little_crit: little-crit { + temperature = <105000>; + hysteresis = <2000>; + type = "critical"; + }; + }; + + cooling-maps { + map0 { + trip = <&little_alert>; + cooling-device = <&cpu0 0xffffffff 0xffffffff>; + }; + + map1 { + trip = <&little_hot>; + cooling-device = <&cpu0 9 0xffffffff>; + }; + }; + }; + /* * Below stock's own GPU trips (passive from 100 C, hot at * 115 C).