* [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU
@ 2026-01-19 12:08 Tudor Ambarus
2026-01-19 12:08 ` [PATCH v2 1/7] dt-bindings: thermal: Add " Tudor Ambarus
` (9 more replies)
0 siblings, 10 replies; 22+ messages in thread
From: Tudor Ambarus @ 2026-01-19 12:08 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening,
Tudor Ambarus
Add support for the Thermal Management Unit (TMU) on the Google GS101
SoC.
The GS101 TMU implementation utilizes a hybrid architecture where
management is shared between the kernel and the Alive Clock and
Power Manager (ACPM) firmware.
Dependencies
============
- firmware patches 2, 3: required by the thermal driver (patch 4).
- bindings (patch 1): required for DTS validation.
- thermal driver patch 4: required by defconfig (patch 7) - logical
dependency.
Given the thermal driver is a new addition, I suggest everything to go
through the Samsung SoC tree, with ACKs from the Thermal maintainers.
If the Thermal maintainers prefer to take the bindings and the thermal
driver patches via their tree we'll need:
- an immutable branch containing the firmware patches (2 and 3) from the
Samsung SoC tree to serve as a base for the thermal driver.
- an immutable branch containing the bindings and the thermal driver
from the thermal tree to serve as a base for the dts and defconfig.
Architecture Overview
=====================
The hardware supports two parallel control paths. For this
implementation, responsibilities are split as follows:
1. Kernel Responsibility:
- maintain direct memory-mapped access to the interrupt pending
(INTPEND) registers to identify thermal events.
- map physical hardware interrupts to logical thermal zones.
- coordinate functional operations through the ACPM IPC protocol.
2. Firmware Responsibility (ACPM):
- handle sensor initialization and calibration.
- manage thermal thresholds and hysteresis configuration.
- perform temperature acquisition and expose data via IPC.
Sensor Mapping (One-to-Many)
============================
The SoC contains multiple physical temperature sensors, but the ACPM
firmware abstracts these into logical groups (Clusters) for reporting:
- ACPM Sensor 0 (Big Cluster): Aggregates physical sensors 0, 6, 7, 8, 9.
- ACPM Sensor 1 (Mid Cluster): Aggregates physical sensors 4, 5.
- ACPM Sensor 2 (Little Cluster): Aggregates physical sensors 1, 2.
The driver maps physical interrupt bits back to these logical parents.
When an interrupt fires, the driver checks the bitmask in the INTPEND
registers and updates the corresponding logical thermal zone.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
Changes in v2:
- architecture: switch from a syscon/MFD approach to a thermal-sensor
node with a phandle to the ACPM interface
- bindings: address Krzysztof's feedback, drop redundencies,
interrupts description.
- firmware: introduce devm_acpm_get_by_phandle() to standardize IPC
handle acquisition.
- thermal driver: drop compatible's data and use the static data from
the driver directly.
- defconfig, make EXYNOS_ACPM_THERMAL a module
- Link to v1: https://lore.kernel.org/r/20260114-acpm-tmu-v1-0-cfe56d93e90f@linaro.org
---
Tudor Ambarus (7):
dt-bindings: thermal: Add Google GS101 TMU
firmware: samsung: acpm: Add TMU protocol support
firmware: samsung: acpm: Add devm_acpm_get_by_phandle helper
thermal: samsung: Add support for GS101 TMU
MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver
arm64: dts: exynos: gs101: Add thermal management unit
arm64: defconfig: enable Exynos ACPM thermal support
.../bindings/thermal/google,gs101-tmu-top.yaml | 67 +++
MAINTAINERS | 8 +
arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi | 209 +++++++
arch/arm64/boot/dts/exynos/google/gs101.dtsi | 18 +
arch/arm64/configs/defconfig | 1 +
drivers/firmware/samsung/Makefile | 1 +
drivers/firmware/samsung/exynos-acpm-tmu.c | 212 +++++++
drivers/firmware/samsung/exynos-acpm-tmu.h | 33 ++
drivers/firmware/samsung/exynos-acpm.c | 35 ++
drivers/thermal/samsung/Kconfig | 16 +
drivers/thermal/samsung/Makefile | 2 +
drivers/thermal/samsung/acpm-tmu.c | 643 +++++++++++++++++++++
.../linux/firmware/samsung/exynos-acpm-protocol.h | 30 +
13 files changed, 1275 insertions(+)
---
base-commit: e2211f5d980086dd9fbdab3bcd86b715e12cae13
change-id: 20260113-acpm-tmu-27e21f0e2c3b
Best regards,
--
Tudor Ambarus <tudor.ambarus@linaro.org>
^ permalink raw reply [flat|nested] 22+ messages in thread
* [PATCH v2 1/7] dt-bindings: thermal: Add Google GS101 TMU
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
@ 2026-01-19 12:08 ` Tudor Ambarus
2026-01-21 7:52 ` Krzysztof Kozlowski
2026-03-05 3:48 ` Alexey Klimov
2026-01-19 12:08 ` [PATCH v2 2/7] firmware: samsung: acpm: Add TMU protocol support Tudor Ambarus
` (8 subsequent siblings)
9 siblings, 2 replies; 22+ messages in thread
From: Tudor Ambarus @ 2026-01-19 12:08 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening,
Tudor Ambarus
Document the Thermal Management Unit (TMU) found on the Google GS101 SoC.
The GS101 TMU utilizes a hybrid control model shared between the
Application Processor (AP) and the ACPM (Alive Clock and Power Manager)
firmware.
While the TMU is a standard memory-mapped IP block, on this platform
the AP's direct register access is restricted to the interrupt pending
(INTPEND) registers for event identification. High-level functional
tasks, such as sensor initialization, threshold programming, and
temperature reads, are delegated to the ACPM firmware.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
.../bindings/thermal/google,gs101-tmu-top.yaml | 67 ++++++++++++++++++++++
1 file changed, 67 insertions(+)
diff --git a/Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml b/Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml
new file mode 100644
index 0000000000000000000000000000000000000000..b09e1ff5d89194b570810a042c75836ca2e53950
--- /dev/null
+++ b/Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml
@@ -0,0 +1,67 @@
+# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
+%YAML 1.2
+---
+$id: http://devicetree.org/schemas/thermal/google,gs101-tmu-top.yaml#
+$schema: http://devicetree.org/meta-schemas/core.yaml#
+
+title: Google GS101 Thermal Management Unit (TMU)
+
+maintainers:
+ - Tudor Ambarus <tudor.ambarus@linaro.org>
+
+description:
+ The Google GS101 TMU is a thermal sensor block that supports both direct
+ register-level access and firmware-mediated management via the ACPM
+ (Alive Clock and Power Manager) firmware.
+
+ On this platform, the hardware is managed in a hybrid fashion. The
+ Application Processor (AP) maintains direct memory-mapped access
+ exclusively to the interrupt pending registers to identify thermal
+ events. All other functional aspects - including sensor
+ initialization, threshold configuration, and temperature acquisition
+ - are handled by the ACPM firmware. The AP coordinates these
+ operations through the ACPM IPC protocol.
+
+properties:
+ compatible:
+ const: google,gs101-tmu-top
+
+ reg:
+ maxItems: 1
+
+ clocks:
+ items:
+ - description: APB peripheral clock (PCLK) for TMU register access.
+
+ interrupts:
+ maxItems: 1
+
+ "#thermal-sensor-cells":
+ const: 1
+
+ samsung,acpm-ipc:
+ $ref: /schemas/types.yaml#/definitions/phandle
+ description: Phandle to the ACPM IPC node.
+
+required:
+ - compatible
+ - reg
+ - clocks
+ - interrupts
+ - "#thermal-sensor-cells"
+
+additionalProperties: false
+
+examples:
+ - |
+ #include <dt-bindings/interrupt-controller/arm-gic.h>
+ #include <dt-bindings/clock/google,gs101.h>
+
+ thermal-sensor@100a0000 {
+ compatible = "google,gs101-tmu-top";
+ reg = <0x100a0000 0x800>;
+ clocks = <&cmu_misc CLK_GOUT_MISC_TMU_TOP_PCLK>;
+ interrupts = <GIC_SPI 769 IRQ_TYPE_LEVEL_HIGH 0>;
+ #thermal-sensor-cells = <1>;
+ samsung,acpm-ipc = <&acpm_ipc>;
+ };
--
2.52.0.457.g6b5491de43-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 2/7] firmware: samsung: acpm: Add TMU protocol support
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
2026-01-19 12:08 ` [PATCH v2 1/7] dt-bindings: thermal: Add " Tudor Ambarus
@ 2026-01-19 12:08 ` Tudor Ambarus
2026-02-13 10:07 ` Krzysztof Kozlowski
2026-01-19 12:08 ` [PATCH v2 3/7] firmware: samsung: acpm: Add devm_acpm_get_by_phandle helper Tudor Ambarus
` (7 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2026-01-19 12:08 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening,
Tudor Ambarus
The Thermal Management Unit (TMU) on the Google GS101 SoC is managed
through a hybrid model shared between the kernel and the Alive Clock
and Power Manager (ACPM) firmware.
Add the protocol helpers required to communicate with the ACPM for
thermal operations, including initialization, threshold configuration,
temperature reading, and system suspend/resume handshakes.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
drivers/firmware/samsung/Makefile | 1 +
drivers/firmware/samsung/exynos-acpm-tmu.c | 212 +++++++++++++++++++++
drivers/firmware/samsung/exynos-acpm-tmu.h | 33 ++++
drivers/firmware/samsung/exynos-acpm.c | 12 ++
.../linux/firmware/samsung/exynos-acpm-protocol.h | 24 +++
5 files changed, 282 insertions(+)
diff --git a/drivers/firmware/samsung/Makefile b/drivers/firmware/samsung/Makefile
index 80d4f89b33a9558b68c9083da675c70ec3d05f19..5a6f72bececfd98ba5af37d1d65fed48a3d8f912 100644
--- a/drivers/firmware/samsung/Makefile
+++ b/drivers/firmware/samsung/Makefile
@@ -3,4 +3,5 @@
acpm-protocol-objs := exynos-acpm.o
acpm-protocol-objs += exynos-acpm-pmic.o
acpm-protocol-objs += exynos-acpm-dvfs.o
+acpm-protocol-objs += exynos-acpm-tmu.o
obj-$(CONFIG_EXYNOS_ACPM_PROTOCOL) += acpm-protocol.o
diff --git a/drivers/firmware/samsung/exynos-acpm-tmu.c b/drivers/firmware/samsung/exynos-acpm-tmu.c
new file mode 100644
index 0000000000000000000000000000000000000000..7ec4b48074eb8b4e569b39d4bb5963d887aa9521
--- /dev/null
+++ b/drivers/firmware/samsung/exynos-acpm-tmu.c
@@ -0,0 +1,212 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2020 Samsung Electronics Co., Ltd.
+ * Copyright 2020 Google LLC.
+ * Copyright 2026 Linaro Ltd.
+ */
+
+#include <linux/bitfield.h>
+#include <linux/bits.h>
+#include <linux/firmware/samsung/exynos-acpm-protocol.h>
+#include <linux/ktime.h>
+#include <linux/types.h>
+#include <linux/units.h>
+
+#include "exynos-acpm.h"
+#include "exynos-acpm-tmu.h"
+
+/* IPC Request Types */
+#define ACPM_TMU_INIT 0x01
+#define ACPM_TMU_READ_TEMP 0x02
+#define ACPM_TMU_SUSPEND 0x04
+#define ACPM_TMU_RESUME 0x10
+#define ACPM_TMU_THRESHOLD 0x11
+#define ACPM_TMU_INTEN 0x12
+#define ACPM_TMU_CONTROL 0x13
+#define ACPM_TMU_IRQ_CLEAR 0x14
+#define ACPM_TMU_HYSTERESIS 0x16
+
+#define ACPM_TMU_TX_DATA_LEN 8
+#define ACPM_TMU_RX_DATA_LEN 7
+
+struct acpm_tmu_tx {
+ u16 ctx;
+ u16 fw_use;
+ u8 type;
+ u8 rsvd0;
+ u8 tzid;
+ u8 rsvd1;
+ u8 data[ACPM_TMU_TX_DATA_LEN];
+} __packed;
+
+struct acpm_tmu_rx {
+ u16 ctx;
+ u16 fw_use;
+ u8 type;
+ s8 ret;
+ u8 tzid;
+ s8 temp;
+ u8 rsvd;
+ u8 data[ACPM_TMU_RX_DATA_LEN];
+} __packed;
+
+union acpm_tmu_msg {
+ u32 data[4];
+ struct acpm_tmu_tx tx;
+ struct acpm_tmu_rx rx;
+} __packed;
+
+static void acpm_tmu_set_xfer(struct acpm_xfer *xfer, u32 *cmd, size_t cmdlen,
+ unsigned int acpm_chan_id)
+{
+ xfer->acpm_chan_id = acpm_chan_id;
+ xfer->txd = cmd;
+ xfer->txlen = cmdlen;
+ xfer->rxd = cmd;
+ xfer->rxlen = cmdlen;
+}
+
+int acpm_tmu_init(const struct acpm_handle *handle, unsigned int acpm_chan_id)
+{
+ union acpm_tmu_msg msg = {0};
+ struct acpm_xfer xfer;
+
+ msg.tx.type = ACPM_TMU_INIT;
+ acpm_tmu_set_xfer(&xfer, msg.data, sizeof(msg.data), acpm_chan_id);
+
+ return acpm_do_xfer(handle, &xfer);
+}
+
+int acpm_tmu_read_temp(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz, int *temp)
+{
+ union acpm_tmu_msg msg = {0};
+ struct acpm_xfer xfer;
+ int ret;
+
+ msg.tx.type = ACPM_TMU_READ_TEMP;
+ msg.tx.tzid = tz;
+
+ acpm_tmu_set_xfer(&xfer, msg.data, sizeof(msg.data), acpm_chan_id);
+
+ ret = acpm_do_xfer(handle, &xfer);
+ if (ret)
+ return ret;
+
+ *temp = msg.rx.temp;
+
+ return 0;
+}
+
+int acpm_tmu_set_threshold(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz,
+ const u8 temperature[8], size_t tlen)
+{
+ union acpm_tmu_msg msg = {0};
+ struct acpm_xfer xfer;
+ int i;
+
+ if (tlen > ACPM_TMU_TX_DATA_LEN)
+ return -EINVAL;
+
+ msg.tx.type = ACPM_TMU_THRESHOLD;
+ msg.tx.tzid = tz;
+
+ for (i = 0; i < tlen; i++)
+ msg.tx.data[i] = temperature[i];
+
+ acpm_tmu_set_xfer(&xfer, msg.data, sizeof(msg.data), acpm_chan_id);
+
+ return acpm_do_xfer(handle, &xfer);
+}
+
+int acpm_tmu_set_hysteresis(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz,
+ const u8 hysteresis[8], size_t hlen)
+{
+ union acpm_tmu_msg msg = {0};
+ struct acpm_xfer xfer;
+ int i;
+
+ if (hlen > ACPM_TMU_TX_DATA_LEN)
+ return -EINVAL;
+
+ msg.tx.type = ACPM_TMU_HYSTERESIS;
+ msg.tx.tzid = tz;
+
+ for (i = 0; i < hlen; i++)
+ msg.tx.data[i] = hysteresis[i];
+
+ acpm_tmu_set_xfer(&xfer, msg.data, sizeof(msg.data), acpm_chan_id);
+
+ return acpm_do_xfer(handle, &xfer);
+}
+
+int acpm_tmu_set_interrupt_enable(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz, u8 inten)
+{
+ union acpm_tmu_msg msg = {0};
+ struct acpm_xfer xfer;
+
+ msg.tx.type = ACPM_TMU_INTEN;
+ msg.tx.tzid = tz;
+ msg.tx.data[0] = inten;
+
+ acpm_tmu_set_xfer(&xfer, msg.data, sizeof(msg.data), acpm_chan_id);
+
+ return acpm_do_xfer(handle, &xfer);
+}
+
+int acpm_tmu_tz_control(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz, bool enable)
+{
+ union acpm_tmu_msg msg = {0};
+ struct acpm_xfer xfer;
+
+ msg.tx.type = ACPM_TMU_CONTROL;
+ msg.tx.tzid = tz;
+ msg.tx.data[0] = enable ? 1 : 0;
+
+ acpm_tmu_set_xfer(&xfer, msg.data, sizeof(msg.data), acpm_chan_id);
+
+ return acpm_do_xfer(handle, &xfer);
+}
+
+int acpm_tmu_clear_tz_irq(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz)
+{
+ union acpm_tmu_msg msg = {0};
+ struct acpm_xfer xfer;
+
+ msg.tx.type = ACPM_TMU_IRQ_CLEAR;
+ msg.tx.tzid = tz;
+
+ acpm_tmu_set_xfer(&xfer, msg.data, sizeof(msg.data), acpm_chan_id);
+
+ return acpm_do_xfer(handle, &xfer);
+}
+
+int acpm_tmu_suspend(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id)
+{
+ union acpm_tmu_msg msg = {0};
+ struct acpm_xfer xfer;
+
+ msg.tx.type = ACPM_TMU_SUSPEND;
+
+ acpm_tmu_set_xfer(&xfer, msg.data, sizeof(msg.data), acpm_chan_id);
+
+ return acpm_do_xfer(handle, &xfer);
+}
+
+int acpm_tmu_resume(const struct acpm_handle *handle, unsigned int acpm_chan_id)
+{
+ union acpm_tmu_msg msg = {0};
+ struct acpm_xfer xfer;
+
+ msg.tx.type = ACPM_TMU_RESUME;
+
+ acpm_tmu_set_xfer(&xfer, msg.data, sizeof(msg.data), acpm_chan_id);
+
+ return acpm_do_xfer(handle, &xfer);
+}
diff --git a/drivers/firmware/samsung/exynos-acpm-tmu.h b/drivers/firmware/samsung/exynos-acpm-tmu.h
new file mode 100644
index 0000000000000000000000000000000000000000..f1a1ac21736d52bea0ad2a7cb3b280201fa74ffe
--- /dev/null
+++ b/drivers/firmware/samsung/exynos-acpm-tmu.h
@@ -0,0 +1,33 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright 2020 Samsung Electronics Co., Ltd.
+ * Copyright 2020 Google LLC.
+ * Copyright 2026 Linaro Ltd.
+ */
+#ifndef __EXYNOS_ACPM_TMU_H__
+#define __EXYNOS_ACPM_TMU_H__
+
+#include <linux/types.h>
+
+struct acpm_handle;
+
+int acpm_tmu_init(const struct acpm_handle *handle, unsigned int acpm_chan_id);
+int acpm_tmu_read_temp(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz, int *temp);
+int acpm_tmu_set_threshold(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz,
+ const u8 temperature[8], size_t tlen);
+int acpm_tmu_set_hysteresis(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz,
+ const u8 hysteresis[8], size_t hlen);
+int acpm_tmu_set_interrupt_enable(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz, u8 inten);
+int acpm_tmu_tz_control(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz, bool enable);
+int acpm_tmu_clear_tz_irq(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz);
+int acpm_tmu_suspend(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id);
+int acpm_tmu_resume(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id);
+#endif /* __EXYNOS_ACPM_TMU_H__ */
diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/samsung/exynos-acpm.c
index 0cb269c7046015d4c5fe5731ba0d61d48dcaeee1..cc045370f4b0dc6ccea99e3c2d6f86a43b2e9671 100644
--- a/drivers/firmware/samsung/exynos-acpm.c
+++ b/drivers/firmware/samsung/exynos-acpm.c
@@ -31,6 +31,7 @@
#include "exynos-acpm.h"
#include "exynos-acpm-dvfs.h"
#include "exynos-acpm-pmic.h"
+#include "exynos-acpm-tmu.h"
#define ACPM_PROTOCOL_SEQNUM GENMASK(21, 16)
@@ -595,6 +596,7 @@ static void acpm_setup_ops(struct acpm_info *acpm)
{
struct acpm_dvfs_ops *dvfs_ops = &acpm->handle.ops.dvfs_ops;
struct acpm_pmic_ops *pmic_ops = &acpm->handle.ops.pmic_ops;
+ struct acpm_tmu_ops *tmu_ops = &acpm->handle.ops.tmu;
dvfs_ops->set_rate = acpm_dvfs_set_rate;
dvfs_ops->get_rate = acpm_dvfs_get_rate;
@@ -604,6 +606,16 @@ static void acpm_setup_ops(struct acpm_info *acpm)
pmic_ops->write_reg = acpm_pmic_write_reg;
pmic_ops->bulk_write = acpm_pmic_bulk_write;
pmic_ops->update_reg = acpm_pmic_update_reg;
+
+ tmu_ops->init = acpm_tmu_init;
+ tmu_ops->read_temp = acpm_tmu_read_temp;
+ tmu_ops->set_threshold = acpm_tmu_set_threshold;
+ tmu_ops->set_hysteresis = acpm_tmu_set_hysteresis;
+ tmu_ops->set_interrupt_enable = acpm_tmu_set_interrupt_enable;
+ tmu_ops->tz_control = acpm_tmu_tz_control;
+ tmu_ops->clear_tz_irq = acpm_tmu_clear_tz_irq;
+ tmu_ops->suspend = acpm_tmu_suspend;
+ tmu_ops->resume = acpm_tmu_resume;
}
static void acpm_clk_pdev_unregister(void *data)
diff --git a/include/linux/firmware/samsung/exynos-acpm-protocol.h b/include/linux/firmware/samsung/exynos-acpm-protocol.h
index 2091da965a5ad238b5e16c567a72fe88fafe6095..43d41e11ad2eb985e27a918ce3f9e9ac15a194ee 100644
--- a/include/linux/firmware/samsung/exynos-acpm-protocol.h
+++ b/include/linux/firmware/samsung/exynos-acpm-protocol.h
@@ -40,9 +40,33 @@ struct acpm_pmic_ops {
u8 value, u8 mask);
};
+struct acpm_tmu_ops {
+ int (*init)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id);
+ int (*read_temp)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz, int *temp);
+ int (*set_threshold)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz,
+ const u8 temperature[8], size_t tlen);
+ int (*set_hysteresis)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz,
+ const u8 hysteresis[8], size_t hlen);
+ int (*set_interrupt_enable)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz, u8 inten);
+ int (*tz_control)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz, bool enable);
+ int (*clear_tz_irq)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, u8 tz);
+ int (*suspend)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id);
+ int (*resume)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id);
+};
+
struct acpm_ops {
struct acpm_dvfs_ops dvfs_ops;
struct acpm_pmic_ops pmic_ops;
+ struct acpm_tmu_ops tmu;
};
/**
--
2.52.0.457.g6b5491de43-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 3/7] firmware: samsung: acpm: Add devm_acpm_get_by_phandle helper
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
2026-01-19 12:08 ` [PATCH v2 1/7] dt-bindings: thermal: Add " Tudor Ambarus
2026-01-19 12:08 ` [PATCH v2 2/7] firmware: samsung: acpm: Add TMU protocol support Tudor Ambarus
@ 2026-01-19 12:08 ` Tudor Ambarus
2026-01-19 12:08 ` [PATCH v2 4/7] thermal: samsung: Add support for GS101 TMU Tudor Ambarus
` (6 subsequent siblings)
9 siblings, 0 replies; 22+ messages in thread
From: Tudor Ambarus @ 2026-01-19 12:08 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening,
Tudor Ambarus
Introduce devm_acpm_get_by_phandle() to standardize how consumer
drivers acquire a handle to the ACPM IPC interface. Enforce the
use of the "samsung,acpm-ipc" property name across the SoC and
simplify the boilerplate code in client drivers.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
drivers/firmware/samsung/exynos-acpm.c | 23 ++++++++++++++++++++++
.../linux/firmware/samsung/exynos-acpm-protocol.h | 6 ++++++
2 files changed, 29 insertions(+)
diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/samsung/exynos-acpm.c
index cc045370f4b0dc6ccea99e3c2d6f86a43b2e9671..cf849ba23f09d8b1e7f91734a0a1cc064f7407c7 100644
--- a/drivers/firmware/samsung/exynos-acpm.c
+++ b/drivers/firmware/samsung/exynos-acpm.c
@@ -776,6 +776,29 @@ const struct acpm_handle *devm_acpm_get_by_node(struct device *dev,
}
EXPORT_SYMBOL_GPL(devm_acpm_get_by_node);
+/**
+ * devm_acpm_get_by_phandle - Resource managed lookup of the standardized
+ * "samsung,acpm-ipc" handle.
+ * @dev: consumer device
+ *
+ * Returns a pointer to the acpm_handle on success, or an ERR_PTR on failure.
+ */
+const struct acpm_handle *devm_acpm_get_by_phandle(struct device *dev)
+{
+ const struct acpm_handle *handle;
+ struct device_node *np;
+
+ np = of_parse_phandle(dev->of_node, "samsung,acpm-ipc", 0);
+ if (!np)
+ return ERR_PTR(-ENODEV);
+
+ handle = devm_acpm_get_by_node(dev, np);
+ of_node_put(np);
+
+ return handle;
+}
+EXPORT_SYMBOL_GPL(devm_acpm_get_by_phandle);
+
static const struct acpm_match_data acpm_gs101 = {
.initdata_base = ACPM_GS101_INITDATA_BASE,
.acpm_clk_dev_name = "gs101-acpm-clk",
diff --git a/include/linux/firmware/samsung/exynos-acpm-protocol.h b/include/linux/firmware/samsung/exynos-acpm-protocol.h
index 43d41e11ad2eb985e27a918ce3f9e9ac15a194ee..9485cdc1d91e86f9a9a8fc00722f3313e3000c6a 100644
--- a/include/linux/firmware/samsung/exynos-acpm-protocol.h
+++ b/include/linux/firmware/samsung/exynos-acpm-protocol.h
@@ -82,6 +82,7 @@ struct device;
#if IS_ENABLED(CONFIG_EXYNOS_ACPM_PROTOCOL)
const struct acpm_handle *devm_acpm_get_by_node(struct device *dev,
struct device_node *np);
+const struct acpm_handle *devm_acpm_get_by_phandle(struct device *dev);
#else
static inline const struct acpm_handle *devm_acpm_get_by_node(struct device *dev,
@@ -89,6 +90,11 @@ static inline const struct acpm_handle *devm_acpm_get_by_node(struct device *dev
{
return NULL;
}
+
+static inline const struct acpm_handle *devm_acpm_get_by_phandle(struct device *dev)
+{
+ return NULL;
+}
#endif
#endif /* __EXYNOS_ACPM_PROTOCOL_H */
--
2.52.0.457.g6b5491de43-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 4/7] thermal: samsung: Add support for GS101 TMU
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
` (2 preceding siblings ...)
2026-01-19 12:08 ` [PATCH v2 3/7] firmware: samsung: acpm: Add devm_acpm_get_by_phandle helper Tudor Ambarus
@ 2026-01-19 12:08 ` Tudor Ambarus
2026-02-13 10:11 ` Krzysztof Kozlowski
2026-03-01 3:33 ` Alexey Klimov
2026-01-19 12:08 ` [PATCH v2 5/7] MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver Tudor Ambarus
` (5 subsequent siblings)
9 siblings, 2 replies; 22+ messages in thread
From: Tudor Ambarus @ 2026-01-19 12:08 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening,
Tudor Ambarus
Add the thermal driver for the Google GS101 SoC.
The GS101 TMU utilizes a hybrid management model shared between the
Application Processor (AP) and the ACPM (Alive Clock and Power Manager)
firmware. The driver maintains direct memory-mapped access to the TMU
interrupt pending registers to identify thermal events, while delegating
functional tasks - such as sensor initialization, threshold configuration,
and temperature acquisition - to the ACPM firmware via the ACPM IPC
protocol.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
drivers/thermal/samsung/Kconfig | 16 +
drivers/thermal/samsung/Makefile | 2 +
drivers/thermal/samsung/acpm-tmu.c | 643 +++++++++++++++++++++++++++++++++++++
3 files changed, 661 insertions(+)
diff --git a/drivers/thermal/samsung/Kconfig b/drivers/thermal/samsung/Kconfig
index f4eff5a41a84ce02b12abb85d6a0f8818031d0dc..5679dfa85f4079c7d40317ac231bd6a1af93c7e7 100644
--- a/drivers/thermal/samsung/Kconfig
+++ b/drivers/thermal/samsung/Kconfig
@@ -9,3 +9,19 @@ config EXYNOS_THERMAL
the TMU, reports temperature and handles cooling action if defined.
This driver uses the Exynos core thermal APIs and TMU configuration
data from the supported SoCs.
+
+config EXYNOS_ACPM_THERMAL
+ tristate "Exynos ACPM thermal management unit driver"
+ depends on THERMAL_OF
+ depends on EXYNOS_ACPM_PROTOCOL || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL)
+ help
+ Support for the Thermal Management Unit (TMU) on Google GS101 SoC.
+
+ The TMU on GS101 is managed through a hybrid architecture. This driver
+ handles direct register access for thermal interrupt status monitoring
+ and communicates with the Alive Clock and Power Manager (ACPM)
+ firmware via the ACPM IPC protocol for functional sensor control and
+ configuration.
+
+ Select this if you want to monitor device temperature and enable
+ thermal mitigation on GS101 based devices.
diff --git a/drivers/thermal/samsung/Makefile b/drivers/thermal/samsung/Makefile
index f139407150d26940fc9ffcf000505cea4866223f..daed80647c349ba4f937ed8fbe6be9df06c34aac 100644
--- a/drivers/thermal/samsung/Makefile
+++ b/drivers/thermal/samsung/Makefile
@@ -4,3 +4,5 @@
#
obj-$(CONFIG_EXYNOS_THERMAL) += exynos_thermal.o
exynos_thermal-y := exynos_tmu.o
+obj-$(CONFIG_EXYNOS_ACPM_THERMAL) += exynos_acpm_thermal.o
+exynos_acpm_thermal-y := acpm-tmu.o
diff --git a/drivers/thermal/samsung/acpm-tmu.c b/drivers/thermal/samsung/acpm-tmu.c
new file mode 100644
index 0000000000000000000000000000000000000000..9fbac174e554284ff0b8c0b188a44dcceee4c440
--- /dev/null
+++ b/drivers/thermal/samsung/acpm-tmu.c
@@ -0,0 +1,643 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2019 Samsung Electronics Co., Ltd.
+ * Copyright 2025 Google LLC.
+ * Copyright 2026 Linaro Ltd.
+ */
+
+#include <linux/cleanup.h>
+#include <linux/clk.h>
+#include <linux/device/devres.h>
+#include <linux/err.h>
+#include <linux/firmware/samsung/exynos-acpm-protocol.h>
+#include <linux/interrupt.h>
+#include <linux/mod_devicetable.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/pm_runtime.h>
+#include <linux/regmap.h>
+#include <linux/thermal.h>
+#include <linux/units.h>
+
+#include "../thermal_hwmon.h"
+
+#define EXYNOS_TMU_SENSOR(i) BIT(i)
+#define EXYNOS_TMU_SENSORS_MAX_COUNT 16
+
+#define GS101_CPUCL2_SENSOR_MASK (EXYNOS_TMU_SENSOR(0) | \
+ EXYNOS_TMU_SENSOR(6) | \
+ EXYNOS_TMU_SENSOR(7) | \
+ EXYNOS_TMU_SENSOR(8) | \
+ EXYNOS_TMU_SENSOR(9))
+#define GS101_CPUCL1_SENSOR_MASK (EXYNOS_TMU_SENSOR(4) | \
+ EXYNOS_TMU_SENSOR(5))
+#define GS101_CPUCL0_SENSOR_MASK (EXYNOS_TMU_SENSOR(1) | \
+ EXYNOS_TMU_SENSOR(2))
+
+#define GS101_REG_INTPEND(i) ((i) * 0x50 + 0xf8)
+
+enum {
+ P0_INTPEND,
+ P1_INTPEND,
+ P2_INTPEND,
+ P3_INTPEND,
+ P4_INTPEND,
+ P5_INTPEND,
+ P6_INTPEND,
+ P7_INTPEND,
+ P8_INTPEND,
+ P9_INTPEND,
+ P10_INTPEND,
+ P11_INTPEND,
+ P12_INTPEND,
+ P13_INTPEND,
+ P14_INTPEND,
+ P15_INTPEND,
+ REG_INTPEND_COUNT,
+};
+
+struct acpm_tmu_sensor_group {
+ u16 mask;
+ u8 id;
+};
+
+struct acpm_tmu_sensor {
+ const struct acpm_tmu_sensor_group *group;
+ struct thermal_zone_device *tzd;
+ struct acpm_tmu_priv *priv;
+ struct mutex lock; /* protects sensor state */
+ bool enabled;
+};
+
+struct acpm_tmu_priv {
+ struct regmap_field *regmap_fields[REG_INTPEND_COUNT];
+ const struct acpm_handle *handle;
+ struct device *dev;
+ struct clk *clk;
+ unsigned int mbox_chan_id;
+ unsigned int num_sensors;
+ int irq;
+ struct acpm_tmu_sensor sensors[] __counted_by(num_sensors);
+};
+
+struct acpm_tmu_driver_data {
+ const struct reg_field *reg_fields;
+ const struct acpm_tmu_sensor_group *sensor_groups;
+ unsigned int num_sensor_groups;
+ unsigned int mbox_chan_id;
+};
+
+struct acpm_tmu_initialize_tripwalkdata {
+ unsigned char threshold[8];
+ unsigned char hysteresis[8];
+ unsigned char inten;
+ int i;
+};
+
+struct acpm_tmu_trip_temp_tripwalkdata {
+ const struct thermal_trip *trip;
+ unsigned char threshold[8];
+ int temperature;
+ int i;
+};
+
+#define ACPM_TMU_SENSOR_GROUP(_mask, _id) \
+ { \
+ .mask = _mask, \
+ .id = _id, \
+ }
+
+static const struct acpm_tmu_sensor_group gs101_sensor_groups[] = {
+ ACPM_TMU_SENSOR_GROUP(GS101_CPUCL2_SENSOR_MASK, 0),
+ ACPM_TMU_SENSOR_GROUP(GS101_CPUCL1_SENSOR_MASK, 1),
+ ACPM_TMU_SENSOR_GROUP(GS101_CPUCL0_SENSOR_MASK, 2),
+};
+
+static const struct reg_field gs101_reg_fields[REG_INTPEND_COUNT] = {
+ [P0_INTPEND] = REG_FIELD(GS101_REG_INTPEND(0), 0, 31),
+ [P1_INTPEND] = REG_FIELD(GS101_REG_INTPEND(1), 0, 31),
+ [P2_INTPEND] = REG_FIELD(GS101_REG_INTPEND(2), 0, 31),
+ [P3_INTPEND] = REG_FIELD(GS101_REG_INTPEND(3), 0, 31),
+ [P4_INTPEND] = REG_FIELD(GS101_REG_INTPEND(4), 0, 31),
+ [P5_INTPEND] = REG_FIELD(GS101_REG_INTPEND(5), 0, 31),
+ [P6_INTPEND] = REG_FIELD(GS101_REG_INTPEND(6), 0, 31),
+ [P7_INTPEND] = REG_FIELD(GS101_REG_INTPEND(7), 0, 31),
+ [P8_INTPEND] = REG_FIELD(GS101_REG_INTPEND(8), 0, 31),
+ [P9_INTPEND] = REG_FIELD(GS101_REG_INTPEND(9), 0, 31),
+ [P10_INTPEND] = REG_FIELD(GS101_REG_INTPEND(10), 0, 31),
+ [P11_INTPEND] = REG_FIELD(GS101_REG_INTPEND(11), 0, 31),
+ [P12_INTPEND] = REG_FIELD(GS101_REG_INTPEND(12), 0, 31),
+ [P13_INTPEND] = REG_FIELD(GS101_REG_INTPEND(13), 0, 31),
+ [P14_INTPEND] = REG_FIELD(GS101_REG_INTPEND(14), 0, 31),
+ [P15_INTPEND] = REG_FIELD(GS101_REG_INTPEND(15), 0, 31),
+};
+
+static const struct regmap_config gs101_regmap_config = {
+ .reg_bits = 32,
+ .reg_stride = 4,
+ .val_bits = 32,
+ .use_relaxed_mmio = true,
+ .max_register = GS101_REG_INTPEND(15),
+};
+
+static const struct acpm_tmu_driver_data acpm_tmu_gs101 = {
+ .reg_fields = gs101_reg_fields,
+ .sensor_groups = gs101_sensor_groups,
+ .num_sensor_groups = ARRAY_SIZE(gs101_sensor_groups),
+ .mbox_chan_id = 9,
+};
+
+static int acpm_tmu_op_tz_control(struct acpm_tmu_sensor *sensor, bool on)
+{
+ struct acpm_tmu_priv *priv = sensor->priv;
+ const struct acpm_handle *handle = priv->handle;
+ const struct acpm_tmu_ops *ops = &handle->ops.tmu;
+ int ret;
+
+ ret = ops->tz_control(handle, priv->mbox_chan_id, sensor->group->id,
+ on);
+ if (ret)
+ return ret;
+
+ sensor->enabled = on;
+
+ return 0;
+}
+
+static int acpm_tmu_control(struct acpm_tmu_priv *priv, bool on)
+{
+ struct device *dev = priv->dev;
+ int i, ret;
+
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0)
+ return ret;
+
+ for (i = 0; i < priv->num_sensors; i++) {
+ struct acpm_tmu_sensor *sensor = &priv->sensors[i];
+
+ /* Skip sensors that weren't found in DT */
+ if (!sensor->tzd)
+ continue;
+
+ scoped_guard(mutex, &sensor->lock) {
+ ret = acpm_tmu_op_tz_control(sensor, on);
+ }
+
+ if (ret)
+ goto out;
+ }
+
+out:
+ pm_runtime_put_autosuspend(dev);
+ return ret;
+}
+
+static int acpm_tmu_get_temp(struct thermal_zone_device *tz, int *temp)
+{
+ struct acpm_tmu_sensor *sensor = thermal_zone_device_priv(tz);
+ struct acpm_tmu_priv *priv = sensor->priv;
+ const struct acpm_handle *handle = priv->handle;
+ const struct acpm_tmu_ops *ops = &handle->ops.tmu;
+ struct device *dev = priv->dev;
+ int acpm_temp, ret;
+
+ if (!sensor->enabled)
+ return -EAGAIN;
+
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0)
+ return ret;
+
+ scoped_guard(mutex, &sensor->lock) {
+ ret = ops->read_temp(handle, priv->mbox_chan_id,
+ sensor->group->id, &acpm_temp);
+ }
+
+ pm_runtime_put_autosuspend(dev);
+
+ if (ret)
+ return ret;
+
+ *temp = acpm_temp * MILLIDEGREE_PER_DEGREE;
+
+ return 0;
+}
+
+static int acpm_tmu_trip_temp_walk_cb(struct thermal_trip *trip, void *data)
+{
+ struct acpm_tmu_trip_temp_tripwalkdata * const twd = data;
+ int temperature;
+
+ if (twd->i >= ARRAY_SIZE(twd->threshold))
+ return -ERANGE;
+
+ if (trip->type == THERMAL_TRIP_PASSIVE)
+ goto out;
+
+ temperature = (trip == twd->trip) ? twd->temperature : trip->temperature;
+
+ twd->threshold[twd->i] = temperature / MILLIDEGREE_PER_DEGREE;
+
+out:
+ ++twd->i;
+ return 0;
+}
+
+static int acpm_tmu_set_trip_temp(struct thermal_zone_device *tz,
+ const struct thermal_trip *trip, int temperature)
+{
+ struct acpm_tmu_sensor *sensor = thermal_zone_device_priv(tz);
+ struct acpm_tmu_priv *priv = sensor->priv;
+ const struct acpm_handle *handle = priv->handle;
+ const struct acpm_tmu_ops *ops = &handle->ops.tmu;
+ struct device *dev = priv->dev;
+ struct acpm_tmu_trip_temp_tripwalkdata twd = {
+ .trip = trip,
+ .temperature = temperature,
+ };
+ int ret;
+
+ if (trip->type == THERMAL_TRIP_PASSIVE)
+ return 0;
+
+ for_each_thermal_trip(tz, acpm_tmu_trip_temp_walk_cb, &twd);
+
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret)
+ return ret;
+
+ guard(mutex)(&sensor->lock);
+
+ if (!sensor->enabled) {
+ ret = ops->set_threshold(handle, priv->mbox_chan_id,
+ sensor->group->id, twd.threshold,
+ ARRAY_SIZE(twd.threshold));
+ goto out;
+ }
+
+ ret = acpm_tmu_op_tz_control(sensor, false);
+ if (ret)
+ goto out;
+
+ ret = ops->set_threshold(handle, priv->mbox_chan_id, sensor->group->id,
+ twd.threshold, ARRAY_SIZE(twd.threshold));
+ if (ret)
+ goto out;
+
+ ret = acpm_tmu_op_tz_control(sensor, true);
+
+out:
+ pm_runtime_put_autosuspend(dev);
+ return ret;
+}
+
+static const struct thermal_zone_device_ops acpm_tmu_sensor_ops = {
+ .get_temp = acpm_tmu_get_temp,
+ .set_trip_temp = acpm_tmu_set_trip_temp,
+};
+
+static int acpm_tmu_has_pending_irq(struct acpm_tmu_sensor *sensor,
+ bool *pending_irq)
+{
+ struct acpm_tmu_priv *priv = sensor->priv;
+ unsigned long mask = sensor->group->mask;
+ int i, ret;
+ u32 val;
+
+ guard(mutex)(&sensor->lock);
+
+ for_each_set_bit(i, &mask, EXYNOS_TMU_SENSORS_MAX_COUNT) {
+ ret = regmap_field_read(priv->regmap_fields[i], &val);
+ if (ret)
+ return ret;
+
+ if (val) {
+ *pending_irq = true;
+ break;
+ }
+ }
+
+ return 0;
+}
+
+static irqreturn_t acpm_tmu_thread_fn(int irq, void *id)
+{
+ struct acpm_tmu_priv *priv = id;
+ const struct acpm_handle *handle = priv->handle;
+ const struct acpm_tmu_ops *ops = &handle->ops.tmu;
+ struct device *dev = priv->dev;
+ int i, ret;
+
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret) {
+ dev_err(dev, "Failed to resume: %d\n", ret);
+ return IRQ_NONE;
+ }
+
+ for (i = 0; i < priv->num_sensors; i++) {
+ struct acpm_tmu_sensor *sensor = &priv->sensors[i];
+ bool pending_irq = false;
+
+ if (!sensor->tzd)
+ continue;
+
+ ret = acpm_tmu_has_pending_irq(sensor, &pending_irq);
+ if (ret || !pending_irq)
+ continue;
+
+ thermal_zone_device_update(sensor->tzd,
+ THERMAL_EVENT_UNSPECIFIED);
+
+ scoped_guard(mutex, &sensor->lock) {
+ ret = ops->clear_tz_irq(handle, priv->mbox_chan_id,
+ sensor->group->id);
+ if (ret)
+ dev_err(priv->dev, "Sensor %d: failed to clear IRQ (%d)\n",
+ i, ret);
+ }
+ }
+
+ pm_runtime_put_autosuspend(dev);
+
+ return IRQ_HANDLED;
+}
+
+static int acpm_tmu_init_sensor(struct acpm_tmu_sensor *sensor,
+ const struct acpm_tmu_initialize_tripwalkdata *twd)
+{
+ struct acpm_tmu_priv *priv = sensor->priv;
+ const struct acpm_handle *handle = priv->handle;
+ const struct acpm_tmu_ops *ops = &handle->ops.tmu;
+ unsigned int mbox_chan_id = priv->mbox_chan_id;
+ u8 acpm_sensor_id = sensor->group->id;
+ int ret;
+
+ guard(mutex)(&sensor->lock);
+
+ ret = ops->set_threshold(handle, mbox_chan_id, acpm_sensor_id,
+ twd->threshold,
+ ARRAY_SIZE(twd->threshold));
+ if (ret)
+ return ret;
+
+ ret = ops->set_hysteresis(handle, mbox_chan_id, acpm_sensor_id,
+ twd->hysteresis,
+ ARRAY_SIZE(twd->threshold));
+ if (ret)
+ return ret;
+
+ ret = ops->set_interrupt_enable(handle, mbox_chan_id, acpm_sensor_id,
+ twd->inten);
+ return ret;
+}
+
+static int acpm_tmu_initialize_walk_cb(struct thermal_trip *trip, void *data)
+{
+ struct acpm_tmu_initialize_tripwalkdata * const twd = data;
+ int i;
+
+ if (twd->i >= ARRAY_SIZE(twd->threshold))
+ return -ERANGE;
+
+ if (trip->type == THERMAL_TRIP_PASSIVE)
+ goto out;
+
+ i = twd->i;
+
+ twd->threshold[i] = trip->temperature / MILLIDEGREE_PER_DEGREE;
+ twd->hysteresis[i] = trip->hysteresis / MILLIDEGREE_PER_DEGREE;
+
+ twd->inten |= BIT(i);
+
+out:
+ ++twd->i;
+ return 0;
+}
+
+static int acpm_tmu_init_sensors(struct acpm_tmu_priv *priv)
+{
+ int i, ret;
+
+ for (i = 0; i < priv->num_sensors; i++) {
+ struct acpm_tmu_sensor *sensor = &priv->sensors[i];
+ struct acpm_tmu_initialize_tripwalkdata twd = {};
+
+ /* Skip sensors that weren't found in DT */
+ if (!sensor->tzd)
+ continue;
+
+ thermal_zone_for_each_trip(sensor->tzd,
+ acpm_tmu_initialize_walk_cb, &twd);
+
+ ret = acpm_tmu_init_sensor(sensor, &twd);
+ if (ret)
+ return ret;
+ }
+
+ return 0;
+}
+
+static const struct of_device_id acpm_tmu_match[] = {
+ { .compatible = "google,gs101-tmu-top" },
+ { /* sentinel */ },
+};
+MODULE_DEVICE_TABLE(of, acpm_tmu_match);
+
+static int acpm_tmu_probe(struct platform_device *pdev)
+{
+ const struct acpm_tmu_driver_data *data = &acpm_tmu_gs101;
+ const struct acpm_handle *acpm_handle;
+ struct device *dev = &pdev->dev;
+ struct acpm_tmu_priv *priv;
+ struct regmap *regmap;
+ void __iomem *base;
+ int i, ret;
+
+ acpm_handle = devm_acpm_get_by_phandle(dev);
+ if (IS_ERR(acpm_handle))
+ return dev_err_probe(dev, PTR_ERR(acpm_handle),
+ "Failed to get ACPM handle\n");
+
+ priv = devm_kzalloc(dev,
+ struct_size(priv, sensors, data->num_sensor_groups),
+ GFP_KERNEL);
+ if (!priv)
+ return -ENOMEM;
+
+ priv->dev = dev;
+ priv->handle = acpm_handle;
+ priv->mbox_chan_id = data->mbox_chan_id;
+ priv->num_sensors = data->num_sensor_groups;
+
+ platform_set_drvdata(pdev, priv);
+
+ base = devm_platform_ioremap_resource(pdev, 0);
+ if (IS_ERR(base))
+ return dev_err_probe(dev, PTR_ERR(base), "Failed to ioremap resource\n");
+
+ regmap = devm_regmap_init_mmio(dev, base, &gs101_regmap_config);
+ if (IS_ERR(regmap))
+ return dev_err_probe(dev, PTR_ERR(regmap), "Failed to init regmap\n");
+
+ ret = devm_regmap_field_bulk_alloc(dev, regmap, priv->regmap_fields,
+ data->reg_fields, REG_INTPEND_COUNT);
+ if (ret)
+ return dev_err_probe(dev, ret,
+ "Unable to map syscon registers\n");
+
+ priv->clk = devm_clk_get(dev, NULL);
+ if (IS_ERR(priv->clk))
+ return dev_err_probe(dev, PTR_ERR(priv->clk),
+ "Failed to get the clock\n");
+
+ priv->irq = platform_get_irq(pdev, 0);
+ if (priv->irq < 0)
+ return dev_err_probe(dev, priv->irq, "Failed to get irq\n");
+
+ ret = devm_request_threaded_irq(dev, priv->irq, NULL,
+ acpm_tmu_thread_fn, IRQF_ONESHOT,
+ dev_name(dev), priv);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to request irq\n");
+
+ pm_runtime_set_autosuspend_delay(dev, 100);
+ pm_runtime_use_autosuspend(dev);
+
+ ret = devm_pm_runtime_enable(dev);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to enable runtime PM\n");
+
+ ret = pm_runtime_resume_and_get(dev);
+ if (ret < 0)
+ return dev_err_probe(dev, ret, "Failed to resume device\n");
+
+ ret = acpm_handle->ops.tmu.init(acpm_handle, priv->mbox_chan_id);
+ if (ret) {
+ ret = dev_err_probe(dev, ret, "Failed to init TMU\n");
+ goto err_pm_put;
+ }
+
+ for (i = 0; i < priv->num_sensors; i++) {
+ struct acpm_tmu_sensor *sensor = &priv->sensors[i];
+
+ mutex_init(&sensor->lock);
+ sensor->group = &data->sensor_groups[i];
+ sensor->priv = priv;
+
+ sensor->tzd = devm_thermal_of_zone_register(dev, i, sensor,
+ &acpm_tmu_sensor_ops);
+ if (IS_ERR(sensor->tzd)) {
+ ret = PTR_ERR(sensor->tzd);
+ if (ret == -ENODEV) {
+ sensor->tzd = NULL;
+ dev_dbg(dev, "Sensor %d not used in DT, skipping\n", i);
+ continue;
+ }
+
+ ret = dev_err_probe(dev, ret, "Failed to register sensor %d\n", i);
+ goto err_pm_put;
+ }
+
+ ret = devm_thermal_add_hwmon_sysfs(dev, sensor->tzd);
+ if (ret)
+ dev_warn(dev, "Failed to add hwmon sysfs!\n");
+ }
+
+ ret = acpm_tmu_init_sensors(priv);
+ if (ret) {
+ ret = dev_err_probe(dev, ret, "Failed to init sensors\n");
+ goto err_pm_put;
+ }
+
+ ret = acpm_tmu_control(priv, true);
+ if (ret) {
+ ret = dev_err_probe(dev, ret, "Failed to enable TMU\n");
+ goto err_pm_put;
+ }
+
+ pm_runtime_put_autosuspend(&pdev->dev);
+
+ return 0;
+
+err_pm_put:
+ pm_runtime_put_sync(dev);
+ return ret;
+}
+
+static void acpm_tmu_remove(struct platform_device *pdev)
+{
+ struct acpm_tmu_priv *priv = platform_get_drvdata(pdev);
+
+ /* Stop IRQ first to prevent race with thread_fn */
+ disable_irq(priv->irq);
+
+ acpm_tmu_control(priv, false);
+}
+
+static int acpm_tmu_suspend(struct device *dev)
+{
+ struct acpm_tmu_priv *priv = dev_get_drvdata(dev);
+ const struct acpm_handle *handle = priv->handle;
+ const struct acpm_tmu_ops *ops = &handle->ops.tmu;
+ int ret;
+
+ ret = acpm_tmu_control(priv, false);
+ if (ret)
+ return ret;
+
+ /* APB clock not required for this specific msg */
+ return ops->suspend(handle, priv->mbox_chan_id);
+}
+
+static int acpm_tmu_resume(struct device *dev)
+{
+ struct acpm_tmu_priv *priv = dev_get_drvdata(dev);
+ const struct acpm_handle *handle = priv->handle;
+ const struct acpm_tmu_ops *ops = &handle->ops.tmu;
+ int ret;
+
+ /* APB clock not required for this specific msg */
+ ret = ops->resume(handle, priv->mbox_chan_id);
+ if (ret)
+ return ret;
+
+ return acpm_tmu_control(priv, true);
+}
+
+static int acpm_tmu_runtime_suspend(struct device *dev)
+{
+ struct acpm_tmu_priv *priv = dev_get_drvdata(dev);
+
+ clk_disable_unprepare(priv->clk);
+
+ return 0;
+}
+
+static int acpm_tmu_runtime_resume(struct device *dev)
+{
+ struct acpm_tmu_priv *priv = dev_get_drvdata(dev);
+
+ return clk_prepare_enable(priv->clk);
+}
+
+static const struct dev_pm_ops acpm_tmu_pm_ops = {
+ SYSTEM_SLEEP_PM_OPS(acpm_tmu_suspend, acpm_tmu_resume)
+ RUNTIME_PM_OPS(acpm_tmu_runtime_suspend, acpm_tmu_runtime_resume, NULL)
+};
+
+static struct platform_driver acpm_tmu_driver = {
+ .driver = {
+ .name = "gs-tmu",
+ .pm = pm_ptr(&acpm_tmu_pm_ops),
+ .of_match_table = acpm_tmu_match,
+ },
+ .probe = acpm_tmu_probe,
+ .remove = acpm_tmu_remove,
+};
+module_platform_driver(acpm_tmu_driver);
+
+MODULE_AUTHOR("Tudor Ambarus <tudor.ambarus@linaro.org>");
+MODULE_DESCRIPTION("Samsung Exynos ACPM TMU Driver");
+MODULE_LICENSE("GPL");
--
2.52.0.457.g6b5491de43-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 5/7] MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
` (3 preceding siblings ...)
2026-01-19 12:08 ` [PATCH v2 4/7] thermal: samsung: Add support for GS101 TMU Tudor Ambarus
@ 2026-01-19 12:08 ` Tudor Ambarus
2026-02-13 10:12 ` Krzysztof Kozlowski
2026-01-19 12:08 ` [PATCH v2 6/7] arm64: dts: exynos: gs101: Add thermal management unit Tudor Ambarus
` (4 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2026-01-19 12:08 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening,
Tudor Ambarus
Add a MAINTAINERS entry for the Samsung Exynos ACPM thermal driver.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
MAINTAINERS | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/MAINTAINERS b/MAINTAINERS
index 5b11839cba9de1e9e43f63787578edd8c429ca39..ab44f2de8e8e03ad9bb022ebdf1b6c0058fb0425 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -23171,6 +23171,14 @@ F: drivers/clk/samsung/clk-acpm.c
F: drivers/firmware/samsung/exynos-acpm*
F: include/linux/firmware/samsung/exynos-acpm-protocol.h
+SAMSUNG EXYNOS ACPM THERMAL DRIVER
+M: Tudor Ambarus <tudor.ambarus@linaro.org>
+L: linux-kernel@vger.kernel.org
+L: linux-samsung-soc@vger.kernel.org
+S: Supported
+F: Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml
+F: drivers/thermal/samsung/acpm-tmu.c
+
SAMSUNG EXYNOS MAILBOX DRIVER
M: Tudor Ambarus <tudor.ambarus@linaro.org>
L: linux-kernel@vger.kernel.org
--
2.52.0.457.g6b5491de43-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 6/7] arm64: dts: exynos: gs101: Add thermal management unit
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
` (4 preceding siblings ...)
2026-01-19 12:08 ` [PATCH v2 5/7] MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver Tudor Ambarus
@ 2026-01-19 12:08 ` Tudor Ambarus
2026-02-13 10:13 ` Krzysztof Kozlowski
2026-01-19 12:08 ` [PATCH v2 7/7] arm64: defconfig: enable Exynos ACPM thermal support Tudor Ambarus
` (3 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2026-01-19 12:08 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening,
Tudor Ambarus
Add the Thermal Management Unit (TMU) support for the Google GS101 SoC.
Describe the TMU using a consolidated SoC node that includes memory
resources for interrupt identification and a phandle to the ACPM IPC
interface for functional control.
Define thermal zones for the little, mid, and big CPU clusters, including
associated trip points and cooling-device maps to enable thermal
mitigation.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi | 209 +++++++++++++++++++++++
arch/arm64/boot/dts/exynos/google/gs101.dtsi | 18 ++
2 files changed, 227 insertions(+)
diff --git a/arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi b/arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi
new file mode 100644
index 0000000000000000000000000000000000000000..6262c3b890aa2f7ad572c32b30bf926df804ec1e
--- /dev/null
+++ b/arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi
@@ -0,0 +1,209 @@
+// SPDX-License-Identifier: GPL-2.0
+/*
+ * Google GS101 TMU configurations device tree source
+ *
+ * Copyright 2020 Samsung Electronics Co., Ltd.
+ * Copyright 2020 Google LLC.
+ * Copyright 2026 Linaro Ltd.
+ */
+
+#include <dt-bindings/thermal/thermal.h>
+
+/ {
+ thermal-zones {
+ cpucl2-thermal {
+ polling-delay-passive = <0>;
+ polling-delay = <0>;
+ thermal-sensors = <&tmu_top 0>;
+
+ trips {
+ big_cold: big-cold {
+ temperature = <20000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ big_switch_on: big-switch-on {
+ temperature = <70000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ big_control_temp: big-control-temp {
+ temperature = <90000>;
+ hysteresis = <5000>;
+ type = "passive";
+ };
+
+ big_pre_switch_on: big-pre-switch-on {
+ temperature = <55000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ big_alert2: big-alert2 {
+ temperature = <95000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ big_hw_throttling: big-hw-throttling {
+ temperature = <103000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ big_pause: big-pause {
+ temperature = <108000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ big_hot: big-hot {
+ temperature = <115000>;
+ hysteresis = <3000>;
+ type = "hot";
+ };
+ };
+
+ cooling-maps {
+ map0 {
+ trip = <&big_control_temp>;
+ cooling-device = <&cpu6 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu7 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ };
+ };
+ };
+
+ cpucl1-thermal {
+ polling-delay-passive = <0>;
+ polling-delay = <0>;
+ thermal-sensors = <&tmu_top 1>;
+
+ trips {
+ mid_cold: mid-cold {
+ temperature = <20000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ mid_switch_on: mid-switch-on {
+ temperature = <70000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ mid_control_temp: mid-control-temp {
+ temperature = <90000>;
+ hysteresis = <5000>;
+ type = "passive";
+ };
+
+ mid_pre_switch_on: mid-pre-switch-on {
+ temperature = <55000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ mid_alert2: mid-alert2 {
+ temperature = <95000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ mid_hw_throttling: mid-hw-throttling {
+ temperature = <98000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ mid_pause: mid-pause {
+ temperature = <108000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ mid_hot: mid-hot {
+ temperature = <115000>;
+ hysteresis = <3000>;
+ type = "hot";
+ };
+ };
+
+ cooling-maps {
+ map0 {
+ trip = <&mid_control_temp>;
+ cooling-device = <&cpu4 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu5 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ };
+ };
+ };
+
+ cpucl0-thermal {
+ polling-delay-passive = <0>;
+ polling-delay = <0>;
+ thermal-sensors = <&tmu_top 2>;
+
+ trips {
+ little_cold: little-cold {
+ temperature = <20000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ little_switch_on: little-switch-on {
+ temperature = <70000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ little_control_temp: little-control-temp {
+ temperature = <95000>;
+ hysteresis = <5000>;
+ type = "passive";
+ };
+
+ little_pre_switch_on: little-pre-switch-on {
+ temperature = <55000>;
+ hysteresis = <2000>;
+ type = "active";
+ };
+
+ little_alert2: little-alert2 {
+ temperature = <100000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ little_alert5: little-alert5 {
+ temperature = <103000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ little_alert6: little-alert6 {
+ temperature = <110000>;
+ hysteresis = <5000>;
+ type = "active";
+ };
+
+ little_hot: little-hot {
+ temperature = <115000>;
+ hysteresis = <3000>;
+ type = "hot";
+ };
+ };
+
+ cooling-maps {
+ map0 {
+ trip = <&little_control_temp>;
+ cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
+ <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
+ };
+ };
+ };
+
+ };
+};
diff --git a/arch/arm64/boot/dts/exynos/google/gs101.dtsi b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
index d085f9fb0f62ac2f57b104c20880e64d885d0bee..4b8c7edaddb6fd49e61496f2f21f348db0b58f10 100644
--- a/arch/arm64/boot/dts/exynos/google/gs101.dtsi
+++ b/arch/arm64/boot/dts/exynos/google/gs101.dtsi
@@ -74,6 +74,7 @@ cpu0: cpu@0 {
compatible = "arm,cortex-a55";
reg = <0x0000>;
clocks = <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL0>;
+ #cooling-cells = <2>;
enable-method = "psci";
cpu-idle-states = <&ananke_cpu_sleep>;
capacity-dmips-mhz = <250>;
@@ -86,6 +87,7 @@ cpu1: cpu@100 {
compatible = "arm,cortex-a55";
reg = <0x0100>;
clocks = <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL0>;
+ #cooling-cells = <2>;
enable-method = "psci";
cpu-idle-states = <&ananke_cpu_sleep>;
capacity-dmips-mhz = <250>;
@@ -98,6 +100,7 @@ cpu2: cpu@200 {
compatible = "arm,cortex-a55";
reg = <0x0200>;
clocks = <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL0>;
+ #cooling-cells = <2>;
enable-method = "psci";
cpu-idle-states = <&ananke_cpu_sleep>;
capacity-dmips-mhz = <250>;
@@ -110,6 +113,7 @@ cpu3: cpu@300 {
compatible = "arm,cortex-a55";
reg = <0x0300>;
clocks = <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL0>;
+ #cooling-cells = <2>;
enable-method = "psci";
cpu-idle-states = <&ananke_cpu_sleep>;
capacity-dmips-mhz = <250>;
@@ -122,6 +126,7 @@ cpu4: cpu@400 {
compatible = "arm,cortex-a76";
reg = <0x0400>;
clocks = <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL1>;
+ #cooling-cells = <2>;
enable-method = "psci";
cpu-idle-states = <&enyo_cpu_sleep>;
capacity-dmips-mhz = <620>;
@@ -134,6 +139,7 @@ cpu5: cpu@500 {
compatible = "arm,cortex-a76";
reg = <0x0500>;
clocks = <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL1>;
+ #cooling-cells = <2>;
enable-method = "psci";
cpu-idle-states = <&enyo_cpu_sleep>;
capacity-dmips-mhz = <620>;
@@ -146,6 +152,7 @@ cpu6: cpu@600 {
compatible = "arm,cortex-x1";
reg = <0x0600>;
clocks = <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL2>;
+ #cooling-cells = <2>;
enable-method = "psci";
cpu-idle-states = <&hera_cpu_sleep>;
capacity-dmips-mhz = <1024>;
@@ -158,6 +165,7 @@ cpu7: cpu@700 {
compatible = "arm,cortex-x1";
reg = <0x0700>;
clocks = <&acpm_ipc GS101_CLK_ACPM_DVFS_CPUCL2>;
+ #cooling-cells = <2>;
enable-method = "psci";
cpu-idle-states = <&hera_cpu_sleep>;
capacity-dmips-mhz = <1024>;
@@ -639,6 +647,15 @@ watchdog_cl1: watchdog@10070000 {
status = "disabled";
};
+ tmu_top: thermal-sensor@100a0000 {
+ compatible = "google,gs101-tmu-top";
+ reg = <0x100a0000 0x800>;
+ clocks = <&cmu_misc CLK_GOUT_MISC_TMU_TOP_PCLK>;
+ interrupts = <GIC_SPI 769 IRQ_TYPE_LEVEL_HIGH 0>;
+ samsung,acpm-ipc = <&acpm_ipc>;
+ #thermal-sensor-cells = <1>;
+ };
+
trng: rng@10141400 {
compatible = "google,gs101-trng",
"samsung,exynos850-trng";
@@ -1861,3 +1878,4 @@ timer {
};
#include "gs101-pinctrl.dtsi"
+#include "gs101-tmu.dtsi"
--
2.52.0.457.g6b5491de43-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* [PATCH v2 7/7] arm64: defconfig: enable Exynos ACPM thermal support
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
` (5 preceding siblings ...)
2026-01-19 12:08 ` [PATCH v2 6/7] arm64: dts: exynos: gs101: Add thermal management unit Tudor Ambarus
@ 2026-01-19 12:08 ` Tudor Ambarus
2026-02-13 10:14 ` Krzysztof Kozlowski
2026-03-01 2:57 ` [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Alexey Klimov
` (2 subsequent siblings)
9 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2026-01-19 12:08 UTC (permalink / raw)
To: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening,
Tudor Ambarus
Enable the Exynos ACPM thermal driver (CONFIG_EXYNOS_ACPM_THERMAL)
to allow temperature monitoring and thermal management on Samsung
Exynos SoCs that use the Alive Clock and Power Manager (ACPM)
protocol.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
arch/arm64/configs/defconfig | 1 +
1 file changed, 1 insertion(+)
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index 45288ec9eaf7365427d98195c48e2f8065a8bb1b..68fefe4bf49501500362fcb0b490a684ea469b26 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -752,6 +752,7 @@ CONFIG_BCM2711_THERMAL=m
CONFIG_BCM2835_THERMAL=m
CONFIG_BRCMSTB_THERMAL=m
CONFIG_EXYNOS_THERMAL=y
+CONFIG_EXYNOS_ACPM_THERMAL=m
CONFIG_TEGRA_SOCTHERM=m
CONFIG_TEGRA_BPMP_THERMAL=m
CONFIG_GENERIC_ADC_THERMAL=m
--
2.52.0.457.g6b5491de43-goog
^ permalink raw reply related [flat|nested] 22+ messages in thread
* Re: [PATCH v2 1/7] dt-bindings: thermal: Add Google GS101 TMU
2026-01-19 12:08 ` [PATCH v2 1/7] dt-bindings: thermal: Add " Tudor Ambarus
@ 2026-01-21 7:52 ` Krzysztof Kozlowski
2026-03-05 3:48 ` Alexey Klimov
1 sibling, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2026-01-21 7:52 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley, Alim Akhtar,
Bartlomiej Zolnierkiewicz, Kees Cook, Gustavo A. R. Silva,
Peter Griffin, André Draszik, willmcvicker, jyescas,
shin.son, linux-samsung-soc, linux-kernel, linux-pm, devicetree,
linux-arm-kernel, linux-hardening
On Mon, Jan 19, 2026 at 12:08:47PM +0000, Tudor Ambarus wrote:
> Document the Thermal Management Unit (TMU) found on the Google GS101 SoC.
>
> The GS101 TMU utilizes a hybrid control model shared between the
> Application Processor (AP) and the ACPM (Alive Clock and Power Manager)
> firmware.
>
> While the TMU is a standard memory-mapped IP block, on this platform
> the AP's direct register access is restricted to the interrupt pending
> (INTPEND) registers for event identification. High-level functional
> tasks, such as sensor initialization, threshold programming, and
> temperature reads, are delegated to the ACPM firmware.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> .../bindings/thermal/google,gs101-tmu-top.yaml | 67 ++++++++++++++++++++++
> 1 file changed, 67 insertions(+)
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 2/7] firmware: samsung: acpm: Add TMU protocol support
2026-01-19 12:08 ` [PATCH v2 2/7] firmware: samsung: acpm: Add TMU protocol support Tudor Ambarus
@ 2026-02-13 10:07 ` Krzysztof Kozlowski
0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-13 10:07 UTC (permalink / raw)
To: Tudor Ambarus, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Bartlomiej Zolnierkiewicz, Kees Cook,
Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On 19/01/2026 13:08, Tudor Ambarus wrote:
> The Thermal Management Unit (TMU) on the Google GS101 SoC is managed
> through a hybrid model shared between the kernel and the Alive Clock
> and Power Manager (ACPM) firmware.
>
> Add the protocol helpers required to communicate with the ACPM for
> thermal operations, including initialization, threshold configuration,
> temperature reading, and system suspend/resume handshakes.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/firmware/samsung/Makefile | 1 +
> drivers/firmware/samsung/exynos-acpm-tmu.c | 212 +++++++++++++++++++++
> drivers/firmware/samsung/exynos-acpm-tmu.h | 33 ++++
> drivers/firmware/samsung/exynos-acpm.c | 12 ++
> .../linux/firmware/samsung/exynos-acpm-protocol.h | 24 +++
> 5 files changed, 282 insertions(+)
I understood from the cover letter this should go via thermal tree, so:
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 4/7] thermal: samsung: Add support for GS101 TMU
2026-01-19 12:08 ` [PATCH v2 4/7] thermal: samsung: Add support for GS101 TMU Tudor Ambarus
@ 2026-02-13 10:11 ` Krzysztof Kozlowski
2026-03-01 3:33 ` Alexey Klimov
1 sibling, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-13 10:11 UTC (permalink / raw)
To: Tudor Ambarus, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Bartlomiej Zolnierkiewicz, Kees Cook,
Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On 19/01/2026 13:08, Tudor Ambarus wrote:
> Add the thermal driver for the Google GS101 SoC.
>
> The GS101 TMU utilizes a hybrid management model shared between the
> Application Processor (AP) and the ACPM (Alive Clock and Power Manager)
> firmware. The driver maintains direct memory-mapped access to the TMU
> interrupt pending registers to identify thermal events, while delegating
> functional tasks - such as sensor initialization, threshold configuration,
> and temperature acquisition - to the ACPM firmware via the ACPM IPC
> protocol.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/thermal/samsung/Kconfig | 16 +
> drivers/thermal/samsung/Makefile | 2 +
> drivers/thermal/samsung/acpm-tmu.c | 643 +++++++++++++++++++++++++++++++++++++
> 3 files changed, 661 insertions(+)
I did not perform full review, but after quick glance:
Acked-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 5/7] MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver
2026-01-19 12:08 ` [PATCH v2 5/7] MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver Tudor Ambarus
@ 2026-02-13 10:12 ` Krzysztof Kozlowski
0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-13 10:12 UTC (permalink / raw)
To: Tudor Ambarus, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Bartlomiej Zolnierkiewicz, Kees Cook,
Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On 19/01/2026 13:08, Tudor Ambarus wrote:
> Add a MAINTAINERS entry for the Samsung Exynos ACPM thermal driver.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
Reviewed-by: Krzysztof Kozlowski <krzysztof.kozlowski@oss.qualcomm.com>
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 6/7] arm64: dts: exynos: gs101: Add thermal management unit
2026-01-19 12:08 ` [PATCH v2 6/7] arm64: dts: exynos: gs101: Add thermal management unit Tudor Ambarus
@ 2026-02-13 10:13 ` Krzysztof Kozlowski
0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-13 10:13 UTC (permalink / raw)
To: Tudor Ambarus, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Bartlomiej Zolnierkiewicz, Kees Cook,
Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On 19/01/2026 13:08, Tudor Ambarus wrote:
> +
> + cooling-maps {
> + map0 {
> + trip = <&little_control_temp>;
> + cooling-device = <&cpu0 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> + <&cpu1 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> + <&cpu2 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>,
> + <&cpu3 THERMAL_NO_LIMIT THERMAL_NO_LIMIT>;
> + };
> + };
> + };
> +
If there is going to be resend, drop stray blank line.
Otherwise looks fine, so please ping me when binding is taken to thermal
tree.
> + };
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 7/7] arm64: defconfig: enable Exynos ACPM thermal support
2026-01-19 12:08 ` [PATCH v2 7/7] arm64: defconfig: enable Exynos ACPM thermal support Tudor Ambarus
@ 2026-02-13 10:14 ` Krzysztof Kozlowski
0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2026-02-13 10:14 UTC (permalink / raw)
To: Tudor Ambarus, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Alim Akhtar, Bartlomiej Zolnierkiewicz, Kees Cook,
Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On 19/01/2026 13:08, Tudor Ambarus wrote:
> Enable the Exynos ACPM thermal driver (CONFIG_EXYNOS_ACPM_THERMAL)
> to allow temperature monitoring and thermal management on Samsung
> Exynos SoCs that use the Alive Clock and Power Manager (ACPM)
> protocol.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> arch/arm64/configs/defconfig | 1 +
> 1 file changed, 1 insertion(+)
I'll take it after driver gets accepted.
Best regards,
Krzysztof
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
` (6 preceding siblings ...)
2026-01-19 12:08 ` [PATCH v2 7/7] arm64: defconfig: enable Exynos ACPM thermal support Tudor Ambarus
@ 2026-03-01 2:57 ` Alexey Klimov
2026-03-02 9:07 ` Tudor Ambarus
2026-03-02 18:30 ` Alexey Klimov
2026-04-08 14:49 ` Alexey Klimov
9 siblings, 1 reply; 22+ messages in thread
From: Alexey Klimov @ 2026-03-01 2:57 UTC (permalink / raw)
To: Tudor Ambarus, Rafael J. Wysocki
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik,
willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On Mon Jan 19, 2026 at 12:08 PM GMT, Tudor Ambarus wrote:
> Add support for the Thermal Management Unit (TMU) on the Google GS101
> SoC.
>
> The GS101 TMU implementation utilizes a hybrid architecture where
> management is shared between the kernel and the Alive Clock and
> Power Manager (ACPM) firmware.
[..]
> Sensor Mapping (One-to-Many)
> ============================
>
> The SoC contains multiple physical temperature sensors, but the ACPM
> firmware abstracts these into logical groups (Clusters) for reporting:
>
> - ACPM Sensor 0 (Big Cluster): Aggregates physical sensors 0, 6, 7, 8, 9.
> - ACPM Sensor 1 (Mid Cluster): Aggregates physical sensors 4, 5.
> - ACPM Sensor 2 (Little Cluster): Aggregates physical sensors 1, 2.
What about other non-CPU devices? Are there no sensors or implementation
currently doesn't support them?
Is this implementation and ACPM TMU support exclusive only to GS101 SoC?
IIRC, mapping could be different for other SoCs and, for instance, last
sensors could be non-CPU devices.
Best regards,
Alexey
[..]
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 4/7] thermal: samsung: Add support for GS101 TMU
2026-01-19 12:08 ` [PATCH v2 4/7] thermal: samsung: Add support for GS101 TMU Tudor Ambarus
2026-02-13 10:11 ` Krzysztof Kozlowski
@ 2026-03-01 3:33 ` Alexey Klimov
2026-03-02 9:16 ` Tudor Ambarus
1 sibling, 1 reply; 22+ messages in thread
From: Alexey Klimov @ 2026-03-01 3:33 UTC (permalink / raw)
To: Tudor Ambarus, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On Mon Jan 19, 2026 at 12:08 PM GMT, Tudor Ambarus wrote:
> Add the thermal driver for the Google GS101 SoC.
Is this driver for GS101 platforms only or for all Exynos-based
platforms where we have deal with thermal unit via ACPM?
> The GS101 TMU utilizes a hybrid management model shared between the
> Application Processor (AP) and the ACPM (Alive Clock and Power Manager)
> firmware. The driver maintains direct memory-mapped access to the TMU
> interrupt pending registers to identify thermal events, while delegating
> functional tasks - such as sensor initialization, threshold configuration,
> and temperature acquisition - to the ACPM firmware via the ACPM IPC
> protocol.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> drivers/thermal/samsung/Kconfig | 16 +
> drivers/thermal/samsung/Makefile | 2 +
> drivers/thermal/samsung/acpm-tmu.c | 643 +++++++++++++++++++++++++++++++++++++
> 3 files changed, 661 insertions(+)
>
> diff --git a/drivers/thermal/samsung/Kconfig b/drivers/thermal/samsung/Kconfig
> index f4eff5a41a84ce02b12abb85d6a0f8818031d0dc..5679dfa85f4079c7d40317ac231bd6a1af93c7e7 100644
> --- a/drivers/thermal/samsung/Kconfig
> +++ b/drivers/thermal/samsung/Kconfig
> @@ -9,3 +9,19 @@ config EXYNOS_THERMAL
> the TMU, reports temperature and handles cooling action if defined.
> This driver uses the Exynos core thermal APIs and TMU configuration
> data from the supported SoCs.
> +
> +config EXYNOS_ACPM_THERMAL
> + tristate "Exynos ACPM thermal management unit driver"
> + depends on THERMAL_OF
> + depends on EXYNOS_ACPM_PROTOCOL || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL)
> + help
> + Support for the Thermal Management Unit (TMU) on Google GS101 SoC.
> +
> + The TMU on GS101 is managed through a hybrid architecture. This driver
> + handles direct register access for thermal interrupt status monitoring
> + and communicates with the Alive Clock and Power Manager (ACPM)
> + firmware via the ACPM IPC protocol for functional sensor control and
> + configuration.
> +
> + Select this if you want to monitor device temperature and enable
> + thermal mitigation on GS101 based devices.
I don't understand this. What this driver actually supports/implements?
Dealing with TMU over ACPM firmware is not exclusive to Google GS101 SoC,
some other Exynos-based systems has this as well. However, it names
the config option EXYNOS_ACPM_THERMAL but a lot of other things say that
it is only for GS101, isn't it?
Does it implement the generic layer dealing with TMU via ACPM (hence the name)
and adds specific things to support gs101?
Should it be something like this (feel free to correct):
Support for the Thermal Management Unit (TMU) exported via ACPM.
This driver handles direct register access for thermal interrupt
status monitoring and communicates with the Alive Clock and Power
Manager (ACPM) firmware via the ACPM IPC protocol for functional
sensor control and configuration.
Select this if you want to monitor device temperature and enable
thermal mitigation on Exynos-based devices that implement dealing
with TMU via ACPM, for instance, GS101-based devices.
?
[...]
Best regards,
Alexey
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU
2026-03-01 2:57 ` [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Alexey Klimov
@ 2026-03-02 9:07 ` Tudor Ambarus
0 siblings, 0 replies; 22+ messages in thread
From: Tudor Ambarus @ 2026-03-02 9:07 UTC (permalink / raw)
To: Alexey Klimov, Rafael J. Wysocki
Cc: Daniel Lezcano, Zhang Rui, Lukasz Luba, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, Krzysztof Kozlowski,
Alim Akhtar, Bartlomiej Zolnierkiewicz, Kees Cook,
Gustavo A. R. Silva, Peter Griffin, André Draszik,
willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On 3/1/26 4:57 AM, Alexey Klimov wrote:
> On Mon Jan 19, 2026 at 12:08 PM GMT, Tudor Ambarus wrote:
>> Add support for the Thermal Management Unit (TMU) on the Google GS101
>> SoC.
>>
>> The GS101 TMU implementation utilizes a hybrid architecture where
>> management is shared between the kernel and the Alive Clock and
>> Power Manager (ACPM) firmware.
>
> [..]
>
>> Sensor Mapping (One-to-Many)
>> ============================
>>
>> The SoC contains multiple physical temperature sensors, but the ACPM
>> firmware abstracts these into logical groups (Clusters) for reporting:
>>
>> - ACPM Sensor 0 (Big Cluster): Aggregates physical sensors 0, 6, 7, 8, 9.
>> - ACPM Sensor 1 (Mid Cluster): Aggregates physical sensors 4, 5.
>> - ACPM Sensor 2 (Little Cluster): Aggregates physical sensors 1, 2.
>
> What about other non-CPU devices? Are there no sensors or implementation
> currently doesn't support them?
The implementation currently doesn't support them. On GS101 other sensors
are for GPU, ISP, TPU, and AUR.
>
> Is this implementation and ACPM TMU support exclusive only to GS101 SoC?
no, it can be extended for other Samsung SoCs.
> IIRC, mapping could be different for other SoCs and, for instance, last
> sensors could be non-CPU devices.
right.
Cheers,
ta
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 4/7] thermal: samsung: Add support for GS101 TMU
2026-03-01 3:33 ` Alexey Klimov
@ 2026-03-02 9:16 ` Tudor Ambarus
0 siblings, 0 replies; 22+ messages in thread
From: Tudor Ambarus @ 2026-03-02 9:16 UTC (permalink / raw)
To: Alexey Klimov, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On 3/1/26 5:33 AM, Alexey Klimov wrote:
> On Mon Jan 19, 2026 at 12:08 PM GMT, Tudor Ambarus wrote:
>> Add the thermal driver for the Google GS101 SoC.
>
> Is this driver for GS101 platforms only or for all Exynos-based
> platforms where we have deal with thermal unit via ACPM?
The driver can be extended for other Samsung Exynos SoCs.
>
>> The GS101 TMU utilizes a hybrid management model shared between the
>> Application Processor (AP) and the ACPM (Alive Clock and Power Manager)
>> firmware. The driver maintains direct memory-mapped access to the TMU
>> interrupt pending registers to identify thermal events, while delegating
>> functional tasks - such as sensor initialization, threshold configuration,
>> and temperature acquisition - to the ACPM firmware via the ACPM IPC
>> protocol.
>>
>> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
>> ---
>> drivers/thermal/samsung/Kconfig | 16 +
>> drivers/thermal/samsung/Makefile | 2 +
>> drivers/thermal/samsung/acpm-tmu.c | 643 +++++++++++++++++++++++++++++++++++++
>> 3 files changed, 661 insertions(+)
>>
>> diff --git a/drivers/thermal/samsung/Kconfig b/drivers/thermal/samsung/Kconfig
>> index f4eff5a41a84ce02b12abb85d6a0f8818031d0dc..5679dfa85f4079c7d40317ac231bd6a1af93c7e7 100644
>> --- a/drivers/thermal/samsung/Kconfig
>> +++ b/drivers/thermal/samsung/Kconfig
>> @@ -9,3 +9,19 @@ config EXYNOS_THERMAL
>> the TMU, reports temperature and handles cooling action if defined.
>> This driver uses the Exynos core thermal APIs and TMU configuration
>> data from the supported SoCs.
>> +
>> +config EXYNOS_ACPM_THERMAL
>> + tristate "Exynos ACPM thermal management unit driver"
>> + depends on THERMAL_OF
>> + depends on EXYNOS_ACPM_PROTOCOL || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL)
>> + help
>> + Support for the Thermal Management Unit (TMU) on Google GS101 SoC.
>> +
>> + The TMU on GS101 is managed through a hybrid architecture. This driver
>> + handles direct register access for thermal interrupt status monitoring
>> + and communicates with the Alive Clock and Power Manager (ACPM)
>> + firmware via the ACPM IPC protocol for functional sensor control and
>> + configuration.
>> +
>> + Select this if you want to monitor device temperature and enable
>> + thermal mitigation on GS101 based devices.
>
> I don't understand this. What this driver actually supports/implements?
> Dealing with TMU over ACPM firmware is not exclusive to Google GS101 SoC,
right
> some other Exynos-based systems has this as well. However, it names
> the config option EXYNOS_ACPM_THERMAL but a lot of other things say that
> it is only for GS101, isn't it?
right, because I'm currently adding support just for GS101. I wanted to be
accurate and thought that when/if other SoCs will be supported by this
driver, we can generalize the description.
> Does it implement the generic layer dealing with TMU via ACPM (hence the name)
> and adds specific things to support gs101?
Right. I expect the sensor mask may differ from other Samsung Exynos SoCs.
I remembered I compared the register set with e850, minor differences there.
>
> Should it be something like this (feel free to correct):
> Support for the Thermal Management Unit (TMU) exported via ACPM.
>
> This driver handles direct register access for thermal interrupt
> status monitoring and communicates with the Alive Clock and Power
> Manager (ACPM) firmware via the ACPM IPC protocol for functional
> sensor control and configuration.
>
> Select this if you want to monitor device temperature and enable
> thermal mitigation on Exynos-based devices that implement dealing
> with TMU via ACPM, for instance, GS101-based devices.
>
I can generalize the description in v2.
Thanks,
ta
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
` (7 preceding siblings ...)
2026-03-01 2:57 ` [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Alexey Klimov
@ 2026-03-02 18:30 ` Alexey Klimov
2026-03-03 9:01 ` Tudor Ambarus
2026-04-08 14:49 ` Alexey Klimov
9 siblings, 1 reply; 22+ messages in thread
From: Alexey Klimov @ 2026-03-02 18:30 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik,
willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
Hi Tudor,
On Sun, 1 Mar 2026 at 02:26, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
[...]
> ---
> Tudor Ambarus (7):
> dt-bindings: thermal: Add Google GS101 TMU
> firmware: samsung: acpm: Add TMU protocol support
> firmware: samsung: acpm: Add devm_acpm_get_by_phandle helper
> thermal: samsung: Add support for GS101 TMU
> MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver
> arm64: dts: exynos: gs101: Add thermal management unit
> arm64: defconfig: enable Exynos ACPM thermal support
>
> .../bindings/thermal/google,gs101-tmu-top.yaml | 67 +++
> MAINTAINERS | 8 +
> arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi | 209 +++++++
> arch/arm64/boot/dts/exynos/google/gs101.dtsi | 18 +
> arch/arm64/configs/defconfig | 1 +
> drivers/firmware/samsung/Makefile | 1 +
> drivers/firmware/samsung/exynos-acpm-tmu.c | 212 +++++++
> drivers/firmware/samsung/exynos-acpm-tmu.h | 33 ++
> drivers/firmware/samsung/exynos-acpm.c | 35 ++
> drivers/thermal/samsung/Kconfig | 16 +
> drivers/thermal/samsung/Makefile | 2 +
> drivers/thermal/samsung/acpm-tmu.c | 643 +++++++++++++++++++++
> .../linux/firmware/samsung/exynos-acpm-protocol.h | 30 +
> 13 files changed, 1275 insertions(+)
> ---
> base-commit: e2211f5d980086dd9fbdab3bcd86b715e12cae13
> change-id: 20260113-acpm-tmu-27e21f0e2c3b
JFYI, the series doesn't clearly apply on today's linux-next:
Grabbing thread from
lore.kernel.org/all/20260119-acpm-tmu-v2-0-e02a834f04c6@linaro.org/t.mbox.gz
Checking for newer revisions
Grabbing search results from lore.kernel.org
Analyzing 18 messages in the thread
Looking for additional code-review trailers on lore.kernel.org
Analyzing 20 code-review messages
Checking attestation on all messages, may take a moment...
Base: using specified base-commit e2211f5d980086dd9fbdab3bcd86b715e12cae13
Applying: dt-bindings: thermal: Add Google GS101 TMU
Applying: firmware: samsung: acpm: Add TMU protocol support
Patch failed at 0002 firmware: samsung: acpm: Add TMU protocol support
error: patch failed: include/linux/firmware/samsung/exynos-acpm-protocol.h:40
error: include/linux/firmware/samsung/exynos-acpm-protocol.h: patch
does not apply
Was it done against mainline?
Thanks,
Alexey
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU
2026-03-02 18:30 ` Alexey Klimov
@ 2026-03-03 9:01 ` Tudor Ambarus
0 siblings, 0 replies; 22+ messages in thread
From: Tudor Ambarus @ 2026-03-03 9:01 UTC (permalink / raw)
To: Alexey Klimov
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik,
willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On 3/2/26 8:30 PM, Alexey Klimov wrote:
> Hi Tudor,
Hi!
>
> On Sun, 1 Mar 2026 at 02:26, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
>
> [...]
>
>> ---
>> Tudor Ambarus (7):
>> dt-bindings: thermal: Add Google GS101 TMU
>> firmware: samsung: acpm: Add TMU protocol support
>> firmware: samsung: acpm: Add devm_acpm_get_by_phandle helper
>> thermal: samsung: Add support for GS101 TMU
>> MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver
>> arm64: dts: exynos: gs101: Add thermal management unit
>> arm64: defconfig: enable Exynos ACPM thermal support
>>
>> .../bindings/thermal/google,gs101-tmu-top.yaml | 67 +++
>> MAINTAINERS | 8 +
>> arch/arm64/boot/dts/exynos/google/gs101-tmu.dtsi | 209 +++++++
>> arch/arm64/boot/dts/exynos/google/gs101.dtsi | 18 +
>> arch/arm64/configs/defconfig | 1 +
>> drivers/firmware/samsung/Makefile | 1 +
>> drivers/firmware/samsung/exynos-acpm-tmu.c | 212 +++++++
>> drivers/firmware/samsung/exynos-acpm-tmu.h | 33 ++
>> drivers/firmware/samsung/exynos-acpm.c | 35 ++
>> drivers/thermal/samsung/Kconfig | 16 +
>> drivers/thermal/samsung/Makefile | 2 +
>> drivers/thermal/samsung/acpm-tmu.c | 643 +++++++++++++++++++++
>> .../linux/firmware/samsung/exynos-acpm-protocol.h | 30 +
>> 13 files changed, 1275 insertions(+)
>> ---
>> base-commit: e2211f5d980086dd9fbdab3bcd86b715e12cae13
>> change-id: 20260113-acpm-tmu-27e21f0e2c3b
>
> JFYI, the series doesn't clearly apply on today's linux-next:
okay, thanks. I'll submit a v2, but right now I'm dealing with other
higher priority topics.
>
> Grabbing thread from
> lore.kernel.org/all/20260119-acpm-tmu-v2-0-e02a834f04c6@linaro.org/t.mbox.gz
> Checking for newer revisions
> Grabbing search results from lore.kernel.org
> Analyzing 18 messages in the thread
> Looking for additional code-review trailers on lore.kernel.org
> Analyzing 20 code-review messages
> Checking attestation on all messages, may take a moment...
>
> Base: using specified base-commit e2211f5d980086dd9fbdab3bcd86b715e12cae13
> Applying: dt-bindings: thermal: Add Google GS101 TMU
> Applying: firmware: samsung: acpm: Add TMU protocol support
> Patch failed at 0002 firmware: samsung: acpm: Add TMU protocol support
> error: patch failed: include/linux/firmware/samsung/exynos-acpm-protocol.h:40
> error: include/linux/firmware/samsung/exynos-acpm-protocol.h: patch
> does not apply
>
> Was it done against mainline?
Of course, yes. It was on top of what was the latest Samsung SoC tree
at the time of development. Internal kernel trees may change,
depending on the maintainer.
If you want to try the code while I submit a v2, I pushed what I
think it was v2 at:
git@github.com:ambarus/linux-0day.git, branch b4/acpm-tmu
Cheers,
ta
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 1/7] dt-bindings: thermal: Add Google GS101 TMU
2026-01-19 12:08 ` [PATCH v2 1/7] dt-bindings: thermal: Add " Tudor Ambarus
2026-01-21 7:52 ` Krzysztof Kozlowski
@ 2026-03-05 3:48 ` Alexey Klimov
1 sibling, 0 replies; 22+ messages in thread
From: Alexey Klimov @ 2026-03-05 3:48 UTC (permalink / raw)
To: Tudor Ambarus, Rafael J. Wysocki, Daniel Lezcano, Zhang Rui,
Lukasz Luba, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik
Cc: willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
Hi Tudor,
On Mon Jan 19, 2026 at 12:08 PM GMT, Tudor Ambarus wrote:
> Document the Thermal Management Unit (TMU) found on the Google GS101 SoC.
>
> The GS101 TMU utilizes a hybrid control model shared between the
> Application Processor (AP) and the ACPM (Alive Clock and Power Manager)
> firmware.
>
> While the TMU is a standard memory-mapped IP block, on this platform
this ^^
> the AP's direct register access is restricted to the interrupt pending
> (INTPEND) registers for event identification. High-level functional
> tasks, such as sensor initialization, threshold programming, and
> temperature reads, are delegated to the ACPM firmware.
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
> .../bindings/thermal/google,gs101-tmu-top.yaml | 67 ++++++++++++++++++++++
> 1 file changed, 67 insertions(+)
>
> diff --git a/Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml b/Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml
> new file mode 100644
> index 0000000000000000000000000000000000000000..b09e1ff5d89194b570810a042c75836ca2e53950
> --- /dev/null
> +++ b/Documentation/devicetree/bindings/thermal/google,gs101-tmu-top.yaml
> @@ -0,0 +1,67 @@
> +# SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause)
> +%YAML 1.2
> +---
> +$id: http://devicetree.org/schemas/thermal/google,gs101-tmu-top.yaml#
> +$schema: http://devicetree.org/meta-schemas/core.yaml#
> +
> +title: Google GS101 Thermal Management Unit (TMU)
> +
> +maintainers:
> + - Tudor Ambarus <tudor.ambarus@linaro.org>
> +
> +description:
> + The Google GS101 TMU is a thermal sensor block that supports both direct
> + register-level access and firmware-mediated management via the ACPM
> + (Alive Clock and Power Manager) firmware.
> +
> + On this platform, the hardware is managed in a hybrid fashion. The
> + Application Processor (AP) maintains direct memory-mapped access
> + exclusively to the interrupt pending registers to identify thermal
> + events. All other functional aspects - including sensor
> + initialization, threshold configuration, and temperature acquisition
> + - are handled by the ACPM firmware. The AP coordinates these
> + operations through the ACPM IPC protocol.
Is it Google TMU hardware block or Exynos/Samsung TMU block?
My understanding at this point is that ACPM interface, ACPM protocols, etc
appeared on Samsung SoCs before gs101 (maybe even before initial SCMI
prototyping). It looks like ACPM firmware, communication via mailboxes,
TMU channel, dealing with TMU behing ACPM, etc are actually a standard
Samsung Exynos architectural feature, rather than a Google-specific
implementation. I can't say though what was the first chipset where it
was implemented.
Given that this is a Samsung design that predates the gs101, would it
make sense to use more generic name for this binding to reflect that
it is Exynos-derived? That would save us from generalizing things later
(if it happens, and I hope it happens).
I was thinking that name for this schema could be smth like:
samsung,acpm-tmu.yaml or samsung,exynos-acpm-tmu.yaml or whatever works.
Thanks,
Alexey
^ permalink raw reply [flat|nested] 22+ messages in thread
* Re: [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
` (8 preceding siblings ...)
2026-03-02 18:30 ` Alexey Klimov
@ 2026-04-08 14:49 ` Alexey Klimov
9 siblings, 0 replies; 22+ messages in thread
From: Alexey Klimov @ 2026-04-08 14:49 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Rafael J. Wysocki, Daniel Lezcano, Zhang Rui, Lukasz Luba,
Rob Herring, Krzysztof Kozlowski, Conor Dooley,
Krzysztof Kozlowski, Alim Akhtar, Bartlomiej Zolnierkiewicz,
Kees Cook, Gustavo A. R. Silva, Peter Griffin, André Draszik,
willmcvicker, jyescas, shin.son, linux-samsung-soc, linux-kernel,
linux-pm, devicetree, linux-arm-kernel, linux-hardening
On Mon Jan 19, 2026 at 12:08 PM GMT, Tudor Ambarus wrote:
> Add support for the Thermal Management Unit (TMU) on the Google GS101
> SoC.
>
> The GS101 TMU implementation utilizes a hybrid architecture where
> management is shared between the kernel and the Alive Clock and
> Power Manager (ACPM) firmware.
Do you plan to update or work on this series? If, by some reason,
this series is postphoned I can rebase it and re-send, for example.
IIRC it needs a clean rebase as a minimial change.
I am constructing some code on top of it, so it will be nice to have
newer version that can be (re-)tested for Exynos850.
Thanks,
Alexey
[...]
^ permalink raw reply [flat|nested] 22+ messages in thread
end of thread, other threads:[~2026-04-08 14:49 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-01-19 12:08 [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Tudor Ambarus
2026-01-19 12:08 ` [PATCH v2 1/7] dt-bindings: thermal: Add " Tudor Ambarus
2026-01-21 7:52 ` Krzysztof Kozlowski
2026-03-05 3:48 ` Alexey Klimov
2026-01-19 12:08 ` [PATCH v2 2/7] firmware: samsung: acpm: Add TMU protocol support Tudor Ambarus
2026-02-13 10:07 ` Krzysztof Kozlowski
2026-01-19 12:08 ` [PATCH v2 3/7] firmware: samsung: acpm: Add devm_acpm_get_by_phandle helper Tudor Ambarus
2026-01-19 12:08 ` [PATCH v2 4/7] thermal: samsung: Add support for GS101 TMU Tudor Ambarus
2026-02-13 10:11 ` Krzysztof Kozlowski
2026-03-01 3:33 ` Alexey Klimov
2026-03-02 9:16 ` Tudor Ambarus
2026-01-19 12:08 ` [PATCH v2 5/7] MAINTAINERS: Add entry for Samsung Exynos ACPM thermal driver Tudor Ambarus
2026-02-13 10:12 ` Krzysztof Kozlowski
2026-01-19 12:08 ` [PATCH v2 6/7] arm64: dts: exynos: gs101: Add thermal management unit Tudor Ambarus
2026-02-13 10:13 ` Krzysztof Kozlowski
2026-01-19 12:08 ` [PATCH v2 7/7] arm64: defconfig: enable Exynos ACPM thermal support Tudor Ambarus
2026-02-13 10:14 ` Krzysztof Kozlowski
2026-03-01 2:57 ` [PATCH v2 0/7] thermal: samsung: Add support for Google GS101 TMU Alexey Klimov
2026-03-02 9:07 ` Tudor Ambarus
2026-03-02 18:30 ` Alexey Klimov
2026-03-03 9:01 ` Tudor Ambarus
2026-04-08 14:49 ` Alexey Klimov
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox