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

From: Cristian Marussi
Date: Sat Aug 26 2023 - 08:55:01 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.

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

----
v1 --> v2
- more descriptive commit message for 1/6
- add and use more descriptive defines to name boolean arguments in clk-scmi.c
- dropped RFC from 6/6


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
firmware: arm_scmi: Add Clock OEM config clock operations

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

--
2.42.0