Skip to content

Commit

Permalink
Added MMc fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Jhinta committed May 22, 2012
1 parent 89042df commit 2f9bef0
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion drivers/mmc/core/mmc.c
Original file line number Diff line number Diff line change
Expand Up @@ -279,8 +279,13 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;

/* Cards with density > 2GiB are sector addressed */
if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512) {
unsigned boot_sectors;
/* size is in 256K chunks, i.e. 512 sectors each */
boot_sectors = ext_csd[EXT_CSD_BOOT_MULT] * 512;
card->ext_csd.sectors -= boot_sectors;
mmc_card_set_blockaddr(card);
}
}
card->ext_csd.raw_card_type = ext_csd[EXT_CSD_CARD_TYPE];
switch (ext_csd[EXT_CSD_CARD_TYPE] & EXT_CSD_CARD_TYPE_MASK) {
Expand Down

0 comments on commit 2f9bef0

Please sign in to comment.