From patchwork Tue Jan 16 21:44:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau?= X-Patchwork-Id: 861907 X-Patchwork-Delegate: jh80.chung@samsung.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; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="f3CEmkro"; dkim-atps=neutral Received: from lists.denx.de (dione.denx.de [81.169.180.215]) by ozlabs.org (Postfix) with ESMTP id 3zLkJs49Pcz9s7F for ; Wed, 17 Jan 2018 08:44:44 +1100 (AEDT) Received: by lists.denx.de (Postfix, from userid 105) id CEDEEC21DFA; Tue, 16 Jan 2018 21:44:39 +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=FREEMAIL_FROM, RCVD_IN_MSPIKE_H2, 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 87367C21DA6; Tue, 16 Jan 2018 21:44:36 +0000 (UTC) Received: by lists.denx.de (Postfix, from userid 105) id 289BDC21DA6; Tue, 16 Jan 2018 21:44:35 +0000 (UTC) Received: from mail-wr0-f194.google.com (mail-wr0-f194.google.com [209.85.128.194]) by lists.denx.de (Postfix) with ESMTPS id 8610FC21C3F for ; Tue, 16 Jan 2018 21:44:34 +0000 (UTC) Received: by mail-wr0-f194.google.com with SMTP id 100so16786472wrb.7 for ; Tue, 16 Jan 2018 13:44:34 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HjMQ0HV7PqBo5Vt7SY+/EhBAasBFECGIqcGxiFU1c90=; b=f3CEmkrow7xEqmMzXX1TSWK//476c1FPCoQAw5183wj7EX2QZ0xSlZPKX4e6KMNkTA W/maSBLjCiQ66sUpfzSmp/uxcfFLZy2sVL/BHVlrG1gGemUNB7slY8X3upo6xI3K1tzF ntqIzRZhOOZ9yKGKDIP02TnVCewi5imMbtqSVqSG/Vp0WgtveEtpQD5NH55XWe5E2r+c SNCtvf/YQRs+K048wi+S5HHkYVYhLjZ4UTpAUMqL3cjMTkR3XICA0h8inFoUb6KJSNCZ yEgGqupJx1JmQxp5pM/f8ZJVWDFKLJBkb0Z4wgYvo5cVio5heUYhnmFQw0penaQmQLdF aHTQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:mime-version :content-transfer-encoding; bh=HjMQ0HV7PqBo5Vt7SY+/EhBAasBFECGIqcGxiFU1c90=; b=GY3nheeOb7MyWbHg2a4zyHkSAOp6+4smNeS3zveZBOO2LRCLiQ74+xStnv8X0QXGX6 fWaSk1IiQU6bd18tD6ApqAch1mTPntvC5nlBhv4+oXJr3ixjuw1/u2RVE0L7+UvNWwHQ uKCsRjZxr0uWcd9HVupgaoogY+wZkSZc8u4EThwLhvoB64eT6BsSUpSGvZSay6R7VYLL VZUIjTtpeRQc2Ulcm670yJ1a2FnMZFUzKES6ZhoxbycE9etCFeV860A/jRl8kyLleY7i PYUX9P40t60BWrRjhfV1kqhKV/ubQgSsBFJIkRGSPngjm0bCGQ0UUauu1FIKqTwJd/zy Jsmg== X-Gm-Message-State: AKwxytfJFTpDuj00q8sGjQcQOmy5Gw/nWiKqZFRH6F3OhbcOGbJHqor7 wtb7Pi29J6ZweqRdARNtKMH5oQ== X-Google-Smtp-Source: ACJfBouJ52rT0PMzoxqTBTQLaCfooQB/2dmoHDYFnALxhIz8pmzEfIyN/oDFvQZM+4Mb7PlyyP0hpw== X-Received: by 10.223.130.194 with SMTP id 60mr547730wrc.72.1516139073924; Tue, 16 Jan 2018 13:44:33 -0800 (PST) Received: from localhost.localdomain (vno44-1-88-172-188-148.fbx.proxad.net. [88.172.188.148]) by smtp.gmail.com with ESMTPSA id q186sm3643506wmb.6.2018.01.16.13.44.32 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 16 Jan 2018 13:44:33 -0800 (PST) From: =?utf-8?q?Beno=C3=AEt_Th=C3=A9baudeau?= To: u-boot@lists.denx.de Date: Tue, 16 Jan 2018 22:44:18 +0100 Message-Id: <20180116214418.11751-1-benoit.thebaudeau.dev@gmail.com> X-Mailer: git-send-email 2.14.1 MIME-Version: 1.0 Cc: Fabio Estevam , "Wladimir J . van der Laan" Subject: [U-Boot] [PATCH v2] mmc: fsl_esdhc: Fix i.MX53 eSDHCv3 clock 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" Commit 4f425280fa71 ("mmc: fsl_esdhc: Allow all supported prescaler values") made it possible to set SYSCTL.SDCLKFS to 0 in SDR mode on i.MX, thus bypassing the SD clock frequency prescaler, in order to be able to get higher SD clock frequencies in some contexts. However, that commit missed the fact that this value is illegal on the eSDHCv3 instance of the i.MX53. This seems to be the only exception on i.MX, this value being legal even for the eSDHCv2 instances of the i.MX53. Fix this issue by changing the minimum prescaler value for the single instance of the i.MX53 eSDHCv3 controller. Signed-off-by: Benoît Thébaudeau Reviewed-by: Fabio Estevam --- Changes for v2: - Surround == with parentheses for clarity (suggested by Stefano). --- drivers/mmc/fsl_esdhc.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/drivers/mmc/fsl_esdhc.c b/drivers/mmc/fsl_esdhc.c index 499d622c6d..5b6042c22c 100644 --- a/drivers/mmc/fsl_esdhc.c +++ b/drivers/mmc/fsl_esdhc.c @@ -528,14 +528,19 @@ out: static void set_sysctl(struct fsl_esdhc_priv *priv, struct mmc *mmc, uint clock) { + struct fsl_esdhc *regs = priv->esdhc_regs; int div = 1; #ifdef ARCH_MXC +#ifdef CONFIG_MX53 + /* For i.MX53 eSDHCv3, SYSCTL.SDCLKFS may not be set to 0. */ + int pre_div = (regs == (struct fsl_esdhc *)MMC_SDHC3_BASE_ADDR) ? 2 : 1; +#else int pre_div = 1; +#endif #else int pre_div = 2; #endif int ddr_pre_div = mmc->ddr_mode ? 2 : 1; - struct fsl_esdhc *regs = priv->esdhc_regs; int sdhc_clk = priv->sdhc_clk; uint clk;