[DMA] Initial DMA driver implementation
Description
We want to implement a standalone Direct Memory Access (DMA) driver. In the past we used hardcoded DMA allocations directly within drivers, this approach limited flexibility and introduced tightly coupled dependencies. Currently, we don’t use DMA in any drivers, but establishing a dedicated DMA driver now will allow us to reintroduce DMA more efficiently when needed.
Goals
- Dynamic DMA stream allocation system.
- Robust but simple API: Vulkan-like with config struct parameters.
Design Notes
API
The design of the API should begin from the analysis of potential usages of this driver, and then the driver designed around those use cases.
The API should be designed while being aware of the real-time constraints of the system, e.g. max wait time for a busy DMA stream to free up. Ideally no API call should be blocking without timeout.
Dynamic Allocation
Certain DMA streams on STM32 boards are mapped to specific peripherals, so our DMA driver must handle allocation dynamically while respecting these hardware constraints.
Optional: ways to reserve critical DMA streams statically.