<div dir="ltr"><div><div>Hi all,<br><br>I have added code for DMA support for RPi. Here is the link for the same : <br></div><br>GitHub Link : <a href="https://github.com/spark1729/rtems/commit/f328c4cd89b02977ccc5d7154b4af5ee9c424ba3">https://github.com/spark1729/rtems/commit/f328c4cd89b02977ccc5d7154b4af5ee9c424ba3</a><br><br></div><div>Kindly review the code and provide comments to improve the same. <br><br></div><div>Questions : <br></div><div>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.<br> <br></div><div>Notes :<br><br></div><div>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.<br><br></div><div>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. <br><br></div><div>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. <br><br></div><div>4. As mentioned above, the logic is taken from the FreeBSD DMA controller for BCM2835. <br><br>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. <br><br>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. <br><br></div><div>7. The PAGE_SIZE is taken as 4096. <br><br>8. <i>rtems_cache_flush_multiple_data_lines, rtems_cache_coherent_allocate </i>- These functions in RTEMS are used to maintain cache coherency.<br><br></div><div>Thanks <br></div><div>Mudit<br></div></div>