[PATCH 0/6] Add SCMI v3.2 Clock new CONFIGs support

From: Cristian Marussi
Date: Fri Aug 11 2023 - 12:15:57 EST


Hi all,

this small series introduces support for the new Clock CONFIG features
added by SCMI v3.2 specification [1].

It does NOT add support, still, for the SCMI v3.2 Clock reparenting
features added in v3.2 too.

After a small refactoring in [1/6], support for the new CONFIG_SET message
format is added in [2/6]: this is just internal rework to support new and
legacy (pre-v3.2) message formats.

Patch [3/6] adds support for the new v3.2 CONFIG_GET command and adds a new
related Clock operation .state_get() to retrieve the enabled state of one
clock when talking to a v3.2 compliant server.

Patch [4/6] extend .state_get() support to legacy SCMI platforms implementing
pre-v3.2 SCMI stacks: in such a scenario we can use the old CLOCK_ATTRIBUTES
command to retrieve the clock state.

Patch [5/6] finally wires up this new .state_get() clock operation to the
Linux Clock framework .is_enabled() callback, AS-LONG-AS the underlying
configured SCMI stack supports atomic operations. (since .is_enabled() is
required not to sleep)
This *should* ease unused clocks management by the Linux Clock framework.

Last but not least, patch [6/6] exposes a couple more SCMI Clock operations
in order to be able to set/get OEM specific clock configuration values as
described in SCMI v3.2 specification; it is marked as RFC since, even
though trivial and tested in emulation, there are really at the moment NO
real users for these new OEM-related clock operations.

Tested on JUNO and on an SCMI emulation setup.

Based on v6.5-rc5.

Any feedback welcome,

Thanks,
Cristian

[1]: https://developer.arm.com/documentation/den0056/e

Cristian Marussi (6):
firmware: arm_scmi: Simplify enable/disable Clock operations
firmware: arm_scmi: Add Clock v3.2 CONFIG_SET support
firmware: arm_scmi: Add v3.2 Clock CONFIG_GET support
firmware: arm_scmi: Add Clock .state_get support to pre-v3.2
clk: scmi: Add support for .is_enabled clk_ops
[RFC] firmware: arm_scmi: Add Clock OEM config clock operations

drivers/clk/clk-scmi.c | 31 ++++-
drivers/firmware/arm_scmi/clock.c | 220 +++++++++++++++++++++++++++---
include/linux/scmi_protocol.h | 19 ++-
3 files changed, 240 insertions(+), 30 deletions(-)

--
2.41.0