Re: [PATCH v9 5/9] mailbox: add CIX mailbox driver
From: Guomin chen <hidden>
Date: 2025-07-16 02:30:33
Also in:
linux-devicetree, lkml
On Tue, Jul 15, 2025 at 05:11:01PM -0500, Jassi Brar wrote:
[Some people who received this message don't often get email from jassisinghbrar@gmail.com. Learn why this is important at https://aka.ms/LearnAboutSenderIdentification ] EXTERNAL EMAIL On Mon, Jul 14, 2025 at 10:40 AM Arnd Bergmann [off-list ref] wrote:quoted
On Sun, Jul 13, 2025, at 19:00, Jassi Brar wrote:quoted
On Tue, Jul 8, 2025 at 8:54 AM Guomin chen [off-list ref] wrote: ....quoted
quoted
quoted
+/* [0~7] Fast channel + * [8] doorbell base channel + * [9]fifo base channel + * [10] register base channel + */ +#define MBOX_FAST_IDX 7 +#define MBOX_DB_IDX 8 +#define MBOX_FIFO_IDX 9 +#define MBOX_REG_IDX 10 +#define CIX_MBOX_CHANS 11 +if it is not really a single controller owning different channels, maybe implement only what you currently use.As mentioned in the previous email, a single controller can support multiple different channels.OK. I am not too worried about having all variants in one driver esp when it is manageable and share the code. Unless I am overlooking something. Arnd?My main worry here is that the types are all quite different: while the doorbell and fast mailboxes are what a lot of other drivers have, the FIFO mode does not seem to be a good fit for the mailbox subsystem but instead looks like a more generic firmware interface with variable length messages. For those, I think a higher-level driver with fixed data structures passed through the hardware interface seems more appropriate.Yes. But sometimes when the data structures of a protocol are not bigger than FIFO depth, the platform may choose to use the FIFO mode. I see it as platform dependent.quoted
Are there any other mailbox drivers that just use the mailbox to tunnel variable-length messages?From a quick look, Armada 37xx and Hi6220 have fifo though they fill them up fully for each transfer.
Yes, both Armada 37xx and Hi6220 support FIFO functionality, and they fill the FIFO with each transfer. Since the cix mailbox hardware supports messages with a maximum length of 128 bytes, different clients transmit messages of varying lengths, such as the cix DSP using 8 bytes, the cix sensorhub using 12 bytes, etc. Therefore, the cix mailbox driver has been modified to support variable- length messages of up to 128 bytes. This allows for more compact and flexible support of various clients. Thanks Guomin Chen