blob: 6a33fef5a81ac28cad83d8fc8d40968a6a339939 [file] [log] [blame]
Haavard Skinnemoen7c2842a2006-01-20 10:03:53 +01001/*
2 * Copyright (C) 2004-2006 Atmel Corporation
3 *
4 * See file CREDITS for list of people who contributed to this
5 * project.
6 *
7 * This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License as
9 * published by the Free Software Foundation; either version 2 of
10 * the License, or (at your option) any later version.
11 *
12 * This program is distributed in the hope that it will be useful,
13 * but WITHOUT ANY WARRANTY; without even the implied warranty of
14 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15 * GNU General Public License for more details.
16 *
17 * You should have received a copy of the GNU General Public License
18 * along with this program; if not, write to the Free Software
19 * Foundation, Inc., 59 Temple Place, Suite 330, Boston,
20 * MA 02111-1307 USA
21 */
22#ifndef __ASM_AVR32_MMC_H
23#define __ASM_AVR32_MMC_H
24
25struct mmc_cid {
26 unsigned long psn;
27 unsigned short oid;
28 unsigned char mid;
29 unsigned char prv;
30 unsigned char mdt;
31 char pnm[7];
32};
33
34struct mmc_csd
35{
36 u8 csd_structure:2,
37 spec_vers:4,
38 rsvd1:2;
39 u8 taac;
40 u8 nsac;
41 u8 tran_speed;
42 u16 ccc:12,
43 read_bl_len:4;
44 u64 read_bl_partial:1,
45 write_blk_misalign:1,
46 read_blk_misalign:1,
47 dsr_imp:1,
48 rsvd2:2,
49 c_size:12,
50 vdd_r_curr_min:3,
51 vdd_r_curr_max:3,
52 vdd_w_curr_min:3,
53 vdd_w_curr_max:3,
54 c_size_mult:3,
55 sector_size:5,
56 erase_grp_size:5,
57 wp_grp_size:5,
58 wp_grp_enable:1,
59 default_ecc:2,
60 r2w_factor:3,
61 write_bl_len:4,
62 write_bl_partial:1,
63 rsvd3:5;
64 u8 file_format_grp:1,
65 copy:1,
66 perm_write_protect:1,
67 tmp_write_protect:1,
68 file_format:2,
69 ecc:2;
70 u8 crc:7;
71 u8 one:1;
72};
73
74/* MMC Command numbers */
75#define MMC_CMD_GO_IDLE_STATE 0
76#define MMC_CMD_SEND_OP_COND 1
Wolfgang Denka1be4762008-05-20 16:00:29 +020077#define MMC_CMD_ALL_SEND_CID 2
Haavard Skinnemoen7c2842a2006-01-20 10:03:53 +010078#define MMC_CMD_SET_RELATIVE_ADDR 3
79#define MMC_CMD_SD_SEND_RELATIVE_ADDR 3
80#define MMC_CMD_SET_DSR 4
81#define MMC_CMD_SELECT_CARD 7
Wolfgang Denka1be4762008-05-20 16:00:29 +020082#define MMC_CMD_SEND_CSD 9
83#define MMC_CMD_SEND_CID 10
Haavard Skinnemoen7c2842a2006-01-20 10:03:53 +010084#define MMC_CMD_SEND_STATUS 13
85#define MMC_CMD_SET_BLOCKLEN 16
86#define MMC_CMD_READ_SINGLE_BLOCK 17
87#define MMC_CMD_READ_MULTIPLE_BLOCK 18
88#define MMC_CMD_WRITE_BLOCK 24
89#define MMC_CMD_APP_CMD 55
90
91#define MMC_ACMD_SD_SEND_OP_COND 41
92
93#define R1_ILLEGAL_COMMAND (1 << 22)
94#define R1_APP_CMD (1 << 5)
95
96#endif /* __ASM_AVR32_MMC_H */