diff options
-rw-r--r-- | drivers/mmc/core/mmc.c | 11 | ||||
-rw-r--r-- | include/linux/mmc/card.h | 2 | ||||
-rw-r--r-- | include/linux/mmc/mmc.h | 2 |
3 files changed, 15 insertions, 0 deletions
diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c index 8c2fa8002abb..6c5576628ef1 100644 --- a/drivers/mmc/core/mmc.c +++ b/drivers/mmc/core/mmc.c | |||
@@ -491,6 +491,17 @@ static int mmc_read_ext_csd(struct mmc_card *card, u8 *ext_csd) | |||
491 | 491 | ||
492 | card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM]; | 492 | card->ext_csd.rel_param = ext_csd[EXT_CSD_WR_REL_PARAM]; |
493 | card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; | 493 | card->ext_csd.rst_n_function = ext_csd[EXT_CSD_RST_N_FUNCTION]; |
494 | |||
495 | /* | ||
496 | * RPMB regions are defined in multiples of 128K. | ||
497 | */ | ||
498 | card->ext_csd.raw_rpmb_size_mult = ext_csd[EXT_CSD_RPMB_MULT]; | ||
499 | if (ext_csd[EXT_CSD_RPMB_MULT]) { | ||
500 | mmc_part_add(card, ext_csd[EXT_CSD_RPMB_MULT] << 17, | ||
501 | EXT_CSD_PART_CONFIG_ACC_RPMB, | ||
502 | "rpmb", 0, false, | ||
503 | MMC_BLK_DATA_AREA_RPMB); | ||
504 | } | ||
494 | } | 505 | } |
495 | 506 | ||
496 | card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; | 507 | card->ext_csd.raw_erased_mem_count = ext_csd[EXT_CSD_ERASED_MEM_CONT]; |
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h index 943550dfe9ea..5c69315d60cc 100644 --- a/include/linux/mmc/card.h +++ b/include/linux/mmc/card.h | |||
@@ -85,6 +85,7 @@ struct mmc_ext_csd { | |||
85 | bool boot_ro_lockable; | 85 | bool boot_ro_lockable; |
86 | u8 raw_exception_status; /* 53 */ | 86 | u8 raw_exception_status; /* 53 */ |
87 | u8 raw_partition_support; /* 160 */ | 87 | u8 raw_partition_support; /* 160 */ |
88 | u8 raw_rpmb_size_mult; /* 168 */ | ||
88 | u8 raw_erased_mem_count; /* 181 */ | 89 | u8 raw_erased_mem_count; /* 181 */ |
89 | u8 raw_ext_csd_structure; /* 194 */ | 90 | u8 raw_ext_csd_structure; /* 194 */ |
90 | u8 raw_card_type; /* 196 */ | 91 | u8 raw_card_type; /* 196 */ |
@@ -206,6 +207,7 @@ struct mmc_part { | |||
206 | #define MMC_BLK_DATA_AREA_MAIN (1<<0) | 207 | #define MMC_BLK_DATA_AREA_MAIN (1<<0) |
207 | #define MMC_BLK_DATA_AREA_BOOT (1<<1) | 208 | #define MMC_BLK_DATA_AREA_BOOT (1<<1) |
208 | #define MMC_BLK_DATA_AREA_GP (1<<2) | 209 | #define MMC_BLK_DATA_AREA_GP (1<<2) |
210 | #define MMC_BLK_DATA_AREA_RPMB (1<<3) | ||
209 | }; | 211 | }; |
210 | 212 | ||
211 | /* | 213 | /* |
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h index 01e4b394029b..94d532e41c61 100644 --- a/include/linux/mmc/mmc.h +++ b/include/linux/mmc/mmc.h | |||
@@ -286,6 +286,7 @@ struct _mmc_csd { | |||
286 | #define EXT_CSD_BKOPS_START 164 /* W */ | 286 | #define EXT_CSD_BKOPS_START 164 /* W */ |
287 | #define EXT_CSD_SANITIZE_START 165 /* W */ | 287 | #define EXT_CSD_SANITIZE_START 165 /* W */ |
288 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ | 288 | #define EXT_CSD_WR_REL_PARAM 166 /* RO */ |
289 | #define EXT_CSD_RPMB_MULT 168 /* RO */ | ||
289 | #define EXT_CSD_BOOT_WP 173 /* R/W */ | 290 | #define EXT_CSD_BOOT_WP 173 /* R/W */ |
290 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ | 291 | #define EXT_CSD_ERASE_GROUP_DEF 175 /* R/W */ |
291 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ | 292 | #define EXT_CSD_PART_CONFIG 179 /* R/W */ |
@@ -339,6 +340,7 @@ struct _mmc_csd { | |||
339 | 340 | ||
340 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) | 341 | #define EXT_CSD_PART_CONFIG_ACC_MASK (0x7) |
341 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) | 342 | #define EXT_CSD_PART_CONFIG_ACC_BOOT0 (0x1) |
343 | #define EXT_CSD_PART_CONFIG_ACC_RPMB (0x3) | ||
342 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) | 344 | #define EXT_CSD_PART_CONFIG_ACC_GP0 (0x4) |
343 | 345 | ||
344 | #define EXT_CSD_PART_SUPPORT_PART_EN (0x1) | 346 | #define EXT_CSD_PART_SUPPORT_PART_EN (0x1) |