mmc: core: expose info about enhanced rpmb support

Following eMMC JEDEC JESD84-B51 standard, an ehannced form of
rpmb is supported. What this enhanced mode supports is in
addition to be able to write one rpmb or two rpmb frames at a
time,32 frames can be written at a time.

Expose this information present in ext csd field so that the
user space application that wants to make use of this can do
so.

Change-Id: I53fd962fd7e04b5d2d7804c289d7865c2c5618d5
Signed-off-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Pavan Anamula <pavana@codeaurora.org>
This commit is contained in:
Krishna Konda 2015-06-29 19:34:35 -07:00 committed by Pavan Anamula
parent 30403f8fd2
commit 5542892b2f
3 changed files with 10 additions and 2 deletions

View File

@ -547,7 +547,8 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
* if it is not set then change value of REL_WR_SEC_C
* to 0x1 directly ignoring value of EXT_CSD[222].
*/
if (!(card->ext_csd.rel_param & EXT_CSD_WR_REL_PARAM_EN_RPMB))
if (!(card->ext_csd.rel_param &
EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR))
card->ext_csd.rel_sectors = 0x1;
/*
@ -622,6 +623,9 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
mmc_hostname(card->host),
card->ext_csd.cmdq_depth);
}
card->ext_csd.enhanced_rpmb_supported =
(card->ext_csd.rel_param &
EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR);
} else {
card->ext_csd.cmdq_support = 0;
card->ext_csd.cmdq_depth = 0;
@ -713,6 +717,8 @@ 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(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
MMC_DEV_ATTR(enhanced_rpmb_supported, "%#x\n",
card->ext_csd.enhanced_rpmb_supported);
MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
static struct attribute *mmc_std_attrs[] = {
@ -731,6 +737,7 @@ static struct attribute *mmc_std_attrs[] = {
&dev_attr_enhanced_area_offset.attr,
&dev_attr_enhanced_area_size.attr,
&dev_attr_raw_rpmb_size_mult.attr,
&dev_attr_enhanced_rpmb_supported.attr,
&dev_attr_rel_sectors.attr,
NULL,
};

View File

@ -54,6 +54,7 @@ struct mmc_ext_csd {
u8 sec_feature_support;
u8 rel_sectors;
u8 rel_param;
bool enhanced_rpmb_supported;
u8 part_config;
u8 cache_ctrl;
u8 rst_n_function;

View File

@ -296,7 +296,7 @@ struct _mmc_csd {
#define EXT_CSD_BKOPS_EN_AUTO_EN BIT(1)
#define EXT_CSD_WR_REL_PARAM_EN (1<<2)
#define EXT_CSD_WR_REL_PARAM_EN_RPMB (1<<4)
#define EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR (1<<4)
#define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40)
#define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10)