source: soft/giet_vm/giet_drivers/cma_driver.h @ 674

Last change on this file since 674 was 612, checked in by bellefin, 9 years ago

CMA driver: update the channel status values of the CMA component

File size: 4.0 KB
RevLine 
[258]1///////////////////////////////////////////////////////////////////////////////////
2// File     : cma_driver.h
3// Date     : 01/11/2013
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
[437]7// The cma_driver.c and cma_driver.h files are part ot the GIET-VM kernel.
8// This driver supports the SocLib vci_chbuf_dma component, that is
9// a multi channels, chained buffer DMA controller.
10//
11// This component can be used in conjonction with the SocLib vci_frame_buffer
12// to display images, or with the SocLib vci_multi_nic controller to tranfer
13// RX or TX packets between NIC and memory buffers.
14//
15// The SEG_CMA_BASE address must be defined in the hard_config.h file
16//
17// All accesses to CMA registers are done by the two _cma_set_register()
18// and _cma_get_register() low-level functions, that are handling virtual
19// to physical extended addressing.
20//
21// The higher level access functions are defined in the fbf_driver
22// and nic_driver files.
23///////////////////////////////////////////////////////////////////////////////////
[258]24
25#ifndef _GIET_CMA_DRIVERS_H_
26#define _GIET_CMA_DRIVERS_H_
27
28///////////////////////////////////////////////////////////////////////////////////
[448]29//  CMA channel registers offsets
[258]30///////////////////////////////////////////////////////////////////////////////////
31
[448]32enum CMA_registers_e
[258]33{
34    CHBUF_RUN           = 0,    // write-only : channel activated
35    CHBUF_STATUS        = 1,    // read-only  : channel fsm state
[506]36    CHBUF_SRC_DESC      = 2,    // read/write : source chbuf pbase address
37    CHBUF_DST_DESC      = 3,    // read/write : dest chbuf pbase address
38    CHBUF_SRC_NBUFS     = 4,    // read/write : source chbuf number of buffers
39    CHBUF_DST_NBUFS     = 5,    // read/write : dest chbuf number of buffers
40    CHBUF_BUF_SIZE      = 6,    // read/write : buffer size for source & dest 
[258]41    CHBUF_PERIOD        = 7,    // read/write : period for status polling
[506]42    CHBUF_SRC_EXT       = 8,    // read/write : source chbuf pbase extension
43    CHBUF_DST_EXT       = 9,    // read/write : dest chbuf pbase extension
[258]44    /****/
45    CHBUF_CHANNEL_SPAN  = 1024,
46};
47
[295]48///////////////////////////////////////////////////////////////////////////////////
[448]49//  CMA channel status values
50///////////////////////////////////////////////////////////////////////////////////
51
52enum CMA_status_e
53{
54    CHANNEL_IDLE,
55
[612]56    CHANNEL_DATA_ERROR,
[448]57    CHANNEL_SRC_DESC_ERROR,
58    CHANNEL_DST_DESC_ERROR,
[612]59    CHANNEL_SRC_STATUS_ERROR,
60    CHANNEL_DST_STATUS_ERROR,
[448]61
[612]62    CHANNEL_READ_SRC_DESC,
63    CHANNEL_READ_SRC_DESC_WAIT,
[448]64    CHANNEL_READ_SRC_STATUS,
65    CHANNEL_READ_SRC_STATUS_WAIT,
66    CHANNEL_READ_SRC_STATUS_DELAY,
67
[612]68    CHANNEL_READ_DST_DESC,
69    CHANNEL_READ_DST_DESC_WAIT,
[448]70    CHANNEL_READ_DST_STATUS,
71    CHANNEL_READ_DST_STATUS_WAIT,
72    CHANNEL_READ_DST_STATUS_DELAY,
73
[612]74    CHANNEL_BURST,
75    CHANNEL_READ_REQ,
76    CHANNEL_READ_REQ_WAIT,
77    CHANNEL_RSP_WAIT,
78    CHANNEL_WRITE_REQ,
79    CHANNEL_WRITE_REQ_WAIT,
80    CHANNEL_BURST_RSP_WAIT,
[448]81
82    CHANNEL_SRC_STATUS_WRITE,
83    CHANNEL_SRC_STATUS_WRITE_WAIT,
84    CHANNEL_DST_STATUS_WRITE,
85    CHANNEL_DST_STATUS_WRITE_WAIT,
[612]86    CHANNEL_NEXT_BUFFERS,
[448]87};
88
89///////////////////////////////////////////////////////////////////////////////////
[437]90//    access functions
[295]91///////////////////////////////////////////////////////////////////////////////////
92
93extern unsigned int _cma_get_register( unsigned int channel,
94                                       unsigned int index );
95
96extern void _cma_set_register( unsigned int channel,
97                               unsigned int index,
98                               unsigned int value );
99
100extern void _cma_isr( unsigned int irq_type,
101                      unsigned int irq_id,
102                      unsigned int channel );
103
[258]104#endif
105
106// Local Variables:
107// tab-width: 4
108// c-basic-offset: 4
109// c-file-offsets:((innamespace . 0)(inline-open . 0))
110// indent-tabs-mode: nil
111// End:
112// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
113
Note: See TracBrowser for help on using the repository browser.