| [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> | 
|---|
|  | 12 | #include <locks.h> | 
|---|
|  | 13 |  | 
|---|
| [258] | 14 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
|  | 15 | // TSAR Memory Cache configuration registers offsets and commands | 
|---|
|  | 16 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
|  | 17 |  | 
|---|
|  | 18 | enum SoclibMemCacheConfigRegs | 
|---|
|  | 19 | { | 
|---|
|  | 20 | MEMC_ADDR_LO, | 
|---|
|  | 21 | MEMC_ADDR_HI, | 
|---|
|  | 22 | MEMC_BUF_LENGTH, | 
|---|
|  | 23 | MEMC_CMD_TYPE | 
|---|
|  | 24 | }; | 
|---|
|  | 25 |  | 
|---|
|  | 26 | enum SoclibMemCacheConfigCmd | 
|---|
|  | 27 | { | 
|---|
|  | 28 | MEMC_CMD_NOP, | 
|---|
|  | 29 | MEMC_CMD_INVAL, | 
|---|
|  | 30 | MEMC_CMD_SYNC | 
|---|
|  | 31 | }; | 
|---|
|  | 32 |  | 
|---|
| [345] | 33 | #define MMC_REG(func,idx) ((func<<7)|idx) | 
|---|
|  | 34 |  | 
|---|
| [481] | 35 | /////////////////////////////////////////////////////////////////////////////// | 
|---|
|  | 36 | // Distributed locks protecting MMC components (one per cluster) | 
|---|
|  | 37 | /////////////////////////////////////////////////////////////////////////////// | 
|---|
|  | 38 |  | 
|---|
|  | 39 | spin_lock_t  _mmc_lock[X_SIZE][Y_SIZE]  __attribute__((aligned(64))); | 
|---|
|  | 40 |  | 
|---|
| [258] | 41 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
|  | 42 | // MEMC access functions (for TSAR architecture) | 
|---|
|  | 43 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
|  | 44 |  | 
|---|
| [297] | 45 | extern void _mmc_inval( unsigned long long buf_paddr, | 
|---|
|  | 46 | unsigned int buf_length ); | 
|---|
| [258] | 47 |  | 
|---|
| [297] | 48 | extern void _mmc_sync(  unsigned long long buf_paddr, | 
|---|
|  | 49 | unsigned int buf_length); | 
|---|
| [258] | 50 |  | 
|---|
| [297] | 51 | extern void _mmc_isr( unsigned int irq_type, | 
|---|
|  | 52 | unsigned int irq_id, | 
|---|
|  | 53 | unsigned int channel ); | 
|---|
|  | 54 |  | 
|---|
| [258] | 55 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
|  | 56 |  | 
|---|
|  | 57 | #endif | 
|---|
|  | 58 |  | 
|---|
|  | 59 | // Local Variables: | 
|---|
|  | 60 | // tab-width: 4 | 
|---|
|  | 61 | // c-basic-offset: 4 | 
|---|
|  | 62 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) | 
|---|
|  | 63 | // indent-tabs-mode: nil | 
|---|
|  | 64 | // End: | 
|---|
|  | 65 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 | 
|---|
|  | 66 |  | 
|---|