summaryrefslogtreecommitdiff
path: root/drivers/mmc/mmc.c
diff options
context:
space:
mode:
authorTerry Lv <r65388@freescale.com>2011-03-21 13:48:07 +0800
committerTerry Lv <r65388@freescale.com>2011-03-21 13:59:13 +0800
commit682e2a17a1f5241b2488e3af76bef0063260a64e (patch)
treef649c8baa5a87373139fda8f0d4d947d002d9019 /drivers/mmc/mmc.c
parentac48999b9353d038e95f965af08184dc6342adfc (diff)
downloadu-boot-imx-682e2a17a1f5241b2488e3af76bef0063260a64e.zip
u-boot-imx-682e2a17a1f5241b2488e3af76bef0063260a64e.tar.gz
u-boot-imx-682e2a17a1f5241b2488e3af76bef0063260a64e.tar.bz2
ENGR00140873: MMC may wrongly regconize 2GB eMMC as high capacity
MMC driver may wrongly regconize some 2GB eMMC as high capacity card. This patch is picked from community. A non-zero value of SEC_COUNT does not indicate that the card is sector addressed. According to the MMC specification, cards with a densitygreater than 2GiB are sector addressed. Signed-off-by: Terry Lv <r65388@freescale.com>
Diffstat (limited to 'drivers/mmc/mmc.c')
-rw-r--r--drivers/mmc/mmc.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/drivers/mmc/mmc.c b/drivers/mmc/mmc.c
index 6fc3be2..ba14330 100644
--- a/drivers/mmc/mmc.c
+++ b/drivers/mmc/mmc.c
@@ -1,5 +1,5 @@
/*
- * (C) Copyright 2008-2010 Freescale Semiconductor, Inc.
+ * (C) Copyright 2008-2011 Freescale Semiconductor, Inc.
* Terry Lv
*
* Copyright 2008, Freescale Semiconductor, Inc
@@ -437,7 +437,9 @@ static int mmc_change_freq(struct mmc *mmc)
if (err)
goto err_rtn;
- if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215])
+ /* Cards with density > 2GiB are sector addressed */
+ if (ext_csd[212] || ext_csd[213] || ext_csd[214] || ext_csd[215] &&
+ (mmc->capacity > (2u * 1024 * 1024 * 1024) / 512))
mmc->high_capacity = 1;
cardtype = ext_csd[EXT_CSD_CARD_TYPE] & 0xf;