From patchwork Wed Nov 1 00:21:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 117664 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp223952qgn; Tue, 31 Oct 2017 17:21:59 -0700 (PDT) X-Google-Smtp-Source: ABhQp+TT4i1otSgD7OuwIxR7lGAR0UAGcsPX0kUDV3+IE6M4hsusHb4Qm3hzFeg6A0Um/10hllgr X-Received: by 10.99.56.19 with SMTP id f19mr3559994pga.328.1509495719399; Tue, 31 Oct 2017 17:21:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1509495719; cv=none; d=google.com; s=arc-20160816; b=A1cEHCcf601BzmDAbLCZhofdPlYQC+/DpxUdPBq3ECc7ieNPXi9hVTuLiOgXoeCa8x wxOhIq30EiBaJERb7fNlxb/S41T7Db+GrTyeNxmxs6rLeHS4AQp0ElLzDYXxMzqxrPPb oST5/OV90Bia0JuPl0faG055Krp/wnA6lM7v+nob6ktYGsv9431hKL44iCcUigTZv4ov DdCWAmKC8dsppXvjJFuma2qbMXQFxqfNLnT1ThEhPbZdMCGgMDL/HODAL3aTY1sA+fBr ZcuD1XUWWsR0+bOV8+Yo4+DMJbFMREyp3uJjvJYS5V0kRlmwesR4ShtWm0jyAgOV7RFy YYvw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=I8SJArvu7bah7hYV0VMjrrGoBoxEJw0Z9Wfl4lksiYk=; b=UpaYopGHBMatOCMhaok2eK946isoCrTzHo7d7qdIHDx/piCKCqjk9eD6WoP0/ipQDC /i6FfzFM2aQ0hLKaSMaQo+yWbvL1QwdUhqFBQfEXDwX/Xi3ksMzqpV+hnQs763s1eRtI hDbW4aEckp320lp5yt3upWKqDc+naYiQ7ZoYI4/38K67pD/87QRfx6wP9V8c8VPo57Hz YhgGjePmjD0ZsdIgs3hkPYsys2Xlu0brl3+MTQL9P8fhu7J1OWxo2rPUHCB5nPn0L5cj pvZiufCHQ0ykgmRL3IRoqOtTFjb37qL1w8G5cBWG+TUOQ3Wu8ZWHOqFp5TpoqEvaLeef JzCA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=j/z127+c; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 83si3014320pfj.308.2017.10.31.17.21.58; Tue, 31 Oct 2017 17:21:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=j/z127+c; spf=pass (google.com: best guess record for domain of devicetree-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=devicetree-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752319AbdKAAV5 (ORCPT + 6 others); Tue, 31 Oct 2017 20:21:57 -0400 Received: from mail-wm0-f68.google.com ([74.125.82.68]:49050 "EHLO mail-wm0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751527AbdKAAV4 (ORCPT ); Tue, 31 Oct 2017 20:21:56 -0400 Received: by mail-wm0-f68.google.com with SMTP id p75so1956643wmg.3 for ; Tue, 31 Oct 2017 17:21:56 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=IMNPXG8CwGtLUJ5/FFPwK9cRPzssWMQLqx0xSn8GKU0=; b=j/z127+c6fBk6w9Sp00FB7b3flgpCeT4udg0onI4x8LJLZGkQQ72PqLy5gdYWSmf4l wqUkc2mbBXRuFGrA1H+LEPYcPDr9alZXfnF8sb+uSelCIn1YggrujSFaZpjl/tctwlLq BR15XBaWzSFQjt0UD5B3iFPmIO/xmvyuU2O/E= 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; bh=IMNPXG8CwGtLUJ5/FFPwK9cRPzssWMQLqx0xSn8GKU0=; b=Coh5FHJPEf4TLf3vJs4hPRlDRYFhn5OJmhDu/Gh2aldNwyXzIomsxWvkLsgQZNbK7I r+m7jgnYh/EwL0MPBUPmVgEza2Q/ElSZ+DcyJUFW/H6jGJ5OFDTocxJbZyeCdEABGpNq stEWZO345w5x1/no9VVlxuDoNVmICBwpchXV61glEHa8whgBZMEPP3iBouUM0dQaM11r Gc8ZGKc5AfzyrMG5hSqgl9UEaxndBqAwGNlf7twWiN06CiHqz4fSrFL9mu4oy4lIxscA M+f8S8zJ7KZCiOZaEw+UDfZvXAOn+hn9oLaj2dlIKQHTG/+vWp+O4S2Z00ave3jol7mm +MBg== X-Gm-Message-State: AMCzsaWAbxW4FICvok5h/+PLZRIqRLi8KhZukuh7PfACZY5SLXCUM0Iq QUuc4+B1X7pTEdT0hK6WotjwwQ== X-Received: by 10.28.21.10 with SMTP id 10mr494103wmv.41.1509495715338; Tue, 31 Oct 2017 17:21:55 -0700 (PDT) Received: from localhost.localdomain ([105.129.222.2]) by smtp.gmail.com with ESMTPSA id k30sm5897732wrf.52.2017.10.31.17.21.53 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 31 Oct 2017 17:21:54 -0700 (PDT) From: Ard Biesheuvel To: ulf.hansson@linaro.org, robh+dt@kernel.org, mark.rutland@arm.com, adrian.hunter@intel.com, linux-mmc@vger.kernel.org Cc: devicetree@vger.kernel.org, Ard Biesheuvel Subject: [PATCH] sdhci-fujitsu: add support for setting the CMD_DAT_DELAY attribute Date: Wed, 1 Nov 2017 00:21:32 +0000 Message-Id: <20171101002132.13500-1-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 Sender: devicetree-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: devicetree@vger.kernel.org The Socionext SynQuacer SoC inherits this IP from Fujitsu, but requires the F_SDH30_CMD_DAT_DELAY bit to be set in the F_SDH30_ESD_CONTROL control register. So let's add an optional property to this device's binding, and set the attribute if it is present in the DT node. Signed-off-by: Ard Biesheuvel --- Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt | 2 ++ drivers/mmc/host/sdhci_f_sdh30.c | 18 +++++++++++++++++- 2 files changed, 19 insertions(+), 1 deletion(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe devicetree" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html diff --git a/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt b/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt index de2c53cff4f1..9ad02f743ad0 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt +++ b/Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt @@ -15,6 +15,8 @@ Required properties: Optional properties: - vqmmc-supply: phandle to the regulator device tree node, mentioned as the VCCQ/VDD_IO supply in the eMMC/SD specs. +- cmd-dat-delay-select: boolean property indicating that this host requires + the CMD_DAT_DELAY control to be enabled. Example: diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c index 111b66f5439b..00bc2121d607 100644 --- a/drivers/mmc/host/sdhci_f_sdh30.c +++ b/drivers/mmc/host/sdhci_f_sdh30.c @@ -13,6 +13,7 @@ #include #include #include +#include #include #include "sdhci-pltfm.h" @@ -45,8 +46,9 @@ struct f_sdhost_priv { struct clk *clk_iface; struct clk *clk; - u32 vendor_hs200; struct device *dev; + u32 vendor_hs200; + bool enable_cmd_dat_delay; }; static void sdhci_f_sdh30_soft_voltage_switch(struct sdhci_host *host) @@ -84,10 +86,19 @@ static unsigned int sdhci_f_sdh30_get_min_clock(struct sdhci_host *host) static void sdhci_f_sdh30_reset(struct sdhci_host *host, u8 mask) { + struct f_sdhost_priv *priv = sdhci_priv(host); + u32 ctl; + if (sdhci_readw(host, SDHCI_CLOCK_CONTROL) == 0) sdhci_writew(host, 0xBC01, SDHCI_CLOCK_CONTROL); sdhci_reset(host, mask); + + if (priv->enable_cmd_dat_delay) { + ctl = sdhci_readl(host, F_SDH30_ESD_CONTROL); + ctl |= F_SDH30_CMD_DAT_DELAY; + sdhci_writel(host, ctl, F_SDH30_ESD_CONTROL); + } } static const struct sdhci_ops sdhci_f_sdh30_ops = { @@ -126,6 +137,11 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) host->quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE | SDHCI_QUIRK2_TUNING_WORK_AROUND; + if (device_property_read_bool(dev, "cmd-dat-delay-select")) { + dev_info(dev, "Setting cmd-dat-delay\n"); + priv->enable_cmd_dat_delay = true; + } + ret = mmc_of_parse(host->mmc); if (ret) goto err;