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 | |
---|
15 | extern volatile unsigned char _timer_event[]; |
---|
16 | |
---|
17 | unsigned int _timer_start( unsigned int cluster_id, |
---|
18 | unsigned int local_id, |
---|
19 | unsigned int period ); |
---|
20 | |
---|
21 | unsigned int _timer_stop( unsigned int cluster_id, |
---|
22 | unsigned int local_id ); |
---|
23 | |
---|
24 | |
---|
25 | unsigned int _timer_reset_irq( unsigned int cluster_id, |
---|
26 | unsigned int local_id ); |
---|
27 | |
---|
28 | /////////////////////////////////////////////////////////////////////////////////// |
---|
29 | // TTY access functions and variables |
---|
30 | /////////////////////////////////////////////////////////////////////////////////// |
---|
31 | |
---|
32 | extern volatile unsigned char _tty_get_buf[]; |
---|
33 | extern volatile unsigned char _tty_get_full[]; |
---|
34 | extern unsigned int _tty_put_lock; |
---|
35 | |
---|
36 | unsigned int _tty_write( const char* buffer, |
---|
37 | unsigned int length); |
---|
38 | |
---|
39 | unsigned int _tty_read( char* buffer, |
---|
40 | unsigned int length); |
---|
41 | |
---|
42 | unsigned int _tty_get_char( unsigned int tty_id, |
---|
43 | char* buffer); |
---|
44 | |
---|
45 | /////////////////////////////////////////////////////////////////////////////////// |
---|
46 | // ICU access functions (both vci_multi_icu and vci_xicu) |
---|
47 | /////////////////////////////////////////////////////////////////////////////////// |
---|
48 | |
---|
49 | unsigned int _icu_get_index(unsigned int cluster_id, |
---|
50 | unsigned int proc_id, |
---|
51 | unsigned int* buffer ); |
---|
52 | |
---|
53 | unsigned int _icu_set_mask( unsigned int cluster_id, |
---|
54 | unsigned int proc_id, |
---|
55 | unsigned int mask, |
---|
56 | unsigned int is_timer ); |
---|
57 | |
---|
58 | /////////////////////////////////////////////////////////////////////////////////// |
---|
59 | // IOC access functions and variables (vci_block_device) |
---|
60 | /////////////////////////////////////////////////////////////////////////////////// |
---|
61 | |
---|
62 | extern volatile unsigned int _ioc_status; |
---|
63 | extern volatile unsigned int _ioc_done; |
---|
64 | extern unsigned int _ioc_lock; |
---|
65 | extern unsigned int _ioc_iommu_ix1; |
---|
66 | extern unsigned int _ioc_iommu_npages; |
---|
67 | |
---|
68 | |
---|
69 | unsigned int _ioc_write( unsigned int lba, |
---|
70 | const void* buffer, |
---|
71 | unsigned int count); |
---|
72 | |
---|
73 | unsigned int _ioc_read( unsigned int lba, |
---|
74 | void* buffer, |
---|
75 | unsigned int count); |
---|
76 | |
---|
77 | unsigned int _ioc_completed(); |
---|
78 | |
---|
79 | unsigned int _ioc_get_status( unsigned int* status); |
---|
80 | |
---|
81 | /////////////////////////////////////////////////////////////////////////////////// |
---|
82 | // Multi DMA variables (vci_multi_dma) |
---|
83 | /////////////////////////////////////////////////////////////////////////////////// |
---|
84 | |
---|
85 | extern volatile unsigned int _dma_status[]; |
---|
86 | extern volatile unsigned int _dma_done[]; |
---|
87 | extern unsigned int _dma_lock[]; |
---|
88 | extern unsigned int _dma_iommu_ix1; |
---|
89 | extern unsigned int _dma_iommu_npages[]; |
---|
90 | |
---|
91 | unsigned int _dma_reset_irq( unsigned int cluster_id, |
---|
92 | unsigned int local_id ); |
---|
93 | |
---|
94 | unsigned int _dma_get_status( unsigned int cluster_id, |
---|
95 | unsigned int local_id, |
---|
96 | unsigned int* status ); |
---|
97 | |
---|
98 | /////////////////////////////////////////////////////////////////////////////////// |
---|
99 | // Frame Buffer access functions (vci_frame_buffer) |
---|
100 | /////////////////////////////////////////////////////////////////////////////////// |
---|
101 | |
---|
102 | unsigned int _fb_sync_write(unsigned int offset, |
---|
103 | const void* buffer, |
---|
104 | unsigned int length); |
---|
105 | |
---|
106 | unsigned int _fb_sync_read( unsigned int offset, |
---|
107 | const void* buffer, |
---|
108 | unsigned int length); |
---|
109 | |
---|
110 | unsigned int _fb_write( unsigned int offset, |
---|
111 | const void* buffer, |
---|
112 | unsigned int length); |
---|
113 | |
---|
114 | unsigned int _fb_read( unsigned int offset, |
---|
115 | const void* buffer, |
---|
116 | unsigned int length); |
---|
117 | |
---|
118 | unsigned int _fb_completed(); |
---|
119 | |
---|
120 | /////////////////////////////////////////////////////////////////////////////////// |
---|
121 | // GCD access functions |
---|
122 | /////////////////////////////////////////////////////////////////////////////////// |
---|
123 | |
---|
124 | unsigned int _gcd_write( unsigned int register_index, |
---|
125 | unsigned int value); |
---|
126 | |
---|
127 | unsigned int _gcd_read( unsigned int register_index, |
---|
128 | unsigned int* buffer); |
---|
129 | |
---|
130 | |
---|
131 | #endif |
---|
132 | |
---|