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