[PATCH 2/8] mailbox: apple: Add driver for Apple IOP mailbox

Mark Kettenis mark.kettenis at xs4all.nl
Sat Jan 22 14:54:44 CET 2022


> From: Simon Glass <sjg at chromium.org>
> Date: Fri, 21 Jan 2022 18:40:12 -0700
> 
> On Fri, 14 Jan 2022 at 04:05, Mark Kettenis <kettenis at openbsd.org> wrote:
> >
> > This mailbox driver provides a communication channel with the
> > Apple IOP controllers found on Apple SoCs.  These IOP controllers
> > are used to implement various functions such as the System
> > Manegement Controller (SMC) and NVMe storage.  It allows sending
> > and receiving a 96-bit message over a single channel.
> >
> > The header file with the struct used for mailbox messages is taken
> > straight from Linux.
> >
> > Signed-off-by: Mark Kettenis <kettenis at openbsd.org>
> > Signed-off-by: Sven Peter <sven at svenpeter.dev>
> > ---
> >  arch/arm/Kconfig              |  1 +
> >  drivers/mailbox/Kconfig       | 11 +++++
> >  drivers/mailbox/Makefile      |  1 +
> >  drivers/mailbox/apple-mbox.c  | 92 +++++++++++++++++++++++++++++++++++
> >  include/linux/apple-mailbox.h | 19 ++++++++
> >  5 files changed, 124 insertions(+)
> >  create mode 100644 drivers/mailbox/apple-mbox.c
> >  create mode 100644 include/linux/apple-mailbox.h
> 
> Reviewed-by: Simon Glass <sjg at chromium.org>
> Tested on: Macbook Air M1
> Tested-by: Simon Glass <sjg at chromium.org>
> 
> with nit below
> 
> [..]
> 
> > diff --git a/include/linux/apple-mailbox.h b/include/linux/apple-mailbox.h
> > new file mode 100644
> > index 0000000000..720fbb7029
> > --- /dev/null
> > +++ b/include/linux/apple-mailbox.h
> > @@ -0,0 +1,19 @@
> > +/* SPDX-License-Identifier: GPL-2.0-only OR MIT */
> > +/*
> > + * Apple mailbox message format
> > + *
> > + * Copyright (C) 2021 The Asahi Linux Contributors
> > + */
> > +
> > +#ifndef _LINUX_APPLE_MAILBOX_H_
> > +#define _LINUX_APPLE_MAILBOX_H_
> 
> Drop the _LINUX

Hmm, this is a straight copy of the Linux header file.  Isn't it
better to keep it unmodified?  Most (all?) the other files in this
directory return the _LINUX bit...

> > +
> > +#include <linux/types.h>
> > +
> > +/* encodes a single 96bit message sent over the single channel */
> > +struct apple_mbox_msg {
> > +       u64 msg0;
> > +       u32 msg1;
> > +};
> > +
> > +#endif
> > --
> > 2.34.1
> >
> 
> Regards,
> Simon
> 


More information about the U-Boot mailing list