add SDHC support in mmc driver
[u-boot-openmoko/mini2440.git] / include / asm-arm / arch-s3c24x0 / mmc.h
blob5da7108ae6a5e23762b329034e5d03621f2631bb
1 /*
2 * linux/drivers/mmc/mmc_pxa.h
4 * Author: Vladimir Shebordaev, Igor Oblakov
5 * Copyright: MontaVista Software Inc.
7 * $Id: mmc_pxa.h,v 0.3.1.6 2002/09/25 19:25:48 ted Exp ted $
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.
13 #ifndef __MMC_PXA_P_H__
14 #define __MMC_PXA_P_H__
16 #include <asm/arch/regs-sdi.h>
18 #define MMC_DEFAULT_RCA (1<<16)
20 #define MMC_BLOCK_SIZE 512
21 #define MMC_CMD_RESET 0
22 #define MMC_CMD_SEND_OP_COND 1
23 #define MMC_CMD_ALL_SEND_CID 2
24 #define MMC_CMD_SET_RCA 3
25 #define MMC_CMD_SELECT_CARD 7
26 #define MMC_CMD_IF_COND 8
27 #define MMC_CMD_SEND_CSD 9
28 #define MMC_CMD_SEND_CID 10
29 #define MMC_CMD_SEND_STATUS 13
30 #define MMC_CMD_SET_BLOCKLEN 16
31 #define MMC_CMD_READ_BLOCK 17
32 #define MMC_CMD_RD_BLK_MULTI 18
33 #define MMC_CMD_WRITE_BLOCK 24
35 #define MMC_MAX_BLOCK_SIZE 512
37 #define MMC_R1_IDLE_STATE 0x01
38 #define MMC_R1_ERASE_STATE 0x02
39 #define MMC_R1_ILLEGAL_CMD 0x04
40 #define MMC_R1_COM_CRC_ERR 0x08
41 #define MMC_R1_ERASE_SEQ_ERR 0x01
42 #define MMC_R1_ADDR_ERR 0x02
43 #define MMC_R1_PARAM_ERR 0x04
45 #define MMC_R1B_WP_ERASE_SKIP 0x0002
46 #define MMC_R1B_ERR 0x0004
47 #define MMC_R1B_CC_ERR 0x0008
48 #define MMC_R1B_CARD_ECC_ERR 0x0010
49 #define MMC_R1B_WP_VIOLATION 0x0020
50 #define MMC_R1B_ERASE_PARAM 0x0040
51 #define MMC_R1B_OOR 0x0080
52 #define MMC_R1B_IDLE_STATE 0x0100
53 #define MMC_R1B_ERASE_RESET 0x0200
54 #define MMC_R1B_ILLEGAL_CMD 0x0400
55 #define MMC_R1B_COM_CRC_ERR 0x0800
56 #define MMC_R1B_ERASE_SEQ_ERR 0x1000
57 #define MMC_R1B_ADDR_ERR 0x2000
58 #define MMC_R1B_PARAM_ERR 0x4000
60 typedef struct mmc_cid
62 /* FIXME: BYTE_ORDER */
63 uchar year:4,
64 month:4;
65 uchar sn[3];
66 uchar fwrev:4,
67 hwrev:4;
68 uchar name[6];
69 uchar id[3];
70 } mmc_cid_t;
72 typedef struct mmc_csd
74 uchar ecc:2,
75 file_format:2,
76 tmp_write_protect:1,
77 perm_write_protect:1,
78 copy:1,
79 file_format_grp:1;
80 uint64_t content_prot_app:1,
81 rsvd3:4,
82 write_bl_partial:1,
83 write_bl_len:4,
84 r2w_factor:3,
85 default_ecc:2,
86 wp_grp_enable:1,
87 wp_grp_size:5,
88 erase_grp_mult:5,
89 erase_grp_size:5,
90 c_size_mult1:3,
91 vdd_w_curr_max:3,
92 vdd_w_curr_min:3,
93 vdd_r_curr_max:3,
94 vdd_r_curr_min:3,
95 c_size:12,
96 rsvd2:2,
97 dsr_imp:1,
98 read_blk_misalign:1,
99 write_blk_misalign:1,
100 read_bl_partial:1;
102 ushort read_bl_len:4,
103 ccc:12;
104 uchar tran_speed;
105 uchar nsac;
106 uchar taac;
107 uchar rsvd1:2,
108 spec_vers:4,
109 csd_structure:2;
110 } mmc_csd_t;
113 #endif /* __MMC_PXA_P_H__ */