From patchwork Thu Sep 19 15:56:13 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Yann Gautier X-Patchwork-Id: 1164748 X-Patchwork-Delegate: van.freenix@gmail.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=lists.denx.de (client-ip=81.169.180.215; helo=lists.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Authentication-Results: ozlabs.org; dmarc=none (p=none dis=none) header.from=st.com Authentication-Results: ozlabs.org; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=st.com header.i=@st.com header.b="dnxSCZ24"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 46Z23T0TQVz9sPT for ; Fri, 20 Sep 2019 02:12:52 +1000 (AEST) Received: by lists.denx.de (Postfix, from userid 105) id 491FEC21DF9; Thu, 19 Sep 2019 16:12:42 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on lists.denx.de X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=T_DKIM_INVALID autolearn=unavailable autolearn_force=no version=3.4.0 Received: from lists.denx.de (localhost [IPv6:::1]) by lists.denx.de (Postfix) with ESMTP id 072FFC21C3F; Thu, 19 Sep 2019 16:12:41 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id B23DAC21C3F; Thu, 19 Sep 2019 15:56:21 +0000 (UTC) Received: from mx07-00178001.pphosted.com (mx07-00178001.pphosted.com [62.209.51.94]) by lists.denx.de (Postfix) with ESMTPS id 787B1C21BE5 for ; Thu, 19 Sep 2019 15:56:21 +0000 (UTC) Received: from pps.filterd (m0046037.ppops.net [127.0.0.1]) by mx07-00178001.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x8JFtjae008813; Thu, 19 Sep 2019 17:56:21 +0200 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=st.com; h=from : to : cc : subject : date : message-id : in-reply-to : references : mime-version : content-type; s=STMicroelectronics; bh=YGxDs2A3zHvodPtTV9a4mFhuoyq9ymtVNDvQGw2SJbc=; b=dnxSCZ24gZsbgxBGKIyHJyx7E761ZPo3UwZLVXx4vPbBCNxU4BNmdR/ov8Ni5Y9XKCq7 k3GHAs9rCJzNlGFrhqj7BG6JMgcplfDvUGqRGbmrAgfMbfRb2V2ln6SzZXo/mCvrW6Yk qatHFDuwJqQehWSwp3TX086aQtUlCTH7S40822TuQ3F0PmjZ1DLOf3wgcuWC99DDXd2i 7w9pG2o7xtofHh9JJkcQePJ9RaTea1ZmFLe8yI00ujM+7gEFNEzhQdscy+pT+o9DHRrg ZmwQ/kzNFnw1mrIs0Mub80wCUnvJvcy0pHXNqy0XvAEKb2aBdrxqd4nk6czHRQPg7fuf 6w== Received: from beta.dmz-ap.st.com (beta.dmz-ap.st.com [138.198.100.35]) by mx07-00178001.pphosted.com with ESMTP id 2v3va2d9wy-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Thu, 19 Sep 2019 17:56:21 +0200 Received: from euls16034.sgp.st.com (euls16034.sgp.st.com [10.75.44.20]) by beta.dmz-ap.st.com (STMicroelectronics) with ESMTP id 083BD24; Thu, 19 Sep 2019 15:56:18 +0000 (GMT) Received: from Webmail-eu.st.com (Safex1hubcas22.st.com [10.75.90.92]) by euls16034.sgp.st.com (STMicroelectronics) with ESMTP id 695032C2B69; Thu, 19 Sep 2019 17:56:17 +0200 (CEST) Received: from SAFEX1HUBCAS24.st.com (10.75.90.95) by Safex1hubcas22.st.com (10.75.90.92) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 17:56:17 +0200 Received: from localhost (10.48.1.208) by webmail-ga.st.com (10.75.90.48) with Microsoft SMTP Server (TLS) id 14.3.439.0; Thu, 19 Sep 2019 17:56:16 +0200 From: Yann Gautier To: Date: Thu, 19 Sep 2019 17:56:13 +0200 Message-ID: <20190919155613.2057-2-yann.gautier@st.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190919155613.2057-1-yann.gautier@st.com> References: <20190919155613.2057-1-yann.gautier@st.com> MIME-Version: 1.0 X-Originating-IP: [10.48.1.208] X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.70,1.0.8 definitions=2019-09-19_05:2019-09-19,2019-09-19 signatures=0 X-Mailman-Approved-At: Thu, 19 Sep 2019 16:12:39 +0000 Cc: Benjamin GAIGNARD , U-Boot STM32 Subject: [U-Boot] [PATCH 2/2] mmc: stm32_sdmmc2: implement host_power_cycle callback X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.18 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" For the correct power cycle sequence with stm32_sdmmc2, the write of the power cycle value in PWRCTL field of SDMMC_POWER register is now done in stm32_sdmmc2_host_power_cycle() and no more in stm32_sdmmc2_pwrcycle(). Signed-off-by: Yann Gautier --- drivers/mmc/stm32_sdmmc2.c | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/drivers/mmc/stm32_sdmmc2.c b/drivers/mmc/stm32_sdmmc2.c index 32434a4762..1726ed72ef 100644 --- a/drivers/mmc/stm32_sdmmc2.c +++ b/drivers/mmc/stm32_sdmmc2.c @@ -524,8 +524,6 @@ static void stm32_sdmmc2_pwrcycle(struct stm32_sdmmc2_priv *priv) return; stm32_sdmmc2_reset(priv); - writel(SDMMC_POWER_PWRCTRL_CYCLE | priv->pwr_reg_msk, - priv->base + SDMMC_POWER); } /* @@ -619,10 +617,21 @@ static int stm32_sdmmc2_getcd(struct udevice *dev) return 1; } +static int stm32_sdmmc2_host_power_cycle(struct udevice *dev) +{ + struct stm32_sdmmc2_priv *priv = dev_get_priv(dev); + + writel(SDMMC_POWER_PWRCTRL_CYCLE | priv->pwr_reg_msk, + priv->base + SDMMC_POWER); + + return 0; +} + static const struct dm_mmc_ops stm32_sdmmc2_ops = { .send_cmd = stm32_sdmmc2_send_cmd, .set_ios = stm32_sdmmc2_set_ios, .get_cd = stm32_sdmmc2_getcd, + .host_power_cycle = stm32_sdmmc2_host_power_cycle, }; static int stm32_sdmmc2_probe(struct udevice *dev)