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