source: soft/giet_vm/giet_drivers/dma_driver.h @ 258

Last change on this file since 258 was 258, checked in by alain, 11 years ago

This is a major release, including a deep restructuration of code.
The main evolutions are

  • use of the Tsar preloader to load the GIET boot-loader from disk
  • introduction of a FAT32 file system library,
  • use of this fat32 library by the boot-loader to load the map.bin data structure, and the various .elf files
  • reorganisation of drivers (one file per peripheral).
  • introduction of drivers for new peripherals: vci_chbuf_dma and vci_multi_ahci.
  • introduction of a new physical memory allocator in the boot code.

This release has been tested on the tsar_generic_iob architecture,
for the two following mappings: 4c_1p_iob_four.xml and 4c_1p_iob_sort.xml

File size: 2.4 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : dma_driver.h
3// Date     : 01/11/2013
4// Author   : alain greiner
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7
8#ifndef _GIET_DMA_DRIVER_H_
9#define _GIET_DMA_DRIVER_H_
10
11///////////////////////////////////////////////////////////////////////////////////
12// Multi DMA registers offset
13///////////////////////////////////////////////////////////////////////////////////
14
15enum DMA_registers
16{
17    DMA_SRC         = 0,
18    DMA_DST         = 1,
19    DMA_LEN         = 2,
20    DMA_RESET       = 3,
21    DMA_IRQ_DISABLE = 4,
22    DMA_SRC_EXT     = 5,
23    DMA_DST_EXT     = 6,
24    /**/
25    DMA_END         = 7,
26    DMA_SPAN        = 8,
27};
28
29enum SoclibDmaStatus
30{
31    DMA_SUCCESS      = 0,
32    DMA_READ_ERROR   = 1,
33    DMA_IDLE         = 2,
34    DMA_WRITE_ERROR  = 3,
35    DMA_BUSY         = 4,
36};
37
38
39///////////////////////////////////////////////////////////////////////////////////
40// Multi DMA variables and access functions  (vci_multi_dma)
41///////////////////////////////////////////////////////////////////////////////////
42
43// low level access functions
44extern unsigned int _dma_init( unsigned int cluster_id,
45                               unsigned int channel_id );
46
47extern unsigned int _dma_reset( unsigned int  cluster_id, 
48                                unsigned int  channel_id );
49
50extern unsigned int _dma_get_status( unsigned int  cluster_id, 
51                                     unsigned int  channel_id );
52
53extern unsigned int _dma_start_transfer( unsigned int       cluster_id,
54                                         unsigned int       channel_id,
55                                         unsigned long long dst_paddr,
56                                         unsigned long long src_paddr,
57                                         unsigned int       size );
58
59// higher level access function
60extern void _dma_copy(  unsigned int vspace_id,
61                        void*        dest,
62                        const void*  source,
63                        unsigned int size ); 
64
65///////////////////////////////////////////////////////////////////////////////////
66
67#endif
68
69// Local Variables:
70// tab-width: 4
71// c-basic-offset: 4
72// c-file-offsets:((innamespace . 0)(inline-open . 0))
73// indent-tabs-mode: nil
74// End:
75// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
76
Note: See TracBrowser for help on using the repository browser.