Skip to content

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 <[email protected]>
@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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
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 <[email protected]>
Improve DMA performance by increasing the burst size to 8.

Signed-off-by: Phil Elwell <[email protected]>
@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).

@pelwell pelwell merged commit b84f979 into raspberrypi:rpi-6.12.y Aug 19, 2025
12 checks passed
popcornmix added a commit to raspberrypi/firmware that referenced this pull request Aug 20, 2025
kernel: INA260 driver support 70fb84a109c639637f0636281dbdb21ed8ffb000 upstream
See: raspberrypi/linux#7004

kernel: drivers: media: pisp_be: Fix for job queue removal in stop_streaming
See: raspberrypi/linux#6999

kernel: Improve PIO DMA performance
See: raspberrypi/linux#6994
popcornmix added a commit to raspberrypi/rpi-firmware that referenced this pull request Aug 20, 2025
kernel: INA260 driver support 70fb84a109c639637f0636281dbdb21ed8ffb000 upstream
See: raspberrypi/linux#7004

kernel: drivers: media: pisp_be: Fix for job queue removal in stop_streaming
See: raspberrypi/linux#6999

kernel: Improve PIO DMA performance
See: raspberrypi/linux#6994
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