wiki:cma_driver

Version 3 (modified by alain, 10 years ago) (diff)

--

GIET-VM / CMA Driver

The cma_driver.c and cma_driver.h files define the CMA driver.

It supports the SOCLIB vci_chbuf_dma component, that is a multi channels, chained buffer DMA controller. This component can be used in conjonction with the SOCLIB vci_frame_buffer to display images, or with the SOCLIB vci_multi_nic controller to transfer both RX and TX packets between NIC and memory buffers.

The SEG_CMA_BASE address must be defined in the hard_config.h file

All accesses to CMA registers are done by the two _cma_set_register() and _cma_get_register() low-level functions, that are handling the extended physical addresses. The higher level access functions are defined in the fbf_driver? and nic_driver files.

The addressable registers map is defined here.

unsigned int _cma_get_register( unsigned int channel, unsigned int index )

This low_level function returns the value contained in register (index).

void _cma_set_register( unsigned int channel, unsigned int index, unsigned int value )

This low_level function returns the value contained in register (index).

void _cma_isr( unsigned int irq_type, unsigned int irq_id, unsigned int channel )

This Interrupt Service Routine handles the IRQ generated by a CMA channel.