[PATCH v2 0/2] Initial support for Exynos850 SoC in ACPM clk driver

Alexey Klimov posted 2 patches 1 week, 3 days ago
drivers/clk/samsung/clk-acpm.c | 62 ++++++++++++++++++++++++++++++++++++++----
1 file changed, 56 insertions(+), 6 deletions(-)
[PATCH v2 0/2] Initial support for Exynos850 SoC in ACPM clk driver
Posted by Alexey Klimov 1 week, 3 days ago
This series adds support for the Exynos850 SoC to the Samsung ACPM clock
driver. 

Currently, the driver hardcodes the GS101 clock variants directly within
its probe() routine. To cleanly support Exynos850 (and potentially other
SoCs that utilize the ACPM protocol in future), this series first
refactors the driver a little bit to be SoC-agnostic, and then wires up
the new Exynos850 data.

First patch introduces `driver_data` to dynamically extract clock lists,
number of clocks, names of clocks, and mailbox channel id, removing the
GS101 hardcoding.

Second patch introduces the `exynos850_acpm_clks` array and
"exynos850-acpm-clk" device ID.

This version also tries to handle missing ->recaclk_rate() implementation
in ACPM firmware. Because the Exynos850 ACPM firmware does not support
dynamic rate reads over ACPM IPC, the second patch introduces
a ->get_rate() callback mechanism. For Exynos850, this falls back to
parent CMU clock topology, registering parent data via pdata.fw_name.

Tested with cpufreq for E850, with OPPs and cpufreq_dt on Winlink E850-96
board.

I decided not to add Tudor's trailer for the second patch because it seems
that rework is quite important.
The dt-bindings for clocks will be added as a separate commit in another
series.

Signed-off-by: Alexey Klimov <alexey.klimov@linaro.org>
---
Changes in v2:
- changed commit message of second patch that adds support for Exynos850;
- introduced ->get_rate() callback for Exynos850;
  Rework of second patch and implementation of get_rate from parent clock;
  ACPM clocks for Exynos850 now rely on clock topology and need parent
  clocks to be provided;
- reworked acpm_clk_recalc_rate() to use driver data calback if it is
  available;
- struct acpm_clk now has pointer to drv_data;
- rebased and added changes associated with rebase;
- added mod_devicetable.h as Tudor suggested, added trailer in the first
  commit;
- Link to v1: https://lore.kernel.org/r/20260512-exynos850-acpm-clk-v1-0-837532ddbf38@linaro.org

---
Alexey Klimov (2):
      clk: samsung: acpm: introduce driver data for SoC-specific clocks
      clk: samsung: acpm: add Exynos850 support

 drivers/clk/samsung/clk-acpm.c | 62 ++++++++++++++++++++++++++++++++++++++----
 1 file changed, 56 insertions(+), 6 deletions(-)
---
base-commit: 1a1de54f7369cd2b5bac0f265910e60ad3a6b4c3
change-id: 20260512-exynos850-acpm-clk-bed1c23b66eb

Best regards,
-- 
Alexey Klimov <alexey.klimov@linaro.org>
Re: [PATCH v2 0/2] Initial support for Exynos850 SoC in ACPM clk driver
Posted by Krzysztof Kozlowski 4 days, 15 hours ago
On Tue, 15 Sep 2026 00:05:42 +0100, Alexey Klimov wrote:
> This series adds support for the Exynos850 SoC to the Samsung ACPM clock
> driver.
> 
> Currently, the driver hardcodes the GS101 clock variants directly within
> its probe() routine. To cleanly support Exynos850 (and potentially other
> SoCs that utilize the ACPM protocol in future), this series first
> refactors the driver a little bit to be SoC-agnostic, and then wires up
> the new Exynos850 data.
> 
> [...]

Applied, thanks!

[1/2] clk: samsung: acpm: introduce driver data for SoC-specific clocks
      https://git.kernel.org/krzk/linux/c/802a1a97c41dff82a557223f7a43655fc02920bd
[2/2] clk: samsung: acpm: add Exynos850 support
      https://git.kernel.org/krzk/linux/c/13634cde9771811488847ef76cd64a785599fdb5

Best regards,
-- 
Krzysztof Kozlowski <krzk@kernel.org>
Re: [PATCH v2 0/2] Initial support for Exynos850 SoC in ACPM clk driver
Posted by Uwe Kleine-König 1 week, 2 days ago
Hello,

On Tue, Sep 15, 2026 at 12:05:42AM +0100, Alexey Klimov wrote:
> - added mod_devicetable.h as Tudor suggested, added trailer in the first
>   commit;

Argh, the reasoning in that suggestion was:

	you need to include linux/mod_devicetable.h for kernel_ulong_t.

(https://lore.kernel.org/all/1c41ecc9-d951-45df-b933-1934e1381663@linaro.org/).

This is wrong:

	$ git grep kernel_ulong_t v7.3-rc1:include/linux/mod_devicetable.h || echo void
	void

Please drop the inclusion of <linux/mod_devicetable.h> again, the only
effect of including is that you introduce a bunch of unneeded build
dependencies and I'm fighting to get rid of that file.

Also note that the driver is already using struct platform_device_id
which obviously has a member with type kernel_ulong_t. If you'd need an
additional header for kernel_ulong_t, the driver wouldn't have compiled
already before.

<linux/platform_device.h> already pulls in the definition of struct
platform_device_id and thus also kernel_ulong_t. Please rely on that or
if you want to go full iwyu include <linux/device-id/platformh.>

Best regards
Uwe