firmware: scmi: add multi-channel support
authorEtienne Carriere <etienne.carriere@linaro.org>
Tue, 31 May 2022 16:09:21 +0000 (18:09 +0200)
committerTom Rini <trini@konsulko.com>
Thu, 23 Jun 2022 17:12:55 +0000 (13:12 -0400)
commit8e96801aa6ae99905acaf9ca36c30b373d441e68
tree653042f3db8871bff4bf348b08ebe86a3c6bf2ad
parent5a11df381a53097a7e813d81221ff735cc20782c
firmware: scmi: add multi-channel support

Adds resources for SCMI protocols to possibly use a dedicated SCMI
channel instead of the default channel allocated by the SCMI agent
during initialization. As per DT binding documentation, some SCMI
transports can define a specific SCMI communication channel for
given SCMI protocols. It allows SCMI protocols to pass messages
concurrently each other.

This change introduces new scmi agent uclass API function
devm_scmi_of_get_channel() for SCMI drivers probe sequences to get
a reference to the SCMI channel assigned to its related SCMI protocol.
The function queries the channel reference to its SCMI transport driver
through new scmi agent uclass operator .of_get_channel that uses Device
Tree information from related SCMI agent node.

Operator .of_get_channel returns a reference to the SCMI channel
assigned to SCMI protocol used by the caller device. SCMI transport
drivers that do not support multi-channel are not mandated to register
this operator. When so, API function devm_scmi_of_get_channel() returns
NULL and SCMI transport driver are expected to retrieve by their own
means the reference to the unique SCMI channel, for example using
platform data as these drivers currently do in U-Boot source tree.

Signed-off-by: Etienne Carriere <etienne.carriere@linaro.org>
drivers/firmware/scmi/scmi_agent-uclass.c
include/scmi_agent-uclass.h
include/scmi_agent.h