mbox series

[v4,0/7] SCMIv3.1 Powercap protocol and driver

Message ID 20220704102241.2988447-1-cristian.marussi@arm.com (mailing list archive)
Headers show
Series SCMIv3.1 Powercap protocol and driver | expand

Message

Cristian Marussi July 4, 2022, 10:22 a.m. UTC
Hi all,

this short series introduces the last missing bit of SCMIv3.1, Powercap
protocol. Along the series, there is a small refactoring around the SCMI
FastChannels handling routines so as to reuse as much as possible the
pre-existent (and tested) FastChannel code from the Perf protocol.

New SCMI FC tracing support is added too along the way.

As a last step in the series an ARM SCMI based powercap driver is added,
which takes care to expose via the Powercap framework all the SCMI Powercap
zones that have been discovered asking the SCMI platform firmware.

Basic testing has been performed against an emulated SCMI platform
supporting SCMIv3.1 Powercap protocol using powercap-utils, with the
exclusion of the FCs bits whose generalization has been only tested for
regression on a JUNO platform sporting a regular SCP/SCMI v2.10 fw.

The series is based on sudeep/for-next/scmi [1] on top of:

commit 754f04cac362 ("firmware: arm_scmi: Relax CLOCK_DESCRIBE_RATES out-of-spec checks")

Thanks,
Cristian

v3 --> v4
- fixed GENMASK usage in thresholds state u64 (was broken on 32bit systems)
- dropped SCMI setup/teardown helpers patch in favour of standard module_init/exit
- dropping FCs usage configurability via Kconfig

v2 --> v3:
- added and used some SCMI Fastchannel tracing support
- reverted logic of Kconfig to configure usage of SCMI FC
- using strscpy with new SHORT_NAME_SZ in Powercap protocol
- added devm_protocol_acquire helper

v1 --> v2:
- fixed measurements thresholds updates to trigger notification
  enable update commands
- added a bit more comments
- usig bitfield.h macros
- fixed sparse complaint about missing static on global

[1]: https://git.kernel.org/pub/scm/linux/kernel/git/sudeep.holla/linux.git/log/?h=for-next/scmi
----

Cristian Marussi (7):
  dt-bindings: firmware: arm,scmi: Add powercap protocol
  firmware: arm_scmi: Add SCMIv3.1 Powercap protocol basic support
  firmware: arm_scmi: Generalize FastChannel support
  firmware: arm_scmi: Add SCMIv3.1 Powercap FastChannels support
  include: trace: Add SCMI FastChannel tracing
  firmware: arm_scmi: Use FastChannel tracing
  powercap: arm_scmi: Add SCMI Powercap based driver

 .../bindings/firmware/arm,scmi.yaml           |  10 +
 drivers/firmware/arm_scmi/Makefile            |   2 +-
 drivers/firmware/arm_scmi/driver.c            | 167 ++++
 drivers/firmware/arm_scmi/perf.c              | 225 ++---
 drivers/firmware/arm_scmi/powercap.c          | 866 ++++++++++++++++++
 drivers/firmware/arm_scmi/protocols.h         |  23 +
 drivers/powercap/Kconfig                      |  13 +
 drivers/powercap/Makefile                     |   1 +
 drivers/powercap/arm_scmi_powercap.c          | 538 +++++++++++
 include/linux/scmi_protocol.h                 | 127 +++
 include/trace/events/scmi.h                   |  25 +
 11 files changed, 1825 insertions(+), 172 deletions(-)
 create mode 100644 drivers/firmware/arm_scmi/powercap.c
 create mode 100644 drivers/powercap/arm_scmi_powercap.c

Comments

Sudeep Holla July 6, 2022, 9:39 a.m. UTC | #1
On Mon, 4 Jul 2022 11:22:34 +0100, Cristian Marussi wrote:
> this short series introduces the last missing bit of SCMIv3.1, Powercap
> protocol. Along the series, there is a small refactoring around the SCMI
> FastChannels handling routines so as to reuse as much as possible the
> pre-existent (and tested) FastChannel code from the Perf protocol.
> 
> New SCMI FC tracing support is added too along the way.
> 
> [...]

Applied to sudeep.holla/linux (for-next/scmi), thanks!

[1/7] dt-bindings: firmware: arm,scmi: Add powercap protocol
      https://git.kernel.org/sudeep.holla/c/451d8457bc
[2/7] firmware: arm_scmi: Add SCMIv3.1 Powercap protocol basic support
      https://git.kernel.org/sudeep.holla/c/0316f99c47
[3/7] firmware: arm_scmi: Generalize FastChannel support
      https://git.kernel.org/sudeep.holla/c/6f9ea4dabd
[4/7] firmware: arm_scmi: Add SCMIv3.1 Powercap FastChannels support
      https://git.kernel.org/sudeep.holla/c/855aa26e5f
[5/7] include: trace: Add SCMI FastChannel tracing
      https://git.kernel.org/sudeep.holla/c/e699eb9b4f
[6/7] firmware: arm_scmi: Use FastChannel tracing
      https://git.kernel.org/sudeep.holla/c/b27d04d5a5

--
Regards,
Sudeep