source: soft/giet_vm/sys/drivers.h @ 253

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

1/ introducing support to display images on the frame buffer
with the vci_chbuf_dma (in stdio.c and drivers.c)
2/ introducing support for mem_cache configuration segment
as the memory cache is considered as another addressable peripheral type
(in drivers.c)
3/ Introducing the new "increment" parameter in the mapping header.
This parameter define the virtual address increment for the vsegs
associated to the replicated peripherals (ICU, XICU, MDMA, TIMER, MMC).
This parameter is mandatory, and all map.xml files the "mappings"
directory have been updated.

File size: 6.5 KB
Line 
1///////////////////////////////////////////////////////////////////////////////////
2// File     : drivers.h
3// Date     : 01/04/2012
4// Author   : alain greiner and joel porquet
5// Copyright (c) UPMC-LIP6
6///////////////////////////////////////////////////////////////////////////////////
7
8#ifndef _GIET_SYS_DRIVERS_H_
9#define _GIET_SYS_DRIVERS_H_
10
11///////////////////////////////////////////////////////////////////////////////////
12// Timer access functions (used for both vci_multi_timer and vci_xicu)
13///////////////////////////////////////////////////////////////////////////////////
14
15extern volatile unsigned char _timer_event[];
16
17unsigned int _timer_start(unsigned int cluster_id, unsigned int local_id, unsigned int period);
18unsigned int _timer_stop(unsigned int cluster_id, unsigned int local_id);
19unsigned int _timer_reset_irq(unsigned int cluster_id, unsigned int local_id);
20unsigned int _timer_reset_irq_cpt(unsigned int cluster_id, unsigned int local_id);
21
22
23///////////////////////////////////////////////////////////////////////////////////
24// TTY access functions and variables
25///////////////////////////////////////////////////////////////////////////////////
26
27extern volatile unsigned char _tty_get_buf[];
28extern volatile unsigned char _tty_get_full[];
29extern unsigned int _tty_put_lock;
30
31unsigned int _tty_write(const char * buffer, unsigned int length);
32unsigned int _tty_read(char * buffer, unsigned int length);
33unsigned int _tty_get_char(unsigned int tty_id, unsigned char * buffer); 
34
35///////////////////////////////////////////////////////////////////////////////////
36// ICU access functions (both vci_multi_icu and vci_xicu)
37///////////////////////////////////////////////////////////////////////////////////
38
39unsigned int _icu_get_index(unsigned int cluster_id, unsigned int proc_id, unsigned int * buffer);
40unsigned int _icu_set_mask(
41        unsigned int cluster_id,
42        unsigned int proc_id,
43        unsigned int mask, 
44        unsigned int is_timer);
45
46///////////////////////////////////////////////////////////////////////////////////
47// IOC access functions and variables (vci_block_device)
48///////////////////////////////////////////////////////////////////////////////////
49
50extern volatile unsigned int _ioc_status;
51extern volatile unsigned int _ioc_done;
52extern unsigned int _ioc_lock;
53extern unsigned int _ioc_iommu_ix1;
54extern unsigned int _ioc_iommu_npages; 
55
56
57unsigned int _ioc_write(unsigned int lba, const void * buffer, unsigned int count);
58unsigned int _ioc_read(unsigned int lba, void * buffer, unsigned int count);
59unsigned int _ioc_completed();
60unsigned int _ioc_get_status(unsigned int * status);
61unsigned int _ioc_get_block_size();
62
63///////////////////////////////////////////////////////////////////////////////////
64// Multi DMA variables and access functions  (vci_multi_dma)
65///////////////////////////////////////////////////////////////////////////////////
66
67extern volatile unsigned int _dma_status[];
68extern volatile unsigned int _dma_done[];
69extern unsigned int _dma_lock[];
70extern unsigned int _dma_iommu_ix1;
71extern unsigned int _dma_iommu_npages[];
72
73unsigned int _dma_reset_irq(unsigned int cluster_id, unsigned int local_id);
74unsigned int _dma_get_status(unsigned int cluster_id, unsigned int local_id, unsigned int * status);
75
76unsigned int _dma_transfer( unsigned int dev_type,
77                            unsigned int to_user,
78                            unsigned int offset,
79                            unsigned int user_vaddr,
80                            unsigned int length );
81
82unsigned int _dma_completed();
83
84///////////////////////////////////////////////////////////////////////////////////
85// Frame Buffer access functions  (vci_frame_buffer)
86///////////////////////////////////////////////////////////////////////////////////
87
88unsigned int _fb_sync_write( unsigned int offset, 
89                             const void * buffer, 
90                             unsigned int length);
91unsigned int _fb_sync_read(  unsigned int offset, 
92                             const void * buffer, 
93                             unsigned int length);
94
95unsigned int _fb_dma_write(  unsigned int offset,
96                             const void * buffer, 
97                             unsigned int length);
98unsigned int _fb_dma_read(   unsigned int offset, 
99                             const void * buffer, 
100                             unsigned int length);
101unsigned int _fb_dma_completed();
102
103unsigned int _fb_cma_init( const void*  vbase0,
104                           const void*  vbase1,
105                           unsigned int length );
106unsigned int _fb_cma_write( unsigned int buffer_id );
107unsigned int _fb_cma_stop();
108
109///////////////////////////////////////////////////////////////////////////////////
110// NIC device access functions  (vci_multi_nic)
111///////////////////////////////////////////////////////////////////////////////////
112
113unsigned int _nic_sync_write( const void*  buffer, 
114                              unsigned int length);
115unsigned int _nic_sync_read(  const void*  buffer, 
116                              unsigned int length);
117
118unsigned int _nic_cma_rx_init( const void*  buf0,
119                               const void*  buf1, 
120                               unsigned int length );
121unsigned int _nic_cma_tx_init( const void*  buf0,
122                               const void*  buf1, 
123                               unsigned int length );
124unsigned int _nic_cma_stop();
125
126///////////////////////////////////////////////////////////////////////////////////
127// GCD access functions
128///////////////////////////////////////////////////////////////////////////////////
129
130unsigned int _gcd_write(unsigned int register_index, unsigned int   value);
131unsigned int _gcd_read( unsigned int register_index, unsigned int * buffer);
132
133///////////////////////////////////////////////////////////////////////////////////
134// MEMC access functions
135///////////////////////////////////////////////////////////////////////////////////
136
137void _memc_inval( unsigned long long buf_paddr, unsigned int buf_length);
138void _memc_sync(  unsigned long long buf_paddr, unsigned int buf_length);
139
140///////////////////////////////////////////////////////////////////////////////////
141// Heap related function(s)
142///////////////////////////////////////////////////////////////////////////////////
143
144unsigned int _heap_info(unsigned int * vaddr, unsigned int * size);
145
146
147#endif
148
149// Local Variables:
150// tab-width: 4
151// c-basic-offset: 4
152// c-file-offsets:((innamespace . 0)(inline-open . 0))
153// indent-tabs-mode: nil
154// End:
155// vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4
156
Note: See TracBrowser for help on using the repository browser.