Re: [PATCH 5/9] soc: apple: Add RTKit IPC library
From: Rob Herring
Date: Mon Apr 04 2022 - 11:02:34 EST
On Sat, Apr 02, 2022 at 03:51:46PM +0200, Sven Peter wrote:
> On Wed, Mar 23, 2022, at 12:19, Krzysztof Kozlowski wrote:
> > On 21/03/2022 17:50, Sven Peter wrote:
> >> Apple SoCs such as the M1 come with multiple embedded co-processors
> >> running proprietary firmware. Communication with those is established
> >> over a simple mailbox using the RTKit IPC protocol.
> >>
> >> Signed-off-by: Sven Peter <sven@xxxxxxxxxxxxx>
> >> ---
> >> drivers/soc/apple/Kconfig | 13 +
> >> drivers/soc/apple/Makefile | 3 +
> >> drivers/soc/apple/rtkit-crashlog.c | 147 +++++
> >> drivers/soc/apple/rtkit-internal.h | 76 +++
> >> drivers/soc/apple/rtkit.c | 842 +++++++++++++++++++++++++++++
> >> include/linux/soc/apple/rtkit.h | 203 +++++++
> >> 6 files changed, 1284 insertions(+)
> >
> > Isn't this some implementation of a mailbox? If so, it should be in
> > drivers/mailbox. Please don't put all stuff in soc/apple, that's not how
> > Linux is organized. To drivers/soc usually we put drivers which do not
> > fit regular subsystems.
> >
>
> I put this into soc/apple because I don't think it fits within the mailbox
> framework very well.
> (It actually uses the mailbox framework for the actual communication
> with the hardware with a driver that's already upstream.)
>
> Essentially, the mailbox subsystem provides a common API to send and
> receive messages over indepedent hardware channels and devicetree bindings
> to describe the relationship between those channels and other drivers.
>
> One of the features that doesn't really fit is that we need to be able
> to start, shutdown and re-start these co-processors. The NVMe driver
remoteproc does that. Did you look at it? Most remoteproc drivers use
some combination of mailboxes and shared memory.
Rob