Changes between Version 2 and Version 3 of dma_driver


Ignore:
Timestamp:
Oct 8, 2014, 5:57:50 PM (10 years ago)
Author:
alain
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • dma_driver

    v2 v3  
    1919The SEG_DMA_BASE virtual address and PERI_CLUSTER_INCREMENT values must be defined in the hard_config.h file.
    2020
    21 The addressable registers map is defined [source:soft/giet_vm/giet_drivers/dma_driver.h here].
     21The addressable registers map, and the status possible values are defined [source:soft/giet_vm/giet_drivers/dma_driver.h here].
     22
     23
     24==   Low level access functions  ==
     25
     26 === unsigned int '''_dma_init'''( unsigned int cluster_xy,  unsigned int channel_id ) ===
     27This function disables interrupts for one DMA channel in one cluster.As the GIET-VM uses a polling policy to detect DMA transfer completion,
     28the DMA component initialisation must disable interrupts.
     29Returns 0 if success, returns > 0 if error.
     30
     31 === unsigned int '''_dma_reset'''( unsigned int  cluster_xy,  unsigned int  channel_id ) ===
     32This function re-initialises one DMA channel in one cluster after transfer completion. It actually forces the channel to return in IDLE state.
     33
     34 === unsigned int '''_dma_get_status'''( unsigned int  cluster_xy,   unsigned int  channel_id );
     35This function returns the status of a DMA channel in a given cluster.
     36
     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 ) ===
     38This 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
     40==  High level access functions ==
     41
     42 === void '''_dma_copy'''( unsigned int cluster_xy,  unsigned int channel_id,  unsigned int dst_vaddr,  unsigned int src_vaddr,    unsigned int size ) ===
     43This function copies a source memory buffer to a destination memory buffer, using virtual addresses. This requires a virtual to physical address translation.
     44This blocking function is supposed to be used by the kernel only, and uses a polling policy on DMA_STATUS register to detect completion.
     45Therefore, the DMA_IRQ is NOT used.
     46The source and destination buffers base addresses must be word aligned, and the buffer's size must be multiple of 4.
     47In case of error (buffer unmapped, unaligned, or DMA_STATUS error), an error message is displayed on TTY0, and system crash.
     48
     49 === void '''_dma_physical_copy'''( unsigned int cluster_xy,  unsigned int channel_id,  unsigned long long dst_paddr,  unsigned long long src_paddr,   unsigned int size ) ===
     50This function copies a source memory buffer to a destination memory buffer, using physical addresses.
     51This blocking function is supposed to be used by the kernel only, and uses a polling policy on DMA_STATUS register to detect completion.
     52Therefore, the DMA_IRQ is NOT used.
     53The source and destination buffers base addresses must be word aligned, and the buffer's size must be multiple of 4.
     54In case of error (buffer unmapped, unaligned, or DMA_STATUS error), an error message is displayed on TTY0, and system crash.
     55
     56 === void _dma_isr( unsigned int irq_type,  unsigned int irq_id,  unsigned int channel ) ===
     57This 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.
     58
     59