Ignore:
Timestamp:
Nov 3, 2014, 10:53:00 AM (10 years ago)
Author:
alain
Message:

Introducing dynamic allocation of peripheral channel(TTY, NIC, TIM, CMA)
Removint the ICU driver : ICU component not supported anymore.
Removing the FBF driver.

File:
1 edited

Legend:

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

    r343 r437  
    55// Copyright (c) UPMC-LIP6
    66///////////////////////////////////////////////////////////////////////////////////
     7// The dma_driver.c and dma_driver.h files are part ot the GIET-VM nano-kernel.
     8// This driver supports the SoCLib vci_multi_dma component.
     9//
     10// It can exist several DMA controlers in the architecture (one per cluster),
     11// and each controller can contain several channels.
     12//
     13// There is  (NB_CLUSTERS * NB_DMA_CHANNELS) channels, indexed by a global index:
     14//        dma_id = cluster_xy * NB_DMA_CHANNELS + loc_id
     15//
     16// A DMA channel is a private ressource allocated to a given processor.
     17// It is exclusively used by the kernet to speedup data transfers, and
     18// there is no lock protecting exclusive access to the channel.
     19// As the kernel uses a polling policy on the DMA_STATUS register to detect
     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 * PERI_CLUSTER_INCREMENT + DMA_SPAN * channel_id
     24//
     25// The SEG_DMA_BASE virtual address mus be defined in the hard_config.h file.
     26////////////////////////////////////////////////////////////////////////////////////
    727
    828#ifndef _GIET_DMA_DRIVER_H_
     
    3757
    3858
    39 ///////////////////////////////////////////////////////////////////////////////////
    40 // Multi DMA variables and access functions  (vci_multi_dma)
    41 ///////////////////////////////////////////////////////////////////////////////////
     59///////////////////////////////////////////////////////////////////////////////
     60//                  low-level access functions 
     61///////////////////////////////////////////////////////////////////////////////
    4262
    43 // low level access functions
     63//////////////////////////////////////////////////////////////////////////////////
     64// This function disables interrupts for one DMA channel in one cluster.
     65// AS the GIET-VM uses a polling policy to detect DMA transfer completion,
     66// the DMA component initialisation must disable interrupts.
     67// Returns 0 if success, returns > 0 if error.
     68//////////////////////////////////////////////////////////////////////////////////
    4469extern unsigned int _dma_init( unsigned int cluster_xy,
    4570                               unsigned int channel_id );
    4671
     72//////////////////////////////////////////////////////////////////////////////////
     73// This function re-initialises one DMA channel in one cluster after transfer
     74// completion. It actually forces the channel to return in IDLE state.
     75//////////////////////////////////////////////////////////////////////////////////
    4776extern unsigned int _dma_reset( unsigned int  cluster_xy,
    4877                                unsigned int  channel_id );
    4978
     79//////////////////////////////////////////////////////////////////////////////////
     80// This function returns the status of a DMA channel in a given cluster
     81//////////////////////////////////////////////////////////////////////////////////
    5082extern unsigned int _dma_get_status( unsigned int  cluster_xy,
    5183                                     unsigned int  channel_id );
    5284
     85//////////////////////////////////////////////////////////////////////////////////
     86// This function sets the physical address (including 64 bits extension)
     87// for the source and destination buffers in a DMA channel in a given cluster
     88// and sets the transfer size to lauch the transfer.
     89//////////////////////////////////////////////////////////////////////////////////
    5390extern void _dma_start_transfer( unsigned int       cluster_xy,
    5491                                 unsigned int       channel_id,
     
    5794                                 unsigned int       size );
    5895
    59 // higher level access function
     96//////////////////////////////////////////////////////////////////////////////////
     97//                     higher level access function
     98//////////////////////////////////////////////////////////////////////////////////
     99
     100///////////////////////////////////////////////////////////////////////////////////
     101// This function copies a source memory buffer to a destination memory buffer,
     102// using directly physical addresses.
     103// This blocking function is supposed to be used by the kernel only,
     104// and uses a polling policy on DMA_STATUS register to detect completion.
     105// Therefore, the DMA_IRQ is NOT used.
     106// The source and destination buffers base addresses must be word aligned,
     107// and the buffer's size must be multiple of 4.
     108// In case of error (buffer unmapped, unaligned, or DMA_STATUS error), an error
     109// message is displayed on TTY0, and system crash.
     110///////////////////////////////////////////////////////////////////////////////////
    60111extern void _dma_physical_copy( unsigned int       cluster_xy,
    61112                                unsigned int       channel_id,
     
    64115                                unsigned int       size );
    65116
     117///////////////////////////////////////////////////////////////////////////////////
     118// This function copies a source memory buffer to a destination memory buffer,
     119// making virtual to physical address translation: the MMU should be activated.
     120// This blocking function is supposed to be used by the kernel only,
     121// and uses a polling policy on DMA_STATUS register to detect completion.
     122// Therefore, the DMA_IRQ is NOT used.
     123// The source and destination buffers base addresses must be word aligned,
     124// and the buffer's size must be multiple of 4.
     125// In case of error (buffer unmapped, unaligned, or DMA_STATUS error), an error
     126// message is displayed on TTY0, and system crash.
     127///////////////////////////////////////////////////////////////////////////////////
    66128extern void _dma_copy(  unsigned int cluster_xy,
    67129                        unsigned int channel_id,
     
    71133                        unsigned int size );
    72134
     135///////////////////////////////////////////////////////////////////////////////
     136// This ISR should not be used by the GIET_VM, because the DMA is only
     137// used by the kernel in the boot phase, with a polling strategy.
     138///////////////////////////////////////////////////////////////////////////////
    73139extern void _dma_isr( unsigned int irq_type,
    74140                      unsigned int irq_id,
    75141                      unsigned int channel );
    76142
    77 ///////////////////////////////////////////////////////////////////////////////////
    78143
    79144#endif
Note: See TracChangeset for help on using the changeset viewer.