Re: [PATCh v3 2/2] dma: sh: rz-dmac: Add DMA ACK signal routing support

From: Frank Li

Date: Thu May 07 2026 - 14:49:30 EST


On Thu, Apr 02, 2026 at 06:22:12PM +0200, John Madieu wrote:
> Some peripherals on RZ/G3E SoCs (SSIU, SPDIF, SCU/SRC, DVC, PFC)
> require explicit ACK signal routing through the ICU for level-based DMA
> handshaking.
>
> Rather than extending the DT binding with an optional second #dma-cells
> (which would require all DMA consumers to supply two cells even when ACK
> routing is not needed), derive the ACK signal number directly from the
> MID/RID request number using the linear mapping defined in RZ/G3E hardware
> manual Table 4.6-28:
>
> PFC external DMA pins (DREQ0..DREQ4):
> req_no 0x000-0x004 -> ACK No. 84-88
>
> SSIU BUSIFs (ssip00..ssip93):
> req_no 0x161-0x198 -> ACK No. 28-83
>
> SPDIF (CH0..CH2) + SCU SRC (sr0..sr9) + DVC (cmd0..cmd1):
> req_no 0x199-0x1b4 -> ACK No. 0-27
>
> ACK routing is programmed when a channel is prepared for transfer and
> cleared when the channel is released or the transfer times out, following
> the same pattern as MID/RID request routing.
>
> Signed-off-by: John Madieu <john.madieu.xa@xxxxxxxxxxxxxx>
> ---
>
> Changes:
>
> v3: No changes
>
> v2:
> - Drop DMA ACK second cell from DT specifier
> - Derive ACK signal number in-driver from MID/RID using arithmetic formulas
> per ICU Table 4.6-28 (3 linear peripheral groups)
>
> drivers/dma/sh/rz-dmac.c | 72 ++++++++++++++++++++++++++++++++++++++++
> 1 file changed, 72 insertions(+)
>
> static void rz_dmac_prepare_desc_for_memcpy(struct rz_dmac_chan *channel)
> {
> struct dma_chan *chan = &channel->vc.chan;
> @@ -431,6 +489,7 @@ static void rz_dmac_prepare_descs_for_slave_sg(struct rz_dmac_chan *channel)
> channel->lmdesc.tail = lmdesc;
>
> rz_dmac_set_dma_req_no(dmac, channel->index, channel->mid_rid);
> + rz_dmac_set_dma_ack_no(dmac, channel->index, channel->dmac_ack);

I am not familar with your hardware, why ACK folllow req immediately?
suppose ACK happen after transfer done.

If ACK need after req, why not add ack handle in rz_dmac_set_dma_req_no()
directly.

Frank

> --
> 2.25.1
>