Skip to content

Improve PIO DMA performance #6994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 6 commits into
base: rpi-6.12.y
Choose a base branch
from
Open

Conversation

pelwell
Copy link
Contributor

@pelwell pelwell commented Aug 12, 2025

The RP1 DMA controller configuration makes channels 1 and 2 more capable than the others. Add a mechanism to reserve those channels for the PIO block. There may be other ways to improve the DMA bandwidth when talking to the PIO block, but this alone more than doubles the throughput.

If the DMA channel allocation fails, the relevant dma_configs entry
should be marked as no longer claimed, otherwise rp1_pio_sm_dma_free
will be called with an error number as a DMA channel pointer.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@P33M
Copy link
Contributor

P33M commented Aug 12, 2025

Channels 0 and 1 were configured with MSIZE=8, not 16. Those channels will only issue 8-beat bursts in response to a request, so there will be a mismatch in FIFO fill levels vs thresholds.

The DesignWare AXI DMAC IP can be configured with heterogeneous channel
parameters. Allow maximum burst length to be set per-channel by making
snps,axi-max-burst-len an array.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Add a mechanism to allow clients to prefer some DMA channels over
others. This is required to allow high-bandwidth clients to request
one of the two "heavy" channels, but could also be used to prevent
some clients from hogging all channels.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Give the DMAC property "snps,axi-max-burst-len" a value for each DMA
channel, encoding the fact that channels 1 and 2 are more capable
("heavy").

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
PIO benefits from increased DMA bandwidth when used with DMA channels
0 or 1, because they support longer bursts. Add DMA channel selection
attributes to prevent other users from claiming them.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
Improve DMA performance by increasing the burst size to 8.

Signed-off-by: Phil Elwell <phil@raspberrypi.com>
@pelwell
Copy link
Contributor Author

pelwell commented Aug 12, 2025

I knew that, on some level. Updated with the 16s changed to 8s, and with the rp1-pio code changes broken out into a separate commit (as it should always have been).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants