From patchwork Mon Nov 6 15:29:22 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 118066 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2891212qgn; Mon, 6 Nov 2017 07:29:35 -0800 (PST) X-Google-Smtp-Source: ABhQp+QuLXde2BN9PeEZmDTnEj9WBGdqBEjkta4MVJoLR7BJchtga4BEm2d3gmtLbq+kf2UO1WFu X-Received: by 10.98.207.71 with SMTP id b68mr17159956pfg.125.1509982175815; Mon, 06 Nov 2017 07:29:35 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509982175; cv=none; d=google.com; s=arc-20160816; b=y8udLgUyGDUYx3foR4Z3sClhE9uPPVvlb817LLCJ2Nze88nV/OkwUZIIGEHdXFaDI5 IAGucPhi/AE9gt/ge2TQF+ZQIxUOOjXhqiwgqJwTzTcwrFym3p15HwC+RaVe+xeto+Gs /Yk+6ZNU2fiPDR8uWMK4iJ5RHnxnxKIdJ+o9wwWBuQJESZD/IUjT8iCNhFzzSw1yu9MZ 8sYMIL8PtvZL4aW3FhnVHkmcf1pNzaoi2IztKy1KiZBqZCfnI/iEOhrRqecI24Zcz+rk J/tMWEyq2xaN8CpJ5x3yLbEQ3avBYqcKNTw81trvgKHl06wpV9t2VD4OfDJXnn6KkHKS f7Jw== 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=je+tQyZv1G7qg0VHoBHFv7sQLrPaYkygDiy3Jaz4pOI=; b=Ew+e7Yj8yqa8NP9FhJljX4GLWUWv2yToY9sR1Hpv01NbMyRWAKZykSr30hm75WJ25T KN2BBrQaiJ5mTq8Kl9aXZrjpXwm5w9N0g21/r/G9sLcizYmL0GOA5N8xkjwNQ7qEnYZs D245giDhoP5ZnULA/Y8AvQD+VOEsZl6mwzGysOOZdKUlJWP2NbkNPFkr3aWsSJT4QHJM 7zYCvIDmHxZQ4g6GzofKfZvU7NDPB43x1/f0ZHThR9RvGY5kyEU1kVBWXXnE8zvkQrYg msnVukidvDurLK+k7TZPLkFCeJSzFhBLuxhxToGCpV9TmyE0YJoYqJ8dC7FoQcYSD7lk DWFw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=Re0XWJ/G; 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 n10si453413pfh.251.2017.11.06.07.29.35; Mon, 06 Nov 2017 07:29:35 -0800 (PST) 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=Re0XWJ/G; 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 S1753765AbdKFP3e (ORCPT + 6 others); Mon, 6 Nov 2017 10:29:34 -0500 Received: from mail-wr0-f193.google.com ([209.85.128.193]:54702 "EHLO mail-wr0-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753364AbdKFP3d (ORCPT ); Mon, 6 Nov 2017 10:29:33 -0500 Received: by mail-wr0-f193.google.com with SMTP id g10so1441607wrg.11 for ; Mon, 06 Nov 2017 07:29:32 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id; bh=emaflNL1byRmuencY3wlCooj1aSXPlapvhvtEKSbAhQ=; b=Re0XWJ/GyU62YY07+RnN7IG5hmzbOAzz3fXyy+2JzptShrO07KtECsEkRUokHpZ4Hp XdcAUw95mjrMAW8fRZPV4WtVUptt5Kx74o/3+GZZmltAl59+g1pnh0QRJBSCQdXdVmRQ ZTsnTK/17eQ3Jta3lu669zBzWYLJVVQDklRng= 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=emaflNL1byRmuencY3wlCooj1aSXPlapvhvtEKSbAhQ=; b=eAHsSSExF6iEcnleQW32YeaDgGS5iC4Phsiopz3u2GZ9q4z0Yb2enCOvmLByNOQ5Ls RAG27hYbnxpFk18G/lifjHuod9fKeXBFJCpiUGlHUj4FqakMkdeUyf8jjI799VWdl2wj oE/X5Ldg9SuhvBKPP8qsXzFTudFc+GzQeJ87SSPkRknyUdPslvZMH5neq8QU/fs9FQD0 aWAVNd4if9w58WWsfpji9KWf6AvL205DpUXy202oIIxNKXdjT/3lxF3+mhCMXi39caFO 2Sl9wkkyT7K91R+mR2q3PVN3DYypKXB9k6tOaZJZe0lKP3BH9C1wvcMey9aNLVKta8ns XE9A== X-Gm-Message-State: AMCzsaWiMUnV/SRSWiYLpsEL/9qaLARqbMaVo42KFwN8fMSOLARAUSzL Fil5c3W+ljRcLlWD4BIgYYPEbA== X-Received: by 10.223.187.131 with SMTP id q3mr12502507wrg.83.1509982171821; Mon, 06 Nov 2017 07:29:31 -0800 (PST) Received: from localhost.localdomain ([105.129.222.2]) by smtp.gmail.com with ESMTPSA id v5sm5465009wme.26.2017.11.06.07.29.29 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 07:29:30 -0800 (PST) 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 v3 1/2] dt-bindings: sdhci-fujitsu: document cmd-dat-delay property Date: Mon, 6 Nov 2017 15:29:22 +0000 Message-Id: <20171106152923.32114-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 Document a new boolean property of the sdhci-fujitsu binding that indicates whether the CMD_DAT_DELAY bit needs to be set in the F_SDH30_ESD_CONTROL register. Acked-by: Rob Herring Signed-off-by: Ard Biesheuvel --- v3: added Rob's ack v2: use vendor prefix Documentation/devicetree/bindings/mmc/sdhci-fujitsu.txt | 2 ++ 1 file changed, 2 insertions(+) -- 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..3ee9263adf73 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. +- fujitsu,cmd-dat-delay-select: boolean property indicating that this host + requires the CMD_DAT_DELAY control to be enabled. Example: From patchwork Mon Nov 6 15:29:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ard Biesheuvel X-Patchwork-Id: 118067 Delivered-To: patch@linaro.org Received: by 10.140.22.164 with SMTP id 33csp2891268qgn; Mon, 6 Nov 2017 07:29:38 -0800 (PST) X-Google-Smtp-Source: ABhQp+TrT278Kn535sT7do9V6dkqO1W6n7VKtr+EeXEohXzI996qYa+/1+4RRcDPcH79UKp4xzTr X-Received: by 10.99.128.199 with SMTP id j190mr15725147pgd.145.1509982178908; Mon, 06 Nov 2017 07:29:38 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1509982178; cv=none; d=google.com; s=arc-20160816; b=FB1v/RhQjWuvWb+EpfaN1fvpBySDSjqwpdptcVy7ky+qtHskhUy6OAqGR/oAq1FxQH 3A9Nuto2CzjvnOuAlCfMVoN2FOlKYgsAQN9RhsKev/j1/Q92C1Lcv7H0QCXmbYCZLBkb EJmLOHu2kq1hpbV+aF3MS+Uzurh5/Hk1DkehEzq2kXjL6RMjYratK96DjM49sOnd7bVk oBQAWOHAC4CzQ58FBxJqK3RUbfWqCCqfhBtF/XywPG//WZAM5AzI16szgAbUSJY2kIBr 5cWMEuxT4Wr4MwnPl2fAbp17L5hGQnVC8S5UNzyJc/LMC0uSQqqCX5ZBXZFBa00KOCNc dSsg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:dkim-signature:arc-authentication-results; bh=SuOgjjWN4f1q0GbStTKcJUycSzTtmV6iZ3sCzAt5/0U=; b=maHV7zKTbs1S1ilpPR8NqZAmugzwCH6mRXHuqtZmrkBShaXCUazM9RRYSHYvL77Lgg hfVJbppS+4BZpVFF251xTRs8uA1c80jlrxe1RrU1FKnjODaQoLsQ/Xlzqs7rR2Y6cdKm AdMX4cyKZ3LXq/yZ6YYGfRMW3ufphKuU7BMeO5ebuZBoufJG7EETKS0qDxr+w4ed+bUp 8STXkuteOWoFIG0UBGVEpkDVMmRd3s0qRTrsHKyS5mwg3nHmIdQd8wdB1/ESJVvwqeiC y0iKPTIQFYlmYjn/zpLKkRa2vGr5/E8eZYdEte43sFHpUsXeas8OihC45dNiKSypbDdl W2cA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@linaro.org header.s=google header.b=ARfYiGWo; 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 k82si12194510pfg.374.2017.11.06.07.29.38; Mon, 06 Nov 2017 07:29:38 -0800 (PST) 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=ARfYiGWo; 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 S1753799AbdKFP3h (ORCPT + 6 others); Mon, 6 Nov 2017 10:29:37 -0500 Received: from mail-wr0-f194.google.com ([209.85.128.194]:48978 "EHLO mail-wr0-f194.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753760AbdKFP3f (ORCPT ); Mon, 6 Nov 2017 10:29:35 -0500 Received: by mail-wr0-f194.google.com with SMTP id 15so8973777wrb.5 for ; Mon, 06 Nov 2017 07:29:35 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linaro.org; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=kLbMtcw2Yu5DkpLIE/5VBs7AKfNVKaFW9KPtI2D+Jrk=; b=ARfYiGWoeS6v6HI+2vlA9JzNkL6VAltRICzfqzv6zre+dcvIVs/230es7pMQLlZpQH fCSyOgjrXuu1pB+VdSNthnuV/jLYxZl6bKuDOmWsz8iU1rZjdAXE9X6fynol9QcUbydQ UwSg5sJHOFNGLr2ZnCaFJ85qNIIWY6uGIVp7s= 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:in-reply-to :references; bh=kLbMtcw2Yu5DkpLIE/5VBs7AKfNVKaFW9KPtI2D+Jrk=; b=SYF1fvn0wT1EQBJy4qkWW0IfDN7ovaGzdY8zqMX9UU8aRxxdv3fjh4oPun5hzXOa1B xVzgehoaikbVBuuVHshFJgAfOeut5DaKjxSUCXljTTOIjJ4U6oVoWeiDipo8xyjnEnlc xSDBhwsD5/lMkKZYIYYZWgzg6TVwJujbrcLfludBZlAQdQGiJgUhjesvTmnCk10LdrJS hotutWYtN8W/k2gqnLvRs+X3YuL8ILnozQR7PSWXRjF5Zly0+aLUVH2vrYJ7DdfxjzZM LoPZ+NFf0L1ZoWSxrDMxlYUyyWC9oKJSLjneciSbwsFRcyVlBMjy6tGuw5/GTSQSpcWM ulbQ== X-Gm-Message-State: AJaThX5anPNp1drTVnjwVRyF49oHCuDcPQIOxh4f8VG7WsTR2Mm5HTc3 S6zHdSNoSQEOTMVMnb5S7qGmQw== X-Received: by 10.223.151.49 with SMTP id r46mr4591736wrb.238.1509982174447; Mon, 06 Nov 2017 07:29:34 -0800 (PST) Received: from localhost.localdomain ([105.129.222.2]) by smtp.gmail.com with ESMTPSA id v5sm5465009wme.26.2017.11.06.07.29.31 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 06 Nov 2017 07:29:33 -0800 (PST) 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 v3 2/2] sdhci-fujitsu: add support for setting the CMD_DAT_DELAY attribute Date: Mon, 6 Nov 2017 15:29:23 +0000 Message-Id: <20171106152923.32114-2-ard.biesheuvel@linaro.org> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20171106152923.32114-1-ard.biesheuvel@linaro.org> References: <20171106152923.32114-1-ard.biesheuvel@linaro.org> 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 set this bit if the DT node has the 'fujitsu,cmd-dat-delay-select' property. Signed-off-by: Ard Biesheuvel --- v3: don't reorder struct members to reduce padding remove pr_info() and simplify conditional assignment v2: no change drivers/mmc/host/sdhci_f_sdh30.c | 14 ++++++++++++++ 1 file changed, 14 insertions(+) -- 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 Acked-by: Adrian Hunter diff --git a/drivers/mmc/host/sdhci_f_sdh30.c b/drivers/mmc/host/sdhci_f_sdh30.c index 111b66f5439b..04ca0d33a521 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" @@ -47,6 +48,7 @@ struct f_sdhost_priv { struct clk *clk; u32 vendor_hs200; struct device *dev; + 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,9 @@ static int sdhci_f_sdh30_probe(struct platform_device *pdev) host->quirks2 = SDHCI_QUIRK2_SUPPORT_SINGLE | SDHCI_QUIRK2_TUNING_WORK_AROUND; + priv->enable_cmd_dat_delay = device_property_read_bool(dev, + "fujitsu,cmd-dat-delay-select"); + ret = mmc_of_parse(host->mmc); if (ret) goto err;