Re: [PATCH v4 05/28] dmaengine: bcm2835: Support dma flags for multi-beat burst
From: Frank Li
Date: Wed Dec 02 2026 - 17:59:08 EST
On Fri, Nov 27, 2026 at 01:21:55PM +0100, Andrea della Porta wrote:
> From: Dom Cobley <popcornmix@xxxxxxxxx>
>
> Use bit 30 of the dreq value to enable multi-beat bursts on a channel.
> This improves DMA performance and is required for HDMI audio.
>
> Signed-off-by: Dom Cobley <popcornmix@xxxxxxxxx>
> Signed-off-by: Andrea della Porta <andrea.porta@xxxxxxxx>
> ---
> drivers/dma/bcm2835-dma.c | 12 ++++++++----
> 1 file changed, 8 insertions(+), 4 deletions(-)
>
> diff --git a/drivers/dma/bcm2835-dma.c b/drivers/dma/bcm2835-dma.c
> index 7bd1fbb2c36d..d65a93be5fa1 100644
> --- a/drivers/dma/bcm2835-dma.c
> +++ b/drivers/dma/bcm2835-dma.c
> @@ -165,6 +165,8 @@ struct bcm2835_desc {
> BCM2835_DMA_S_WIDTH : 0)
> #define WIDE_DEST(x) (((x) & BCM2835_DMA_FLAG_WIDE_DEST) ? \
> BCM2835_DMA_D_WIDTH : 0)
> +#define BURST_LENGTH(x) (((x) & BCM2835_DMA_FLAG_BURST) ? \
> + BCM2835_DMA_BURST_LENGTH(3) : 0)
look like burst length is 2bit, why only use at bit30 to controller it?
why not use dma_slave_config to set burst length?
Frank
>
> /* debug register bits */
> #define BCM2835_DMA_DEBUG_LAST_NOT_SET_ERR BIT(0)
> @@ -630,7 +632,8 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_memcpy(
> struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
> struct bcm2835_desc *d;
> u32 info = BCM2835_DMA_D_INC | BCM2835_DMA_S_INC |
> - WAIT_RESP(c->dreq) | WIDE_SOURCE(c->dreq) | WIDE_DEST(c->dreq);
> + WAIT_RESP(c->dreq) | WIDE_SOURCE(c->dreq) |
> + WIDE_DEST(c->dreq) | BURST_LENGTH(c->dreq);
> u32 extra = BCM2835_DMA_INT_EN;
> size_t max_len = bcm2835_dma_max_frame_length(c);
> size_t frames;
> @@ -661,8 +664,8 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_slave_sg(
> struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
> struct bcm2835_desc *d;
> dma_addr_t src = 0, dst = 0;
> - u32 info = WAIT_RESP(c->dreq) |
> - WIDE_SOURCE(c->dreq) | WIDE_DEST(c->dreq);
> + u32 info = WAIT_RESP(c->dreq) | WIDE_SOURCE(c->dreq) |
> + WIDE_DEST(c->dreq) | BURST_LENGTH(c->dreq);
> u32 extra = BCM2835_DMA_INT_EN;
> size_t frames;
>
> @@ -714,7 +717,8 @@ static struct dma_async_tx_descriptor *bcm2835_dma_prep_dma_cyclic(
> struct bcm2835_chan *c = to_bcm2835_dma_chan(chan);
> struct bcm2835_desc *d;
> dma_addr_t src, dst;
> - u32 info = WAIT_RESP(c->dreq) | WIDE_SOURCE(c->dreq) | WIDE_DEST(c->dreq);
> + u32 info = WAIT_RESP(c->dreq) | WIDE_SOURCE(c->dreq) |
> + WIDE_DEST(c->dreq) | BURST_LENGTH(c->dreq);
> u32 extra = 0;
> size_t max_len = bcm2835_dma_max_frame_length(c);
> size_t frames;
> --
> 2.51.0
>