| 1 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 2 | // File     : mmc_driver.h | 
|---|
| 3 | // Date     : 01/11/2013 | 
|---|
| 4 | // Author   : alain greiner | 
|---|
| 5 | // Copyright (c) UPMC-LIP6 | 
|---|
| 6 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 7 | // This simplified driver provides only one INVAL command, and does not | 
|---|
| 8 | // use any lock to access the MMC registers, as the boot-loader does not | 
|---|
| 9 | // generate concurrent accesses to the MMC configuration interface. | 
|---|
| 10 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 11 |  | 
|---|
| 12 | #ifndef _GIET_MMC_DRIVERS_H_ | 
|---|
| 13 | #define _GIET_MMC_DRIVERS_H_ | 
|---|
| 14 |  | 
|---|
| 15 | #include <hal_types.h> | 
|---|
| 16 |  | 
|---|
| 17 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 18 | // TSAR Memory Cache configuration registers offsets and commands | 
|---|
| 19 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 20 |  | 
|---|
| 21 | enum SoclibMemCacheFunc | 
|---|
| 22 | { | 
|---|
| 23 | MEMC_CONFIG = 0, | 
|---|
| 24 | MEMC_INSTRM = 1, | 
|---|
| 25 | MEMC_RERROR = 2, | 
|---|
| 26 |  | 
|---|
| 27 | MEMC_FUNC_SPAN = 0x200 | 
|---|
| 28 | }; | 
|---|
| 29 |  | 
|---|
| 30 | enum SoclibMemCacheConfigRegs | 
|---|
| 31 | { | 
|---|
| 32 | MEMC_ADDR_LO, | 
|---|
| 33 | MEMC_ADDR_HI, | 
|---|
| 34 | MEMC_BUF_LENGTH, | 
|---|
| 35 | MEMC_CMD_TYPE | 
|---|
| 36 | }; | 
|---|
| 37 |  | 
|---|
| 38 | enum SoclibMemCacheConfigCmd | 
|---|
| 39 | { | 
|---|
| 40 | MEMC_CMD_NOP, | 
|---|
| 41 | MEMC_CMD_INVAL, | 
|---|
| 42 | MEMC_CMD_SYNC | 
|---|
| 43 | }; | 
|---|
| 44 |  | 
|---|
| 45 | #define MMC_REG(func,idx) ((func<<7)|idx) | 
|---|
| 46 |  | 
|---|
| 47 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 48 | // MEMC access functions (for TSAR architecture) | 
|---|
| 49 | /////////////////////////////////////////////////////////////////////////////////// | 
|---|
| 50 |  | 
|---|
| 51 | extern int boot_mmc_inval( uint64_t buf_paddr, | 
|---|
| 52 | uint32_t buf_length ); | 
|---|
| 53 |  | 
|---|
| 54 |  | 
|---|
| 55 | #endif | 
|---|
| 56 |  | 
|---|
| 57 | // Local Variables: | 
|---|
| 58 | // tab-width: 4 | 
|---|
| 59 | // c-basic-offset: 4 | 
|---|
| 60 | // c-file-offsets:((innamespace . 0)(inline-open . 0)) | 
|---|
| 61 | // indent-tabs-mode: nil | 
|---|
| 62 | // End: | 
|---|
| 63 | // vim: filetype=c:expandtab:shiftwidth=4:tabstop=4:softtabstop=4 | 
|---|
| 64 |  | 
|---|