diff mbox

[REVIEW,2/2] ENGR0000137838 SDHCI Some eMMC cards can't work well in our BSP

Message ID 1294711368-446-1-git-send-email-r65037@freescale.com (mailing list archive)
State New, archived
Headers show

Commit Message

Richard Zhu Jan. 11, 2011, 2:02 a.m. UTC
None
diff mbox

Patch

=============================================
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 4a9e2ed..95e13c2 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -222,7 +222,9 @@  static int mmc_read_ext_csd(struct mmc_card *card)
 			ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |
 			ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |
 			ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
-		if (card->ext_csd.sectors)
+
+		/* Cards with density > 2GiB are sector addressed */
+		if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
 			mmc_card_set_blockaddr(card);
 	}