* [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver
@ 2025-10-10 12:46 Tudor Ambarus
  2025-10-10 12:46 ` [PATCH v6 1/6] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks Tudor Ambarus
                   ` (6 more replies)
  0 siblings, 7 replies; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-10 12:46 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
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.
The following DT patches depend on the bindings from #1:
https://lore.kernel.org/linux-samsung-soc/20250924-acpm-dvfs-dt-v4-0-3106d49e03f5@linaro.org/
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>
---
Changes in v6:
- acpm-clk: s/b0/bo, (big ocean)
- acpm-dvfs: drop dbg_val arg from get_rate(). It's unused upstream and
  we'll probably choose to introduce a dedicated debug API if needed.
- MAINTAINERS: add ACPM clock bindings and driver (new patch)
- Link to v5: https://lore.kernel.org/r/20250924-acpm-clk-v5-0-4cca1fadd00d@linaro.org
Changes in v5:
- acpm-clk: address Stephen's comments:
  - drop of.h unused include, add devres/devres.h and container_of.h
    to avoid implicit includes.
  - r/acpm_clk_ops_init/acpm_clk_register.
  - remove period from error messages, drop comma after sentinel in
    platform_device_id.
- collect Peter's R-b and T-b tags.
- Link to v4: https://lore.kernel.org/r/20250908-acpm-clk-v4-0-633350c0c0b1@linaro.org
Changes in v4:
- clk-acpm:
  - remove GS101_ACPM_CLK_ID type handling. Dead code, it should be
    introduced with next devices.
  - remove runtime check on clock IDs. Instead add a comment about the
    assumptions the code is making: the clock IDs start from zero, are
    sequential and do not have gaps. Slight changes based on this
    assumption: s/hws[id]/hws[i], remove the inclusion of
    dt-bindings/clock/google,gs101-acpm.h and the use of the clock IDs.
    The clocks are defined solely by name in the driver.
- move firmware patches close to each other, in between the bindings and
  the clock driver
- update the description of dependencies in the cover letter.
- Link to v3: https://lore.kernel.org/r/20250903-acpm-clk-v3-0-65ecd42d88c7@linaro.org
Changes in v3:
- dt-bindings:
  - move clock bindings to a new bindings header
  - update commit's subject, s/add #clock-cells/add ACPM clocks.
    It also suggests that the bindings are added.
  - prepend "GS101_" on clocks binding name. The bindings name are the
    same for GS201 and the acpm-clk driver will likely include both.
  - collect Rob's R-b
- clk-acpm:
  - move clock definitions here instead of keeping them into the
    ACPM protocol driver
  - use platform_driver.id_table to differentiate device type
  - fix Kconfig dependency, || (COMPILE_TEST && !EXYNOS_ACPM_PROTOCOL)
  - update commit subject, s/dev/pdev
- exynos-acpm:
  - move clock definitions to clk-acpm
  - use devm-action to unregister clk-acpm platform device
- Link to v2: https://lore.kernel.org/r/20250827-acpm-clk-v2-0-de5c86b49b64@linaro.org
Changes in v2:
- dt-bindings: clocks are not longer a child of ACPM protocol. Instead
  make Alive Clock and Power Manager (ACPM) node a clock provider.
  Update commit message.
- firmware: exynos-acpm: register by hand the ACPM clocks dev (new
  patch)
- firmware: exynos-acpm: use defines intead of enum
- acpm-clk:
  - switch to determine_rate
  - drop __init, __refdata, __initconst, this is a module, we need those
    methods and data, after boot as well.
  - fix the assumption that the clocks are defined by ID in ascending order.
    There's still an assumption that the clk_id < nr_clks, but this is
    now covered by a sanity check in the clock driver.
- arm64: defconfig: enable Exynos ACPM clocks (add patch together with
  this patch set) 
- Link to v1: https://lore.kernel.org/r/20250819-acpm-clk-v1-0-6bbd97474671@linaro.org
---
Tudor Ambarus (6):
      dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks
      firmware: exynos-acpm: add DVFS protocol
      firmware: exynos-acpm: register ACPM clocks pdev
      clk: samsung: add Exynos ACPM clock driver
      arm64: defconfig: enable Exynos ACPM clocks
      MAINTAINERS: add ACPM clock bindings and driver
 .../bindings/firmware/google,gs101-acpm-ipc.yaml   |  11 ++
 MAINTAINERS                                        |   3 +-
 arch/arm64/configs/defconfig                       |   1 +
 drivers/clk/samsung/Kconfig                        |  10 ++
 drivers/clk/samsung/Makefile                       |   1 +
 drivers/clk/samsung/clk-acpm.c                     | 185 +++++++++++++++++++++
 drivers/firmware/samsung/Makefile                  |   4 +-
 drivers/firmware/samsung/exynos-acpm-dvfs.c        |  80 +++++++++
 drivers/firmware/samsung/exynos-acpm-dvfs.h        |  21 +++
 drivers/firmware/samsung/exynos-acpm.c             |  26 +++
 include/dt-bindings/clock/google,gs101-acpm.h      |  26 +++
 .../linux/firmware/samsung/exynos-acpm-protocol.h  |  10 ++
 12 files changed, 376 insertions(+), 2 deletions(-)
---
base-commit: 5472d60c129f75282d94ae5ad072ee6dfb7c7246
change-id: 20250819-acpm-clk-28d2a78e0307
Best regards,
-- 
Tudor Ambarus <tudor.ambarus@linaro.org>
^ permalink raw reply	[flat|nested] 22+ messages in thread
* [PATCH v6 1/6] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks
  2025-10-10 12:46 [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
@ 2025-10-10 12:46 ` Tudor Ambarus
  2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
  2025-10-10 12:46 ` [PATCH v6 2/6] firmware: exynos-acpm: add DVFS protocol Tudor Ambarus
                   ` (5 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-10 12:46 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>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org> # on gs101-oriole
---
 .../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.740.g6adb054d12-goog
^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH v6 2/6] firmware: exynos-acpm: add DVFS protocol
  2025-10-10 12:46 [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
  2025-10-10 12:46 ` [PATCH v6 1/6] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks Tudor Ambarus
@ 2025-10-10 12:46 ` Tudor Ambarus
  2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
  2025-10-10 12:46 ` [PATCH v6 3/6] firmware: exynos-acpm: register ACPM clocks pdev Tudor Ambarus
                   ` (4 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-10 12:46 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>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org> # on gs101-oriole
---
 drivers/firmware/samsung/Makefile                  |  4 +-
 drivers/firmware/samsung/exynos-acpm-dvfs.c        | 80 ++++++++++++++++++++++
 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, 119 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..1c5b2b143bcc3fa2d1f92146206a2351fe0b9e95
--- /dev/null
+++ b/drivers/firmware/samsung/exynos-acpm-dvfs.c
@@ -0,0 +1,80 @@
+// 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)
+{
+	cmd[0] = FIELD_PREP(ACPM_DVFS_ID, clk_id);
+	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)
+{
+	struct acpm_xfer xfer;
+	unsigned int cmd[4] = {0};
+	int ret;
+
+	acpm_dvfs_init_get_rate_cmd(cmd, clk_id);
+	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..9f2778e649c9d806646467c3f3f1425333b6acd8
--- /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);
+
+#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..b1e95435240fdb895a03f178d4fb3789411b1583 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);
+};
+
 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.740.g6adb054d12-goog
^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH v6 3/6] firmware: exynos-acpm: register ACPM clocks pdev
  2025-10-10 12:46 [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
  2025-10-10 12:46 ` [PATCH v6 1/6] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks Tudor Ambarus
  2025-10-10 12:46 ` [PATCH v6 2/6] firmware: exynos-acpm: add DVFS protocol Tudor Ambarus
@ 2025-10-10 12:46 ` Tudor Ambarus
  2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
  2025-10-10 12:46 ` [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver Tudor Ambarus
                   ` (3 subsequent siblings)
  6 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-10 12:46 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>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org> # on gs101-oriole
---
 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.740.g6adb054d12-goog
^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver
  2025-10-10 12:46 [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
                   ` (2 preceding siblings ...)
  2025-10-10 12:46 ` [PATCH v6 3/6] firmware: exynos-acpm: register ACPM clocks pdev Tudor Ambarus
@ 2025-10-10 12:46 ` Tudor Ambarus
  2025-10-20  6:54   ` Krzysztof Kozlowski
  2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
  2025-10-10 12:46 ` [PATCH v6 5/6] arm64: defconfig: enable Exynos ACPM clocks Tudor Ambarus
                   ` (2 subsequent siblings)
  6 siblings, 2 replies; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-10 12:46 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>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org> # on gs101-oriole
---
 drivers/clk/samsung/Kconfig    |  10 +++
 drivers/clk/samsung/Makefile   |   1 +
 drivers/clk/samsung/clk-acpm.c | 185 +++++++++++++++++++++++++++++++++++++++++
 3 files changed, 196 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 ef464f434740f96623f9df62f94e2903e14e2226..f3657f2e1b98c6f431ab1f04c2d2a44fe317261b 100644
--- a/drivers/clk/samsung/Makefile
+++ b/drivers/clk/samsung/Makefile
@@ -28,6 +28,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..b90809ce3f882c489114c9d7299417d7fe373749
--- /dev/null
+++ b/drivers/clk/samsung/clk-acpm.c
@@ -0,0 +1,185 @@
+// 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/container_of.h>
+#include <linux/device/devres.h>
+#include <linux/device.h>
+#include <linux/err.h>
+#include <linux/firmware/samsung/exynos-acpm-protocol.h>
+#include <linux/module.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("bo"),
+};
+
+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);
+}
+
+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_register(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_register(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.740.g6adb054d12-goog
^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH v6 5/6] arm64: defconfig: enable Exynos ACPM clocks
  2025-10-10 12:46 [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
                   ` (3 preceding siblings ...)
  2025-10-10 12:46 ` [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver Tudor Ambarus
@ 2025-10-10 12:46 ` Tudor Ambarus
  2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
  2025-10-10 12:46 ` [PATCH v6 6/6] MAINTAINERS: add ACPM clock bindings and driver Tudor Ambarus
  2025-10-20  7:03 ` [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Krzysztof Kozlowski
  6 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-10 12:46 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>
Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
Tested-by: Peter Griffin <peter.griffin@linaro.org> # on gs101-oriole
---
 arch/arm64/configs/defconfig | 1 +
 1 file changed, 1 insertion(+)
diff --git a/arch/arm64/configs/defconfig b/arch/arm64/configs/defconfig
index e3a2d37bd10423b028f59dc40d6e8ee1c610d6b8..646097e94efe7f1a18fb59d5b6dfc6268be91383 100644
--- a/arch/arm64/configs/defconfig
+++ b/arch/arm64/configs/defconfig
@@ -1458,6 +1458,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.740.g6adb054d12-goog
^ permalink raw reply related	[flat|nested] 22+ messages in thread
* [PATCH v6 6/6] MAINTAINERS: add ACPM clock bindings and driver
  2025-10-10 12:46 [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
                   ` (4 preceding siblings ...)
  2025-10-10 12:46 ` [PATCH v6 5/6] arm64: defconfig: enable Exynos ACPM clocks Tudor Ambarus
@ 2025-10-10 12:46 ` Tudor Ambarus
  2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
  2025-10-20  7:03 ` [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Krzysztof Kozlowski
  6 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-10 12:46 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
Extend the Google Tensor SoC support list of files to include the
GS101 ACPM clock bindings. Add the ACPM clock driver under the
Samsung Exynos ACPM Protocol entry.
Signed-off-by: Tudor Ambarus <tudor.ambarus@linaro.org>
---
 MAINTAINERS | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/MAINTAINERS b/MAINTAINERS
index 3a27901781c2b2589a0f95678cf3df06401cac3c..6a6727ceeef67622e96441165aec542a2cb696c4 100644
--- a/MAINTAINERS
+++ b/MAINTAINERS
@@ -10599,7 +10599,7 @@ F:	Documentation/devicetree/bindings/soc/google/google,gs101-pmu-intr-gen.yaml
 F:	arch/arm64/boot/dts/exynos/google/
 F:	drivers/clk/samsung/clk-gs101.c
 F:	drivers/phy/samsung/phy-gs101-ufs.c
-F:	include/dt-bindings/clock/google,gs101.h
+F:	include/dt-bindings/clock/google,gs101*
 K:	[gG]oogle.?[tT]ensor
 
 GPD FAN DRIVER
@@ -22756,6 +22756,7 @@ L:	linux-kernel@vger.kernel.org
 L:	linux-samsung-soc@vger.kernel.org
 S:	Supported
 F:	Documentation/devicetree/bindings/firmware/google,gs101-acpm-ipc.yaml
+F:	drivers/clk/samsung/clk-acpm.c
 F:	drivers/firmware/samsung/exynos-acpm*
 F:	include/linux/firmware/samsung/exynos-acpm-protocol.h
 
-- 
2.51.0.740.g6adb054d12-goog
^ permalink raw reply related	[flat|nested] 22+ messages in thread
* Re: [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver
  2025-10-10 12:46 ` [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver Tudor Ambarus
@ 2025-10-20  6:54   ` Krzysztof Kozlowski
  2025-10-20  7:45     ` Tudor Ambarus
  2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
  1 sibling, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  6:54 UTC (permalink / raw)
  To: Tudor Ambarus, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Griffin, André Draszik, Michael Turquette,
	Stephen Boyd, 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
On 10/10/2025 14:46, Tudor Ambarus wrote:
> 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>
> Reviewed-by: Peter Griffin <peter.griffin@linaro.org>
> Tested-by: Peter Griffin <peter.griffin@linaro.org> # on gs101-oriole
> ---
>  drivers/clk/samsung/Kconfig    |  10 +++
>  drivers/clk/samsung/Makefile   |   1 +
>  drivers/clk/samsung/clk-acpm.c | 185 +++++++++++++++++++++++++++++++++++++++++
>  3 files changed, 196 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)
I merged the patches but I don't get why we are not enabling it by
default, just like every other clock driver. What is so special here?
> +	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
Best regards,
Krzysztof
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: (subset) [PATCH v6 1/6] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks
  2025-10-10 12:46 ` [PATCH v6 1/6] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks Tudor Ambarus
@ 2025-10-20  6:55   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  6:55 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, Tudor Ambarus
  Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-clk, willmcvicker, kernel-team
On Fri, 10 Oct 2025 12:46:31 +0000, Tudor Ambarus wrote:
> 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.
> 
> [...]
Applied, thanks!
[1/6] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks
      https://git.kernel.org/krzk/linux/c/83c4e3c39b2b55afe56ed0d14b93b5f219350c81
Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: (subset) [PATCH v6 2/6] firmware: exynos-acpm: add DVFS protocol
  2025-10-10 12:46 ` [PATCH v6 2/6] firmware: exynos-acpm: add DVFS protocol Tudor Ambarus
@ 2025-10-20  6:55   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  6:55 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, Tudor Ambarus
  Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-clk, willmcvicker, kernel-team
On Fri, 10 Oct 2025 12:46:32 +0000, Tudor Ambarus wrote:
> Add ACPM DVFS protocol handler. It constructs DVFS messages that
> the APM firmware can understand.
> 
> 
Applied, thanks!
[2/6] firmware: exynos-acpm: add DVFS protocol
      https://git.kernel.org/krzk/linux/c/84a222d1b369ba83f8947948670f775367e653f1
Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: (subset) [PATCH v6 3/6] firmware: exynos-acpm: register ACPM clocks pdev
  2025-10-10 12:46 ` [PATCH v6 3/6] firmware: exynos-acpm: register ACPM clocks pdev Tudor Ambarus
@ 2025-10-20  6:55   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  6:55 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, Tudor Ambarus
  Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-clk, willmcvicker, kernel-team
On Fri, 10 Oct 2025 12:46:33 +0000, Tudor Ambarus wrote:
> 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.
> 
> [...]
Applied, thanks!
[3/6] firmware: exynos-acpm: register ACPM clocks pdev
      https://git.kernel.org/krzk/linux/c/bad0d1260b6dc229657b942400c5fc4f257f50cd
Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: (subset) [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver
  2025-10-10 12:46 ` [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver Tudor Ambarus
  2025-10-20  6:54   ` Krzysztof Kozlowski
@ 2025-10-20  6:55   ` Krzysztof Kozlowski
  1 sibling, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  6:55 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, Tudor Ambarus
  Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-clk, willmcvicker, kernel-team
On Fri, 10 Oct 2025 12:46:34 +0000, Tudor Ambarus wrote:
> Add the Exynos ACPM clock driver. It provides support for clocks that
> are controlled by firmware that implements the ACPM interface.
> 
> 
Applied, thanks!
[4/6] clk: samsung: add Exynos ACPM clock driver
      https://git.kernel.org/krzk/linux/c/40498a74205371400a5b0088acb886ac47a523aa
Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: (subset) [PATCH v6 5/6] arm64: defconfig: enable Exynos ACPM clocks
  2025-10-10 12:46 ` [PATCH v6 5/6] arm64: defconfig: enable Exynos ACPM clocks Tudor Ambarus
@ 2025-10-20  6:55   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  6:55 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, Tudor Ambarus
  Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-clk, willmcvicker, kernel-team
On Fri, 10 Oct 2025 12:46:35 +0000, Tudor Ambarus wrote:
> Enable the Exynos ACPM clocks driver. Samsung Exynos platforms
> implement ACPM to provide support for clock configuration, PMIC
> and temperature sensors.
> 
> 
Applied, thanks!
[5/6] arm64: defconfig: enable Exynos ACPM clocks
      (no commit info)
Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: (subset) [PATCH v6 6/6] MAINTAINERS: add ACPM clock bindings and driver
  2025-10-10 12:46 ` [PATCH v6 6/6] MAINTAINERS: add ACPM clock bindings and driver Tudor Ambarus
@ 2025-10-20  6:55   ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  6:55 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, Tudor Ambarus
  Cc: linux-kernel, linux-samsung-soc, devicetree, linux-arm-kernel,
	linux-clk, willmcvicker, kernel-team
On Fri, 10 Oct 2025 12:46:36 +0000, Tudor Ambarus wrote:
> Extend the Google Tensor SoC support list of files to include the
> GS101 ACPM clock bindings. Add the ACPM clock driver under the
> Samsung Exynos ACPM Protocol entry.
> 
> 
Applied, thanks!
[6/6] MAINTAINERS: add ACPM clock bindings and driver
      https://git.kernel.org/krzk/linux/c/ad97aba3e64f8e474ecbce0c4e08486023ce8ab2
Best regards,
-- 
Krzysztof Kozlowski <krzysztof.kozlowski@linaro.org>
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver
  2025-10-10 12:46 [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
                   ` (5 preceding siblings ...)
  2025-10-10 12:46 ` [PATCH v6 6/6] MAINTAINERS: add ACPM clock bindings and driver Tudor Ambarus
@ 2025-10-20  7:03 ` Krzysztof Kozlowski
  2025-10-20  9:53   ` Tudor Ambarus
  6 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  7:03 UTC (permalink / raw)
  To: Tudor Ambarus, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Griffin, André Draszik, Michael Turquette,
	Stephen Boyd, 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
On 10/10/2025 14:46, Tudor Ambarus 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.
> 
> The following DT patches depend on the bindings from #1:
> https://lore.kernel.org/linux-samsung-soc/20250924-acpm-dvfs-dt-v4-0-3106d49e03f5@linaro.org/
You forgot to mention that this patchset adds new dtbs_check warnings,
which are fixed ONLY after applying DT patches.
Best regards,
Krzysztof
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver
  2025-10-20  6:54   ` Krzysztof Kozlowski
@ 2025-10-20  7:45     ` Tudor Ambarus
  2025-10-20  8:22       ` Krzysztof Kozlowski
  0 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-20  7:45 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Griffin, André Draszik,
	Michael Turquette, Stephen Boyd, 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
On 10/20/25 7:54 AM, Krzysztof Kozlowski wrote:
>> 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)
> 
> I merged the patches but I don't get why we are not enabling it by
> default, just like every other clock driver. What is so special here?
Thanks! Are you referring to the depends on line? I needed it 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!
Cheers,
ta
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver
  2025-10-20  7:45     ` Tudor Ambarus
@ 2025-10-20  8:22       ` Krzysztof Kozlowski
  2025-10-20  9:19         ` Tudor Ambarus
  0 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  8:22 UTC (permalink / raw)
  To: Tudor Ambarus, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Griffin, André Draszik, Michael Turquette,
	Stephen Boyd, 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
On 20/10/2025 09:45, Tudor Ambarus wrote:
> 
> 
> On 10/20/25 7:54 AM, Krzysztof Kozlowski wrote:
>>> 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)
>>
>> I merged the patches but I don't get why we are not enabling it by
>> default, just like every other clock driver. What is so special here?
> 
> Thanks! Are you referring to the depends on line? I needed it otherwise
> on randconfigs where COMPILE_TEST=y and EXYNOS_ACPM_PROTOCOL=n I get:
No. I am referring to missing default and defconfig patch.
Best regards,
Krzysztof
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver
  2025-10-20  8:22       ` Krzysztof Kozlowski
@ 2025-10-20  9:19         ` Tudor Ambarus
  2025-10-20  9:58           ` Krzysztof Kozlowski
  0 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-20  9:19 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Griffin, André Draszik,
	Michael Turquette, Stephen Boyd, 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
On 10/20/25 9:22 AM, Krzysztof Kozlowski wrote:
> On 20/10/2025 09:45, Tudor Ambarus wrote:
>>
>>
>> On 10/20/25 7:54 AM, Krzysztof Kozlowski wrote:
>>>> 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)
>>>
>>> I merged the patches but I don't get why we are not enabling it by
>>> default, just like every other clock driver. What is so special here?
>>
>> Thanks! Are you referring to the depends on line? I needed it otherwise
>> on randconfigs where COMPILE_TEST=y and EXYNOS_ACPM_PROTOCOL=n I get:
> 
> 
> No. I am referring to missing default and defconfig patch.
> 
default m or y would force compilation of EXYNOS_ACPM_CLK and
EXYNOS_ACPM_PROTOCOL for all ARCH_EXYNOS, even on Exynos platforms that
don't use ACPM. Since ACPM is not universally required by the Exynos
architecture, I thought to make it opt-in (default n).
Setting it as a module in arm64 defconfig makes it available on
compatible platforms.
Similar clock drivers do the same: CLK_RASPBERRYPI.
COMMON_CLK_SCPI, COMMON_CLK_SCMI - no defaults and set them as builtin
in the arm64 defconfig.
Cheers,
ta
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver
  2025-10-20  7:03 ` [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Krzysztof Kozlowski
@ 2025-10-20  9:53   ` Tudor Ambarus
  0 siblings, 0 replies; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-20  9:53 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Griffin, André Draszik,
	Michael Turquette, Stephen Boyd, 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
On 10/20/25 8:03 AM, Krzysztof Kozlowski wrote:
> On 10/10/2025 14:46, Tudor Ambarus 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.
>>
>> The following DT patches depend on the bindings from #1:
>> https://lore.kernel.org/linux-samsung-soc/20250924-acpm-dvfs-dt-v4-0-3106d49e03f5@linaro.org/
> 
> You forgot to mention that this patchset adds new dtbs_check warnings,
> which are fixed ONLY after applying DT patches.
> 
Indeed, sorry. I saw how you handled the dependencies in your tree with
the 2 dedicated branches, I'll keep in mind.
Cheers,
ta
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver
  2025-10-20  9:19         ` Tudor Ambarus
@ 2025-10-20  9:58           ` Krzysztof Kozlowski
  2025-10-20 11:02             ` Tudor Ambarus
  0 siblings, 1 reply; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20  9:58 UTC (permalink / raw)
  To: Tudor Ambarus, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Griffin, André Draszik, Michael Turquette,
	Stephen Boyd, 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
On 20/10/2025 11:19, Tudor Ambarus wrote:
> 
> 
> On 10/20/25 9:22 AM, Krzysztof Kozlowski wrote:
>> On 20/10/2025 09:45, Tudor Ambarus wrote:
>>>
>>>
>>> On 10/20/25 7:54 AM, Krzysztof Kozlowski wrote:
>>>>> 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)
>>>>
>>>> I merged the patches but I don't get why we are not enabling it by
>>>> default, just like every other clock driver. What is so special here?
>>>
>>> Thanks! Are you referring to the depends on line? I needed it otherwise
>>> on randconfigs where COMPILE_TEST=y and EXYNOS_ACPM_PROTOCOL=n I get:
>>
>>
>> No. I am referring to missing default and defconfig patch.
>>
> 
> default m or y would force compilation of EXYNOS_ACPM_CLK and
> EXYNOS_ACPM_PROTOCOL for all ARCH_EXYNOS, even on Exynos platforms that
> don't use ACPM. Since ACPM is not universally required by the Exynos
> architecture, I thought to make it opt-in (default n).
Just like every clock driver. So again - how is it different?
> 
> Setting it as a module in arm64 defconfig makes it available on
> compatible platforms.
> 
> Similar clock drivers do the same: CLK_RASPBERRYPI.
> COMMON_CLK_SCPI, COMMON_CLK_SCMI - no defaults and set them as builtin
> in the arm64 defconfig.
I am speaking about Samsung drivers.
Best regards,
Krzysztof
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver
  2025-10-20  9:58           ` Krzysztof Kozlowski
@ 2025-10-20 11:02             ` Tudor Ambarus
  2025-10-20 11:21               ` Krzysztof Kozlowski
  0 siblings, 1 reply; 22+ messages in thread
From: Tudor Ambarus @ 2025-10-20 11:02 UTC (permalink / raw)
  To: Krzysztof Kozlowski, Rob Herring, Krzysztof Kozlowski,
	Conor Dooley, Peter Griffin, André Draszik,
	Michael Turquette, Stephen Boyd, 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
On 10/20/25 10:58 AM, Krzysztof Kozlowski wrote:
> On 20/10/2025 11:19, Tudor Ambarus wrote:
>>
>>
>> On 10/20/25 9:22 AM, Krzysztof Kozlowski wrote:
>>> On 20/10/2025 09:45, Tudor Ambarus wrote:
>>>>
>>>>
>>>> On 10/20/25 7:54 AM, Krzysztof Kozlowski wrote:
>>>>>> 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)
>>>>>
>>>>> I merged the patches but I don't get why we are not enabling it by
>>>>> default, just like every other clock driver. What is so special here?
>>>>
>>>> Thanks! Are you referring to the depends on line? I needed it otherwise
>>>> on randconfigs where COMPILE_TEST=y and EXYNOS_ACPM_PROTOCOL=n I get:
>>>
>>>
>>> No. I am referring to missing default and defconfig patch.
>>>
>>
>> default m or y would force compilation of EXYNOS_ACPM_CLK and
>> EXYNOS_ACPM_PROTOCOL for all ARCH_EXYNOS, even on Exynos platforms that
>> don't use ACPM. Since ACPM is not universally required by the Exynos
>> architecture, I thought to make it opt-in (default n).
> 
> 
> Just like every clock driver. So again - how is it different?
The key difference lies in the universality of the hardware interface
across the ARCH_EXYNOS family. If EXYNOS_AUDSS_CLK_CON, EXYNOS_CLKOUT
are considered core, integral, or nearly universal features across
Exynos SoCs, then it's alright to have them by default. I can't tell how
common is ACPM across the Samsung Exynos SoCs. I know it's present on
gs{1,2)01 and e850. Heard it mentioned around some other phone but I
can't remember which. Maybe we shall set to a default m when more users
reveal themselves? I'm of course open to drop the defconfig patch and
follow up with a patch setting EXYNOS_ACPM_CLK to
"default m if ARCH_EXYNOS" if you think it's common enough.
Cheers,
ta
^ permalink raw reply	[flat|nested] 22+ messages in thread
* Re: [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver
  2025-10-20 11:02             ` Tudor Ambarus
@ 2025-10-20 11:21               ` Krzysztof Kozlowski
  0 siblings, 0 replies; 22+ messages in thread
From: Krzysztof Kozlowski @ 2025-10-20 11:21 UTC (permalink / raw)
  To: Tudor Ambarus, Rob Herring, Krzysztof Kozlowski, Conor Dooley,
	Peter Griffin, André Draszik, Michael Turquette,
	Stephen Boyd, 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
On 20/10/2025 13:02, Tudor Ambarus wrote:
> 
> 
> On 10/20/25 10:58 AM, Krzysztof Kozlowski wrote:
>> On 20/10/2025 11:19, Tudor Ambarus wrote:
>>>
>>>
>>> On 10/20/25 9:22 AM, Krzysztof Kozlowski wrote:
>>>> On 20/10/2025 09:45, Tudor Ambarus wrote:
>>>>>
>>>>>
>>>>> On 10/20/25 7:54 AM, Krzysztof Kozlowski wrote:
>>>>>>> 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)
>>>>>>
>>>>>> I merged the patches but I don't get why we are not enabling it by
>>>>>> default, just like every other clock driver. What is so special here?
>>>>>
>>>>> Thanks! Are you referring to the depends on line? I needed it otherwise
>>>>> on randconfigs where COMPILE_TEST=y and EXYNOS_ACPM_PROTOCOL=n I get:
>>>>
>>>>
>>>> No. I am referring to missing default and defconfig patch.
>>>>
>>>
>>> default m or y would force compilation of EXYNOS_ACPM_CLK and
>>> EXYNOS_ACPM_PROTOCOL for all ARCH_EXYNOS, even on Exynos platforms that
>>> don't use ACPM. Since ACPM is not universally required by the Exynos
>>> architecture, I thought to make it opt-in (default n).
>>
>>
>> Just like every clock driver. So again - how is it different?
> 
> The key difference lies in the universality of the hardware interface
> across the ARCH_EXYNOS family. If EXYNOS_AUDSS_CLK_CON, EXYNOS_CLKOUT
> are considered core, integral, or nearly universal features across
> Exynos SoCs, then it's alright to have them by default. I can't tell how
> common is ACPM across the Samsung Exynos SoCs. I know it's present on
> gs{1,2)01 and e850. Heard it mentioned around some other phone but I
> can't remember which. Maybe we shall set to a default m when more users
> reveal themselves? I'm of course open to drop the defconfig patch and
> follow up with a patch setting EXYNOS_ACPM_CLK to
> "default m if ARCH_EXYNOS" if you think it's common enough.
OK, we can wait till one more user appears. Although the choice is less
about universality, but rather if this is a core SoC element. If this is
a core SoC element, then SoC ARCH should select it (not allow to disable
it), even if this is only for one ARCH_EXYNOS SoC.
Best regards,
Krzysztof
^ permalink raw reply	[flat|nested] 22+ messages in thread
end of thread, other threads:[~2025-10-20 11:22 UTC | newest]
Thread overview: 22+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-10-10 12:46 [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Tudor Ambarus
2025-10-10 12:46 ` [PATCH v6 1/6] dt-bindings: firmware: google,gs101-acpm-ipc: add ACPM clocks Tudor Ambarus
2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
2025-10-10 12:46 ` [PATCH v6 2/6] firmware: exynos-acpm: add DVFS protocol Tudor Ambarus
2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
2025-10-10 12:46 ` [PATCH v6 3/6] firmware: exynos-acpm: register ACPM clocks pdev Tudor Ambarus
2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
2025-10-10 12:46 ` [PATCH v6 4/6] clk: samsung: add Exynos ACPM clock driver Tudor Ambarus
2025-10-20  6:54   ` Krzysztof Kozlowski
2025-10-20  7:45     ` Tudor Ambarus
2025-10-20  8:22       ` Krzysztof Kozlowski
2025-10-20  9:19         ` Tudor Ambarus
2025-10-20  9:58           ` Krzysztof Kozlowski
2025-10-20 11:02             ` Tudor Ambarus
2025-10-20 11:21               ` Krzysztof Kozlowski
2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
2025-10-10 12:46 ` [PATCH v6 5/6] arm64: defconfig: enable Exynos ACPM clocks Tudor Ambarus
2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
2025-10-10 12:46 ` [PATCH v6 6/6] MAINTAINERS: add ACPM clock bindings and driver Tudor Ambarus
2025-10-20  6:55   ` (subset) " Krzysztof Kozlowski
2025-10-20  7:03 ` [PATCH v6 0/6] exynos-acpm: add DVFS protocol and clock driver Krzysztof Kozlowski
2025-10-20  9:53   ` Tudor Ambarus
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).