All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] mmc: dw_mmc: exynos: add the function for controlling SMU
@ 2016-03-31  5:53 Jaehoon Chung
  2016-04-03 23:46 ` Jaehoon Chung
  0 siblings, 1 reply; 2+ messages in thread
From: Jaehoon Chung @ 2016-03-31  5:53 UTC (permalink / raw)
  To: linux-mmc; +Cc: ulf.hansson, shawn.lin, Jaehoon Chung

Some of Exynos has the Security management Unit(SMU).
This patch adds the function for controlling SMU.

In future, if exynos needs to control SMU, it can be implemented
in "config_smu" function, not "init" function.

Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
---
 drivers/mmc/host/dw_mmc-exynos.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
index 8790f2a..0e989eb 100644
--- a/drivers/mmc/host/dw_mmc-exynos.c
+++ b/drivers/mmc/host/dw_mmc-exynos.c
@@ -91,10 +91,14 @@ static inline u8 dw_mci_exynos_get_ciu_div(struct dw_mci *host)
 		return SDMMC_CLKSEL_GET_DIV(mci_readl(host, CLKSEL)) + 1;
 }
 
-static int dw_mci_exynos_priv_init(struct dw_mci *host)
+static void dw_mci_exynos_config_smu(struct dw_mci *host)
 {
 	struct dw_mci_exynos_priv_data *priv = host->priv;
 
+	/*
+	 * If Exynos is provided the Security management,
+	 * set for non-ecryption mode at this time.
+	 */
 	if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS5420_SMU ||
 		priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU) {
 		mci_writel(host, MPSBEGIN0, 0);
@@ -104,6 +108,13 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host)
 			   SDMMC_MPSCTRL_VALID |
 			   SDMMC_MPSCTRL_NON_SECURE_WRITE_BIT);
 	}
+}
+
+static int dw_mci_exynos_priv_init(struct dw_mci *host)
+{
+	struct dw_mci_exynos_priv_data *priv = host->priv;
+
+	dw_mci_exynos_config_smu(host);
 
 	if (priv->ctrl_type >= DW_MCI_TYPE_EXYNOS5420) {
 		priv->saved_strobe_ctrl = mci_readl(host, HS400_DLINE_CTRL);
@@ -169,7 +180,7 @@ static int dw_mci_exynos_resume(struct device *dev)
 {
 	struct dw_mci *host = dev_get_drvdata(dev);
 
-	dw_mci_exynos_priv_init(host);
+	dw_mci_exynos_config_smu(host);
 	return dw_mci_resume(host);
 }
 
-- 
1.9.1


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

* Re: [PATCH] mmc: dw_mmc: exynos: add the function for controlling SMU
  2016-03-31  5:53 [PATCH] mmc: dw_mmc: exynos: add the function for controlling SMU Jaehoon Chung
@ 2016-04-03 23:46 ` Jaehoon Chung
  0 siblings, 0 replies; 2+ messages in thread
From: Jaehoon Chung @ 2016-04-03 23:46 UTC (permalink / raw)
  To: linux-mmc; +Cc: ulf.hansson, shawn.lin

Hi,

Picked this patch on my repository.

Best Regards,
Jaehoon Chung

On 03/31/2016 02:53 PM, Jaehoon Chung wrote:
> Some of Exynos has the Security management Unit(SMU).
> This patch adds the function for controlling SMU.
> 
> In future, if exynos needs to control SMU, it can be implemented
> in "config_smu" function, not "init" function.
> 
> Signed-off-by: Jaehoon Chung <jh80.chung@samsung.com>
> ---
>  drivers/mmc/host/dw_mmc-exynos.c | 15 +++++++++++++--
>  1 file changed, 13 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/mmc/host/dw_mmc-exynos.c b/drivers/mmc/host/dw_mmc-exynos.c
> index 8790f2a..0e989eb 100644
> --- a/drivers/mmc/host/dw_mmc-exynos.c
> +++ b/drivers/mmc/host/dw_mmc-exynos.c
> @@ -91,10 +91,14 @@ static inline u8 dw_mci_exynos_get_ciu_div(struct dw_mci *host)
>  		return SDMMC_CLKSEL_GET_DIV(mci_readl(host, CLKSEL)) + 1;
>  }
>  
> -static int dw_mci_exynos_priv_init(struct dw_mci *host)
> +static void dw_mci_exynos_config_smu(struct dw_mci *host)
>  {
>  	struct dw_mci_exynos_priv_data *priv = host->priv;
>  
> +	/*
> +	 * If Exynos is provided the Security management,
> +	 * set for non-ecryption mode at this time.
> +	 */
>  	if (priv->ctrl_type == DW_MCI_TYPE_EXYNOS5420_SMU ||
>  		priv->ctrl_type == DW_MCI_TYPE_EXYNOS7_SMU) {
>  		mci_writel(host, MPSBEGIN0, 0);
> @@ -104,6 +108,13 @@ static int dw_mci_exynos_priv_init(struct dw_mci *host)
>  			   SDMMC_MPSCTRL_VALID |
>  			   SDMMC_MPSCTRL_NON_SECURE_WRITE_BIT);
>  	}
> +}
> +
> +static int dw_mci_exynos_priv_init(struct dw_mci *host)
> +{
> +	struct dw_mci_exynos_priv_data *priv = host->priv;
> +
> +	dw_mci_exynos_config_smu(host);
>  
>  	if (priv->ctrl_type >= DW_MCI_TYPE_EXYNOS5420) {
>  		priv->saved_strobe_ctrl = mci_readl(host, HS400_DLINE_CTRL);
> @@ -169,7 +180,7 @@ static int dw_mci_exynos_resume(struct device *dev)
>  {
>  	struct dw_mci *host = dev_get_drvdata(dev);
>  
> -	dw_mci_exynos_priv_init(host);
> +	dw_mci_exynos_config_smu(host);
>  	return dw_mci_resume(host);
>  }
>  
> 


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

end of thread, other threads:[~2016-04-03 23:46 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-03-31  5:53 [PATCH] mmc: dw_mmc: exynos: add the function for controlling SMU Jaehoon Chung
2016-04-03 23:46 ` Jaehoon Chung

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.