[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 | |
---|
[189] | 17 | unsigned int _timer_access( unsigned int read, // reas if non 0 |
---|
| 18 | unsigned int cluster_id, |
---|
| 19 | unsigned int local_id, |
---|
| 20 | unsigned int register_id, |
---|
| 21 | unsigned int* buffer); |
---|
[158] | 22 | |
---|
[189] | 23 | unsigned int _timer_read( unsigned int register_id, |
---|
| 24 | unsigned int* buffer); |
---|
| 25 | |
---|
| 26 | unsigned int _timer_write( unsigned int register_id, |
---|
| 27 | unsigned int value); |
---|
| 28 | |
---|
| 29 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 30 | // TTY access functions and variables |
---|
| 31 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 32 | |
---|
[158] | 33 | extern volatile unsigned char _tty_get_buf[]; |
---|
| 34 | extern volatile unsigned char _tty_get_full[]; |
---|
[165] | 35 | extern unsigned int _tty_put_lock; |
---|
[158] | 36 | |
---|
[189] | 37 | unsigned int _tty_write( const char* buffer, |
---|
| 38 | unsigned int length); |
---|
[158] | 39 | |
---|
[189] | 40 | unsigned int _tty_read( char* buffer, |
---|
| 41 | unsigned int length); |
---|
[158] | 42 | |
---|
[189] | 43 | unsigned int _tty_read_irq( char* buffer, |
---|
| 44 | unsigned int length); |
---|
[158] | 45 | |
---|
[189] | 46 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 47 | // ICU access functions (both vci_multi_icu and vci_xicu) |
---|
| 48 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[165] | 49 | |
---|
| 50 | unsigned int _icu_read( unsigned int cluster_id, |
---|
| 51 | unsigned int proc_id, |
---|
| 52 | unsigned int register_id, |
---|
| 53 | unsigned int* buffer); |
---|
| 54 | |
---|
[189] | 55 | unsigned int _icu_write( unsigned int cluster_id, |
---|
| 56 | unsigned int proc_id, |
---|
| 57 | unsigned int register_id, |
---|
| 58 | unsigned int value ); |
---|
[165] | 59 | |
---|
[189] | 60 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 61 | // IOC access functions and variables (vci_block_device) |
---|
| 62 | /////////////////////////////////////////////////////////////////////////////////// |
---|
[165] | 63 | |
---|
[189] | 64 | extern volatile unsigned int _ioc_status; |
---|
| 65 | extern volatile unsigned int _ioc_done; |
---|
| 66 | extern unsigned int _ioc_lock; |
---|
| 67 | extern unsigned int _ioc_iommu_ix1; |
---|
| 68 | extern unsigned int _ioc_iommu_npages; |
---|
[165] | 69 | |
---|
[189] | 70 | |
---|
[165] | 71 | unsigned int _ioc_write( unsigned int lba, |
---|
| 72 | const void* buffer, |
---|
| 73 | unsigned int count); |
---|
| 74 | |
---|
| 75 | unsigned int _ioc_read( unsigned int lba, |
---|
| 76 | void* buffer, |
---|
| 77 | unsigned int count); |
---|
| 78 | |
---|
[158] | 79 | unsigned int _ioc_completed(); |
---|
| 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 | |
---|
[189] | 91 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 92 | // Frame Buffer access functions (vci_frame_buffer) |
---|
| 93 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 94 | |
---|
[165] | 95 | unsigned int _fb_sync_write(unsigned int offset, |
---|
| 96 | const void* buffer, |
---|
| 97 | unsigned int length); |
---|
| 98 | |
---|
| 99 | unsigned int _fb_sync_read( unsigned int offset, |
---|
| 100 | const void* buffer, |
---|
| 101 | unsigned int length); |
---|
| 102 | |
---|
| 103 | unsigned int _fb_write( unsigned int offset, |
---|
| 104 | const void* buffer, |
---|
| 105 | unsigned int length); |
---|
| 106 | |
---|
| 107 | unsigned int _fb_read( unsigned int offset, |
---|
| 108 | const void* buffer, |
---|
| 109 | unsigned int length); |
---|
| 110 | |
---|
[158] | 111 | unsigned int _fb_completed(); |
---|
| 112 | |
---|
[189] | 113 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 114 | // GCD access functions |
---|
| 115 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 116 | |
---|
| 117 | unsigned int _gcd_write( unsigned int register_index, |
---|
| 118 | unsigned int value); |
---|
| 119 | |
---|
| 120 | unsigned int _gcd_read( unsigned int register_index, |
---|
| 121 | unsigned int* buffer); |
---|
| 122 | |
---|
| 123 | |
---|
[158] | 124 | #endif |
---|
| 125 | |
---|