Skip to content
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

[DMA] add automatic trigger mode #618

Merged
merged 6 commits into from
May 19, 2023
Merged

[DMA] add automatic trigger mode #618

merged 6 commits into from
May 19, 2023

Conversation

stnolting
Copy link
Owner

This PR adds an automatic transfer trigger to the processor's DMA controller.

Instead of starting a transfer by writing to a specific DMA register, the DMA can be configured to start a previously programmed transfer when a specific processor-internal module issues an interrupt request.

Exemplary Use Case

The TRNG (true-random number generator) is configured with a FIFO depth of 64 entries using the according generic. The application code configures the TRNG interrupt to fire if the FIFO is completely full - indicating that 64 bytes of entropy have been sampled.

A DMA transfer is programmed to read bytes (constant address) from TRNG (= the entropy data) and to store it to a 64-bytes array in memory (incrementing address). The automatic trigger mode is used to start the transfer when the TRNG sends the "FIFO full" interrupt.

Enabling just the DMA interrupt in the CPU's mie CSR will trigger an interrupt when the DMA transfer is complete (but not when the TRNG issues its FIFO full interrupt).

@stnolting stnolting added enhancement New feature or request HW hardware-related labels May 18, 2023
@stnolting stnolting self-assigned this May 18, 2023
add example using the new automatic trigger mode
@stnolting stnolting changed the title [DMA] add automatic trigger option [DMA] add automatic trigger mode May 18, 2023
@stnolting stnolting marked this pull request as ready for review May 19, 2023 06:10
@stnolting stnolting merged commit 8ab4ca0 into main May 19, 2023
8 checks passed
@stnolting stnolting deleted the auto_dma branch May 19, 2023 12:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request HW hardware-related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant