Commit Graph

8 Commits

Author SHA1 Message Date
Cristian Marussi
db15cd2926 FROMLIST: firmware: arm_scmi: add protocol modularization support
Extend SCMI protocols accounting mechanism to address possible module
usage and add the support to possibly define new protocols as loadable
modules.

Keep Standard protocols built into the SCMI core.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I75f2e400c0fe6a0692a1acc2e20f54a3c7336ab7
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:35 -08:00
Cristian Marussi
bb35ff40d5 FROMLIST: firmware: arm_scmi: cleanup events registration transient code
Remove all the events registration code used to ease the transition to the
new interface based on protocol handles..

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I8470b8cf24ce2e4d004e207a4213003e524f45e5
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:35 -08:00
Cristian Marussi
b75183098d FROMLIST: firmware: arm_scmi: port SystemPower protocol to new protocols interface
Convert internals of protocol implementation to use protocol handles and
expose a new protocol operations interface for SCMI driver using the new
get/put common operations.

Remove handle->system_priv now unused.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I0cc9e9735f5bc81af29dc483e5aaa6c3467a65bb
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:34 -08:00
Cristian Marussi
a0a8e0f761 FROMLIST: firmware: arm_scmi: convert events registration to protocol handles
Convert refactored events registration routines to use protocol handles.

In order to maintain bisectability and to allow protocols and drivers
to be later ported to the new protocol handle interface one by one,
introduce here also some transient code and typing that will be removed
later in order to ease such transition.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ic74cc4576b9189c0fff8968b8063a86375bb7ae7
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:30 -08:00
Cristian Marussi
834134abe6 FROMLIST: firmware: arm_scmi: refactor events registration
Add a new refactored protocol events registration helper and invoke it
from the centralized initialization process triggered by get_ops() and
friends.

Add a .get_num_sources as a new optional callback amongst protocol events
operations; finally remove events registration call-sites from within the
legacy protocol init routines.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: Ib875eb3ec6be086c7d02175a6ff3742eb112026e
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:30 -08:00
Cristian Marussi
cf516fb6f7 FROMLIST: firmware: arm_scmi: review protocol registration interface
Extend common protocol registration routines and provide some new generic
protocols get/put helpers that can track protocols usage and automatically
perform the proper initialization and de-initialization on demand when
required.

Convert all standard protocols to use this new registration scheme while
keeping them all still using the usual initialization logic bound to SCMI
devices probing.

Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>

Bug: 171409184
Link: https://lore.kernel.org/linux-arm-kernel/20210202221555.41167-1-cristian.marussi@arm.com/
Change-Id: I8d40f1f25f8d007f1fa4788f432a7ffeb012e1c2
Signed-off-by: Rishabh Bhatnagar <quic_rishabhb@quicinc.com>
2021-03-02 17:34:29 -08:00
Sudeep Holla
1eaf18e35a firmware: arm_scmi: Move scmi protocols registration into the driver
In preparation to enable building SCMI as a single module, let us move
the SCMI protocol registration call into the driver. This enables us
to also add unregistration of the SCMI protocols.

The main reason for this is to keep it simple instead of maintaining
it as separate modules and dealing with all possible initcall races
and deferred probe handling. We can move it as separate modules if
needed in future.

Link: https://lore.kernel.org/r/20200907195046.56615-4-sudeep.holla@arm.com
Tested-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2020-09-14 07:30:55 +01:00
Cristian Marussi
a880305512 firmware: arm_scmi: Add system power protocol support
Add bare protocol support for SCMI system power protocol as needed by
an OSPM agent: basic initialization and SYSTEM_POWER_STATE_NOTIFIER
core notification support.

No event-handling logic is attached to such notification..

Link: https://lore.kernel.org/r/20200907174657.32466-2-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2020-09-08 16:00:55 +01:00