Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Krishna Konda and committed by
Ulf Hansson
064f7e58 1dc5a615

+8
+6
drivers/mmc/core/mmc.c
··· 647 647 mmc_hostname(card->host), 648 648 card->ext_csd.cmdq_depth); 649 649 } 650 + card->ext_csd.enhanced_rpmb_supported = 651 + (card->ext_csd.rel_param & 652 + EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR); 650 653 } 651 654 out: 652 655 return err; ··· 789 786 card->ext_csd.enhanced_area_offset); 790 787 MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size); 791 788 MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult); 789 + MMC_DEV_ATTR(enhanced_rpmb_supported, "%#x\n", 790 + card->ext_csd.enhanced_rpmb_supported); 792 791 MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors); 793 792 MMC_DEV_ATTR(ocr, "0x%08x\n", card->ocr); 794 793 MMC_DEV_ATTR(rca, "0x%04x\n", card->rca); ··· 848 843 &dev_attr_enhanced_area_offset.attr, 849 844 &dev_attr_enhanced_area_size.attr, 850 845 &dev_attr_raw_rpmb_size_mult.attr, 846 + &dev_attr_enhanced_rpmb_supported.attr, 851 847 &dev_attr_rel_sectors.attr, 852 848 &dev_attr_ocr.attr, 853 849 &dev_attr_rca.attr,
+1
include/linux/mmc/card.h
··· 48 48 u8 sec_feature_support; 49 49 u8 rel_sectors; 50 50 u8 rel_param; 51 + bool enhanced_rpmb_supported; 51 52 u8 part_config; 52 53 u8 cache_ctrl; 53 54 u8 rst_n_function;
+1
include/linux/mmc/mmc.h
··· 325 325 */ 326 326 327 327 #define EXT_CSD_WR_REL_PARAM_EN (1<<2) 328 + #define EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR (1<<4) 328 329 329 330 #define EXT_CSD_BOOT_WP_B_PWR_WP_DIS (0x40) 330 331 #define EXT_CSD_BOOT_WP_B_PERM_WP_DIS (0x10)