Re: [PATCH v2] drivers/mailbox: Add Aspeed mailbox driver
From: Suraj Jitindar Singh
Date: Wed May 03 2017 - 04:02:44 EST
***PING***
Are there any comments on this stopping it going upstream?
Do we think this would better belong in /drivers/misc rather than as a
mailbox driver?
Looking to get some discussion going and this moving along :)
Suraj
On Thu, 2017-02-09 at 15:09 +1030, Joel Stanley wrote:
> On Wed, Feb 8, 2017 at 10:06 AM, Cyril Bur <cyrilbur@xxxxxxxxx>
> wrote:
> >
> > This provides access to the mbox registers on the ast2400 and
> > ast2500
> > SoCs.
> >
> > This driver allows arbitrary reads and writes to the 16 data
> > registers as
> > the other end may have configured the mbox hardware to provide an
> > interrupt when a specific register gets written to.
> >
> > Signed-off-by: Cyril Bur <cyrilbur@xxxxxxxxx>
> > ---
> > V2:
> > ÂÂÂs/ASpeed/Aspeed/
> > ÂÂÂReword Kconfig options
> > ÂÂÂUse tristate for config symbol
> >
> > Âdrivers/mailbox/KconfigÂÂÂÂÂÂÂ|ÂÂÂ8 +
> > Âdrivers/mailbox/MakefileÂÂÂÂÂÂ|ÂÂÂ2 +
> > Âdrivers/mailbox/aspeed-mbox.c | 334
> > ++++++++++++++++++++++++++++++++++++++++++
> > Â3 files changed, 344 insertions(+)
> > Âcreate mode 100644 drivers/mailbox/aspeed-mbox.c
> >
> > diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
> > index ceff415f201c..e24044d5c219 100644
> > --- a/drivers/mailbox/Kconfig
> > +++ b/drivers/mailbox/Kconfig
> > @@ -152,4 +152,12 @@ config BCM_PDC_MBOX
> > ÂÂÂÂÂÂÂÂÂÂMailbox implementation for the Broadcom PDC ring manager,
> > ÂÂÂÂÂÂÂÂÂÂwhich provides access to various offload engines on
> > Broadcom
> > ÂÂÂÂÂÂÂÂÂÂSoCs. Say Y here if you want to use the Broadcom PDC.
> > +
> > +config ASPEED_LPC_MBOX
> > +ÂÂÂÂÂÂÂdepends on (ARCH_ASPEED || COMPILE_TEST) && REGMAP &&
> > MFD_SYSCON
> > +ÂÂÂÂÂÂÂtristate "Aspeed LPC Mailbox Controller"
> > +ÂÂÂÂÂÂÂ---help---
> > +ÂÂÂÂÂÂÂÂÂProvides a driver for the MBOX registers found on Aspeed
> > SOCs
> > +ÂÂÂÂÂÂÂÂÂ(AST2400 and AST2500). This driver provides a device for
> > aspeed
> > +ÂÂÂÂÂÂÂÂÂmbox registers
> You repeat yourself.
>
> Mention that this driver is for the the BMC side.
>
> >
> > diff --git a/drivers/mailbox/aspeed-mbox.c
> > b/drivers/mailbox/aspeed-mbox.c
> >
> > +static int aspeed_mbox_probe(struct platform_device *pdev)
> > +{
> > +ÂÂÂÂÂÂÂstruct aspeed_mbox *mbox;
> > +ÂÂÂÂÂÂÂstruct device *dev;
> > +ÂÂÂÂÂÂÂint rc;
> > +
> > +ÂÂÂÂÂÂÂdev = &pdev->dev;
> > +
> > +ÂÂÂÂÂÂÂmbox = devm_kzalloc(dev, sizeof(*mbox), GFP_KERNEL);
> > +ÂÂÂÂÂÂÂif (!mbox)
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn -ENOMEM;
> > +
> > +ÂÂÂÂÂÂÂdev_set_drvdata(&pdev->dev, mbox);
> > +
> > +ÂÂÂÂÂÂÂrc = of_property_read_u32(dev->of_node, "reg", &mbox-
> > >base);
> > +ÂÂÂÂÂÂÂif (rc) {
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂdev_err(dev, "Couldn't read reg device-tree
> > property\n");
> > +ÂÂÂÂÂÂÂÂÂÂÂÂÂÂÂreturn rc;
> > +ÂÂÂÂÂÂÂ}
> I think we want to use of_address_to_resource here.
>
> >
> > +
> > +static const struct of_device_id aspeed_mbox_match[] = {
> > +ÂÂÂÂÂÂÂ{ .compatible = "aspeed,ast2400-mbox" },
> > +ÂÂÂÂÂÂÂ{ .compatible = "aspeed,ast2500-mbox" },
> > +ÂÂÂÂÂÂÂ{ },
> I didn't see the bindings in this series. Have they already been
> accepted?
>
> Cheers,
>
> Joel