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

mmc: core: Extend sysfs to ext_csd parameters for RPMB support

Extend current sysfs access to ext_csd rpmb parameters (RPMB partition
size) and rel_sector information.

Signed-off-by: Loic Pallardy <loic.pallardy@stericsson.com>
Reviewed-by: Namjae Jeon <linkinjeon@gmail.com>
Acked-by: Linus Walleij <linus.walleij@linaro.org>
Acked-by: Johan Rudholm <johan.rudholm@stericsson.com>
Acked-by: Krishna Konda <kkonda@codeaurora.org>
Signed-off-by: Chris Ball <cjb@laptop.org>

authored by

Loic Pallardy and committed by
Chris Ball
188cc042 53d8f974

+11
+7
Documentation/mmc/mmc-dev-attrs.txt
··· 25 25 serial Product Serial Number (from CID Register) 26 26 erase_size Erase group size 27 27 preferred_erase_size Preferred erase size 28 + raw_rpmb_size_mult RPMB partition size 29 + rel_sectors Reliable write sector count 28 30 29 31 Note on Erase Size and Preferred Erase Size: 30 32 ··· 66 64 size specified by the card. 67 65 68 66 "preferred_erase_size" is in bytes. 67 + 68 + Note on raw_rpmb_size_mult: 69 + "raw_rpmb_size_mult" is a mutliple of 128kB block. 70 + RPMB size in byte is calculated by using the following equation: 71 + RPMB partition size = 128kB x raw_rpmb_size_mult 69 72 70 73 SD/MMC/SDIO Clock Gating Attribute 71 74 ==================================
+4
drivers/mmc/core/mmc.c
··· 626 626 MMC_DEV_ATTR(enhanced_area_offset, "%llu\n", 627 627 card->ext_csd.enhanced_area_offset); 628 628 MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size); 629 + MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult); 630 + MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors); 629 631 630 632 static struct attribute *mmc_std_attrs[] = { 631 633 &dev_attr_cid.attr, ··· 643 641 &dev_attr_serial.attr, 644 642 &dev_attr_enhanced_area_offset.attr, 645 643 &dev_attr_enhanced_area_size.attr, 644 + &dev_attr_raw_rpmb_size_mult.attr, 645 + &dev_attr_rel_sectors.attr, 646 646 NULL, 647 647 }; 648 648