| 1 | /* |
| 2 | * linux/drivers/mmc/mmc_pxa.h |
| 3 | * |
| 4 | * Author: Vladimir Shebordaev, Igor Oblakov |
| 5 | * Copyright: MontaVista Software Inc. |
| 6 | * |
| 7 | * $Id: mmc_pxa.h,v 0.3.1.6 2002/09/25 19:25:48 ted Exp ted $ |
| 8 | * |
| 9 | * This program is free software; you can redistribute it and/or modify |
| 10 | * it under the terms of the GNU General Public License version 2 as |
| 11 | * published by the Free Software Foundation. |
| 12 | */ |
| 13 | #ifndef __MMC_PXA_P_H__ |
| 14 | #define __MMC_PXA_P_H__ |
| 15 | |
| 16 | #define MMC_DEFAULT_RCA (1<<16) |
| 17 | |
| 18 | #define MMC_BLOCK_SIZE 512 |
| 19 | #define MMC_CMD_RESET 0 |
| 20 | #define MMC_CMD_SEND_OP_COND 1 |
| 21 | #define MMC_CMD_ALL_SEND_CID 2 |
| 22 | #define MMC_CMD_SET_RCA 3 |
| 23 | #define MMC_CMD_SELECT_CARD 7 |
| 24 | #define MMC_CMD_SEND_CSD 9 |
| 25 | #define MMC_CMD_SEND_CID 10 |
| 26 | #define MMC_CMD_SEND_STATUS 13 |
| 27 | #define MMC_CMD_SET_BLOCKLEN 16 |
| 28 | #define MMC_CMD_READ_BLOCK 17 |
| 29 | #define MMC_CMD_RD_BLK_MULTI 18 |
| 30 | #define MMC_CMD_WRITE_BLOCK 24 |
| 31 | |
| 32 | #define MMC_MAX_BLOCK_SIZE 512 |
| 33 | |
| 34 | #define MMC_R1_IDLE_STATE 0x01 |
| 35 | #define MMC_R1_ERASE_STATE 0x02 |
| 36 | #define MMC_R1_ILLEGAL_CMD 0x04 |
| 37 | #define MMC_R1_COM_CRC_ERR 0x08 |
| 38 | #define MMC_R1_ERASE_SEQ_ERR 0x01 |
| 39 | #define MMC_R1_ADDR_ERR 0x02 |
| 40 | #define MMC_R1_PARAM_ERR 0x04 |
| 41 | |
| 42 | #define MMC_R1B_WP_ERASE_SKIP 0x0002 |
| 43 | #define MMC_R1B_ERR 0x0004 |
| 44 | #define MMC_R1B_CC_ERR 0x0008 |
| 45 | #define MMC_R1B_CARD_ECC_ERR 0x0010 |
| 46 | #define MMC_R1B_WP_VIOLATION 0x0020 |
| 47 | #define MMC_R1B_ERASE_PARAM 0x0040 |
| 48 | #define MMC_R1B_OOR 0x0080 |
| 49 | #define MMC_R1B_IDLE_STATE 0x0100 |
| 50 | #define MMC_R1B_ERASE_RESET 0x0200 |
| 51 | #define MMC_R1B_ILLEGAL_CMD 0x0400 |
| 52 | #define MMC_R1B_COM_CRC_ERR 0x0800 |
| 53 | #define MMC_R1B_ERASE_SEQ_ERR 0x1000 |
| 54 | #define MMC_R1B_ADDR_ERR 0x2000 |
| 55 | #define MMC_R1B_PARAM_ERR 0x4000 |
| 56 | |
| 57 | typedef struct mmc_cid |
| 58 | { |
| 59 | /* FIXME: BYTE_ORDER */ |
| 60 | u8 year:4, |
| 61 | month:4; |
| 62 | u8 sn[3]; |
| 63 | u8 fwrev:4, |
| 64 | hwrev:4; |
| 65 | u8 name[6]; |
| 66 | u8 id[3]; |
| 67 | } mmc_cid_t; |
| 68 | |
| 69 | typedef struct mmc_csd |
| 70 | { |
| 71 | u8 ecc:2, |
| 72 | file_format:2, |
| 73 | tmp_write_protect:1, |
| 74 | perm_write_protect:1, |
| 75 | copy:1, |
| 76 | file_format_grp:1; |
| 77 | unsigned long long content_prot_app:1, |
| 78 | rsvd3:4, |
| 79 | write_bl_partial:1, |
| 80 | write_bl_len:4, |
| 81 | r2w_factor:3, |
| 82 | default_ecc:2, |
| 83 | wp_grp_enable:1, |
| 84 | wp_grp_size:5, |
| 85 | erase_grp_mult:5, |
| 86 | erase_grp_size:5, |
| 87 | c_size_mult1:3, |
| 88 | vdd_w_curr_max:3, |
| 89 | vdd_w_curr_min:3, |
| 90 | vdd_r_curr_max:3, |
| 91 | vdd_r_curr_min:3, |
| 92 | c_size:12, |
| 93 | rsvd2:2, |
| 94 | dsr_imp:1, |
| 95 | read_blk_misalign:1, |
| 96 | write_blk_misalign:1, |
| 97 | read_bl_partial:1; |
| 98 | |
| 99 | u16 read_bl_len:4, |
| 100 | ccc:12; |
| 101 | u8 tran_speed; |
| 102 | u8 nsac; |
| 103 | u8 taac; |
| 104 | u8 rsvd1:2, |
| 105 | spec_vers:4, |
| 106 | csd_structure:2; |
| 107 | } mmc_csd_t; |
| 108 | |
| 109 | |
| 110 | #endif /* __MMC_PXA_P_H__ */ |
| 111 | |