Re: [PATCH v4 06/12] ASoC: rsnd: Add RZ/G3E DMA address calculation support

Kuninori Morimoto
2026-04-10T02:06:06Z

Hi John

> RZ/G3E has different DMA register base addresses and offset
> calculations compared to R-Car platforms.
>
> Add dedicated rsnd_rzg3e_dma_addr() function with dispatch from
> rsnd_dma_addr(), following the existing per-generation pattern.
>
> Signed-off-by: John Madieu <john.madieu.xa@bp.renesas.com>
> ---
(snip)
> +struct rsnd_dma_addr {
> + dma_addr_t out_addr;
> + dma_addr_t in_addr;
> +};
> +
> +struct rsnd_dma_addr_dir {
> + struct rsnd_dma_addr capture[3];
> + struct rsnd_dma_addr playback[3];
> +};
> +
> +struct rsnd_dma_addr_map {
> + struct rsnd_dma_addr_dir src;
> + struct rsnd_dma_addr_dir ssi;
> + struct rsnd_dma_addr_dir ssiu;
> +};
> +
> +static dma_addr_t
> +rsnd_dma_addr_lookup(struct rsnd_dai_stream *io,
> + struct rsnd_mod *mod,
> + struct rsnd_priv *priv,
> + const struct rsnd_dma_addr_map *map,
> + int is_play, int is_from)
> +{
> + struct device *dev = rsnd_priv_to_dev(priv);
> + int is_ssi = !!(rsnd_io_to_mod_ssi(io) == mod) ||
> + !!(rsnd_io_to_mod_ssiu(io) == mod);
> + int use_src = !!rsnd_io_to_mod_src(io);
> + int use_cmd = !!rsnd_io_to_mod_dvc(io) ||
> + !!rsnd_io_to_mod_mix(io) ||
> + !!rsnd_io_to_mod_ctu(io);
> + int id = rsnd_mod_id(mod);
> + const struct rsnd_dma_addr_dir *dir;
> + const struct rsnd_dma_addr *addr;
> +
> + /* it shouldn't happen */
> + if (use_cmd && !use_src)
> + dev_err(dev, "DVC is selected without SRC\n");
> +
> + /* use SSIU or SSI? */
> + if (is_ssi && rsnd_ssi_use_busif(io))
> + is_ssi++;
> +
> + dev_dbg(dev, "dma%d addr : is_ssi=%d use_src=%d use_cmd=%d\n",
> + id, is_ssi, use_src, use_cmd);
> +
> + switch (is_ssi) {
> + case 2:
> + dir = &map->ssiu;
> + break;
> + case 1:
> + dir = &map->ssi;
> + break;
> + default:
> + dir = &map->src;
> + break;
> + }
> +
> + addr = is_play ? &dir->playback[use_src + use_cmd]
> + : &dir->capture[use_src + use_cmd];
> +
> + return is_from ? addr->out_addr : addr->in_addr;
> +}

Thank you for adding new struct and look function !!
It is easy to read !

But I think exising gen2 map and new lookup should be done by separated
as preparation-patch. And add new RZ/G3E feature as new-patch.

> /*
> * Common DMAC Interface
> */
> @@ -499,7 +562,16 @@ static struct rsnd_mod_ops rsnd_dmapp_ops = {
> * SSIU: 0xec541000 / 0xec100000 / 0xec100000 / 0xec400000 / 0xec400000
> * SCU : 0xec500000 / 0xec000000 / 0xec004000 / 0xec300000 / 0xec304000
> * CMD : 0xec500000 / / 0xec008000 0xec308000
> + *
> + * ex) G3E case
> + * mod / DMAC in / DMAC out / DMAC PP in / DMAC pp out
> + * SSI : 0x13C31000 / 0x13C40000 / 0x13C40000
> + * SSIU: 0x13C31000 / 0x13C40000 / 0x13C40000 / 0xEC400000 / 0xEC400000
> + * SCU : 0x13C00000 / 0x13C10000 / 0x13C14000 / 0xEC300000 / 0xEC304000
> + * CMD : 0x13C00000 / / 0x13C18000 0xEC308000

This G3E comment should go-to at rzg3e_dma_addr(), not here

> if ((id == 9) && (busif >= 4))
> - dev_err(dev, "This driver doesn't support SSI%d-%d, so far",
> - id, busif);
> + dev_err(dev,
> + "This driver doesn't support SSI%d-%d, so far", id, busif);

What was changed ?

Thank you for your help !!

Best regards
---
Kuninori Morimoto