Re: [PATCH V3] firmware: arm_scmi: Make scmi core independent of the transport type

From: Arnd Bergmann
Date: Tue Jan 21 2020 - 10:11:31 EST


On Tue, Jan 21, 2020 at 9:27 AM Viresh Kumar <viresh.kumar@xxxxxxxxxx> wrote:
>
> The SCMI specification is fairly independent of the transport protocol,
> which can be a simple mailbox (already implemented) or anything else.
> The current Linux implementation however is very much dependent on the
> mailbox transport layer.
>
> This patch makes the SCMI core code (driver.c) independent of the
> mailbox transport layer and moves all mailbox related code to a new
> file: mailbox.c.
>
> We can now implement more transport protocols to transport SCMI
> messages.
>
> The transport protocols just need to provide struct scmi_transport_ops,
> with its version of the callbacks to enable exchange of SCMI messages.
>
> Signed-off-by: Viresh Kumar <viresh.kumar@xxxxxxxxxx>
> ---
> @Sudeep: Can you please help me getting this tested?
>
> V2->V3:
> - Added more ops to the structure to read/write/memcpy data
> - Payload is moved to mailbox.c and is handled in transport specific way
> now. This resulted in lots of changes.

This addresses the comments I had about the implementation.

It's still hard for me to judge whether this is a good abstraction as
long as there is only one backend in the framework, but I see nothing
immediately wrong with it either.

Arnd