From patchwork Thu Mar 31 05:53:18 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jaehoon Chung X-Patchwork-Id: 8707591 Return-Path: X-Original-To: patchwork-linux-mmc@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C35C09F44D for ; Thu, 31 Mar 2016 05:53:25 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 0313E2035B for ; Thu, 31 Mar 2016 05:53:25 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id ADE4720357 for ; Thu, 31 Mar 2016 05:53:23 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752408AbcCaFxW (ORCPT ); Thu, 31 Mar 2016 01:53:22 -0400 Received: from mailout1.samsung.com ([203.254.224.24]:36747 "EHLO mailout1.samsung.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751567AbcCaFxW (ORCPT ); Thu, 31 Mar 2016 01:53:22 -0400 Received: from epcpsbgr5.samsung.com (u145.gpu120.samsung.co.kr [203.254.230.145]) by mailout1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTP id <0O4W01JOH30VO480@mailout1.samsung.com> for linux-mmc@vger.kernel.org; Thu, 31 Mar 2016 14:53:19 +0900 (KST) Received: from epcpsbgm2new.samsung.com ( [172.20.52.113]) by epcpsbgr5.samsung.com (EPCPMTA) with SMTP id 11.CB.04789.F4BBCF65; Thu, 31 Mar 2016 14:53:19 +0900 (KST) X-AuditID: cbfee691-f795a6d0000012b5-31-56fcbb4fd3dc Received: from epmmp1.local.host ( [203.254.227.16]) by epcpsbgm2new.samsung.com (EPCPMTA) with SMTP id A2.6A.06699.F4BBCF65; Thu, 31 Mar 2016 14:53:19 +0900 (KST) Received: from localhost.localdomain ([10.113.62.216]) by mmp1.samsung.com (Oracle Communications Messaging Server 7.0.5.31.0 64bit (built May 5 2014)) with ESMTPA id <0O4W00IQH30V3D30@mmp1.samsung.com>; Thu, 31 Mar 2016 14:53:19 +0900 (KST) From: Jaehoon Chung To: linux-mmc@vger.kernel.org Cc: ulf.hansson@linaro.org, shawn.lin@rock-chips.com, Jaehoon Chung Subject: [PATCH] mmc: dw_mmc: exynos: add the function for controlling SMU Date: Thu, 31 Mar 2016 14:53:18 +0900 Message-id: <1459403598-5256-1-git-send-email-jh80.chung@samsung.com> X-Mailer: git-send-email 1.9.1 X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFlrNLMWRmVeSWpSXmKPExsWyRsSkUNd/958wg48rTS1u/GpjtTjyv5/R 4s6T9awWx9eGO7B43Lm2h83j76z9LB59W1YxenzeJBfAEsVlk5Kak1mWWqRvl8CVcfGnWMFR voobE/uZGxgn8HQxcnJICJhI7LpyhxXCFpO4cG89WxcjF4eQwApGia7Ztxlhih5f6GWHSCxl lHi09BUbSEJI4AejROvrNBCbTUBHYvu340wgtoiArMTPPxfAapgF4iQWHf0J1MzBISzgJbGx XQwkzCKgKtHTfx4szCvgKrFpkTHEKjmJk8cms4KskhB4zCax8uNGZoh6AYlvkw+xgNRLAI3f dIAZol5S4uCKGywTGAUXMDKsYhRNLUguKE5KLzLVK07MLS7NS9dLzs/dxAgMw9P/nk3cwXj/ gPUhRgEORiUeXo20P2FCrIllxZW5hxhNgTZMZJYSTc4HBnteSbyhsZmRhamJqbGRuaWZkjiv jvTPYCGB9MSS1OzU1ILUovii0pzU4kOMTBycUg2M+sddti88kx7VJFW/xNRD7F5Fd/QbB1a2 89s27XrTsFm4u4w71OqMycXred+n1bH3iZ/wXHi4K+up48EcHq/ad8kfDhxL9u48uSrT8ZzA 4xnaPndyvDgfF/w6xCr1Pljfsdo65+Hj3Rd36cmYtT14Fvk4JycvTGnCxH4hve8fU1yd4kPE f/1QYinOSDTUYi4qTgQAggfJ8z4CAAA= X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFvrBLMWRmVeSWpSXmKPExsVy+t9jAV3/3X/CDC7cN7C48auN1eLI/35G iztP1rNaHF8b7sDicefaHjaPv7P2s3j0bVnF6PF5k1wAS1QDo01GamJKapFCal5yfkpmXrqt kndwvHO8qZmBoa6hpYW5kkJeYm6qrZKLT4CuW2YO0EolhbLEnFKgUEBicbGSvh2mCaEhbroW MI0Rur4hQXA9RgZoIGENY8bFn2IFR/kqbkzsZ25gnMDTxcjJISFgIvH4Qi87hC0mceHeerYu Ri4OIYGljBKPlr5iA0kICfxglGh9nQZiswnoSGz/dpwJxBYRkJX4+ecCWA2zQJzEoqM/gQZx cAgLeElsbBcDCbMIqEr09J8HC/MKuEpsWmQMsUpO4uSxyawTGLkXMDKsYpRILUguKE5KzzXK Sy3XK07MLS7NS9dLzs/dxAgO9WfSOxgP73I/xCjAwajEw3sh+U+YEGtiWXFl7iFGCQ5mJRHe AzuAQrwpiZVVqUX58UWlOanFhxhNgfZPZJYSTc4HxmFeSbyhsYmZkaWRuaGFkbG5kjjv4//r woQE0hNLUrNTUwtSi2D6mDg4pRoYBVvNTF4Klfn9FHARzTh9Vtz9c8HFjCajNSJMn+9W5xk+ Vk7ikT637vTSC4+lm7ttFXXdJ1Yq1DhNbcl+mbhuo/T0q0fnRjZYPM1k9XGfbcHt9r7r7/Ul c9YkifM3MGgwPuPe8Pac0swOR8XlQr2myQZbQ7d82ttyMmDGm2tHd0YpFYoumH9NiaU4I9FQ i7moOBEA4CC3ZIsCAAA= DLP-Filter: Pass X-MTR: 20000000000000000@CPGS X-CFilter-Loop: Reflected Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org X-Spam-Status: No, score=-7.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=unavailable version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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 --- 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); }