Ignore:
Timestamp:
Mar 10, 2015, 2:58:59 PM (9 years ago)
Author:
alain
Message:

Redefinition of the driver for the vci_mwmr_dma component.

File:
1 edited

Legend:

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

    r263 r518  
    44// Author   : alain greiner
    55// Copyright (c) UPMC-LIP6
    6 ///////////////////////////////////////////////////////////////////////////////////
     6///////////////////////////////////////////////////////////////////////////////
     7// The mwr_driver.c and mwr_driver.h files are part ot the GIET-VM OS.
     8// This driver supports the SoCLib vci_mwmr_dma component.
     9//
     10// It can exist several MWMR_DMA controlers in the architecture
     11// (one per cluster), and each controller can contain several ports.
     12// Each port defines a TO_COPROC or FROM_COPROC communication channel.
     13// Each channel can be configured to run in one of three predefined modes
     14// (MWMR / DMA_IRQ / DMA_NO_IRQ).
     15// The MWMR_DMA controler is a private ressource, allocated to a given task.
     16//
     17// The virtual base address of the segment associated to the coprocessor
     18// addressable registers is:
     19//   SEG_MWR_BASE + cluster_xy*PERI_CLUSTER_INCREMENT
     20//
     21// The virtual base address of the segments associated to a channel is:
     22//   SEG_MWR_BASE +
     23//   cluster_xy * PERI_CLUSTER_INCREMENT +
     24//   4 * CHANNEL_SPAN * (channel+1)
     25//
     26// The SEG_MWR_BASE virtual address mus be defined in the hard_config.h file.
     27///////////////////////////////////////////////////////////////////////////////
    728
    829#ifndef _GIET_MWR_DRIVERS_H_
    930#define _GIET_MWR_DRIVERS_H_
    1031
    11 ///////////////////////////////////////////////////////////////////////////////////
     32///////////////////////////////////////////////////////////////////////////////
    1233// MWMR controler registers offsets
    13 ///////////////////////////////////////////////////////////////////////////////////
     34///////////////////////////////////////////////////////////////////////////////
    1435
    15 enum SoclibMwmrRegisters
     36enum MwmrDmaRegisters
    1637{
    17     MWMR_IOREG_MAX = 16,
    18     MWMR_RESET = MWMR_IOREG_MAX,
    19     MWMR_CONFIG_FIFO_WAY,
    20     MWMR_CONFIG_FIFO_NO,
    21     MWMR_CONFIG_STATUS,
    22     MWMR_CONFIG_DEPTH,
    23     MWMR_CONFIG_BUFFER_ADDR,
    24     MWMR_CONFIG_RUNNING,
    25     MWMR_CONFIG_WIDTH,
    26     MWMR_CONFIG_DATA,
    27     MWMR_CONFIG_EXT,
    28     /***/
    29     MWMR_SPAN,
     38    CHANNEL_BUFFER_LSB   = 0,     // Data buffer paddr 32 LSB bits
     39    CHANNEL_BUFFER_MSB   = 1,     // Data buffer paddr extension
     40    CHANNEL_MWMR_LSB     = 2,     // MWMR descriptor paddr 32 LSB bits
     41    CHANNEL_MWMR_MSB     = 3,     // MWMR descriptor paddr extension
     42    CHANNEL_LOCK_LSB     = 4,     // MWMR lock paddr 32 LSB bits
     43    CHANNEL_LOCK_MSB     = 5,     // MWMR lock paddr extension
     44    CHANNEL_WAY          = 6,     // TO_COPROC / FROMCOPROC         (Read-only)
     45    CHANNEL_MODE         = 7,     // MWMR / DMA / DMA_IRQ
     46    CHANNEL_SIZE         = 8,     // Data Buffer size (bytes)
     47    CHANNEL_RUNNING      = 9,     // channel running   
     48    CHANNEL_STATUS       = 10,    // channel FSM state              (Read-Only)
     49    CHANNEL_INFO         = 11,    // STS | CFG | FROM | TO          (Read-Only)
     50    //
     51    CHANNEL_SPAN         = 16,
    3052};
    3153
    32 enum SoclibMwmrWay
    33 {
    34     MWMR_TO_COPROC,
    35     MWMR_FROM_COPROC,
    36 };
     54///////////////////////////////////////////////////////////////////////////////
     55//           Low-level access functions
     56///////////////////////////////////////////////////////////////////////////////
    3757
    38 ///////////////////////////////////////////////////////////////////////////////////
    39 // MWMR controller access functions
    40 ///////////////////////////////////////////////////////////////////////////////////
     58extern void _mwr_set_channel_register( unsigned int cluster_xy,
     59                                       unsigned int channel,
     60                                       unsigned int index,
     61                                       unsigned int value );
    4162
    42 extern unsigned int _mwr_hw_init( unsigned int           cluster_xy,
    43                                   unsigned int           port_id,
    44                                   unsigned int           from_coproc,
    45                                   unsigned long long     channel_pbase);
     63extern unsigned int _mwr_get_channel_register( unsigned int cluster_xy,
     64                                               unsigned int channel,
     65                                               unsigned int index );
    4666
    47 ///////////////////////////////////////////////////////////////////////////////////
     67extern void _mwr_set_coproc_register( unsigned int cluster_xy,
     68                                      unsigned int index,
     69                                      unsigned int value );
    4870
     71extern unsigned int _mwr_get_coproc_register( unsigned int cluster_xy,
     72                                              unsigned int index );
    4973
     74///////////////////////////////////////////////////////////////////////////////
     75//            Interrupt Service Routine
     76///////////////////////////////////////////////////////////////////////////////
     77
     78extern void _mwr_isr( unsigned int irq_type,
     79                      unsigned int irq_id,
     80                      unsigned int channel );
    5081#endif
    5182
Note: See TracChangeset for help on using the changeset viewer.