From: "Shah, Tanmay" <tanmays@amd.com>
To: Krzysztof Kozlowski <krzk@kernel.org>,
Ben Levinsky <ben.levinsky@amd.com>
Cc: <jassisinghbrar@gmail.com>, <andersson@kernel.org>,
<mathieu.poirier@linaro.org>, <robh@kernel.org>,
<krzk+dt@kernel.org>, <conor+dt@kernel.org>,
<michal.simek@amd.com>, <linux-remoteproc@vger.kernel.org>,
<devicetree@vger.kernel.org>,
<linux-arm-kernel@lists.infradead.org>,
<linux-kernel@vger.kernel.org>, <tanmay.shah@amd.com>
Subject: Re: [PATCH 4/6] mailbox: Add AMD PL Mailbox soft IP controller
Date: Fri, 16 Oct 2026 09:54:37 -0500 [thread overview]
Message-ID: <0ad96f34-97d6-4998-9cf3-4b09ab6c94a2@amd.com> (raw)
In-Reply-To: <20261015-aromatic-ibex-of-opposition-dafb43@quoll>
On 10/15/2026 4:48 AM, Krzysztof Kozlowski wrote:
> 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
>> 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.
>
>> + 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?
>
Hi Krzysztof,
This block will be used on 4 SoC - zynqmp, versal, versal-net & versal2.
IIRC we should list each SoC where the device/hw block is available.
That is why we listed all 4 of them. I am not sure if the compatible
property in the YAML is presenting this correctly, but here I think it
is good. Please suggest if there is a better way.
Thank You.
> Best regards,
> Krzysztof
next prev parent reply other threads:[~2026-10-16 14:55 UTC|newest]
Thread overview: 22+ 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-16 13:59 ` Krzysztof Kozlowski
2026-10-16 14:11 ` Shah, Tanmay
2026-10-16 13:57 ` Krzysztof Kozlowski
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
2026-10-16 14:54 ` Shah, Tanmay [this message]
2026-10-16 14:56 ` Krzysztof Kozlowski
2026-10-16 15:02 ` Ben Levinsky
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=0ad96f34-97d6-4998-9cf3-4b09ab6c94a2@amd.com \
--to=tanmays@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