Changes between Version 6 and Version 7 of dma_driver
- Timestamp:
- Mar 13, 2015, 2:47:28 PM (10 years ago)
Legend:
- Unmodified
- Added
- Removed
- Modified
-
dma_driver
v6 v7 5 5 The [source:soft/giet_vm/giet_drivers/dma_driver.c dma_driver.c] and [source:soft/giet_vm/giet_drivers/dma_driver.h dma_driver.h] files define the DMA driver. 6 6 7 This ''vci_multi_dma'' component is a multi-channels DMA controller, that can replicated in all clusters (''internal'' peripheral).7 This ''vci_multi_dma'' component is a multi-channels DMA controller, that can be replicated in all clusters (''internal'' peripheral). 8 8 9 9 There is (NB_CLUSTERS * NB_DMA_CHANNELS) channels, indexed by a global index: … … 23 23 == __Low level access functions__ == 24 24 25 === unsigned int '''_dma_init'''( unsigned int cluster_xy, unsigned int channel_id ) === 26 This function disables interrupts for one DMA channel in one cluster.As the GIET-VM uses a polling policy to detect DMA transfer completion, 27 the DMA component initialisation must disable interrupts. 28 Returns 0 if success, returns > 0 if error. 25 === void '''_dma_disable_irq'''( unsigned int cluster_xy, unsigned int channel_id ) === 26 This function disables interrupts for one DMA channel in one cluster. 27 In case of error (illegal DMA channel), an error message is displayed on TTY0, and system crash. 29 28 30 === unsigned int '''_dma_reset'''( unsigned int cluster_xy, unsigned int channel_id ) ===29 === void '''_dma_reset_channel'''( unsigned int cluster_xy, unsigned int channel_id ) === 31 30 This function re-initialises one DMA channel in one cluster after transfer completion. It actually forces the channel to return in IDLE state. 31 In case of error (illegal DMA channel), an error message is displayed on TTY0, and system crash. 32 32 33 === unsigned int '''_dma_get_status'''( unsigned int cluster_xy, unsigned int channel_id);33 === void '''_dma_get_status'''( unsigned int cluster_xy, unsigned int channel_id , unsigned int * status ); 34 34 This function returns the status of a DMA channel in a given cluster. 35 In case of error (illegal DMA channel), an error message is displayed on TTY0, and system crash. 35 36 36 === void '''_dma_start_transfer'''( unsigned int 37 === void '''_dma_start_transfer'''( unsigned int cluster_xy, unsigned int channel_id, unsigned long long dst_paddr, unsigned long long src_paddr, unsigned int size ) === 37 38 This function sets the physical address (including 64 bits extension) of the source and destination buffers for a DMA channel in a given cluster, and sets the transfer size to lauch the transfer. 39 In case of error (illegal DMA channel), an error message is displayed on TTY0, and system crash. 38 40 39 41 == __High level access functions__ == 40 42 41 43 === void '''_dma_copy'''( unsigned int cluster_xy, unsigned int channel_id, unsigned int dst_vaddr, unsigned int src_vaddr, unsigned int size ) === 42 This function copies a source memory buffer to a destination memory buffer, using virtual addresses. This requires a virtual to physical address translation. 43 This blocking function is supposed to be used by the kernel only, and uses a polling policy on DMA_STATUS register to detect completion. 44 Therefore, the DMA_IRQ is NOT used. 44 This function copies a source memory buffer to a destination memory buffer, using virtual addresses. This requires a virtual to physical address translation for both addresses. 45 45 The source and destination buffers base addresses must be word aligned, and the buffer's size must be multiple of 4. 46 46 In case of error (buffer unmapped, unaligned, or DMA_STATUS error), an error message is displayed on TTY0, and system crash. … … 54 54 55 55 === void '''_dma_isr'''( unsigned int irq_type, unsigned int irq_id, unsigned int channel ) === 56 This Interrupt Service Routine should not be used by the GIET_VM, because the DMA is only used by the kernel in the boot phase, with a polling strategy.56 This Interrupt Service Routine is not implemented yet, because the DMA is only used by the kernel in the boot phase, with a polling strategy. 57 57 58 58