DMA for RPi

Mudit Jain muditjain18011995 at
Sun Jul 31 11:14:46 UTC 2016

Hi all,

I have added code for DMA support for RPi. Here is the link for the same :

GitHub Link :

Kindly review the code and provide comments to improve the same.

Questions :
If someone could specifically look at the portion in the rpi_dma_init
function, marked by FIXME. I require some guidance to ascertain the logic
implemented is right.

Notes :

1. The basic idea is to control a particular channel using a control block
structure. The structure is populated and the address of the same in
written into a particular register corresponding to that channel.

2. The software context is primarily a array of structures [ channel
structures ]. The control block is a member of the channel struct and is
used to control that particular channel.

3. Important thing to note is that the DMA controller is directly connected
to the peripherals, so it deals with real address spaces. Thus cache
coherency is required when you consider changing addresses between
different address spaces.

4. As mentioned above, the logic is taken from the FreeBSD DMA controller
for BCM2835.

5.Instead of adding the entire dma_tag API, I have added relevant sections
which offer the same utility. For mutex, I have used, the struct Atomic
flag in RTEMS.

6. I have run uncrustify on the two files to account for the code
conventions and added comments to increase readability. The files are added
to the build process and builds without any errors.

7. The PAGE_SIZE is taken as 4096.

8. *rtems_cache_flush_multiple_data_lines, rtems_cache_coherent_allocate *-
These functions in RTEMS are used to maintain cache coherency.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <>

More information about the devel mailing list