* [PATCH v2 0/2] soc: renesas: mfis: add R-Car V4H/V4M support
@ 2026-05-19 7:56 Wolfram Sang
2026-05-19 7:56 ` [PATCH v2 1/2] dt-bindings: " Wolfram Sang
` (2 more replies)
0 siblings, 3 replies; 7+ messages in thread
From: Wolfram Sang @ 2026-05-19 7:56 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Conor Dooley, devicetree, Geert Uytterhoeven,
Krzysztof Kozlowski, Magnus Damm, Rob Herring
Here are the additions to the MFIS driver in -next to add V4H support.
A full branch for testing with the SparrowHawk is here:
git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/v4h/mfis
To trigger the mailbox-test instances, I use:
$ for f in /sys/kernel/debug/e6300*/message; do echo "Hallo $f!" > $f; done
Looking forward to comments!
Happy hacking,
Wolfram
Changes since (internal) v1:
* added tags from Geert (Thanks!)
Wolfram Sang (2):
dt-bindings: soc: renesas: mfis: add R-Car V4H/V4M support
soc: renesas: mfis: add R-Car V4H/V4M support
.../soc/renesas/renesas,r8a78000-mfis.yaml | 38 +++++++++++++++-
drivers/soc/renesas/rcar-mfis.c | 44 ++++++++++++++++++-
2 files changed, 78 insertions(+), 4 deletions(-)
--
2.51.0
^ permalink raw reply [flat|nested] 7+ messages in thread
* [PATCH v2 1/2] dt-bindings: soc: renesas: mfis: add R-Car V4H/V4M support
2026-05-19 7:56 [PATCH v2 0/2] soc: renesas: mfis: add R-Car V4H/V4M support Wolfram Sang
@ 2026-05-19 7:56 ` Wolfram Sang
2026-05-19 17:31 ` Conor Dooley
2026-05-29 8:13 ` Geert Uytterhoeven
2026-05-19 7:56 ` [PATCH v2 2/2] " Wolfram Sang
2026-05-29 7:07 ` [PATCH v2 0/2] " Wolfram Sang
2 siblings, 2 replies; 7+ messages in thread
From: Wolfram Sang @ 2026-05-19 7:56 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, devicetree
The above SoCs have only 12 mailboxes and do not have an extra register
space for mailboxes. Everything is contained in the common register set.
In addition to adding these SoCs, the other entries get updated to
enforce 2 register spaces and their specific number of interrupts.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
.../soc/renesas/renesas,r8a78000-mfis.yaml | 38 ++++++++++++++++++-
1 file changed, 36 insertions(+), 2 deletions(-)
diff --git a/Documentation/devicetree/bindings/soc/renesas/renesas,r8a78000-mfis.yaml b/Documentation/devicetree/bindings/soc/renesas/renesas,r8a78000-mfis.yaml
index eef8c0a59e9c..72b9fa67d1f7 100644
--- a/Documentation/devicetree/bindings/soc/renesas/renesas,r8a78000-mfis.yaml
+++ b/Documentation/devicetree/bindings/soc/renesas/renesas,r8a78000-mfis.yaml
@@ -19,25 +19,29 @@ description:
properties:
compatible:
enum:
+ - renesas,r8a779g0-mfis # R-Car V4H
+ - renesas,r8a779h0-mfis # R-Car V4M
- renesas,r8a78000-mfis # R-Car X5H (AP<->AP, with PRR)
- renesas,r8a78000-mfis-scp # R-Car X5H (AP<->SCP, without PRR)
reg:
+ minItems: 1
maxItems: 2
reg-names:
+ minItems: 1
items:
- const: common
- const: mboxes
interrupts:
- minItems: 32
+ minItems: 12
maxItems: 128
description:
The interrupts raised by the remote doorbells.
interrupt-names:
- minItems: 32
+ minItems: 12
maxItems: 128
description:
An interrupt name is constructed with the prefix 'ch'. Then, the
@@ -56,6 +60,26 @@ properties:
<dt-bindings/soc/renesas,r8a78000-mfis.h>.
allOf:
+ - if:
+ properties:
+ compatible:
+ contains:
+ enum:
+ - renesas,r8a779g0-mfis
+ - renesas,r8a779h0-mfis
+ then:
+ properties:
+ reg:
+ maxItems: 1
+ reg-names:
+ maxItems: 1
+ interrupts:
+ maxItems: 12
+ interrupt-names:
+ maxItems: 12
+ items:
+ pattern: "^ch[0-9]+e$"
+
- if:
properties:
compatible:
@@ -63,6 +87,10 @@ allOf:
const: renesas,r8a78000-mfis
then:
properties:
+ reg:
+ minItems: 2
+ reg-names:
+ minItems: 2
interrupts:
minItems: 128
interrupt-names:
@@ -77,9 +105,15 @@ allOf:
const: renesas,r8a78000-mfis-scp
then:
properties:
+ reg:
+ minItems: 2
+ reg-names:
+ minItems: 2
interrupts:
+ minItems: 32
maxItems: 32
interrupt-names:
+ minItems: 32
maxItems: 32
items:
pattern: "^ch[0-9]+i$"
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* [PATCH v2 2/2] soc: renesas: mfis: add R-Car V4H/V4M support
2026-05-19 7:56 [PATCH v2 0/2] soc: renesas: mfis: add R-Car V4H/V4M support Wolfram Sang
2026-05-19 7:56 ` [PATCH v2 1/2] dt-bindings: " Wolfram Sang
@ 2026-05-19 7:56 ` Wolfram Sang
2026-05-29 8:14 ` Geert Uytterhoeven
2026-05-29 7:07 ` [PATCH v2 0/2] " Wolfram Sang
2 siblings, 1 reply; 7+ messages in thread
From: Wolfram Sang @ 2026-05-19 7:56 UTC (permalink / raw)
To: linux-renesas-soc; +Cc: Wolfram Sang, Geert Uytterhoeven, Magnus Damm
The above SoCs have a weird register layout for the mailbox registers.
So, encapsulate register offset calculation in a per-SoC callback. Other
than that, only a separate config struct and compatibles are needed.
Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
---
drivers/soc/renesas/rcar-mfis.c | 44 +++++++++++++++++++++++++++++++--
1 file changed, 42 insertions(+), 2 deletions(-)
diff --git a/drivers/soc/renesas/rcar-mfis.c b/drivers/soc/renesas/rcar-mfis.c
index b334b35306ae..3435c3e16198 100644
--- a/drivers/soc/renesas/rcar-mfis.c
+++ b/drivers/soc/renesas/rcar-mfis.c
@@ -41,6 +41,7 @@ struct mfis_info {
unsigned int mb_reg_comes_from_dt:1;
unsigned int mb_tx_uses_eicr:1;
unsigned int mb_channels_are_unidir:1;
+ u32 (*mb_calc_reg)(u32 chan_num, bool tx_uses_eicr, bool is_only_rx);
};
struct mfis_chan_priv {
@@ -155,6 +156,35 @@ static const struct mbox_chan_ops mfis_iicr_ops = {
.last_tx_done = mfis_mb_iicr_last_tx_done,
};
+static u32 mfis_mb_r8a779g0_calc_reg(u32 chan_num, bool tx_uses_eicr, bool is_only_rx)
+{
+ unsigned int i, k;
+ u32 reg;
+
+ i = chan_num & 3;
+ k = chan_num >> 2;
+
+ if (is_only_rx) {
+ if (k < 2)
+ reg = 0x9404 + 0x1020 * k + 0x08 * i;
+ else
+ reg = 0xb504 + 0x08 * i;
+ } else {
+ if (k < 2)
+ reg = 0x1400 + 0x1008 * i + 0x20 * k;
+ else
+ reg = 0x1500 + 0x1008 * i;
+ }
+
+ return reg;
+}
+
+static u32 mfis_mb_r8a78000_calc_reg(u32 chan_num, bool tx_uses_eicr, bool is_only_rx)
+{
+ return (tx_uses_eicr ^ is_only_rx) ? MFIS_X5H_EICR(chan_num) :
+ MFIS_X5H_IICR(chan_num);
+}
+
static struct mbox_chan *mfis_mb_of_xlate(struct mbox_controller *mbox,
const struct of_phandle_args *sp)
{
@@ -191,8 +221,7 @@ static struct mbox_chan *mfis_mb_of_xlate(struct mbox_controller *mbox,
}
chan_priv = chan->con_priv;
- chan_priv->reg = (tx_uses_eicr ^ is_only_rx) ? MFIS_X5H_EICR(chan_num) :
- MFIS_X5H_IICR(chan_num);
+ chan_priv->reg = priv->info->mb_calc_reg(chan_num, tx_uses_eicr, is_only_rx);
if (!priv->info->mb_channels_are_unidir || is_only_rx) {
char irqname[8];
@@ -307,11 +336,19 @@ static int mfis_probe(struct platform_device *pdev)
return mfis_mb_probe(priv);
}
+static const struct mfis_info mfis_info_r8a779g0 = {
+ .unprotect_mask = 0x0000ffff,
+ .mb_num_channels = 12,
+ .mb_channels_are_unidir = true,
+ .mb_calc_reg = mfis_mb_r8a779g0_calc_reg,
+};
+
static const struct mfis_info mfis_info_r8a78000 = {
.unprotect_mask = 0x000fffff,
.mb_num_channels = 64,
.mb_reg_comes_from_dt = true,
.mb_channels_are_unidir = true,
+ .mb_calc_reg = mfis_mb_r8a78000_calc_reg,
};
static const struct mfis_info mfis_info_r8a78000_scp = {
@@ -319,9 +356,12 @@ static const struct mfis_info mfis_info_r8a78000_scp = {
.mb_num_channels = 32,
.mb_tx_uses_eicr = true,
.mb_channels_are_unidir = true,
+ .mb_calc_reg = mfis_mb_r8a78000_calc_reg,
};
static const struct of_device_id mfis_mfd_of_match[] = {
+ { .compatible = "renesas,r8a779g0-mfis", .data = &mfis_info_r8a779g0, },
+ { .compatible = "renesas,r8a779h0-mfis", .data = &mfis_info_r8a779g0, },
{ .compatible = "renesas,r8a78000-mfis", .data = &mfis_info_r8a78000, },
{ .compatible = "renesas,r8a78000-mfis-scp", .data = &mfis_info_r8a78000_scp, },
{}
--
2.51.0
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: soc: renesas: mfis: add R-Car V4H/V4M support
2026-05-19 7:56 ` [PATCH v2 1/2] dt-bindings: " Wolfram Sang
@ 2026-05-19 17:31 ` Conor Dooley
2026-05-29 8:13 ` Geert Uytterhoeven
1 sibling, 0 replies; 7+ messages in thread
From: Conor Dooley @ 2026-05-19 17:31 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Geert Uytterhoeven, Magnus Damm, Rob Herring,
Krzysztof Kozlowski, Conor Dooley, devicetree
[-- Attachment #1: Type: text/plain, Size: 75 bytes --]
Acked-by: Conor Dooley <conor.dooley@microchip.com>
pw-bot: not-applicable
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 228 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 0/2] soc: renesas: mfis: add R-Car V4H/V4M support
2026-05-19 7:56 [PATCH v2 0/2] soc: renesas: mfis: add R-Car V4H/V4M support Wolfram Sang
2026-05-19 7:56 ` [PATCH v2 1/2] dt-bindings: " Wolfram Sang
2026-05-19 7:56 ` [PATCH v2 2/2] " Wolfram Sang
@ 2026-05-29 7:07 ` Wolfram Sang
2 siblings, 0 replies; 7+ messages in thread
From: Wolfram Sang @ 2026-05-29 7:07 UTC (permalink / raw)
To: linux-renesas-soc
Cc: Conor Dooley, devicetree, Geert Uytterhoeven, Krzysztof Kozlowski,
Magnus Damm, Rob Herring
[-- Attachment #1: Type: text/plain, Size: 613 bytes --]
Hi Geert,
On Tue, May 19, 2026 at 09:56:17AM +0200, Wolfram Sang wrote:
> Here are the additions to the MFIS driver in -next to add V4H support.
> A full branch for testing with the SparrowHawk is here:
>
> git://git.kernel.org/pub/scm/linux/kernel/git/wsa/linux.git renesas/v4h/mfis
>
> To trigger the mailbox-test instances, I use:
>
> $ for f in /sys/kernel/debug/e6300*/message; do echo "Hallo $f!" > $f; done
>
> Looking forward to comments!
>
> Happy hacking,
>
> Wolfram
Any chance to get this into 7.2? All tags are there AFAICS.
Thanks and happy hacking,
Wolfram
[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 1/2] dt-bindings: soc: renesas: mfis: add R-Car V4H/V4M support
2026-05-19 7:56 ` [PATCH v2 1/2] dt-bindings: " Wolfram Sang
2026-05-19 17:31 ` Conor Dooley
@ 2026-05-29 8:13 ` Geert Uytterhoeven
1 sibling, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2026-05-29 8:13 UTC (permalink / raw)
To: Wolfram Sang
Cc: linux-renesas-soc, Magnus Damm, Rob Herring, Krzysztof Kozlowski,
Conor Dooley, devicetree
On Tue, 19 May 2026 at 09:56, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> The above SoCs have only 12 mailboxes and do not have an extra register
> space for mailboxes. Everything is contained in the common register set.
> In addition to adding these SoCs, the other entries get updated to
> enforce 2 register spaces and their specific number of interrupts.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v7.2.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH v2 2/2] soc: renesas: mfis: add R-Car V4H/V4M support
2026-05-19 7:56 ` [PATCH v2 2/2] " Wolfram Sang
@ 2026-05-29 8:14 ` Geert Uytterhoeven
0 siblings, 0 replies; 7+ messages in thread
From: Geert Uytterhoeven @ 2026-05-29 8:14 UTC (permalink / raw)
To: Wolfram Sang; +Cc: linux-renesas-soc, Magnus Damm
On Tue, 19 May 2026 at 09:56, Wolfram Sang
<wsa+renesas@sang-engineering.com> wrote:
> The above SoCs have a weird register layout for the mailbox registers.
> So, encapsulate register offset calculation in a per-SoC callback. Other
> than that, only a separate config struct and compatibles are needed.
>
> Signed-off-by: Wolfram Sang <wsa+renesas@sang-engineering.com>
> Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
Reviewed-by: Geert Uytterhoeven <geert+renesas@glider.be>
i.e. will queue in renesas-devel for v7.2.
Gr{oetje,eeting}s,
Geert
--
Geert Uytterhoeven -- There's lots of Linux beyond ia32 -- geert@linux-m68k.org
In personal conversations with technical people, I call myself a hacker. But
when I'm talking to journalists I just say "programmer" or something like that.
-- Linus Torvalds
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2026-05-29 8:14 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-05-19 7:56 [PATCH v2 0/2] soc: renesas: mfis: add R-Car V4H/V4M support Wolfram Sang
2026-05-19 7:56 ` [PATCH v2 1/2] dt-bindings: " Wolfram Sang
2026-05-19 17:31 ` Conor Dooley
2026-05-29 8:13 ` Geert Uytterhoeven
2026-05-19 7:56 ` [PATCH v2 2/2] " Wolfram Sang
2026-05-29 8:14 ` Geert Uytterhoeven
2026-05-29 7:07 ` [PATCH v2 0/2] " Wolfram Sang
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox