mmc: core: Expose access to RPMB partition

Following JEDEC standard, if the mmc supports RPMB partition,
a new interface is created and exposed via /dev/block.
Users will be able to access RPMB partition using standard
mmc IOCTL commands.

Signed-off-by: Alex Macro <[email protected]>
Signed-off-by: Loic Pallardy <[email protected]>
Reviewed-by: Namjae Jeon <[email protected]>
Acked-by: Linus Walleij <[email protected]>
Acked-by: Johan Rudholm <[email protected]>
Acked-by: Krishna Konda <[email protected]>
Signed-off-by: Chris Ball <[email protected]>
This commit is contained in:
Loic Pallardy 2012-11-17 18:08:24 -05:00 • committed by Chris Ball
commit 090d25fe22
3 changed files with 15 additions and 0 deletions

View file

@ -491,6 +491,17 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd)
card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM];
card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION];
/*
* RPMB regions are defined in multiples of 128K.
*/
card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT];
if (ext_csd[EXT_CSD_RPMB_MULT]) {
mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17,
EXT_CSD_PART_CONFIG_ACC_RPMB,
"rpmb", 0, false,
MMC_BLK_DATA_AREA_RPMB);
}
}
card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT];