[U-Boot] [PATCH] mmc: fix capacity calculation with high capacity mmc
Lei Wen
leiwen at marvell.com
Mon Sep 6 15:59:08 CEST 2010
According spec, high capacity mmc should be calculated by sector
number multiply by sector size.
Signed-off-by: Lei Wen <leiwen at marvell.com>
---
drivers/mmc/mmc.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index ea398a5..bb97171 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -441,6 +441,11 @@ int mmc_change_freq(struct mmc *mmc)
if (!ext_csd[185])
return 0;
+ if (!IS_SD(mmc) && mmc->high_capacity) {
+ mmc->capacity = ext_csd[212] | (ext_csd[213] << 8)
+ | (ext_csd[214] << 16) | (ext_csd[215] << 24);
+ mmc->capacity *= mmc->read_bl_len;
+ }
/* High Speed is set, there are two types: 52MHz and 26MHz */
if (cardtype & MMC_HS_52MHZ)
mmc->card_caps |= MMC_MODE_HS_52MHz | MMC_MODE_HS;
--
1.7.0.4
More information about the U-Boot
mailing list