aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAndrei Warkentin <andreiw@motorola.com>2011-05-23 16:06:38 -0400
committerChris Ball <cjb@laptop.org>2011-05-25 16:49:03 -0400
commitf0d89972b01798cf9d245dfa1cacfa0ee78a3593 (patch)
treea3e69fc95825971384798eac4281148db837f891
parente89d456fcdde2df008c032bf928e69e628e07a28 (diff)
mmc: core: Block CMD23 support for UHS104/SDXC cards.
SD cards operating at UHS104 or better support SET_BLOCK_COUNT. Signed-off-by: Andrei Warkentin <andreiw@motorola.com> Reviewed-by: Arindam Nath <arindam.nath@amd.com> Signed-off-by: Chris Ball <cjb@laptop.org>
-rw-r--r--drivers/mmc/card/block.c9
-rw-r--r--drivers/mmc/core/sd.c2
-rw-r--r--include/linux/mmc/card.h3
-rw-r--r--include/linux/mmc/sd.h2
4 files changed, 12 insertions, 4 deletions
diff --git a/drivers/mmc/card/block.c b/drivers/mmc/card/block.c
index a380accaba9a..71da5641e258 100644
--- a/drivers/mmc/card/block.c
+++ b/drivers/mmc/card/block.c
@@ -1057,9 +1057,12 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
1057 blk_queue_logical_block_size(md->queue.queue, 512); 1057 blk_queue_logical_block_size(md->queue.queue, 512);
1058 set_capacity(md->disk, size); 1058 set_capacity(md->disk, size);
1059 1059
1060 if (mmc_host_cmd23(card->host) && 1060 if (mmc_host_cmd23(card->host)) {
1061 mmc_card_mmc(card)) 1061 if (mmc_card_mmc(card) ||
1062 md->flags |= MMC_BLK_CMD23; 1062 (mmc_card_sd(card) &&
1063 card->scr.cmds & SD_SCR_CMD23_SUPPORT))
1064 md->flags |= MMC_BLK_CMD23;
1065 }
1063 1066
1064 if (mmc_card_mmc(card) && 1067 if (mmc_card_mmc(card) &&
1065 md->flags & MMC_BLK_CMD23 && 1068 md->flags & MMC_BLK_CMD23 &&
diff --git a/drivers/mmc/core/sd.c b/drivers/mmc/core/sd.c
index 596d0b9d30b8..ff2774128aa9 100644
--- a/drivers/mmc/core/sd.c
+++ b/drivers/mmc/core/sd.c
@@ -203,6 +203,8 @@ static int mmc_decode_scr(struct mmc_card *card)
203 else 203 else
204 card->erased_byte = 0x0; 204 card->erased_byte = 0x0;
205 205
206 if (scr->sda_spec3)
207 scr->cmds = UNSTUFF_BITS(resp, 32, 2);
206 return 0; 208 return 0;
207} 209}
208 210
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index 4a0e27baaea0..c6927a4d157f 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -72,6 +72,9 @@ struct sd_scr {
72 unsigned char bus_widths; 72 unsigned char bus_widths;
73#define SD_SCR_BUS_WIDTH_1 (1<<0) 73#define SD_SCR_BUS_WIDTH_1 (1<<0)
74#define SD_SCR_BUS_WIDTH_4 (1<<2) 74#define SD_SCR_BUS_WIDTH_4 (1<<2)
75 unsigned char cmds;
76#define SD_SCR_CMD20_SUPPORT (1<<0)
77#define SD_SCR_CMD23_SUPPORT (1<<1)
75}; 78};
76 79
77struct sd_ssr { 80struct sd_ssr {
diff --git a/include/linux/mmc/sd.h b/include/linux/mmc/sd.h
index c648878f6734..7d35d52c3df3 100644
--- a/include/linux/mmc/sd.h
+++ b/include/linux/mmc/sd.h
@@ -66,7 +66,7 @@
66 66
67#define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */ 67#define SCR_SPEC_VER_0 0 /* Implements system specification 1.0 - 1.01 */
68#define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */ 68#define SCR_SPEC_VER_1 1 /* Implements system specification 1.10 */
69#define SCR_SPEC_VER_2 2 /* Implements system specification 2.00 */ 69#define SCR_SPEC_VER_2 2 /* Implements system specification 2.00-3.0X */
70 70
71/* 71/*
72 * SD bus widths 72 * SD bus widths