linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH V1] mmc: core: expose info about enhanced rpmb support
@ 2020-05-01 13:53 Veerabhadrarao Badiganti
  2020-05-07  9:29 ` Ulf Hansson
  0 siblings, 1 reply; 2+ messages in thread
From: Veerabhadrarao Badiganti @ 2020-05-01 13:53 UTC (permalink / raw)
  To: adrian.hunter, ulf.hansson
  Cc: linux-mmc, linux-kernel, linux-arm-msm, Krishna Konda,
	Veerabhadrarao Badiganti, Baolin Wang, Ludovic Barre,
	Thomas Gleixner, Wolfram Sang, Bradley Bolen

From: Krishna Konda <kkonda@codeaurora.org>

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>
---
 drivers/mmc/core/mmc.c   | 6 ++++++
 include/linux/mmc/card.h | 1 +
 include/linux/mmc/mmc.h  | 1 +
 3 files changed, 8 insertions(+)

diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
index de94fbe..4203303 100644
--- a/drivers/mmc/core/mmc.c
+++ b/drivers/mmc/core/mmc.c
@@ -647,6 +647,9 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
 				 mmc_hostname(card->host),
 				 card->ext_csd.cmdq_depth);
 		}
+		card->ext_csd.enhanced_rpmb_supported =
+					(card->ext_csd.rel_param &
+					 EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR);
 	}
 out:
 	return err;
@@ -786,6 +789,8 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width)
 		card->ext_csd.enhanced_area_offset);
 MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
 MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
+MMC_DEV_ATTR(enhanced_rpmb_supported, "%#x\n",
+	card->ext_csd.enhanced_rpmb_supported);
 MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
 MMC_DEV_ATTR(ocr, "0x%08x\n", card->ocr);
 MMC_DEV_ATTR(rca, "0x%04x\n", card->rca);
@@ -843,6 +848,7 @@ static ssize_t mmc_dsr_show(struct device *dev,
 	&dev_attr_enhanced_area_offset.attr,
 	&dev_attr_enhanced_area_size.attr,
 	&dev_attr_raw_rpmb_size_mult.attr,
+	&dev_attr_enhanced_rpmb_supported.attr,
 	&dev_attr_rel_sectors.attr,
 	&dev_attr_ocr.attr,
 	&dev_attr_rca.attr,
diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
index cf3780a..7d46411 100644
--- a/include/linux/mmc/card.h
+++ b/include/linux/mmc/card.h
@@ -48,6 +48,7 @@ struct mmc_ext_csd {
 	u8			sec_feature_support;
 	u8			rel_sectors;
 	u8			rel_param;
+	bool			enhanced_rpmb_supported;
 	u8			part_config;
 	u8			cache_ctrl;
 	u8			rst_n_function;
diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
index 4b85ef0..d9a65c6 100644
--- a/include/linux/mmc/mmc.h
+++ b/include/linux/mmc/mmc.h
@@ -325,6 +325,7 @@ static inline bool mmc_ready_for_data(u32 status)
  */
 
 #define EXT_CSD_WR_REL_PARAM_EN		(1<<2)
+#define EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR	(1<<4)
 
 #define EXT_CSD_BOOT_WP_B_PWR_WP_DIS	(0x40)
 #define EXT_CSD_BOOT_WP_B_PERM_WP_DIS	(0x10)
-- 
Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [PATCH V1] mmc: core: expose info about enhanced rpmb support
  2020-05-01 13:53 [PATCH V1] mmc: core: expose info about enhanced rpmb support Veerabhadrarao Badiganti
@ 2020-05-07  9:29 ` Ulf Hansson
  0 siblings, 0 replies; 2+ messages in thread
From: Ulf Hansson @ 2020-05-07  9:29 UTC (permalink / raw)
  To: Veerabhadrarao Badiganti
  Cc: Adrian Hunter, linux-mmc, Linux Kernel Mailing List,
	linux-arm-msm, Krishna Konda, Baolin Wang, Ludovic Barre,
	Thomas Gleixner, Wolfram Sang, Bradley Bolen

On Fri, 1 May 2020 at 15:54, Veerabhadrarao Badiganti
<vbadigan@codeaurora.org> wrote:
>
> From: Krishna Konda <kkonda@codeaurora.org>
>
> 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>

Applied for next, thanks!

Kind regards
Uffe


> ---
>  drivers/mmc/core/mmc.c   | 6 ++++++
>  include/linux/mmc/card.h | 1 +
>  include/linux/mmc/mmc.h  | 1 +
>  3 files changed, 8 insertions(+)
>
> diff --git a/drivers/mmc/core/mmc.c b/drivers/mmc/core/mmc.c
> index de94fbe..4203303 100644
> --- a/drivers/mmc/core/mmc.c
> +++ b/drivers/mmc/core/mmc.c
> @@ -647,6 +647,9 @@ static int mmc_decode_ext_csd(struct mmc_card *card, u8 *ext_csd)
>                                  mmc_hostname(card->host),
>                                  card->ext_csd.cmdq_depth);
>                 }
> +               card->ext_csd.enhanced_rpmb_supported =
> +                                       (card->ext_csd.rel_param &
> +                                        EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR);
>         }
>  out:
>         return err;
> @@ -786,6 +789,8 @@ static int mmc_compare_ext_csds(struct mmc_card *card, unsigned bus_width)
>                 card->ext_csd.enhanced_area_offset);
>  MMC_DEV_ATTR(enhanced_area_size, "%u\n", card->ext_csd.enhanced_area_size);
>  MMC_DEV_ATTR(raw_rpmb_size_mult, "%#x\n", card->ext_csd.raw_rpmb_size_mult);
> +MMC_DEV_ATTR(enhanced_rpmb_supported, "%#x\n",
> +       card->ext_csd.enhanced_rpmb_supported);
>  MMC_DEV_ATTR(rel_sectors, "%#x\n", card->ext_csd.rel_sectors);
>  MMC_DEV_ATTR(ocr, "0x%08x\n", card->ocr);
>  MMC_DEV_ATTR(rca, "0x%04x\n", card->rca);
> @@ -843,6 +848,7 @@ static ssize_t mmc_dsr_show(struct device *dev,
>         &dev_attr_enhanced_area_offset.attr,
>         &dev_attr_enhanced_area_size.attr,
>         &dev_attr_raw_rpmb_size_mult.attr,
> +       &dev_attr_enhanced_rpmb_supported.attr,
>         &dev_attr_rel_sectors.attr,
>         &dev_attr_ocr.attr,
>         &dev_attr_rca.attr,
> diff --git a/include/linux/mmc/card.h b/include/linux/mmc/card.h
> index cf3780a..7d46411 100644
> --- a/include/linux/mmc/card.h
> +++ b/include/linux/mmc/card.h
> @@ -48,6 +48,7 @@ struct mmc_ext_csd {
>         u8                      sec_feature_support;
>         u8                      rel_sectors;
>         u8                      rel_param;
> +       bool                    enhanced_rpmb_supported;
>         u8                      part_config;
>         u8                      cache_ctrl;
>         u8                      rst_n_function;
> diff --git a/include/linux/mmc/mmc.h b/include/linux/mmc/mmc.h
> index 4b85ef0..d9a65c6 100644
> --- a/include/linux/mmc/mmc.h
> +++ b/include/linux/mmc/mmc.h
> @@ -325,6 +325,7 @@ static inline bool mmc_ready_for_data(u32 status)
>   */
>
>  #define EXT_CSD_WR_REL_PARAM_EN                (1<<2)
> +#define EXT_CSD_WR_REL_PARAM_EN_RPMB_REL_WR    (1<<4)
>
>  #define EXT_CSD_BOOT_WP_B_PWR_WP_DIS   (0x40)
>  #define EXT_CSD_BOOT_WP_B_PERM_WP_DIS  (0x10)
> --
> Qualcomm India Private Limited, on behalf of Qualcomm Innovation Center, Inc., is a member of Code Aurora Forum, a Linux Foundation Collaborative Project

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2020-05-07  9:29 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-05-01 13:53 [PATCH V1] mmc: core: expose info about enhanced rpmb support Veerabhadrarao Badiganti
2020-05-07  9:29 ` Ulf Hansson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).