version 1.2, 2007/12/20 15:23:15 |
version 1.3, 2007/12/21 17:45:26 |
|
|
#ifndef _DEV_SDMMC_SDMMCVAR_H |
#ifndef _DEV_SDMMC_SDMMCVAR_H |
#define _DEV_SDMMC_SDMMCVAR_H |
#define _DEV_SDMMC_SDMMCVAR_H |
|
|
|
#define SDMMC_BLOCK_SIZE 512 |
|
|
/* |
/* |
* SD/MMC simplified commands set. |
* SD/MMC simplified commands set. |
*/ |
*/ |
|
|
|
|
|
|
/* |
/* |
|
* Tokens. |
|
*/ |
|
#define TOK_READ_BLOCK 0xfe |
|
#define TOK_READ_BLOCK_MULTIPLE 0xfe |
|
#define TOK_WRITE_BLOCK 0xfe |
|
#define TOK_WRITE_BLOCK_MULTIPLE 0xfc |
|
#define TOK_STOP_MULTIPLE 0xfd |
|
|
|
|
|
/* |
* Read Error Token bits. |
* Read Error Token bits. |
*/ |
*/ |
#define RE_UNSPECIFIED_ERROR 0x01 |
#define RE_UNSPECIFIED_ERROR 0x01 |
|
|
#define RE_CARD_ECC_FAILED 0x04 |
#define RE_CARD_ECC_FAILED 0x04 |
#define RE_OUT_OF_RANGE 0x08 |
#define RE_OUT_OF_RANGE 0x08 |
#define RE_CARD_LOCKED 0x10 |
#define RE_CARD_LOCKED 0x10 |
|
|
|
/* |
|
* Card CID (Card ID) register. |
|
*/ |
|
struct sdmmc_cid { |
|
uint8_t cid_mid; |
|
uint16_t cid_oid; |
|
uint8_t cid_pnm[5]; |
|
uint8_t cid_prv; |
|
uint32_t cid_psn; |
|
uint16_t cid_mdt; |
|
uint8_t cid_crc; |
|
|
|
} __attribute__((packed)); |
|
|
/* |
/* |
* SD/MMC bus handle. |
* SD/MMC bus handle. |