Adding DMA functionality for SPI and I2C in RPi

Mudit Jain muditjain18011995 at gmail.com
Wed Jul 6 13:25:32 UTC 2016


Hi,

I have started this mail thread for discussions regarding the addition of
DMA in the RTEMS Mailine for RPI and subsequently being used by other
peripherals including SPI and I2C

The present implementation of the SPI uses the libi2c API and the present
I2C implementation used the Linux I2C userspace API.

For adding DMA to RTEMS Mailine I'm presently thinking of providing the
following API interface
int bcm_dma_allocate(int req_ch);
int bcm_dma_free(int ch);
int bcm_dma_setup_intr(int ch, void (*func)(int, void *), void *arg);
int bcm_dma_setup_src(int ch, int dreq, int inc_addr, int width);
int bcm_dma_setup_dst(int ch, int dreq, int inc_addr, int width);
int bcm_dma_start(int ch, vm_paddr_t src, vm_paddr_t dst, int len);
uint32_t bcm_dma_length(int ch);

following the DMA driver in FreeBSD. From browsing the code, the major
change will be to use  *BCM2835_REG *instead of the *bus* functions. This
API can then be used in both SPI and I2C.

Is this an acceptable solution ?

This deliverable has to be tested on a peripherals for both SPI and I2C. It
would be great if people could comment if they have some peripherals in
mind.

For the SD card, I have uploaded the code that I have ported to github.
However, I'm facing the similar issue as deval, not able to view the logs
even after adding, rtems_bsd_setlogpriority("debug") in the init function.

Thanks
Mudit
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.rtems.org/pipermail/devel/attachments/20160706/a3637c8c/attachment.html>


More information about the devel mailing list