[258] | 1 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 2 | // File : mmc_driver.h |
---|
| 3 | // Date : 01/11/2013 |
---|
| 4 | // Author : alain greiner |
---|
| 5 | // Copyright (c) UPMC-LIP6 |
---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 7 | |
---|
| 8 | #ifndef _GIET_MMC_DRIVERS_H_ |
---|
| 9 | #define _GIET_MMC_DRIVERS_H_ |
---|
| 10 | |
---|
[481] | 11 | #include <hard_config.h> |
---|
[496] | 12 | #include <kernel_locks.h> |
---|
[481] | 13 | |
---|
[258] | 14 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 15 | // TSAR Memory Cache configuration registers offsets and commands |
---|
| 16 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 17 | |
---|
[496] | 18 | enum SoclibMemCacheFunc |
---|
| 19 | { |
---|
| 20 | MEMC_CONFIG = 0, |
---|
| 21 | MEMC_INSTRM = 1, |
---|
| 22 | MEMC_RERROR = 2, |
---|
| 23 | |
---|
| 24 | MEMC_FUNC_SPAN = 0x200 |
---|
| 25 | }; |
---|
| 26 | |
---|
[258] | 27 | enum SoclibMemCacheConfigRegs |
---|
| 28 | { |
---|
| 29 | MEMC_ADDR_LO, |
---|
| 30 | MEMC_ADDR_HI, |
---|
| 31 | MEMC_BUF_LENGTH, |
---|
| 32 | MEMC_CMD_TYPE |
---|
| 33 | }; |
---|
| 34 | |
---|
| 35 | enum SoclibMemCacheConfigCmd |
---|
| 36 | { |
---|
| 37 | MEMC_CMD_NOP, |
---|
| 38 | MEMC_CMD_INVAL, |
---|
| 39 | MEMC_CMD_SYNC |
---|
| 40 | }; |
---|
| 41 | |
---|
[496] | 42 | enum SoclibMemCacheInstrRegs { |
---|
[345] | 43 | |
---|
[496] | 44 | // NUMBER OF LOCAL TRANSACTIONS ON DIRECT NETWORK |
---|
[481] | 45 | |
---|
[496] | 46 | MEMC_LOCAL_READ_LO = 0x00, |
---|
| 47 | MEMC_LOCAL_READ_HI = 0x01, |
---|
| 48 | MEMC_LOCAL_WRITE_LO = 0x02, |
---|
| 49 | MEMC_LOCAL_WRITE_HI = 0x03, |
---|
| 50 | MEMC_LOCAL_LL_LO = 0x04, |
---|
| 51 | MEMC_LOCAL_LL_HI = 0x05, |
---|
| 52 | MEMC_LOCAL_SC_LO = 0x06, |
---|
| 53 | MEMC_LOCAL_SC_HI = 0x07, |
---|
| 54 | MEMC_LOCAL_CAS_LO = 0x08, |
---|
| 55 | MEMC_LOCAL_CAS_HI = 0x09, |
---|
[481] | 56 | |
---|
[496] | 57 | // NUMBER OF REMOTE TRANSACTIONS ON DIRECT NETWORK |
---|
| 58 | |
---|
| 59 | MEMC_REMOTE_READ_LO = 0x10, |
---|
| 60 | MEMC_REMOTE_READ_HI = 0x11, |
---|
| 61 | MEMC_REMOTE_WRITE_LO = 0x12, |
---|
| 62 | MEMC_REMOTE_WRITE_HI = 0x13, |
---|
| 63 | MEMC_REMOTE_LL_LO = 0x14, |
---|
| 64 | MEMC_REMOTE_LL_HI = 0x15, |
---|
| 65 | MEMC_REMOTE_SC_LO = 0x16, |
---|
| 66 | MEMC_REMOTE_SC_HI = 0x17, |
---|
| 67 | MEMC_REMOTE_CAS_LO = 0x18, |
---|
| 68 | MEMC_REMOTE_CAS_HI = 0x19, |
---|
| 69 | |
---|
| 70 | // COST OF TRANSACTIONS ON DIRECT NETWORK |
---|
| 71 | |
---|
| 72 | MEMC_COST_READ_LO = 0x20, |
---|
| 73 | MEMC_COST_READ_HI = 0x21, |
---|
| 74 | MEMC_COST_WRITE_LO = 0x22, |
---|
| 75 | MEMC_COST_WRITE_HI = 0x23, |
---|
| 76 | MEMC_COST_LL_LO = 0x24, |
---|
| 77 | MEMC_COST_LL_HI = 0x25, |
---|
| 78 | MEMC_COST_SC_LO = 0x26, |
---|
| 79 | MEMC_COST_SC_HI = 0x27, |
---|
| 80 | MEMC_COST_CAS_LO = 0x28, |
---|
| 81 | MEMC_COST_CAS_HI = 0x29, |
---|
| 82 | |
---|
| 83 | // NUMBER OF LOCAL TRANSACTIONS ON CC NETWORK |
---|
| 84 | |
---|
| 85 | MEMC_LOCAL_MUPDATE_LO = 0x40, |
---|
| 86 | MEMC_LOCAL_MUPDATE_HI = 0x41, |
---|
| 87 | MEMC_LOCAL_MINVAL_LO = 0x42, |
---|
| 88 | MEMC_LOCAL_MINVAL_HI = 0x43, |
---|
| 89 | MEMC_LOCAL_CLEANUP_LO = 0x44, |
---|
| 90 | MEMC_LOCAL_CLEANUP_HI = 0x45, |
---|
| 91 | |
---|
| 92 | // NUMBER OF REMOTE TRANSACTIONS ON CC NETWORK |
---|
| 93 | |
---|
| 94 | MEMC_REMOTE_MUPDATE_LO = 0x50, |
---|
| 95 | MEMC_REMOTE_MUPDATE_HI = 0x51, |
---|
| 96 | MEMC_REMOTE_MINVAL_LO = 0x52, |
---|
| 97 | MEMC_REMOTE_MINVAL_HI = 0x53, |
---|
| 98 | MEMC_REMOTE_CLEANUP_LO = 0x54, |
---|
| 99 | MEMC_REMOTE_CLEANUP_HI = 0x55, |
---|
| 100 | |
---|
| 101 | // COST OF TRANSACTIONS ON CC NETWORK |
---|
| 102 | |
---|
| 103 | MEMC_COST_MUPDATE_LO = 0x60, |
---|
| 104 | MEMC_COST_MUPDATE_HI = 0x61, |
---|
| 105 | MEMC_COST_MINVAL_LO = 0x62, |
---|
| 106 | MEMC_COST_MINVAL_HI = 0x63, |
---|
| 107 | MEMC_COST_CLEANUP_LO = 0x64, |
---|
| 108 | MEMC_COST_CLEANUP_HI = 0x65, |
---|
| 109 | |
---|
| 110 | // TOTAL |
---|
| 111 | |
---|
| 112 | MEMC_TOTAL_MUPDATE_LO = 0x68, |
---|
| 113 | MEMC_TOTAL_MUPDATE_HI = 0x69, |
---|
| 114 | MEMC_TOTAL_MINVAL_LO = 0x6A, |
---|
| 115 | MEMC_TOTAL_MINVAL_HI = 0x6B, |
---|
| 116 | MEMC_TOTAL_BINVAL_LO = 0x6C, |
---|
| 117 | MEMC_TOTAL_BINVAL_HI = 0x6D, |
---|
| 118 | }; |
---|
| 119 | |
---|
| 120 | #define MMC_REG(func,idx) ((func<<7)|idx) |
---|
| 121 | |
---|
[258] | 122 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 123 | // MEMC access functions (for TSAR architecture) |
---|
| 124 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 125 | |
---|
[496] | 126 | extern unsigned int _mmc_instrument( unsigned int x, |
---|
| 127 | unsigned int y, |
---|
| 128 | unsigned int reg ); |
---|
| 129 | |
---|
[297] | 130 | extern void _mmc_inval( unsigned long long buf_paddr, |
---|
| 131 | unsigned int buf_length ); |
---|
[258] | 132 | |
---|
[297] | 133 | extern void _mmc_sync( unsigned long long buf_paddr, |
---|
| 134 | unsigned int buf_length); |
---|
[258] | 135 | |
---|
[297] | 136 | extern void _mmc_isr( unsigned int irq_type, |
---|
| 137 | unsigned int irq_id, |
---|
| 138 | unsigned int channel ); |
---|
| 139 | |
---|
[258] | 140 | /////////////////////////////////////////////////////////////////////////////////// |
---|
| 141 | |
---|
| 142 | #endif |
---|
| 143 | |
---|
| 144 | // Local Variables: |
---|
| 145 | // tab-width: 4 |
---|
| 146 | // c-basic-offset: 4 |
---|
| 147 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) |
---|
| 148 | // indent-tabs-mode: nil |
---|
| 149 | // End: |
---|
| 150 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 |
---|
| 151 | |
---|