Commit Graph

7 Commits

Author SHA1 Message Date
Wan Jiabing 03f840c492 firmware: arm_scmi: Remove duplicate declaration of struct scmi_protocol_handle
struct scmi_protocol_handle is declared twice, let us remove the duplicate
declaration.

Link: https://lore.kernel.org/r/20210427033031.4580-1-wanjiabing@vivo.com
Reviewed-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Wan Jiabing <wanjiabing@vivo.com>
[sudeep.holla: minor updates to the title and the changelog]
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-04-27 11:57:26 +01:00
Cristian Marussi 3cb8c95f4b 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.

Link: https://lore.kernel.org/r/20210316124903.35011-35-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-03-30 16:35:15 +01:00
Cristian Marussi b9f7fd907c firmware: arm_scmi: Convert events registration to protocol handles
Convert all 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 that will be removed later
in order to ease such transition.

Link: https://lore.kernel.org/r/20210316124903.35011-8-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-03-29 10:00:35 +01:00
Cristian Marussi 533c7095b1 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.

Also 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.

Link: https://lore.kernel.org/r/20210316124903.35011-7-cristian.marussi@arm.com
Tested-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2021-03-29 10:00:35 +01:00
Cristian Marussi 72a5eb9d9c firmware: arm_scmi: Remove fixed size fields from reports/scmi_event_header
Event reports are used to convey information describing events to the
registered user-callbacks: they are necessarily derived from the underlying
raw SCMI events' messages but they are not meant to expose or directly
mirror any of those messages data layout, which belong to the protocol
layer.

Using fixed size types for report fields, mirroring messages structure,
is at odd with this: get rid of them using more generic, equivalent,
typing.

Substitute scmi_event_header fixed size fields with generic types too and
shuffle around fields definitions to minimize implicit padding while
adapting involved functions.

Link: https://lore.kernel.org/r/20200710133919.39792-3-cristian.marussi@arm.com
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2020-07-13 09:40:21 +01:00
Cristian Marussi bd31b24969 firmware: arm_scmi: Add notification dispatch and delivery
Add the core SCMI notifications dispatch and delivery support logic
which is able to dispatch well-known received events from the Rx
interrupt handler to the dedicated deferred worker. From there, it will
deliver the events to the registered users' callbacks.

Dispatch and delivery support is just added here, still not enabled.

Link: https://lore.kernel.org/r/20200701155348.52864-4-cristian.marussi@arm.com
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2020-07-01 17:07:25 +01:00
Cristian Marussi 1fc2dd1864 firmware: arm_scmi: Add notification protocol-registration
Add the core SCMI notifications protocol-registration support: allow
protocols to register their own set of supported events, during their
initialization phase. Notification core can track multiple platform
instances by their handles.

Link: https://lore.kernel.org/r/20200701155348.52864-2-cristian.marussi@arm.com
Reviewed-by: Jonathan Cameron <Jonathan.Cameron@huawei.com>
Signed-off-by: Cristian Marussi <cristian.marussi@arm.com>
Signed-off-by: Sudeep Holla <sudeep.holla@arm.com>
2020-07-01 17:07:25 +01:00