summaryrefslogtreecommitdiff
path: root/drivers/mmc/core/mmc.c
diff options
context:
space:
mode:
authorban_feng <Ban_Feng@asus.com>2012-03-28 11:05:29 +0800
committerMarcel Ziswiler <marcel.ziswiler@toradex.com>2015-02-03 15:49:06 +0100
commit5f7bbcaf707c56badf8dd9354994ea908561eda6 (patch)
treee0b09bb152f254b8f4d9a9fd1b3810ec71d933a8 /drivers/mmc/core/mmc.c
parenta699c4f23852bad780b8ad5273d5a3171cd461f9 (diff)
eMMC: Add Product revision, Sector count and driver init log
Change-Id: I89b544afbb0a109a222621a9948399fba8f77693 Change-Id: Ie366a152100a478e7811b4395f3fae9794bb1386 Reviewed-on: http://mcrd1-5.corpnet.asus/code-review/master/45221 Reviewed-by: Ban Feng <Ban_Feng@asus.com> Tested-by: Ban Feng <Ban_Feng@asus.com> Reviewed-by: Sam hblee <Sam_hblee@asus.com> Conflicts: drivers/mmc/core/mmc.c include/linux/mmc/card.h asdf
Diffstat (limited to 'drivers/mmc/core/mmc.c')
-rw-r--r--drivers/mmc/core/mmc.c16
1 files changed, 12 insertions, 4 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index 0e83a400f71d..7af569522624 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -23,6 +23,8 @@
#include "mmc_ops.h"
#include "sd_ops.h"
+#include "../debug_mmc.h"
+
static const unsigned int tran_exp[] = {
10000, 100000, 1000000, 10000000,
0, 0, 0, 0
@@ -96,7 +98,7 @@ static int mmc_decode_cid(struct mmc_card *card)
card->cid.prod_name[3] = UNSTUFF_BITS(resp, 72, 8);
card->cid.prod_name[4] = UNSTUFF_BITS(resp, 64, 8);
card->cid.prod_name[5] = UNSTUFF_BITS(resp, 56, 8);
- card->cid.prod_rev = UNSTUFF_BITS(resp, 48, 8);
+ card->cid.prv = UNSTUFF_BITS(resp, 48, 8);
card->cid.serial = UNSTUFF_BITS(resp, 16, 32);
card->cid.month = UNSTUFF_BITS(resp, 12, 4);
card->cid.year = UNSTUFF_BITS(resp, 8, 4) + 1997;
@@ -108,6 +110,8 @@ static int mmc_decode_cid(struct mmc_card *card)
return -EINVAL;
}
+ MMC_printk("cid.prv 0x%x", card->cid.prv);
+
return 0;
}
@@ -277,6 +281,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
ext_csd[EXT_CSD_SEC_CNT + 1] << 8 |
ext_csd[EXT_CSD_SEC_CNT + 2] << 16 |
ext_csd[EXT_CSD_SEC_CNT + 3] << 24;
+ MMC_printk("ext_csd.sectors 0x%x prod_name %s BOOT_MULTI 0x%x", card->ext_csd.sectors, card->cid.prod_name, ext_csd[EXT_CSD_BOOT_MULT]);
+ card->ext_csd.sec_count = card->ext_csd.sectors;
/* Cards with density > 2GiB are sector addressed */
if (card->ext_csd.sectors > (2u * 1024 * 1024 * 1024) / 512)
@@ -427,8 +433,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
card->ext_csd.bk_ops = 1;
/* Check whether the eMMC card needs proactive refresh */
- if ((card->cid.manfid == 0x90) && ((card->cid.prod_rev == 0x73)
- || (card->cid.prod_rev == 0x7b)))
+ if ((card->cid.manfid == 0x90) && ((card->cid.prv == 0x73)
+ || (card->cid.prv == 0x7b)))
card->ext_csd.refresh = 1;
}
@@ -521,11 +527,12 @@ MMC_DEV_ATTR(hwrev, "0x%x\n", card->cid.hwrev);
MMC_DEV_ATTR(manfid, "0x%06x\n", card->cid.manfid);
MMC_DEV_ATTR(name, "%s\n", card->cid.prod_name);
MMC_DEV_ATTR(oemid, "0x%04x\n", card->cid.oemid);
-MMC_DEV_ATTR(prv, "0x%x\n", card->cid.prod_rev);
+MMC_DEV_ATTR(prv, "0x%x\n", card->cid.prv);
MMC_DEV_ATTR(serial, "0x%08x\n", card->cid.serial);
MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
card->ext_csd.enhanced_area_offset);
MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
+MMC_DEV_ATTR(sec_count, "0x%x\n", card->ext_csd.sec_count);
static struct attribute *mmc_std_attrs[] = {
&dev_attr_cid.attr,
@@ -542,6 +549,7 @@ static struct attribute *mmc_std_attrs[] = {
&dev_attr_serial.attr,
&dev_attr_enhanced_area_offset.attr,
&dev_attr_enhanced_area_size.attr,
+ &dev_attr_sec_count.attr,
NULL,
};