Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 25 additions & 3 deletions Documentation/devicetree/bindings/clock/google,zuma-clock.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,16 @@ maintainers:
- Brett-Michael Green <brett@bmgvisualtech.com>

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.
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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":
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
1 change: 1 addition & 0 deletions MAINTAINERS
Original file line number Diff line number Diff line change
Expand Up @@ -11188,6 +11188,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
Expand Down
79 changes: 79 additions & 0 deletions arch/arm64/boot/dts/exynos/google/zuma-husky.dts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@

/dts-v1/;

#include <dt-bindings/clock/google,zuma-acpm.h>
#include <dt-bindings/gpio/gpio.h>
#include <dt-bindings/input/input.h>
#include <dt-bindings/leds/common.h>
Expand Down Expand Up @@ -158,6 +159,67 @@
constant-charge-current-max-microamp = <1485000>;
};

/*
* The GPU's levels: the shader rates of the Pixel 8 Pro's GPU DVFS
* 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";

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>;
};

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 {
#address-cells = <2>;
#size-cells = <1>;
Expand Down Expand Up @@ -207,6 +269,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";
};

/*
* Wi-Fi: the BCM4398 on pcie_1, one Gen3 lane as on stock. Its DMA
* buffers come from wifi_dma_pool.
Expand Down
66 changes: 66 additions & 0 deletions arch/arm64/boot/dts/exynos/google/zuma.dtsi
Original file line number Diff line number Diff line change
Expand Up @@ -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>;
};
};
};

Expand All @@ -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 = <GIC_PPI 13 IRQ_TYPE_LEVEL_LOW>,
Expand Down Expand Up @@ -879,6 +918,33 @@
};
};

/* 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 = <GIC_SPI 347 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 348 IRQ_TYPE_LEVEL_HIGH>,
<GIC_SPI 346 IRQ_TYPE_LEVEL_HIGH>;
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";
#cooling-cells = <2>;
status = "disabled";
};

cmu_top: clock-controller@26040000 {
compatible = "google,zuma-cmu-top";
reg = <0x26040000 0x8000>;
Expand Down
37 changes: 37 additions & 0 deletions drivers/clk/samsung/clk-acpm.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 },
};

Expand Down Expand Up @@ -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)
{
Expand Down Expand Up @@ -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,
Expand Down
Loading