diff options
Diffstat (limited to 'drivers/mmc/core/mmc.c')
-rw-r--r-- | drivers/mmc/core/mmc.c | 20 |
1 files changed, 9 insertions, 11 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index fb5bf01dd1b2..36270449dd9d 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -467,29 +467,27 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) | |||
467 | card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; | 467 | card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; |
468 | } | 468 | } |
469 | 469 | ||
470 | /* eMMC v4.5 or later */ | ||
471 | if (card->ext_csd.rev >= 6) | ||
472 | card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; | ||
473 | |||
474 | card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; | 470 | card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; |
475 | if (ext_csd[EXT_CSD_ERASED_MEM_CONT]) | 471 | if (ext_csd[EXT_CSD_ERASED_MEM_CONT]) |
476 | card->erased_byte = 0xFF; | 472 | card->erased_byte = 0xFF; |
477 | else | 473 | else |
478 | card->erased_byte = 0x0; | 474 | card->erased_byte = 0x0; |
479 | 475 | ||
476 | /* eMMC v4.5 or later */ | ||
480 | if (card->ext_csd.rev >= 6) { | 477 | if (card->ext_csd.rev >= 6) { |
478 | card->ext_csd.feature_support |= MMC_DISCARD_FEATURE; | ||
479 | |||
481 | card->ext_csd.generic_cmd6_time = 10 * | 480 | card->ext_csd.generic_cmd6_time = 10 * |
482 | ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; | 481 | ext_csd[EXT_CSD_GENERIC_CMD6_TIME]; |
483 | card->ext_csd.power_off_longtime = 10 * | 482 | card->ext_csd.power_off_longtime = 10 * |
484 | ext_csd[EXT_CSD_POWER_OFF_LONG_TIME]; | 483 | ext_csd[EXT_CSD_POWER_OFF_LONG_TIME]; |
485 | } else | ||
486 | card->ext_csd.generic_cmd6_time = 0; | ||
487 | 484 | ||
488 | card->ext_csd.cache_size = | 485 | card->ext_csd.cache_size = |
489 | ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 | | 486 | ext_csd[EXT_CSD_CACHE_SIZE + 0] << 0 | |
490 | ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | | 487 | ext_csd[EXT_CSD_CACHE_SIZE + 1] << 8 | |
491 | ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | | 488 | ext_csd[EXT_CSD_CACHE_SIZE + 2] << 16 | |
492 | ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; | 489 | ext_csd[EXT_CSD_CACHE_SIZE + 3] << 24; |
490 | } | ||
493 | 491 | ||
494 | out: | 492 | out: |
495 | return err; | 493 | return err; |