* [PATCH v4 1/5] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks
2025-09-08 13:12 [PATCH v4 0/5] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
@ 2025-09-08 13:12 ` Tudor Ambarus
2025-09-08 13:12 ` [PATCH v4 2/5] firmware: exynos-acpm: add DVFS protocol Tudor Ambarus
` (4 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Tudor Ambarus @ 2025-09-08 13:12 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Peter Griffin,
André Draszik, Michael Turquette, Stephen Boyd,
Krzysztof Kozlowski, Alim Akhtar, Sylwester Nawrocki,
Chanwoo Choi, Catalin Marinas, Will Deacon
Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
linux-clk, willmcvicker, kernel-team, Tudor Ambarus
The firmware exposes clocks that can be controlled via the
Alive Clock and Power Manager (ACPM) interface.
Make the ACPM node a clock provider by adding the mandatory
"#clock-cells" property, which allows devices to reference its
clock outputs.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
Reviewed-by: Rob Herring (Arm) <robh@kernel.org>
---
.../bindings/firmware/google,gs101-acpm-ipc.yaml | 11 +++++++++
include/dt-bindings/clock/google,gs101-acpm.h | 26 ++++++++++++++++++++++
2 files changed, 37 insertions(+)
diff --git a/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml b/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml
index 9785aac3b5f34955bbfe2718eec48581d050954f..d3bca6088d128485618bb2b538ed8596b4ba14f0 100644
--- a/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml
+++ b/Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml
@@ -24,6 +24,15 @@ properties:
compatible:
const: google,gs101-acpm-ipc
+ "#clock-cells":
+ const: 1
+ description:
+ Clocks that are variable and index based. These clocks don't provide
+ an entire range of values between the limits but only discrete points
+ within the range. The firmware also manages the voltage scaling
+ appropriately with the clock scaling. The argument is the ID of the
+ clock contained by the firmware messages.
+
mboxes:
maxItems: 1
@@ -45,6 +54,7 @@ properties:
required:
- compatible
+ - "#clock-cells"
- mboxes
- shmem
@@ -56,6 +66,7 @@ examples:
power-management {
compatible = "google,gs101-acpm-ipc";
+ #clock-cells = <1>;
mboxes = <&ap2apm_mailbox>;
shmem = <&apm_sram>;
diff --git a/include/dt-bindings/clock/google,gs101-acpm.h b/include/dt-bindings/clock/google,gs101-acpm.h
new file mode 100644
index 0000000000000000000000000000000000000000..e2ba89e09fa6209f7c81f554dd511b2619009e5b
--- /dev/null
+++ b/include/dt-bindings/clock/google,gs101-acpm.h
@@ -0,0 +1,26 @@
+/* SPDX-License-Identifier: (GPL-2.0-only OR BSD-2-Clause) */
+/*
+ * Copyright 2025 Linaro Ltd.
+ *
+ * Device Tree binding constants for Google gs101 ACPM clock controller.
+ */
+
+#ifndef _DT_BINDINGS_CLOCK_GOOGLE_GS101_ACPM_H
+#define _DT_BINDINGS_CLOCK_GOOGLE_GS101_ACPM_H
+
+#define GS101_CLK_ACPM_DVFS_MIF 0
+#define GS101_CLK_ACPM_DVFS_INT 1
+#define GS101_CLK_ACPM_DVFS_CPUCL0 2
+#define GS101_CLK_ACPM_DVFS_CPUCL1 3
+#define GS101_CLK_ACPM_DVFS_CPUCL2 4
+#define GS101_CLK_ACPM_DVFS_G3D 5
+#define GS101_CLK_ACPM_DVFS_G3DL2 6
+#define GS101_CLK_ACPM_DVFS_TPU 7
+#define GS101_CLK_ACPM_DVFS_INTCAM 8
+#define GS101_CLK_ACPM_DVFS_TNR 9
+#define GS101_CLK_ACPM_DVFS_CAM 10
+#define GS101_CLK_ACPM_DVFS_MFC 11
+#define GS101_CLK_ACPM_DVFS_DISP 12
+#define GS101_CLK_ACPM_DVFS_BO 13
+
+#endif /* _DT_BINDINGS_CLOCK_GOOGLE_GS101_ACPM_H */
--
2.51.0.355.g5224444f11-goog
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v4 2/5] firmware: exynos-acpm: add DVFS protocol
2025-09-08 13:12 [PATCH v4 0/5] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
2025-09-08 13:12 ` [PATCH v4 1/5] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks Tudor Ambarus
@ 2025-09-08 13:12 ` Tudor Ambarus
2025-09-08 13:12 ` [PATCH v4 3/5] firmware: exynos-acpm: register ACPM clocks pdev Tudor Ambarus
` (3 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Tudor Ambarus @ 2025-09-08 13:12 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Peter Griffin,
André Draszik, Michael Turquette, Stephen Boyd,
Krzysztof Kozlowski, Alim Akhtar, Sylwester Nawrocki,
Chanwoo Choi, Catalin Marinas, Will Deacon
Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
linux-clk, willmcvicker, kernel-team, Tudor Ambarus
Add ACPM DVFS protocol handler. It constructs DVFS messages that
the APM firmware can understand.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
drivers/firmware/samsung/Makefile | 4 +-
drivers/firmware/samsung/exynos-acpm-dvfs.c | 83 ++++++++++++++++++++++
drivers/firmware/samsung/exynos-acpm-dvfs.h | 21 ++++++
drivers/firmware/samsung/exynos-acpm.c | 5 ++
.../linux/firmware/samsung/exynos-acpm-protocol.h | 10 +++
5 files changed, 122 insertions(+), 1 deletion(-)
diff --git a/drivers/firmware/samsung/Makefile b/drivers/firmware/samsung/Makefile
index 7b4c9f6f34f54fd731886d97a615fe1aa97ba9a0..80d4f89b33a9558b68c9083da675c70ec3d05f19 100644
--- a/drivers/firmware/samsung/Makefile
+++ b/drivers/firmware/samsung/Makefile
@@ -1,4 +1,6 @@
# SPDX-License-Identifier: GPL-2.0-only
-acpm-protocol-objs := exynos-acpm.o exynos-acpm-pmic.o
+acpm-protocol-objs := exynos-acpm.o
+acpm-protocol-objs += exynos-acpm-pmic.o
+acpm-protocol-objs += exynos-acpm-dvfs.o
obj-$(CONFIG_EXYNOS_ACPM_PROTOCOL) += acpm-protocol.o
diff --git a/drivers/firmware/samsung/exynos-acpm-dvfs.c b/drivers/firmware/samsung/exynos-acpm-dvfs.c
new file mode 100644
index 0000000000000000000000000000000000000000..a8763bf9374d41952a8d26124cc77baae0f1c723
--- /dev/null
+++ b/drivers/firmware/samsung/exynos-acpm-dvfs.c
@@ -0,0 +1,83 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Copyright 2020 Samsung Electronics Co., Ltd.
+ * Copyright 2020 Google LLC.
+ * Copyright 2025 Linaro Ltd.
+ */
+
+#include <linux/bitfield.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-dvfs.h"
+
+#define ACPM_DVFS_ID GENMASK(11, 0)
+#define ACPM_DVFS_REQ_TYPE GENMASK(15, 0)
+
+#define ACPM_DVFS_FREQ_REQ 0
+#define ACPM_DVFS_FREQ_GET 1
+
+static void acpm_dvfs_set_xfer(struct acpm_xfer *xfer, u32 *cmd, size_t cmdlen,
+ unsigned int acpm_chan_id, bool response)
+{
+ xfer->acpm_chan_id = acpm_chan_id;
+ xfer->txd = cmd;
+ xfer->txlen = cmdlen;
+
+ if (response) {
+ xfer->rxd = cmd;
+ xfer->rxlen = cmdlen;
+ }
+}
+
+static void acpm_dvfs_init_set_rate_cmd(u32 cmd[4], unsigned int clk_id,
+ unsigned long rate)
+{
+ cmd[0] = FIELD_PREP(ACPM_DVFS_ID, clk_id);
+ cmd[1] = rate / HZ_PER_KHZ;
+ cmd[2] = FIELD_PREP(ACPM_DVFS_REQ_TYPE, ACPM_DVFS_FREQ_REQ);
+ cmd[3] = ktime_to_ms(ktime_get());
+}
+
+int acpm_dvfs_set_rate(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, unsigned int clk_id,
+ unsigned long rate)
+{
+ struct acpm_xfer xfer = {0};
+ u32 cmd[4];
+
+ acpm_dvfs_init_set_rate_cmd(cmd, clk_id, rate);
+ acpm_dvfs_set_xfer(&xfer, cmd, sizeof(cmd), acpm_chan_id, false);
+
+ return acpm_do_xfer(handle, &xfer);
+}
+
+static void acpm_dvfs_init_get_rate_cmd(u32 cmd[4], unsigned int clk_id,
+ u32 dbg_val)
+{
+ cmd[0] = FIELD_PREP(ACPM_DVFS_ID, clk_id);
+ cmd[1] = dbg_val;
+ cmd[2] = FIELD_PREP(ACPM_DVFS_REQ_TYPE, ACPM_DVFS_FREQ_GET);
+ cmd[3] = ktime_to_ms(ktime_get());
+}
+
+unsigned long acpm_dvfs_get_rate(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, unsigned int clk_id,
+ u32 dbg_val)
+{
+ struct acpm_xfer xfer;
+ unsigned int cmd[4];
+ int ret;
+
+ acpm_dvfs_init_get_rate_cmd(cmd, clk_id, dbg_val);
+ acpm_dvfs_set_xfer(&xfer, cmd, sizeof(cmd), acpm_chan_id, true);
+
+ ret = acpm_do_xfer(handle, &xfer);
+ if (ret)
+ return 0;
+
+ return xfer.rxd[1] * HZ_PER_KHZ;
+}
diff --git a/drivers/firmware/samsung/exynos-acpm-dvfs.h b/drivers/firmware/samsung/exynos-acpm-dvfs.h
new file mode 100644
index 0000000000000000000000000000000000000000..85a10bd535d118f2f36e9888e41b9b705b08ea59
--- /dev/null
+++ b/drivers/firmware/samsung/exynos-acpm-dvfs.h
@@ -0,0 +1,21 @@
+/* SPDX-License-Identifier: GPL-2.0-only */
+/*
+ * Copyright 2020 Samsung Electronics Co., Ltd.
+ * Copyright 2020 Google LLC.
+ * Copyright 2025 Linaro Ltd.
+ */
+#ifndef __EXYNOS_ACPM_DVFS_H__
+#define __EXYNOS_ACPM_DVFS_H__
+
+#include <linux/types.h>
+
+struct acpm_handle;
+
+int acpm_dvfs_set_rate(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, unsigned int id,
+ unsigned long rate);
+unsigned long acpm_dvfs_get_rate(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, unsigned int clk_id,
+ u32 dbg_val);
+
+#endif /* __EXYNOS_ACPM_DVFS_H__ */
diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/samsung/exynos-acpm.c
index 3a69fe3234c75e0b5a93cbea6bb210dc6f69d2a6..9fa0335ccf5db32892fdf09e8d4b0a885a8f8fb5 100644
--- a/drivers/firmware/samsung/exynos-acpm.c
+++ b/drivers/firmware/samsung/exynos-acpm.c
@@ -29,6 +29,7 @@
#include <linux/types.h>
#include "exynos-acpm.h"
+#include "exynos-acpm-dvfs.h"
#include "exynos-acpm-pmic.h"
#define ACPM_PROTOCOL_SEQNUM GENMASK(21, 16)
@@ -590,8 +591,12 @@ static int acpm_channels_init(struct acpm_info *acpm)
*/
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;
+ dvfs_ops->set_rate = acpm_dvfs_set_rate;
+ dvfs_ops->get_rate = acpm_dvfs_get_rate;
+
pmic_ops->read_reg = acpm_pmic_read_reg;
pmic_ops->bulk_read = acpm_pmic_bulk_read;
pmic_ops->write_reg = acpm_pmic_write_reg;
diff --git a/include/linux/firmware/samsung/exynos-acpm-protocol.h b/include/linux/firmware/samsung/exynos-acpm-protocol.h
index f628bf1862c25fa018a2fe5e7e123bf05c5254b9..e41055316bb578bb8250a1b1177f1059eeeb2611 100644
--- a/include/linux/firmware/samsung/exynos-acpm-protocol.h
+++ b/include/linux/firmware/samsung/exynos-acpm-protocol.h
@@ -13,6 +13,15 @@
struct acpm_handle;
struct device_node;
+struct acpm_dvfs_ops {
+ int (*set_rate)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id, unsigned int clk_id,
+ unsigned long rate);
+ unsigned long (*get_rate)(const struct acpm_handle *handle,
+ unsigned int acpm_chan_id,
+ unsigned int clk_id, u32 dbg_val);
+};
+
struct acpm_pmic_ops {
int (*read_reg)(const struct acpm_handle *handle,
unsigned int acpm_chan_id, u8 type, u8 reg, u8 chan,
@@ -32,6 +41,7 @@ struct acpm_pmic_ops {
};
struct acpm_ops {
+ struct acpm_dvfs_ops dvfs_ops;
struct acpm_pmic_ops pmic_ops;
};
--
2.51.0.355.g5224444f11-goog
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v4 3/5] firmware: exynos-acpm: register ACPM clocks pdev
2025-09-08 13:12 [PATCH v4 0/5] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
2025-09-08 13:12 ` [PATCH v4 1/5] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks Tudor Ambarus
2025-09-08 13:12 ` [PATCH v4 2/5] firmware: exynos-acpm: add DVFS protocol Tudor Ambarus
@ 2025-09-08 13:12 ` Tudor Ambarus
2025-09-08 13:12 ` [PATCH v4 4/5] clk: samsung: add Exynos ACPM clock driver Tudor Ambarus
` (2 subsequent siblings)
5 siblings, 0 replies; 9+ messages in thread
From: Tudor Ambarus @ 2025-09-08 13:12 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Peter Griffin,
André Draszik, Michael Turquette, Stephen Boyd,
Krzysztof Kozlowski, Alim Akhtar, Sylwester Nawrocki,
Chanwoo Choi, Catalin Marinas, Will Deacon
Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
linux-clk, willmcvicker, kernel-team, Tudor Ambarus
Register by hand a platform device for the ACPM clocks.
The ACPM clocks are not modeled as a DT child of ACPM because:
1/ they don't have their own resources.
2/ they are not a block that can be reused. The clock identifying
data is reduced (clock ID, clock name and mailbox channel ID)
and may differ from a SoC to another.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
drivers/firmware/samsung/exynos-acpm.c | 21 +++++++++++++++++++++
1 file changed, 21 insertions(+)
diff --git a/drivers/firmware/samsung/exynos-acpm.c b/drivers/firmware/samsung/exynos-acpm.c
index 9fa0335ccf5db32892fdf09e8d4b0a885a8f8fb5..0cb269c7046015d4c5fe5731ba0d61d48dcaeee1 100644
--- a/drivers/firmware/samsung/exynos-acpm.c
+++ b/drivers/firmware/samsung/exynos-acpm.c
@@ -177,9 +177,11 @@ struct acpm_info {
/**
* struct acpm_match_data - of_device_id data.
* @initdata_base: offset in SRAM where the channels configuration resides.
+ * @acpm_clk_dev_name: base name for the ACPM clocks device that we're registering.
*/
struct acpm_match_data {
loff_t initdata_base;
+ const char *acpm_clk_dev_name;
};
#define client_to_acpm_chan(c) container_of(c, struct acpm_chan, cl)
@@ -604,9 +606,15 @@ static void acpm_setup_ops(struct acpm_info *acpm)
pmic_ops->update_reg = acpm_pmic_update_reg;
}
+static void acpm_clk_pdev_unregister(void *data)
+{
+ platform_device_unregister(data);
+}
+
static int acpm_probe(struct platform_device *pdev)
{
const struct acpm_match_data *match_data;
+ struct platform_device *acpm_clk_pdev;
struct device *dev = &pdev->dev;
struct device_node *shmem;
struct acpm_info *acpm;
@@ -647,6 +655,18 @@ static int acpm_probe(struct platform_device *pdev)
platform_set_drvdata(pdev, acpm);
+ acpm_clk_pdev = platform_device_register_data(dev,
+ match_data->acpm_clk_dev_name,
+ PLATFORM_DEVID_NONE, NULL, 0);
+ if (IS_ERR(acpm_clk_pdev))
+ return dev_err_probe(dev, PTR_ERR(acpm_clk_pdev),
+ "Failed to register ACPM clocks device.\n");
+
+ ret = devm_add_action_or_reset(dev, acpm_clk_pdev_unregister,
+ acpm_clk_pdev);
+ if (ret)
+ return dev_err_probe(dev, ret, "Failed to add devm action.\n");
+
return devm_of_platform_populate(dev);
}
@@ -746,6 +766,7 @@ EXPORT_SYMBOL_GPL(devm_acpm_get_by_node);
static const struct acpm_match_data acpm_gs101 = {
.initdata_base = ACPM_GS101_INITDATA_BASE,
+ .acpm_clk_dev_name = "gs101-acpm-clk",
};
static const struct of_device_id acpm_match[] = {
--
2.51.0.355.g5224444f11-goog
^ permalink raw reply related [flat|nested] 9+ messages in thread* [PATCH v4 4/5] clk: samsung: add Exynos ACPM clock driver
2025-09-08 13:12 [PATCH v4 0/5] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
` (2 preceding siblings ...)
2025-09-08 13:12 ` [PATCH v4 3/5] firmware: exynos-acpm: register ACPM clocks pdev Tudor Ambarus
@ 2025-09-08 13:12 ` Tudor Ambarus
2025-09-21 20:37 ` Stephen Boyd
2025-09-08 13:12 ` [PATCH v4 5/5] arm64: defconfig: enable Exynos ACPM clocks Tudor Ambarus
2025-09-12 14:58 ` [PATCH v4 0/5] exynos-acpm: add DVFS protocol and clock driver Peter Griffin
5 siblings, 1 reply; 9+ messages in thread
From: Tudor Ambarus @ 2025-09-08 13:12 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Peter Griffin,
André Draszik, Michael Turquette, Stephen Boyd,
Krzysztof Kozlowski, Alim Akhtar, Sylwester Nawrocki,
Chanwoo Choi, Catalin Marinas, Will Deacon
Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
linux-clk, willmcvicker, kernel-team, Tudor Ambarus
Add the Exynos ACPM clock driver. It provides support for clocks that
are controlled by firmware that implements the ACPM interface.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
drivers/clk/samsung/Kconfig | 10 +++
drivers/clk/samsung/Makefile | 1 +
drivers/clk/samsung/clk-acpm.c | 184 +++++++++++++++++++++++++++++++++++++++++
3 files changed, 195 insertions(+)
diff --git a/drivers/clk/samsung/Kconfig b/drivers/clk/samsung/Kconfig
index 76a494e95027af26272e30876a87ac293bd56dfa..70a8b82a0136b4d0213d8ff95e029c52436e5c7f 100644
--- a/drivers/clk/samsung/Kconfig
+++ b/drivers/clk/samsung/Kconfig
@@ -95,6 +95,16 @@ config EXYNOS_CLKOUT
status of the certains clocks from SoC, but it could also be tied to
other devices as an input clock.
+config EXYNOS_ACPM_CLK
+ tristate "Clock driver controlled via ACPM interface"
+ depends on EXYNOS_ACPM_PROTOCOL || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL)
+ help
+ This driver provides support for clocks that are controlled by
+ firmware that implements the ACPM interface.
+
+ This driver uses the ACPM interface to interact with the firmware
+ providing all the clock controlls.
+
config TESLA_FSD_COMMON_CLK
bool "Tesla FSD clock controller support" if COMPILE_TEST
depends on COMMON_CLK_SAMSUNG
diff --git a/drivers/clk/samsung/Makefile b/drivers/clk/samsung/Makefile
index b77fe288e4bb484c68d1ff497acc0b83d132ea03..04b63436b12f6f5169575d74f54b105e97bbb052 100644
--- a/drivers/clk/samsung/Makefile
+++ b/drivers/clk/samsung/Makefile
@@ -27,6 +27,7 @@ obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-exynos990.o
obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-exynosautov9.o
obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-exynosautov920.o
obj-$(CONFIG_EXYNOS_ARM64_COMMON_CLK) += clk-gs101.o
+obj-$(CONFIG_EXYNOS_ACPM_CLK) += clk-acpm.o
obj-$(CONFIG_S3C64XX_COMMON_CLK) += clk-s3c64xx.o
obj-$(CONFIG_S5PV210_COMMON_CLK) += clk-s5pv210.o clk-s5pv210-audss.o
obj-$(CONFIG_TESLA_FSD_COMMON_CLK) += clk-fsd.o
diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
new file mode 100644
index 0000000000000000000000000000000000000000..8566495265ee3e06dbf370f9e424d5540f5c7457
--- /dev/null
+++ b/drivers/clk/samsung/clk-acpm.c
@@ -0,0 +1,184 @@
+// SPDX-License-Identifier: GPL-2.0-only
+/*
+ * Samsung Exynos ACPM protocol based clock driver.
+ *
+ * Copyright 2025 Linaro Ltd.
+ */
+
+#include <linux/array_size.h>
+#include <linux/clk-provider.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/firmware/samsung/exynos-acpm-protocol.h>
+#include <linux/module.h>
+#include <linux/of.h>
+#include <linux/platform_device.h>
+#include <linux/types.h>
+
+struct acpm_clk {
+ u32 id;
+ struct clk_hw hw;
+ unsigned int mbox_chan_id;
+ const struct acpm_handle *handle;
+};
+
+struct acpm_clk_variant {
+ const char *name;
+};
+
+struct acpm_clk_driver_data {
+ const struct acpm_clk_variant *clks;
+ unsigned int nr_clks;
+ unsigned int mbox_chan_id;
+};
+
+#define to_acpm_clk(clk) container_of(clk, struct acpm_clk, hw)
+
+#define ACPM_CLK(cname) \
+ { \
+ .name = cname, \
+ }
+
+static const struct acpm_clk_variant gs101_acpm_clks[] = {
+ ACPM_CLK("mif"),
+ ACPM_CLK("int"),
+ ACPM_CLK("cpucl0"),
+ ACPM_CLK("cpucl1"),
+ ACPM_CLK("cpucl2"),
+ ACPM_CLK("g3d"),
+ ACPM_CLK("g3dl2"),
+ ACPM_CLK("tpu"),
+ ACPM_CLK("intcam"),
+ ACPM_CLK("tnr"),
+ ACPM_CLK("cam"),
+ ACPM_CLK("mfc"),
+ ACPM_CLK("disp"),
+ ACPM_CLK("b0"),
+};
+
+static const struct acpm_clk_driver_data acpm_clk_gs101 = {
+ .clks = gs101_acpm_clks,
+ .nr_clks = ARRAY_SIZE(gs101_acpm_clks),
+ .mbox_chan_id = 0,
+};
+
+static unsigned long acpm_clk_recalc_rate(struct clk_hw *hw,
+ unsigned long parent_rate)
+{
+ struct acpm_clk *clk = to_acpm_clk(hw);
+
+ return clk->handle->ops.dvfs_ops.get_rate(clk->handle,
+ clk->mbox_chan_id, clk->id, 0);
+}
+
+static int acpm_clk_determine_rate(struct clk_hw *hw,
+ struct clk_rate_request *req)
+{
+ /*
+ * We can't figure out what rate it will be, so just return the
+ * rate back to the caller. acpm_clk_recalc_rate() will be called
+ * after the rate is set and we'll know what rate the clock is
+ * running at then.
+ */
+ return 0;
+}
+
+static int acpm_clk_set_rate(struct clk_hw *hw, unsigned long rate,
+ unsigned long parent_rate)
+{
+ struct acpm_clk *clk = to_acpm_clk(hw);
+
+ return clk->handle->ops.dvfs_ops.set_rate(clk->handle,
+ clk->mbox_chan_id, clk->id, rate);
+}
+
+static const struct clk_ops acpm_clk_ops = {
+ .recalc_rate = acpm_clk_recalc_rate,
+ .determine_rate = acpm_clk_determine_rate,
+ .set_rate = acpm_clk_set_rate,
+};
+
+static int acpm_clk_ops_init(struct device *dev, struct acpm_clk *aclk,
+ const char *name)
+{
+ struct clk_init_data init = {};
+
+ init.name = name;
+ init.ops = &acpm_clk_ops;
+ aclk->hw.init = &init;
+
+ return devm_clk_hw_register(dev, &aclk->hw);
+}
+
+static int acpm_clk_probe(struct platform_device *pdev)
+{
+ const struct acpm_handle *acpm_handle;
+ struct clk_hw_onecell_data *clk_data;
+ struct clk_hw **hws;
+ struct device *dev = &pdev->dev;
+ struct acpm_clk *aclks;
+ unsigned int mbox_chan_id;
+ int i, err, count;
+
+ acpm_handle = devm_acpm_get_by_node(dev, dev->parent->of_node);
+ if (IS_ERR(acpm_handle))
+ return dev_err_probe(dev, PTR_ERR(acpm_handle),
+ "Failed to get acpm handle.\n");
+
+ count = acpm_clk_gs101.nr_clks;
+ mbox_chan_id = acpm_clk_gs101.mbox_chan_id;
+
+ clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, count),
+ GFP_KERNEL);
+ if (!clk_data)
+ return -ENOMEM;
+
+ clk_data->num = count;
+ hws = clk_data->hws;
+
+ aclks = devm_kcalloc(dev, count, sizeof(*aclks), GFP_KERNEL);
+ if (!aclks)
+ return -ENOMEM;
+
+ for (i = 0; i < count; i++) {
+ struct acpm_clk *aclk = &aclks[i];
+
+ /*
+ * The code assumes the clock IDs start from zero,
+ * are sequential and do not have gaps.
+ */
+ aclk->id = i;
+ aclk->handle = acpm_handle;
+ aclk->mbox_chan_id = mbox_chan_id;
+
+ hws[i] = &aclk->hw;
+
+ err = acpm_clk_ops_init(dev, aclk,
+ acpm_clk_gs101.clks[i].name);
+ if (err)
+ return dev_err_probe(dev, err,
+ "Failed to register clock.\n");
+ }
+
+ return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
+ clk_data);
+}
+
+static const struct platform_device_id acpm_clk_id[] = {
+ { "gs101-acpm-clk" },
+ {},
+};
+MODULE_DEVICE_TABLE(platform, acpm_clk_id);
+
+static struct platform_driver acpm_clk_driver = {
+ .driver = {
+ .name = "acpm-clocks",
+ },
+ .probe = acpm_clk_probe,
+ .id_table = acpm_clk_id,
+};
+module_platform_driver(acpm_clk_driver);
+
+MODULE_AUTHOR("Tudor Ambarus <tudor.ambarus@linaro.org>");
+MODULE_DESCRIPTION("Samsung Exynos ACPM clock driver");
+MODULE_LICENSE("GPL");
--
2.51.0.355.g5224444f11-goog
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v4 4/5] clk: samsung: add Exynos ACPM clock driver
2025-09-08 13:12 ` [PATCH v4 4/5] clk: samsung: add Exynos ACPM clock driver Tudor Ambarus
@ 2025-09-21 20:37 ` Stephen Boyd
2025-09-22 7:58 ` Tudor Ambarus
0 siblings, 1 reply; 9+ messages in thread
From: Stephen Boyd @ 2025-09-21 20:37 UTC (permalink / raw)
To: Alim Akhtar, André Draszik, Catalin Marinas, Chanwoo Choi,
Conor Dooley, Krzysztof Kozlowski, Krzysztof Kozlowski,
Michael Turquette, Peter Griffin, Rob Herring, Sylwester Nawrocki,
Tudor Ambarus, Will Deacon
Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
linux-clk, willmcvicker, kernel-team, Tudor Ambarus
Quoting Tudor Ambarus (2025-09-08 06:12:45)
> diff --git a/drivers/clk/samsung/Kconfig b/drivers/clk/samsung/Kconfig
> index 76a494e95027af26272e30876a87ac293bd56dfa..70a8b82a0136b4d0213d8ff95e029c52436e5c7f 100644
> --- a/drivers/clk/samsung/Kconfig
> +++ b/drivers/clk/samsung/Kconfig
> @@ -95,6 +95,16 @@ config EXYNOS_CLKOUT
> status of the certains clocks from SoC, but it could also be tied to
> other devices as an input clock.
>
> +config EXYNOS_ACPM_CLK
> + tristate "Clock driver controlled via ACPM interface"
> + depends on EXYNOS_ACPM_PROTOCOL || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL)
Why is COMPILE_TEST limited to !EXYNOS_ACPM_PROTOCOL?
> + help
> + This driver provides support for clocks that are controlled by
> + firmware that implements the ACPM interface.
> +
> + This driver uses the ACPM interface to interact with the firmware
> + providing all the clock controlls.
> +
> config TESLA_FSD_COMMON_CLK
> bool "Tesla FSD clock controller support" if COMPILE_TEST
> depends on COMMON_CLK_SAMSUNG
> diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
> new file mode 100644
> index 0000000000000000000000000000000000000000..8566495265ee3e06dbf370f9e424d5540f5c7457
> --- /dev/null
> +++ b/drivers/clk/samsung/clk-acpm.c
> @@ -0,0 +1,184 @@
> +// SPDX-License-Identifier: GPL-2.0-only
> +/*
> + * Samsung Exynos ACPM protocol based clock driver.
> + *
> + * Copyright 2025 Linaro Ltd.
> + */
> +
> +#include <linux/array_size.h>
> +#include <linux/clk-provider.h>
> +#include <linux/device.h>
> +#include <linux/err.h>
> +#include <linux/firmware/samsung/exynos-acpm-protocol.h>
> +#include <linux/module.h>
> +#include <linux/of.h>
Is this include used?
> +#include <linux/platform_device.h>
> +#include <linux/types.h>
Are you avoiding kernel.h? If so, please include container_of.h and
device/devres.h to avoid implicit includes.
> +
> +struct acpm_clk {
> + u32 id;
> + struct clk_hw hw;
> + unsigned int mbox_chan_id;
> + const struct acpm_handle *handle;
> +};
> +
> +struct acpm_clk_variant {
> + const char *name;
> +};
> +
> +struct acpm_clk_driver_data {
> + const struct acpm_clk_variant *clks;
> + unsigned int nr_clks;
> + unsigned int mbox_chan_id;
> +};
> +
> +#define to_acpm_clk(clk) container_of(clk, struct acpm_clk, hw)
> +
> +#define ACPM_CLK(cname) \
> + { \
> + .name = cname, \
> + }
> +
> +static const struct acpm_clk_variant gs101_acpm_clks[] = {
> + ACPM_CLK("mif"),
> + ACPM_CLK("int"),
> + ACPM_CLK("cpucl0"),
> + ACPM_CLK("cpucl1"),
> + ACPM_CLK("cpucl2"),
> + ACPM_CLK("g3d"),
> + ACPM_CLK("g3dl2"),
> + ACPM_CLK("tpu"),
> + ACPM_CLK("intcam"),
> + ACPM_CLK("tnr"),
> + ACPM_CLK("cam"),
> + ACPM_CLK("mfc"),
> + ACPM_CLK("disp"),
> + ACPM_CLK("b0"),
> +};
> +
> +static const struct acpm_clk_driver_data acpm_clk_gs101 = {
> + .clks = gs101_acpm_clks,
> + .nr_clks = ARRAY_SIZE(gs101_acpm_clks),
> + .mbox_chan_id = 0,
> +};
> +
> +static unsigned long acpm_clk_recalc_rate(struct clk_hw *hw,
> + unsigned long parent_rate)
> +{
> + struct acpm_clk *clk = to_acpm_clk(hw);
> +
> + return clk->handle->ops.dvfs_ops.get_rate(clk->handle,
> + clk->mbox_chan_id, clk->id, 0);
> +}
> +
> +static int acpm_clk_determine_rate(struct clk_hw *hw,
> + struct clk_rate_request *req)
> +{
> + /*
> + * We can't figure out what rate it will be, so just return the
> + * rate back to the caller. acpm_clk_recalc_rate() will be called
> + * after the rate is set and we'll know what rate the clock is
> + * running at then.
> + */
> + return 0;
> +}
> +
> +static int acpm_clk_set_rate(struct clk_hw *hw, unsigned long rate,
> + unsigned long parent_rate)
> +{
> + struct acpm_clk *clk = to_acpm_clk(hw);
> +
> + return clk->handle->ops.dvfs_ops.set_rate(clk->handle,
> + clk->mbox_chan_id, clk->id, rate);
> +}
> +
> +static const struct clk_ops acpm_clk_ops = {
> + .recalc_rate = acpm_clk_recalc_rate,
> + .determine_rate = acpm_clk_determine_rate,
> + .set_rate = acpm_clk_set_rate,
> +};
> +
> +static int acpm_clk_ops_init(struct device *dev, struct acpm_clk *aclk,
Maybe acpm_clk_register() is a more appropriate name.
> + const char *name)
> +{
> + struct clk_init_data init = {};
> +
> + init.name = name;
> + init.ops = &acpm_clk_ops;
> + aclk->hw.init = &init;
> +
> + return devm_clk_hw_register(dev, &aclk->hw);
> +}
> +
> +static int acpm_clk_probe(struct platform_device *pdev)
> +{
> + const struct acpm_handle *acpm_handle;
> + struct clk_hw_onecell_data *clk_data;
> + struct clk_hw **hws;
> + struct device *dev = &pdev->dev;
> + struct acpm_clk *aclks;
> + unsigned int mbox_chan_id;
> + int i, err, count;
> +
> + acpm_handle = devm_acpm_get_by_node(dev, dev->parent->of_node);
> + if (IS_ERR(acpm_handle))
> + return dev_err_probe(dev, PTR_ERR(acpm_handle),
> + "Failed to get acpm handle.\n");
Remove the period please. Most error messages don't have proper
punctuation.
> +
> + count = acpm_clk_gs101.nr_clks;
> + mbox_chan_id = acpm_clk_gs101.mbox_chan_id;
> +
> + clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, count),
> + GFP_KERNEL);
> + if (!clk_data)
> + return -ENOMEM;
> +
> + clk_data->num = count;
> + hws = clk_data->hws;
> +
> + aclks = devm_kcalloc(dev, count, sizeof(*aclks), GFP_KERNEL);
> + if (!aclks)
> + return -ENOMEM;
> +
> + for (i = 0; i < count; i++) {
> + struct acpm_clk *aclk = &aclks[i];
> +
> + /*
> + * The code assumes the clock IDs start from zero,
> + * are sequential and do not have gaps.
> + */
> + aclk->id = i;
> + aclk->handle = acpm_handle;
> + aclk->mbox_chan_id = mbox_chan_id;
> +
> + hws[i] = &aclk->hw;
> +
> + err = acpm_clk_ops_init(dev, aclk,
> + acpm_clk_gs101.clks[i].name);
> + if (err)
> + return dev_err_probe(dev, err,
> + "Failed to register clock.\n");
> + }
> +
> + return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
> + clk_data);
> +}
> +
> +static const struct platform_device_id acpm_clk_id[] = {
> + { "gs101-acpm-clk" },
> + {},
Please drop comma here so that nothing can come after.
^ permalink raw reply [flat|nested] 9+ messages in thread* Re: [PATCH v4 4/5] clk: samsung: add Exynos ACPM clock driver
2025-09-21 20:37 ` Stephen Boyd
@ 2025-09-22 7:58 ` Tudor Ambarus
0 siblings, 0 replies; 9+ messages in thread
From: Tudor Ambarus @ 2025-09-22 7:58 UTC (permalink / raw)
To: Stephen Boyd, Alim Akhtar, André Draszik, Catalin Marinas,
Chanwoo Choi, Conor Dooley, Krzysztof Kozlowski,
Krzysztof Kozlowski, Michael Turquette, Peter Griffin,
Rob Herring, Sylwester Nawrocki, Will Deacon
Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
linux-clk, willmcvicker, kernel-team
Hi, Stephen,
On 9/21/25 9:37 PM, Stephen Boyd wrote:
> Quoting Tudor Ambarus (2025-09-08 06:12:45)
>> diff --git a/drivers/clk/samsung/Kconfig b/drivers/clk/samsung/Kconfig
>> index 76a494e95027af26272e30876a87ac293bd56dfa..70a8b82a0136b4d0213d8ff95e029c52436e5c7f 100644
>> --- a/drivers/clk/samsung/Kconfig
>> +++ b/drivers/clk/samsung/Kconfig
>> @@ -95,6 +95,16 @@ config EXYNOS_CLKOUT
>> status of the certains clocks from SoC, but it could also be tied to
>> other devices as an input clock.
>>
>> +config EXYNOS_ACPM_CLK
>> + tristate "Clock driver controlled via ACPM interface"
>> + depends on EXYNOS_ACPM_PROTOCOL || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL)
>
> Why is COMPILE_TEST limited to !EXYNOS_ACPM_PROTOCOL?
otherwise on randconfigs where COMPILE_TEST=y and EXYNOS_ACPM_PROTOCOL=n I get:
ERROR: modpost: "devm_acpm_get_by_node" [drivers/clk/samsung/clk-acpm.ko] undefined!
>
>> + help
>> + This driver provides support for clocks that are controlled by
>> + firmware that implements the ACPM interface.
>> +
>> + This driver uses the ACPM interface to interact with the firmware
>> + providing all the clock controlls.
>> +
>> config TESLA_FSD_COMMON_CLK
>> bool "Tesla FSD clock controller support" if COMPILE_TEST
>> depends on COMMON_CLK_SAMSUNG
>> diff --git a/drivers/clk/samsung/clk-acpm.c b/drivers/clk/samsung/clk-acpm.c
>> new file mode 100644
>> index 0000000000000000000000000000000000000000..8566495265ee3e06dbf370f9e424d5540f5c7457
>> --- /dev/null
>> +++ b/drivers/clk/samsung/clk-acpm.c
>> @@ -0,0 +1,184 @@
>> +// SPDX-License-Identifier: GPL-2.0-only
>> +/*
>> + * Samsung Exynos ACPM protocol based clock driver.
>> + *
>> + * Copyright 2025 Linaro Ltd.
>> + */
>> +
>> +#include <linux/array_size.h>
>> +#include <linux/clk-provider.h>
>> +#include <linux/device.h>
>> +#include <linux/err.h>
>> +#include <linux/firmware/samsung/exynos-acpm-protocol.h>
>> +#include <linux/module.h>
>> +#include <linux/of.h>
>
> Is this include used?
ah, it's no longer used, I'll drop it, thanks!
>
>> +#include <linux/platform_device.h>
>> +#include <linux/types.h>
>
> Are you avoiding kernel.h? If so, please include container_of.h and
I tend to include just what's needed, yes. kernel.h has some things that
are not yet needed in this driver.
> device/devres.h to avoid implicit includes.
Will add the two and recheck whether I rely on implicit includes somewhere else.
>> +
>> +struct acpm_clk {
>> + u32 id;
>> + struct clk_hw hw;
>> + unsigned int mbox_chan_id;
>> + const struct acpm_handle *handle;
>> +};
>> +
>> +struct acpm_clk_variant {
>> + const char *name;
>> +};
>> +
>> +struct acpm_clk_driver_data {
>> + const struct acpm_clk_variant *clks;
>> + unsigned int nr_clks;
>> + unsigned int mbox_chan_id;
>> +};
>> +
>> +#define to_acpm_clk(clk) container_of(clk, struct acpm_clk, hw)
>> +
>> +#define ACPM_CLK(cname) \
>> + { \
>> + .name = cname, \
>> + }
>> +
>> +static const struct acpm_clk_variant gs101_acpm_clks[] = {
>> + ACPM_CLK("mif"),
>> + ACPM_CLK("int"),
>> + ACPM_CLK("cpucl0"),
>> + ACPM_CLK("cpucl1"),
>> + ACPM_CLK("cpucl2"),
>> + ACPM_CLK("g3d"),
>> + ACPM_CLK("g3dl2"),
>> + ACPM_CLK("tpu"),
>> + ACPM_CLK("intcam"),
>> + ACPM_CLK("tnr"),
>> + ACPM_CLK("cam"),
>> + ACPM_CLK("mfc"),
>> + ACPM_CLK("disp"),
>> + ACPM_CLK("b0"),
>> +};
>> +
>> +static const struct acpm_clk_driver_data acpm_clk_gs101 = {
>> + .clks = gs101_acpm_clks,
>> + .nr_clks = ARRAY_SIZE(gs101_acpm_clks),
>> + .mbox_chan_id = 0,
>> +};
>> +
>> +static unsigned long acpm_clk_recalc_rate(struct clk_hw *hw,
>> + unsigned long parent_rate)
>> +{
>> + struct acpm_clk *clk = to_acpm_clk(hw);
>> +
>> + return clk->handle->ops.dvfs_ops.get_rate(clk->handle,
>> + clk->mbox_chan_id, clk->id, 0);
>> +}
>> +
>> +static int acpm_clk_determine_rate(struct clk_hw *hw,
>> + struct clk_rate_request *req)
>> +{
>> + /*
>> + * We can't figure out what rate it will be, so just return the
>> + * rate back to the caller. acpm_clk_recalc_rate() will be called
>> + * after the rate is set and we'll know what rate the clock is
>> + * running at then.
>> + */
>> + return 0;
>> +}
>> +
>> +static int acpm_clk_set_rate(struct clk_hw *hw, unsigned long rate,
>> + unsigned long parent_rate)
>> +{
>> + struct acpm_clk *clk = to_acpm_clk(hw);
>> +
>> + return clk->handle->ops.dvfs_ops.set_rate(clk->handle,
>> + clk->mbox_chan_id, clk->id, rate);
>> +}
>> +
>> +static const struct clk_ops acpm_clk_ops = {
>> + .recalc_rate = acpm_clk_recalc_rate,
>> + .determine_rate = acpm_clk_determine_rate,
>> + .set_rate = acpm_clk_set_rate,
>> +};
>> +
>> +static int acpm_clk_ops_init(struct device *dev, struct acpm_clk *aclk,
>
> Maybe acpm_clk_register() is a more appropriate name.
okay, will update.
>
>> + const char *name)
>> +{
>> + struct clk_init_data init = {};
>> +
>> + init.name = name;
>> + init.ops = &acpm_clk_ops;
>> + aclk->hw.init = &init;
>> +
>> + return devm_clk_hw_register(dev, &aclk->hw);
>> +}
>> +
>> +static int acpm_clk_probe(struct platform_device *pdev)
>> +{
>> + const struct acpm_handle *acpm_handle;
>> + struct clk_hw_onecell_data *clk_data;
>> + struct clk_hw **hws;
>> + struct device *dev = &pdev->dev;
>> + struct acpm_clk *aclks;
>> + unsigned int mbox_chan_id;
>> + int i, err, count;
>> +
>> + acpm_handle = devm_acpm_get_by_node(dev, dev->parent->of_node);
>> + if (IS_ERR(acpm_handle))
>> + return dev_err_probe(dev, PTR_ERR(acpm_handle),
>> + "Failed to get acpm handle.\n");
>
> Remove the period please. Most error messages don't have proper
> punctuation.
okay, will update.
>
>> +
>> + count = acpm_clk_gs101.nr_clks;
>> + mbox_chan_id = acpm_clk_gs101.mbox_chan_id;
>> +
>> + clk_data = devm_kzalloc(dev, struct_size(clk_data, hws, count),
>> + GFP_KERNEL);
>> + if (!clk_data)
>> + return -ENOMEM;
>> +
>> + clk_data->num = count;
>> + hws = clk_data->hws;
>> +
>> + aclks = devm_kcalloc(dev, count, sizeof(*aclks), GFP_KERNEL);
>> + if (!aclks)
>> + return -ENOMEM;
>> +
>> + for (i = 0; i < count; i++) {
>> + struct acpm_clk *aclk = &aclks[i];
>> +
>> + /*
>> + * The code assumes the clock IDs start from zero,
>> + * are sequential and do not have gaps.
>> + */
>> + aclk->id = i;
>> + aclk->handle = acpm_handle;
>> + aclk->mbox_chan_id = mbox_chan_id;
>> +
>> + hws[i] = &aclk->hw;
>> +
>> + err = acpm_clk_ops_init(dev, aclk,
>> + acpm_clk_gs101.clks[i].name);
>> + if (err)
>> + return dev_err_probe(dev, err,
>> + "Failed to register clock.\n");
>> + }
>> +
>> + return devm_of_clk_add_hw_provider(dev, of_clk_hw_onecell_get,
>> + clk_data);
>> +}
>> +
>> +static const struct platform_device_id acpm_clk_id[] = {
>> + { "gs101-acpm-clk" },
>> + {},
>
> Please drop comma here so that nothing can come after.
okay. Thanks for the review!
Cheers,
ta
^ permalink raw reply [flat|nested] 9+ messages in thread
* [PATCH v4 5/5] arm64: defconfig: enable Exynos ACPM clocks
2025-09-08 13:12 [PATCH v4 0/5] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
` (3 preceding siblings ...)
2025-09-08 13:12 ` [PATCH v4 4/5] clk: samsung: add Exynos ACPM clock driver Tudor Ambarus
@ 2025-09-08 13:12 ` Tudor Ambarus
2025-09-12 14:58 ` [PATCH v4 0/5] exynos-acpm: add DVFS protocol and clock driver Peter Griffin
5 siblings, 0 replies; 9+ messages in thread
From: Tudor Ambarus @ 2025-09-08 13:12 UTC (permalink / raw)
To: Rob Herring, Krzysztof Kozlowski, Conor Dooley, Peter Griffin,
André Draszik, Michael Turquette, Stephen Boyd,
Krzysztof Kozlowski, Alim Akhtar, Sylwester Nawrocki,
Chanwoo Choi, Catalin Marinas, Will Deacon
Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
linux-clk, willmcvicker, kernel-team, Tudor Ambarus
Enable the Exynos ACPM clocks driver. Samsung Exynos platforms
implement ACPM to provide support for clock configuration, PMIC
and temperature sensors.
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 58f87d09366cd12ae212a1d107660afe8be6c5ef..4255bc885545fb3bb7e9cf02760cac35bf2872fa 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -1445,6 +1445,7 @@ CONFIG_CLK_GFM_LPASS_SM8250=m
CONFIG_SM_VIDEOCC_8450=m
CONFIG_CLK_RCAR_USB2_CLOCK_SEL=y
CONFIG_CLK_RENESAS_VBATTB=m
+CONFIG_EXYNOS_ACPM_CLK=m
CONFIG_CLK_SOPHGO_CV1800=y
CONFIG_HWSPINLOCK=y
CONFIG_HWSPINLOCK_OMAP=m
--
2.51.0.355.g5224444f11-goog
^ permalink raw reply related [flat|nested] 9+ messages in thread* Re: [PATCH v4 0/5] exynos-acpm: add DVFS protocol and clock driver
2025-09-08 13:12 [PATCH v4 0/5] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
` (4 preceding siblings ...)
2025-09-08 13:12 ` [PATCH v4 5/5] arm64: defconfig: enable Exynos ACPM clocks Tudor Ambarus
@ 2025-09-12 14:58 ` Peter Griffin
5 siblings, 0 replies; 9+ messages in thread
From: Peter Griffin @ 2025-09-12 14:58 UTC (permalink / raw)
To: Tudor Ambarus
Cc: Rob Herring, Krzysztof Kozlowski, Conor Dooley,
André Draszik, Michael Turquette, Stephen Boyd,
Krzysztof Kozlowski, Alim Akhtar, Sylwester Nawrocki,
Chanwoo Choi, Catalin Marinas, Will Deacon, linux-kernel,
linux-samsung-soc, devicetree, linux-arm-kernel, linux-clk,
willmcvicker, kernel-team
On Mon, 8 Sept 2025 at 14:13, Tudor Ambarus <tudor.ambarus@linaro.org> wrote:
>
> Dependencies description:
> All patches should go through the Samsung SoC tree.
> The acpm-clk driver (#4) depends on the ACPM DVFS ops (#2).
> If the clock subsystem needs to merge the new clock driver, it will
> need an immutable tag with the 2 patches.
> No dependecies for #1, #3, #5.
>
> The Alive CLock and Power Manager (ACPM) firmware exposes clocks that
> are variable and index based. These clocks don't provide an entire range
> of values between the limits but only discrete points within the range.
> The firmware also manages the voltage scaling appropriately with the
> clock scaling. Make the ACPM node a clock provider.
>
> Add support for the ACPM DVFS protocol. It translates clock frequency
> requests to messages that can be interpreted by the ACPM firmware.
> Add an ACPM clock driver to model the clocks exposed by the ACPM firmware.
>
> Thanks,
> ta
>
> Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
> ---
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org> # on gs101-oriole
^ permalink raw reply [flat|nested] 9+ messages in thread