mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ben Levinsky <blevinsk@amd.com>
To: Krzysztof Kozlowski <krzk@kernel.org>
Cc: "Levinsky, Ben" <ben.levinsky@amd.com>,
	"jassisinghbrar@gmail.com" <jassisinghbrar@gmail.com>,
	"andersson@kernel.org" <andersson@kernel.org>,
	"mathieu.poirier@linaro.org" <mathieu.poirier@linaro.org>,
	"robh@kernel.org" <robh@kernel.org>,
	"krzk+dt@kernel.org" <krzk+dt@kernel.org>,
	"conor+dt@kernel.org" <conor+dt@kernel.org>,
	"Simek, Michal" <michal.simek@amd.com>,
	"linux-remoteproc@vger.kernel.org"
	<linux-remoteproc@vger.kernel.org>,
	"devicetree@vger.kernel.org" <devicetree@vger.kernel.org>,
	"linux-arm-kernel@lists.infradead.org"
	<linux-arm-kernel@lists.infradead.org>,
	"linux-kernel@vger.kernel.org" <linux-kernel@vger.kernel.org>,
	"Shah, Tanmay" <tanmay.shah@amd.com>
Subject: Re: [PATCH 4/6] mailbox: Add AMD PL Mailbox soft IP controller
Date: Thu, 15 Oct 2026 07:30:59 -0700	[thread overview]
Message-ID: <b9e5863b-cf74-46e4-a1f1-a379be779ad1@amd.com> (raw)
In-Reply-To: <DM4PR12MB6448B4B18D0B45CCA678814F839C2@DM4PR12MB6448.namprd12.prod.outlook.com>



> 
> *From: *Krzysztof Kozlowski <krzk@kernel.org>
> *Date: *Thursday, October 15, 2026 at 2:48 AM
> *To: *Levinsky, Ben <ben.levinsky@amd.com>
> *Cc: *jassisinghbrar@gmail.com <jassisinghbrar@gmail.com>; andersson@kernel.org 
> <andersson@kernel.org>; mathieu.poirier@linaro.org <mathieu.poirier@linaro.org>; 
> robh@kernel.org <robh@kernel.org>; krzk+dt@kernel.org <krzk+dt@kernel.org>; 
> conor+dt@kernel.org <conor+dt@kernel.org>; Simek, Michal <michal.simek@amd.com>; 
> linux-remoteproc@vger.kernel.org <linux-remoteproc@vger.kernel.org>; 
> devicetree@vger.kernel.org <devicetree@vger.kernel.org>; linux-arm- 
> kernel@lists.infradead.org <linux-arm-kernel@lists.infradead.org>; linux- 
> kernel@vger.kernel.org <linux-kernel@vger.kernel.org>; Shah, Tanmay 
> <tanmay.shah@amd.com>
> *Subject: *Re: [PATCH 4/6] mailbox: Add AMD PL Mailbox soft IP controller
> 
> On Wed, Oct 14, 2026 at 02:34:24PM -0700, Ben Levinsky wrote:
>  > Add a mailbox-framework controller for the AMD programmable-logic
>  > Mailbox soft IP. Expose separate transmit and receive FIFO channels.
>  >
>  > Enable the interface clock only while a channel is started, before any
>  > register access, and disable it last when the channel shuts down. Keep
>  > provider probe free of register accesses and leave the IRQ disabled until
>  > a client starts the receive channel. Initialize each FIFO when its channel
>  > starts, use receive-threshold interrupts for incoming words, and poll the
>  > send-threshold status for transmit completion. Stop that polling from
>  > accessing registers once the transmit channel begins to shut down.
>  >
>  > Carry mailbox payloads in struct zynqmp_ipi_message, limited to the FIFO
>  > depth given by the device tree. The FIFO transfers 32-bit words and the
>  > hardware conveys neither a byte count nor the FIFO occupancy, so a
>  > transmit length that is not a multiple of four is zero-padded to a whole
>  > word.
>  >
>  > On a receive-threshold interrupt, read up to one FIFO depth of words and
>  > deliver them as one message, then acknowledge the interrupt. The event
>  > latches only when the FIFO goes from empty to nonempty, so a word that
>  > arrives between the drain and the acknowledge, or words left by the
>  > bounded drain, raise no new event. If the FIFO is nonempty after the
>  > acknowledge, toggle the threshold to latch a new event for them.
>  >
>  > Assisted-by: LLM sparse
>  > Signed-off-by: Ben Levinsky <ben.levinsky@amd.com>
>  > ---
>  >  MAINTAINERS                      |   7 +
>  >  drivers/mailbox/Kconfig          |  10 +
>  >  drivers/mailbox/Makefile         |   1 +
>  >  drivers/mailbox/amd-pl-mailbox.c | 369 +++++++++++++++++++++++++++++++
>  >  4 files changed, 387 insertions(+)
>  >  create mode 100644 drivers/mailbox/amd-pl-mailbox.c
>  >
>  > diff --git a/MAINTAINERS b/MAINTAINERS
>  > index f53047aa8d3c..4e28e0c311c0 100644
>  > --- a/MAINTAINERS
>  > +++ b/MAINTAINERS
>  > @@ -1287,6 +1287,13 @@ S:     Supported
>  >  T:   git https://gitlab.freedesktop.org/agd5f/linux.git <https:// 
> gitlab.freedesktop.org/agd5f/linux.git>
>  >  F:   drivers/gpu/drm/amd/pm/
>  >
>  > +AMD PROGRAMMABLE LOGIC MAILBOX DRIVER
>  > +M:   Ben Levinsky <ben.levinsky@amd.com>
>  > +L:   linux-kernel@vger.kernel.org
>  > +S:   Maintained
>  > +F:   Documentation/devicetree/bindings/mailbox/amd,zynqmp-pl-mbox-2.1.yaml
>  > +F:   drivers/mailbox/amd-pl-mailbox.c
>  > +
>  >  AMD PSTATE DRIVER
>  >  M:   Huang Rui <ray.huang@amd.com>
>  >  M:   Mario Limonciello <mario.limonciello@amd.com>
>  > diff --git a/drivers/mailbox/Kconfig b/drivers/mailbox/Kconfig
>  > index ab869769e278..3c3f262c903c 100644
>  > --- a/drivers/mailbox/Kconfig
>  > +++ b/drivers/mailbox/Kconfig
>  > @@ -8,6 +8,16 @@ menuconfig MAILBOX
>  >
>  >  if MAILBOX
>  >
>  > +config AMD_PL_MAILBOX
>  > +     tristate "AMD PL Mailbox soft IP controller"
> 
> Missing depends on Zynq/Xilinx.

  Hi Krzysztof,

  Thanks, I will add "depends on ARCH_ZYNQMP || COMPILE_TEST" in v2.
  ARCH_ZYNQMP covers the ZynqMP, Versal, Versal NET and Versal Gen 2
  families, which are the platforms this has been used and tested on.


> 
>  > +     depends on HAS_IOMEM
>  > +     depends on OF
>  > +     help
>  > +       Mailbox controller for the AMD Programmable Logic Mailbox soft IP.
>  > +       The controller exposes transmit and receive FIFO channels to mailbox
>  > +       clients. It supports interrupt-driven receive notification and
>  > +       polling-based transmit completion through the common mailbox framework.
> 
> ...
> 
>  > +     mb->controller.dev = dev;
>  > +     mb->controller.ops = &amd_pl_mbox_ops;
>  > +     mb->controller.chans = mb->chans;
>  > +     mb->controller.num_chans = AMD_PL_MBOX_NUM_CHANS;
>  > +     mb->controller.txdone_poll = true;
>  > +     mb->controller.txpoll_period = 1;
>  > +     mb->controller.of_xlate = amd_pl_mbox_xlate;
>  > +
>  > +     ret = devm_request_irq(dev, mb->irq, amd_pl_mbox_irq,
>  > +                            IRQF_NO_AUTOEN,
>  > +                            dev_name(dev), mb);
>  > +     if (ret)
>  > +             return ret;
>  > +
>  > +     return devm_mbox_controller_register(dev, &mb->controller);
>  > +}
>  > +
>  > +static const struct of_device_id amd_pl_mbox_of_match[] = {
>  > +     { .compatible = "amd,zynqmp-pl-mbox-2.1" },
>  > +     { .compatible = "amd,versal-pl-mbox-2.1" },
>  > +     { .compatible = "amd,versal-net-pl-mbox-2.1" },
>  > +     { .compatible = "amd,versal2-pl-mbox-2.1" },
> 
> So all of them are compatible? Then why do you need all this?

  Yes, they are the same IP on every SoC, so there is no reason to list
  them separately. As described in my reply to patch 3, v2 uses the
  single compatible "xlnx,mailbox-2.1", and the match table will have
  just that one entry.

  Thanks,
  Ben

> 
> Best regards,
> Krzysztof
> 


  parent reply	other threads:[~2026-10-15 14:31 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-10-14 21:34 [PATCH 0/6] Add AMD PL Mailbox and RPMsg support for the AMD BRAM remoteproc Ben Levinsky
2026-10-14 21:34 ` [PATCH 1/6] remoteproc: amd_mbv_bram: Bound device name formatting Ben Levinsky
2026-10-14 21:34 ` [PATCH 2/6] remoteproc: amd_mbv_bram: Restore reset GPIO direction after PL reconfig Ben Levinsky
2026-10-14 21:34 ` [PATCH 3/6] dt-bindings: mailbox: Add AMD PL Mailbox IP Ben Levinsky
2026-10-15  9:46   ` Krzysztof Kozlowski
     [not found]     ` <DM4PR12MB644859F1CA3A936684A3338B839C2@DM4PR12MB6448.namprd12.prod.outlook.com>
2026-10-15 14:29       ` Ben Levinsky
2026-10-15 15:31         ` Shah, Tanmay
2026-10-14 21:34 ` [PATCH 4/6] mailbox: Add AMD PL Mailbox soft IP controller Ben Levinsky
2026-10-15  9:48   ` Krzysztof Kozlowski
     [not found]     ` <DM4PR12MB6448B4B18D0B45CCA678814F839C2@DM4PR12MB6448.namprd12.prod.outlook.com>
2026-10-15 14:30       ` Ben Levinsky [this message]
2026-10-14 21:34 ` [PATCH 5/6] dt-bindings: remoteproc: Add RPMsg resources to AMD BRAM rproc Ben Levinsky
2026-10-15  9:49   ` Krzysztof Kozlowski
     [not found]     ` <DM4PR12MB64480F027338BA7A1EF91E17839C2@DM4PR12MB6448.namprd12.prod.outlook.com>
2026-10-15 14:32       ` Ben Levinsky
2026-10-14 21:34 ` [PATCH 6/6] remoteproc: amd_mbv_bram: Add RPMsg support Ben Levinsky
2026-10-15  9:51   ` Krzysztof Kozlowski
     [not found]     ` <DM4PR12MB6448FDE3208DB753A37EF3F9839C2@DM4PR12MB6448.namprd12.prod.outlook.com>
2026-10-15 14:33       ` Ben Levinsky

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=b9e5863b-cf74-46e4-a1f1-a379be779ad1@amd.com \
    --to=blevinsk@amd.com \
    --cc=andersson@kernel.org \
    --cc=ben.levinsky@amd.com \
    --cc=conor+dt@kernel.org \
    --cc=devicetree@vger.kernel.org \
    --cc=jassisinghbrar@gmail.com \
    --cc=krzk+dt@kernel.org \
    --cc=krzk@kernel.org \
    --cc=linux-arm-kernel@lists.infradead.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-remoteproc@vger.kernel.org \
    --cc=mathieu.poirier@linaro.org \
    --cc=michal.simek@amd.com \
    --cc=robh@kernel.org \
    --cc=tanmay.shah@amd.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®