Skip to content

Commit 064f7e5

Browse files
Krishna KondaUlf Hansson
authored andcommitted
mmc: core: expose info about enhanced rpmb support
Following eMMC JEDEC JESD84-B51 standard, an enhanced 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. Signed-off-by: Krishna Konda <kkonda@codeaurora.org> Signed-off-by: Veerabhadrarao Badiganti <vbadigan@codeaurora.org> Link: https://lore.kernel.org/r/1588341189-4371-1-git-send-email-vbadigan@codeaurora.org Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
1 parent 1dc5a61 commit 064f7e5

3 files changed

Lines changed: 8 additions & 0 deletions

File tree

‎drivers/mmc/core/mmc.c‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -647,6 +647,9 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
647647
mmc_hostname(card->host),
648648
card->ext_csd.cmdq_depth);
649649
}
650+
card->ext_csd.enhanced_rpmb_supported =
651+
(card->ext_csd.rel_param &
652+
EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR);
650653
}
651654
out:
652655
return err;
@@ -786,6 +789,8 @@ MMC_DEV_ATTR(enhanced_area_offset, "%llu\n",
786789
card->ext_csd.enhanced_area_offset);
787790
MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
788791
MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
792+
MMC_DEV_ATTR(enhanced_rpmb_supported, "%#x\n",
793+
card->ext_csd.enhanced_rpmb_supported);
789794
MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
790795
MMC_DEV_ATTR(ocr, "0x%08x\n", card->ocr);
791796
MMC_DEV_ATTR(rca, "0x%04x\n", card->rca);
@@ -843,6 +848,7 @@ static struct attribute *mmc_std_attrs[] = {
843848
&dev_attr_enhanced_area_offset.attr,
844849
&dev_attr_enhanced_area_size.attr,
845850
&dev_attr_raw_rpmb_size_mult.attr,
851+
&dev_attr_enhanced_rpmb_supported.attr,
846852
&dev_attr_rel_sectors.attr,
847853
&dev_attr_ocr.attr,
848854
&dev_attr_rca.attr,

‎include/linux/mmc/card.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,7 @@ struct mmc_ext_csd {
4848
u8 sec_feature_support;
4949
u8 rel_sectors;
5050
u8 rel_param;
51+
bool enhanced_rpmb_supported;
5152
u8 part_config;
5253
u8 cache_ctrl;
5354
u8 rst_n_function;

‎include/linux/mmc/mmc.h‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -325,6 +325,7 @@ static inline bool mmc_ready_for_data(u32 status)
325325
*/
326326

327327
#define EXT_CSD_WR_REL_PARAM_EN (1<<2)
328+
#define EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR (1<<4)
328329

329330
#define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40)
330331
#define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10)

0 commit comments

Comments
 (0)