[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 | |
---|
[203] | 17 | unsigned int _timer_start( unsigned int cluster_id, |
---|
| 18 | unsigned int local_id, |
---|
| 19 | unsigned int period ); |
---|
[158] | 20 | |
---|
[203] | 21 | unsigned int _timer_stop( unsigned int cluster_id, |
---|
| 22 | unsigned int local_id ); |
---|
[189] | 23 | |
---|
| 24 | |
---|
[203] | 25 | unsigned int _timer_reset_irq( unsigned int cluster_id, |
---|
| 26 | unsigned int local_id ); |
---|
| 27 | |
---|
[189] | 28 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 29 | // TTY access functions and variables |
---|
| 30 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 31 | |
---|
[158] | 32 | extern volatile unsigned char _tty_get_buf[]; |
---|
| 33 | extern volatile unsigned char _tty_get_full[]; |
---|
[165] | 34 | extern unsigned int _tty_put_lock; |
---|
[158] | 35 | |
---|
[189] | 36 | unsigned int _tty_write( const char* buffer, |
---|
| 37 | unsigned int length); |
---|
[158] | 38 | |
---|
[189] | 39 | unsigned int _tty_read( char* buffer, |
---|
| 40 | unsigned int length); |
---|
[158] | 41 | |
---|
[204] | 42 | unsigned int _tty_get_char( unsigned int tty_id, |
---|
| 43 | char* buffer); |
---|
[158] | 44 | |
---|
[189] | 45 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 46 | // ICU access functions (both vci_multi_icu and vci_xicu) |
---|
| 47 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[165] | 48 | |
---|
[203] | 49 | unsigned int _icu_get_index(unsigned int cluster_id, |
---|
[165] | 50 | unsigned int proc_id, |
---|
[203] | 51 | unsigned int* buffer ); |
---|
[165] | 52 | |
---|
[203] | 53 | unsigned int _icu_set_mask( unsigned int cluster_id, |
---|
[189] | 54 | unsigned int proc_id, |
---|
[203] | 55 | unsigned int mask, |
---|
| 56 | unsigned int is_timer ); |
---|
[165] | 57 | |
---|
[189] | 58 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 59 | // IOC access functions and variables (vci_block_device) |
---|
| 60 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[165] | 61 | |
---|
[189] | 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; |
---|
[165] | 67 | |
---|
[189] | 68 | |
---|
[165] | 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 | |
---|
[158] | 77 | unsigned int _ioc_completed(); |
---|
| 78 | |
---|
[204] | 79 | unsigned int _ioc_get_status( unsigned int* status); |
---|
| 80 | |
---|
[189] | 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[]; |
---|
[158] | 90 | |
---|
[204] | 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 | |
---|
[189] | 98 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 99 | // Frame Buffer access functions (vci_frame_buffer) |
---|
| 100 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 101 | |
---|
[165] | 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 | |
---|
[158] | 118 | unsigned int _fb_completed(); |
---|
| 119 | |
---|
[189] | 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 | |
---|
[158] | 131 | #endif |
---|
| 132 | |
---|