| 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_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); | 
|---|
| 22 |  | 
|---|
| 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 |  | 
|---|
| 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_read_irq( char*                       buffer, | 
|---|
| 44 | unsigned int        length); | 
|---|
| 45 |  | 
|---|
| 46 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 47 | // ICU access functions (both vci_multi_icu and vci_xicu) | 
|---|
| 48 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 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 |  | 
|---|
| 55 | unsigned int _icu_write(        unsigned int    cluster_id, | 
|---|
| 56 | unsigned int    proc_id, | 
|---|
| 57 | unsigned int    register_id, | 
|---|
| 58 | unsigned int    value ); | 
|---|
| 59 |  | 
|---|
| 60 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 61 | // IOC access functions and variables (vci_block_device) | 
|---|
| 62 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 63 |  | 
|---|
| 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; | 
|---|
| 69 |  | 
|---|
| 70 |  | 
|---|
| 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 |  | 
|---|
| 79 | unsigned int _ioc_completed(); | 
|---|
| 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 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 92 | // Frame Buffer access functions  (vci_frame_buffer) | 
|---|
| 93 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 94 |  | 
|---|
| 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 |  | 
|---|
| 111 | unsigned int _fb_completed(); | 
|---|
| 112 |  | 
|---|
| 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 |  | 
|---|
| 124 | #endif | 
|---|
| 125 |  | 
|---|