mmc: core: Block CMD23 support for UHS104/SDXC cards.
authorAndrei Warkentin <andreiw@motorola.com>
Mon, 23 May 2011 20:06:38 +0000 (15:06 -0500)
committerChris Ball <cjb@laptop.org>
Wed, 25 May 2011 20:49:03 +0000 (16:49 -0400)
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>
drivers/mmc/card/block.c
drivers/mmc/core/sd.c
include/linux/mmc/card.h
include/linux/mmc/sd.h

index a380accaba9a807b15e4c98cae419c065c7a4743..71da5641e258e041cb9b72439d3d18eac9d9baa9 100644 (file)
@@ -1057,9 +1057,12 @@ static struct mmc_blk_data *mmc_blk_alloc_req(struct mmc_card *card,
        blk_queue_logical_block_size(md->queue.queue, 512);
        set_capacity(md->disk, size);
 
-       if (mmc_host_cmd23(card->host) &&
-           mmc_card_mmc(card))
-               md->flags |= MMC_BLK_CMD23;
+       if (mmc_host_cmd23(card->host)) {
+               if (mmc_card_mmc(card) ||
+                   (mmc_card_sd(card) &&
+                    card->scr.cmds & SD_SCR_CMD23_SUPPORT))
+                       md->flags |= MMC_BLK_CMD23;
+       }
 
        if (mmc_card_mmc(card) &&
            md->flags & MMC_BLK_CMD23 &&
index 596d0b9d30b8038c0083f10d51c1cebb88cbd386..ff2774128aa93b1231538b1f5e014b0df987e7ca 100644 (file)
@@ -203,6 +203,8 @@ static int mmc_decode_scr(struct mmc_card *card)
        else
                card->erased_byte = 0x0;
 
+       if (scr->sda_spec3)
+               scr->cmds = UNSTUFF_BITS(resp, 32, 2);
        return 0;
 }
 
index 4a0e27baaea0b9e3f379899b6d201ab946e16b7b..c6927a4d157fd3cfb9f4a963065353c730364b99 100644 (file)
@@ -72,6 +72,9 @@ struct sd_scr {
        unsigned char           bus_widths;
 #define SD_SCR_BUS_WIDTH_1     (1<<0)
 #define SD_SCR_BUS_WIDTH_4     (1<<2)
+       unsigned char           cmds;
+#define SD_SCR_CMD20_SUPPORT   (1<<0)
+#define SD_SCR_CMD23_SUPPORT   (1<<1)
 };
 
 struct sd_ssr {
index c648878f6734a24db71753f0d9e167f778d38252..7d35d52c3df374a2a19ad7d9089381992f88317c 100644 (file)
@@ -66,7 +66,7 @@
 
 #define SCR_SPEC_VER_0         0       /* Implements system specification 1.0 - 1.01 */
 #define SCR_SPEC_VER_1         1       /* Implements system specification 1.10 */
-#define SCR_SPEC_VER_2         2       /* Implements system specification 2.00 */
+#define SCR_SPEC_VER_2         2       /* Implements system specification 2.00-3.0X */
 
 /*
  * SD bus widths