diff options
| author | Krzysztof Kozlowski <krzk@kernel.org> | 2026-06-09 13:51:41 +0300 |
|---|---|---|
| committer | Krzysztof Kozlowski <krzk@kernel.org> | 2026-06-09 13:51:41 +0300 |
| commit | a451dd4b4312cb64c4598e980fdfad00e25ba4e9 (patch) | |
| tree | 07aeb8473b179e6bb4c902248e019fbef3f7fc0b | |
| parent | adbd66a8f7cf05c5ba3adbbdbb8c5a54993e4028 (diff) | |
| parent | b4d41ffa750fc3403a4076d17090589d000f13ff (diff) | |
| download | linux-a451dd4b4312cb64c4598e980fdfad00e25ba4e9.tar.xz | |
Merge tag 'renesas-drivers-for-v7.2-tag2' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel into soc/drivers
Renesas driver updates for v7.2 (take two)
- Identify the R-Car M3Le SoC,
- Add Multifunctional Interface (MFIS) support for R-Car V4H and V4M.
* tag 'renesas-drivers-for-v7.2-tag2' of https://git.kernel.org/pub/scm/linux/kernel/git/geert/renesas-devel:
soc: renesas: rcar-mfis: Add R-Car V4H/V4M support
dt-bindings: soc: renesas: mfis: Add R-Car V4H/V4M support
soc: renesas: Identify R-Car R8A779MD M3Le SoC
Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
| -rw-r--r-- | Documentation/devicetree/bindings/soc/renesas/renesas,r8a78000-mfis.yaml | 38 | ||||
| -rw-r--r-- | drivers/soc/renesas/rcar-mfis.c | 44 | ||||
| -rw-r--r-- | drivers/soc/renesas/renesas-soc.c | 1 |
3 files changed, 79 insertions, 4 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 @@ -60,9 +64,33 @@ allOf: 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: + contains: 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$" 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, }, {} diff --git a/drivers/soc/renesas/renesas-soc.c b/drivers/soc/renesas/renesas-soc.c index dedb2a0be586..18acca73064c 100644 --- a/drivers/soc/renesas/renesas-soc.c +++ b/drivers/soc/renesas/renesas-soc.c @@ -361,6 +361,7 @@ static const struct of_device_id renesas_socs[] __initconst __maybe_unused = { { .compatible = "renesas,r8a77965", .data = &soc_rcar_m3_n }, { .compatible = "renesas,r8a779m4", .data = &soc_rcar_m3_n }, { .compatible = "renesas,r8a779m5", .data = &soc_rcar_m3_n }, + { .compatible = "renesas,r8a779md", .data = &soc_rcar_m3_n }, #endif #ifdef CONFIG_ARCH_R8A77970 { .compatible = "renesas,r8a77970", .data = &soc_rcar_v3m }, |
