aboutsummaryrefslogtreecommitdiffstats
path: root/include/linux/mmc/protocol.h
diff options
context:
space:
mode:
authorPhilip Langdale <philipl@overt.org>2006-10-21 06:35:02 -0400
committerPierre Ossman <drzeus@drzeus.cx>2006-12-01 12:21:32 -0500
commitbce40a36de574376f41f1ff3c4d212a7da2a3c90 (patch)
treef866c1d744db98d897d8e2684f7f47b56e75cb9b /include/linux/mmc/protocol.h
parent9c9c26188ff9fa5f44ba5a00e01b54b539f83d1d (diff)
[PATCH] mmc: Add support for mmc v4 high speed mode
This adds support for the high-speed modes defined by mmc v4 (assuming the host controller is up to it). On a TI sdhci controller, it improves read speed from 1.3MBps to 2.3MBps. The TI controller can only go up to 24MHz, but everything helps. Another person has taken this basic patch and used it on a Nokia 770 to get a bigger boost because that controller can run at 48MHZ. Signed-off-by: Philip Langdale <philipl@overt.org> Signed-off-by: Pierre Ossman <drzeus@drzeus.cx>
Diffstat (limited to 'include/linux/mmc/protocol.h')
-rw-r--r--include/linux/mmc/protocol.h47
1 files changed, 44 insertions, 3 deletions
diff --git a/include/linux/mmc/protocol.h b/include/linux/mmc/protocol.h
index 08dec8d9e703..311b6547f561 100644
--- a/include/linux/mmc/protocol.h
+++ b/include/linux/mmc/protocol.h
@@ -25,14 +25,16 @@
25#ifndef MMC_MMC_PROTOCOL_H 25#ifndef MMC_MMC_PROTOCOL_H
26#define MMC_MMC_PROTOCOL_H 26#define MMC_MMC_PROTOCOL_H
27 27
28/* Standard MMC commands (3.1) type argument response */ 28/* Standard MMC commands (4.1) type argument response */
29 /* class 1 */ 29 /* class 1 */
30#define MMC_GO_IDLE_STATE 0 /* bc */ 30#define MMC_GO_IDLE_STATE 0 /* bc */
31#define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */ 31#define MMC_SEND_OP_COND 1 /* bcr [31:0] OCR R3 */
32#define MMC_ALL_SEND_CID 2 /* bcr R2 */ 32#define MMC_ALL_SEND_CID 2 /* bcr R2 */
33#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */ 33#define MMC_SET_RELATIVE_ADDR 3 /* ac [31:16] RCA R1 */
34#define MMC_SET_DSR 4 /* bc [31:16] RCA */ 34#define MMC_SET_DSR 4 /* bc [31:16] RCA */
35#define MMC_SWITCH 6 /* ac [31:0] See below R1b */
35#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */ 36#define MMC_SELECT_CARD 7 /* ac [31:16] RCA R1 */
37#define MMC_SEND_EXT_CSD 8 /* adtc R1 */
36#define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */ 38#define MMC_SEND_CSD 9 /* ac [31:16] RCA R2 */
37#define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */ 39#define MMC_SEND_CID 10 /* ac [31:16] RCA R2 */
38#define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */ 40#define MMC_READ_DAT_UNTIL_STOP 11 /* adtc [31:0] dadr R1 */
@@ -88,6 +90,17 @@
88#define SD_APP_SEND_SCR 51 /* adtc R1 */ 90#define SD_APP_SEND_SCR 51 /* adtc R1 */
89 91
90/* 92/*
93 * MMC_SWITCH argument format:
94 *
95 * [31:26] Always 0
96 * [25:24] Access Mode
97 * [23:16] Location of target Byte in EXT_CSD
98 * [15:08] Value Byte
99 * [07:03] Always 0
100 * [02:00] Command Set
101 */
102
103/*
91 MMC status in R1 104 MMC status in R1
92 Type 105 Type
93 e : error bit 106 e : error bit
@@ -230,13 +243,41 @@ struct _mmc_csd {
230 243
231#define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */ 244#define CSD_STRUCT_VER_1_0 0 /* Valid for system specification 1.0 - 1.2 */
232#define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */ 245#define CSD_STRUCT_VER_1_1 1 /* Valid for system specification 1.4 - 2.2 */
233#define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 */ 246#define CSD_STRUCT_VER_1_2 2 /* Valid for system specification 3.1 - 3.2 - 3.31 - 4.0 - 4.1 */
247#define CSD_STRUCT_EXT_CSD 3 /* Version is coded in CSD_STRUCTURE in EXT_CSD */
234 248
235#define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */ 249#define CSD_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.2 */
236#define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */ 250#define CSD_SPEC_VER_1 1 /* Implements system specification 1.4 */
237#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */ 251#define CSD_SPEC_VER_2 2 /* Implements system specification 2.0 - 2.2 */
238#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 */ 252#define CSD_SPEC_VER_3 3 /* Implements system specification 3.1 - 3.2 - 3.31 */
253#define CSD_SPEC_VER_4 4 /* Implements system specification 4.0 - 4.1 */
254
255/*
256 * EXT_CSD fields
257 */
258
259#define EXT_CSD_HS_TIMING 185 /* R/W */
260#define EXT_CSD_CARD_TYPE 196 /* RO */
261
262/*
263 * EXT_CSD field definitions
264 */
265
266#define EXT_CSD_CMD_SET_NORMAL (1<<0)
267#define EXT_CSD_CMD_SET_SECURE (1<<1)
268#define EXT_CSD_CMD_SET_CPSECURE (1<<2)
269
270#define EXT_CSD_CARD_TYPE_26 (1<<0) /* Card can run at 26MHz */
271#define EXT_CSD_CARD_TYPE_52 (1<<1) /* Card can run at 52MHz */
272
273/*
274 * MMC_SWITCH access modes
275 */
239 276
277#define MMC_SWITCH_MODE_CMD_SET 0x00 /* Change the command set */
278#define MMC_SWITCH_MODE_SET_BITS 0x01 /* Set bits which are 1 in value */
279#define MMC_SWITCH_MODE_CLEAR_BITS 0x02 /* Clear bits which are 1 in value */
280#define MMC_SWITCH_MODE_WRITE_BYTE 0x03 /* Set target to value */
240 281
241/* 282/*
242 * SD bus widths 283 * SD bus widths