Ignore:
Timestamp:
Jun 10, 2014, 12:33:23 PM (10 years ago)
Author:
alain
Message:

All drivers have been modified to use only the information
contained in the hard_config.h file

File:
1 edited

Legend:

Unmodified
Added
Removed
  • soft/giet_vm/giet_drivers/dma_driver.c

    r313 r320  
    1818// there is no lock protecting exclusive access to the channel.
    1919// As the kernel uses a polling policy on the DMA_STATUS register to detect
    20 // transfer completion, the DMA IRQ is not used, and there is no DMA_ISR.
     20// transfer completion, the DMA IRQ is not used.
     21//
     22// The virtual base address of the segment associated to a channel is:
     23//    SEG_DMA_BASE + cluster_xy * vseg_cluster_increment + DMA_SPAN * channel_id
     24//
     25// The SEG_DMA_BASE virtual address mus be defined in the hard_config.h file.
    2126////////////////////////////////////////////////////////////////////////////////////
    22 // The virtual base address of the segment associated to a channel is:
    23 //
    24 //    seg_dma_base + cluster_xy * vseg_cluster_increment + DMA_SPAN * channel_id
    25 //
    26 ////////////////////////////////////////////////////////////////////////////////////
    2727
    2828#include <giet_config.h>
     29#include <hard_config.h>
    2930#include <dma_driver.h>
    30 #include <utils.h>
    3131#include <tty_driver.h>
    3232#include <vmem.h>
     33#include <utils.h>
    3334
    3435#if !defined(X_SIZE)
     
    5051#if !defined(NB_DMA_CHANNELS)
    5152# error: You must define NB_DMA_CHANNELS in the hard_config.h file
     53#endif
     54
     55#if !defined(SEG_DMA_BASE)
     56# error: You must define SEG_DMA_BASE in the hard_config.h file
     57#endif
     58
     59#if !defined(VSEG_CLUSTER_INCREMENT)
     60# error: You must define VSEG_CLUSTER_INCREMENT in the hard_config.h file
    5261#endif
    5362
     
    7382
    7483    // compute DMA base address
    75     unsigned int* dma_address = (unsigned int*) ((unsigned int)&seg_dma_base +
    76                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
     84    unsigned int* dma_address = (unsigned int*) ( SEG_DMA_BASE +
     85                                (cluster_xy * VSEG_CLUSTER_INCREMENT) );
    7786
    7887    // disable interrupt for selected channel
     
    101110
    102111    // compute DMA base address
    103     unsigned int* dma_address = (unsigned int*) ((unsigned int)&seg_dma_base +
    104                                 (cluster_xy * (unsigned int)&vseg_cluster_increment));
     112    unsigned int* dma_address = (unsigned int*) ( SEG_DMA_BASE +
     113                                (cluster_xy * VSEG_CLUSTER_INCREMENT) );
    105114
    106115    // reset selected channel
     
    128137
    129138    // compute DMA base address
    130     unsigned int * dma_address = (unsigned int *) ((unsigned int)&seg_dma_base +
    131                                  (cluster_xy * (unsigned int)&vseg_cluster_increment));
     139    unsigned int * dma_address = (unsigned int *) ( SEG_DMA_BASE +
     140                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
    132141
    133142    // get selected channel status
     
    159168
    160169    // compute DMA base address
    161     unsigned int * dma_address = (unsigned int *) ((unsigned int)&seg_dma_base +
    162                                  (cluster_xy * (unsigned int)&vseg_cluster_increment));
     170    unsigned int * dma_address = (unsigned int *) ( SEG_DMA_BASE +
     171                                 (cluster_xy * VSEG_CLUSTER_INCREMENT) );
    163172
    164173    // selected channel configuration and lauching
     
    304313} // end _dma_copy
    305314
     315///////////////////////////////////////////////////////////////////////////////
     316// This ISR handles the IRQ generated by a DMA channel.
     317///////////////////////////////////////////////////////////////////////////////
     318void _dma_isr( unsigned int irq_type,
     319               unsigned int irq_id,
     320               unsigned int channel )
     321{
     322    _printf("\n[GIET ERROR] _dma_isr() not implemented\n");
     323    _exit();
     324}
     325
    306326
    307327
Note: See TracChangeset for help on using the changeset viewer.