diff options
author | Philip Rakity <prakity@marvell.com> | 2011-11-14 22:14:38 -0500 |
---|---|---|
committer | Chris Ball <cjb@laptop.org> | 2012-01-11 23:58:41 -0500 |
commit | a303c5319c8e6ab0e744ebca118da8420043b2c3 (patch) | |
tree | c4b307137f68551b4d30fefab6f9ec2760d3f7eb /include/linux/mmc | |
parent | b70a7fab26db65f7daaf04f49a3bd673250f48c7 (diff) |
mmc: sdio: support SDIO UHS cards
This patch adds support for sdio UHS cards per the version 3.0
spec.
UHS mode is only enabled for version 3.0 cards when both the
host and the controller support UHS modes.
1.8v signaling support is removed if both the card and the
host do not support UHS. This is done to maintain
compatibility and some system/card combinations break when
1.8v signaling is enabled when the host does not support UHS.
Signed-off-by: Philip Rakity <prakity@marvell.com>
Signed-off-by: Aaron Lu <Aaron.lu@amd.com>
Reviewed-by: Arindam Nath <arindam.nath@amd.com>
Tested-by: Bing Zhao <bzhao@marvell.com>
Signed-off-by: Chris Ball <cjb@laptop.org>
Diffstat (limited to 'include/linux/mmc')
-rw-r--r-- | include/linux/mmc/card.h | 4 | ||||
-rw-r--r-- | include/linux/mmc/sdio.h | 29 |
2 files changed, 30 insertions, 3 deletions
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 2c9be29684cf..534974c3ef0c 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -367,7 +367,8 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) | |||
367 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) | 367 | #define mmc_card_highspeed(c) ((c)->state & MMC_STATE_HIGHSPEED) |
368 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) | 368 | #define mmc_card_blockaddr(c) ((c)->state & MMC_STATE_BLOCKADDR) |
369 | #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) | 369 | #define mmc_card_ddr_mode(c) ((c)->state & MMC_STATE_HIGHSPEED_DDR) |
370 | #define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) | 370 | #define mmc_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) |
371 | #define mmc_sd_card_uhs(c) ((c)->state & MMC_STATE_ULTRAHIGHSPEED) | ||
371 | #define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC) | 372 | #define mmc_card_ext_capacity(c) ((c)->state & MMC_CARD_SDXC) |
372 | 373 | ||
373 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) | 374 | #define mmc_card_set_present(c) ((c)->state |= MMC_STATE_PRESENT) |
@@ -375,6 +376,7 @@ static inline void __maybe_unused remove_quirk(struct mmc_card *card, int data) | |||
375 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) | 376 | #define mmc_card_set_highspeed(c) ((c)->state |= MMC_STATE_HIGHSPEED) |
376 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) | 377 | #define mmc_card_set_blockaddr(c) ((c)->state |= MMC_STATE_BLOCKADDR) |
377 | #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) | 378 | #define mmc_card_set_ddr_mode(c) ((c)->state |= MMC_STATE_HIGHSPEED_DDR) |
379 | #define mmc_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) | ||
378 | #define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) | 380 | #define mmc_sd_card_set_uhs(c) ((c)->state |= MMC_STATE_ULTRAHIGHSPEED) |
379 | #define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) | 381 | #define mmc_card_set_ext_capacity(c) ((c)->state |= MMC_CARD_SDXC) |
380 | 382 | ||
diff --git a/include/linux/mmc/sdio.h b/include/linux/mmc/sdio.h index e0b1123497b9..c9fe66c58f8f 100644 --- a/include/linux/mmc/sdio.h +++ b/include/linux/mmc/sdio.h | |||
@@ -38,6 +38,7 @@ | |||
38 | * [8:0] Byte/block count | 38 | * [8:0] Byte/block count |
39 | */ | 39 | */ |
40 | 40 | ||
41 | #define R4_18V_PRESENT (1<<24) | ||
41 | #define R4_MEMORY_PRESENT (1 << 27) | 42 | #define R4_MEMORY_PRESENT (1 << 27) |
42 | 43 | ||
43 | /* | 44 | /* |
@@ -85,6 +86,7 @@ | |||
85 | #define SDIO_SD_REV_1_01 0 /* SD Physical Spec Version 1.01 */ | 86 | #define SDIO_SD_REV_1_01 0 /* SD Physical Spec Version 1.01 */ |
86 | #define SDIO_SD_REV_1_10 1 /* SD Physical Spec Version 1.10 */ | 87 | #define SDIO_SD_REV_1_10 1 /* SD Physical Spec Version 1.10 */ |
87 | #define SDIO_SD_REV_2_00 2 /* SD Physical Spec Version 2.00 */ | 88 | #define SDIO_SD_REV_2_00 2 /* SD Physical Spec Version 2.00 */ |
89 | #define SDIO_SD_REV_3_00 3 /* SD Physical Spev Version 3.00 */ | ||
88 | 90 | ||
89 | #define SDIO_CCCR_IOEx 0x02 | 91 | #define SDIO_CCCR_IOEx 0x02 |
90 | #define SDIO_CCCR_IORx 0x03 | 92 | #define SDIO_CCCR_IORx 0x03 |
@@ -134,8 +136,31 @@ | |||
134 | #define SDIO_CCCR_SPEED 0x13 | 136 | #define SDIO_CCCR_SPEED 0x13 |
135 | 137 | ||
136 | #define SDIO_SPEED_SHS 0x01 /* Supports High-Speed mode */ | 138 | #define SDIO_SPEED_SHS 0x01 /* Supports High-Speed mode */ |
137 | #define SDIO_SPEED_EHS 0x02 /* Enable High-Speed mode */ | 139 | #define SDIO_SPEED_BSS_SHIFT 1 |
138 | 140 | #define SDIO_SPEED_BSS_MASK (7<<SDIO_SPEED_BSS_SHIFT) | |
141 | #define SDIO_SPEED_SDR12 (0<<SDIO_SPEED_BSS_SHIFT) | ||
142 | #define SDIO_SPEED_SDR25 (1<<SDIO_SPEED_BSS_SHIFT) | ||
143 | #define SDIO_SPEED_SDR50 (2<<SDIO_SPEED_BSS_SHIFT) | ||
144 | #define SDIO_SPEED_SDR104 (3<<SDIO_SPEED_BSS_SHIFT) | ||
145 | #define SDIO_SPEED_DDR50 (4<<SDIO_SPEED_BSS_SHIFT) | ||
146 | #define SDIO_SPEED_EHS SDIO_SPEED_SDR25 /* Enable High-Speed */ | ||
147 | |||
148 | #define SDIO_CCCR_UHS 0x14 | ||
149 | #define SDIO_UHS_SDR50 0x01 | ||
150 | #define SDIO_UHS_SDR104 0x02 | ||
151 | #define SDIO_UHS_DDR50 0x04 | ||
152 | |||
153 | #define SDIO_CCCR_DRIVE_STRENGTH 0x15 | ||
154 | #define SDIO_SDTx_MASK 0x07 | ||
155 | #define SDIO_DRIVE_SDTA (1<<0) | ||
156 | #define SDIO_DRIVE_SDTC (1<<1) | ||
157 | #define SDIO_DRIVE_SDTD (1<<2) | ||
158 | #define SDIO_DRIVE_DTSx_MASK 0x03 | ||
159 | #define SDIO_DRIVE_DTSx_SHIFT 4 | ||
160 | #define SDIO_DTSx_SET_TYPE_B (0 << SDIO_DRIVE_DTSx_SHIFT) | ||
161 | #define SDIO_DTSx_SET_TYPE_A (1 << SDIO_DRIVE_DTSx_SHIFT) | ||
162 | #define SDIO_DTSx_SET_TYPE_C (2 << SDIO_DRIVE_DTSx_SHIFT) | ||
163 | #define SDIO_DTSx_SET_TYPE_D (3 << SDIO_DRIVE_DTSx_SHIFT) | ||
139 | /* | 164 | /* |
140 | * Function Basic Registers (FBR) | 165 | * Function Basic Registers (FBR) |
141 | */ | 166 | */ |