From patchwork Wed Mar 7 13:20:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 130882 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp5175338lja; Wed, 7 Mar 2018 05:21:20 -0800 (PST) X-Google-Smtp-Source: AG47ELscS5Vk96iZnWfMclO3wV4BMQz8mmlDKHJrbdsL86KLRXMFRzDhu2n3D0IQgpq79TRGtKNk X-Received: by 2002:a17:902:2843:: with SMTP id e61-v6mr20470843plb.437.1520428880517; Wed, 07 Mar 2018 05:21:20 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520428880; cv=none; d=google.com; s=arc-20160816; b=l+xY7kWb5XGF5H0megafM+XybEOsXhyGR1dtiY8uGaN3gqe7Ii6LmU2VSHzHjvHk+M xWZmZCSWLOKbBEZcLs5EHwoNaAQshHAeWjHHF0scDRf4IaZFrSkxHLezErw5V6P8YYb6 UBOgNgwiiiGRYxqQiYtF5ltRnbowcCC5U6/z7SAVm7KiDzOw3pbw4qsJ6+cv10Z/I+uE +eSsHmlNqTm3YRaZ8w9Ski/SQhIL/d1llNC+bouTH3nCHNucs4HY0ZFm3+YTlWP6S03D byN7F79iWGzsILRSg2WKqihHaIOQfLiTmcRTZlTK4cEtKhoRvVcdx4DIk6/SHMKX35Cg SIMw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=4jqQTYbKKinfba4VmW/+rbS1Fs3rKc/aMrXj+7zkJwM=; b=dmRANVm5LjaAvkbXht2kH3VJ33h7QDvmgQdRoBEP6WuInKZC0su1ai8T4W8SZQGxuh oeshpNZQlxSt/aGMqLEBOx4QmH1DU5SZVw/NoVBK0yaxB6sAtHpEI1v++n488Y8OkXnm Epm9+4K+26khy+L9Oubz3CIEpoQyydovHmpNzQl11iRFUJypb2bthxtiDKTu62zhiSwy 3yG2edNAKI+i+jMkxjrwmRpl3+RUfKpwuuifCoey3LI43DfSdm1HPc02ipc7Hgdu6m7t mxeQ5IqvdwfN/Nq/ZxJPF3mnegvGY7bUdmIKWBC+Uh1bSElDvgYVokYrGh8P8DIU3gTZ pvfA== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=WklhF/Ai; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id q26si13714606pfh.129.2018.03.07.05.21.20; Wed, 07 Mar 2018 05:21:20 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=WklhF/Ai; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754462AbeCGNVS (ORCPT + 5 others); Wed, 7 Mar 2018 08:21:18 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:52203 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbeCGNVM (ORCPT ); Wed, 7 Mar 2018 08:21:12 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w27DKYp4004073; Wed, 7 Mar 2018 07:20:34 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1520428834; bh=UTTByl9TileeDFbHiQHoWjyvwLs9FLAWGkJbAF5X2ls=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=WklhF/AieVeJuOivcx5bZLk7ONBZaXtujQ2d31GQn/yjn2djU+8+dJJTnMWAGMKVh 3wCXdHeqVyWhsN7mILcZkyFi0tuNqI4GmyOZtXFK8woIJar1yFIA4gxUkfHDNSRvJo gS0r2TWEQxUXkfzMjNXDp66JEjfj+tT7QAFB2hEU= Received: from DFLE102.ent.ti.com (dfle102.ent.ti.com [10.64.6.23]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DKYM6002949; Wed, 7 Mar 2018 07:20:34 -0600 Received: from DFLE105.ent.ti.com (10.64.6.26) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 7 Mar 2018 07:20:33 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE105.ent.ti.com (10.64.6.26) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 7 Mar 2018 07:20:33 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DKMnL018331; Wed, 7 Mar 2018 07:20:28 -0600 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Adrian Hunter CC: Rob Herring , Mark Rutland , Russell King , , , , , , Subject: [PATCH v3 01/11] mmc: sdhci-omap: Fix when capabilities are obtained from SDHCI_CAPABILITIES reg Date: Wed, 7 Mar 2018 18:50:10 +0530 Message-ID: <20180307132020.30951-2-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180307132020.30951-1-kishon@ti.com> References: <20180307132020.30951-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org sdhci_omap_config_iodelay_pinctrl_state() requires caps and caps2 to be initialized (speed mode capabilities like UHS/HS200) before it is invoked. While mmc_of_parse() initializes caps/caps2 if capabilities is populated in device tree, it will remain uninitialized for capabilities obtained from SDHCI_CAPABILITIES register. Fix sdhci_omap_config_iodelay_pinctrl_state() to be used even while getting the capabilities from SDHCI_CAPABILITIES register by invoking sdhci_setup_host() before sdhci_omap_config_iodelay_pinctrl_state(). Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/sdhci-omap.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 1456abd5eeb9..3cce30584d2f 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -916,10 +916,6 @@ static int sdhci_omap_probe(struct platform_device *pdev) goto err_put_sync; } - ret = sdhci_omap_config_iodelay_pinctrl_state(omap_host); - if (ret) - goto err_put_sync; - host->mmc_host_ops.get_ro = mmc_gpio_get_ro; host->mmc_host_ops.start_signal_voltage_switch = sdhci_omap_start_signal_voltage_switch; @@ -930,7 +926,15 @@ static int sdhci_omap_probe(struct platform_device *pdev) sdhci_read_caps(host); host->caps |= SDHCI_CAN_DO_ADMA2; - ret = sdhci_add_host(host); + ret = sdhci_setup_host(host); + if (ret) + goto err_put_sync; + + ret = sdhci_omap_config_iodelay_pinctrl_state(omap_host); + if (ret) + goto err_put_sync; + + ret = __sdhci_add_host(host); if (ret) goto err_put_sync; From patchwork Wed Mar 7 13:20:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 130883 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp5175486lja; Wed, 7 Mar 2018 05:21:27 -0800 (PST) X-Google-Smtp-Source: AG47ELtfo7bcVd81EF+cGpnF8Ps9SJnlcr6lQOg9iOtrz4W5FpyJKIPy/MnmI6YfrB8XWOB4moNX X-Received: by 2002:a17:902:c24:: with SMTP id 33-v6mr20393320pls.24.1520428887814; Wed, 07 Mar 2018 05:21:27 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520428887; cv=none; d=google.com; s=arc-20160816; b=0SgtdwToY6Wgn11xYUYEnFQzvltNRv9M2mEmxvEdvU7CgQRGWJBhXrqNNcKoYH+U2m fibGXK4zxTOnl1Jmpue0dUVF1qyfQk3e/ypX+F/6N8fU4VgJKBuFNj7E9Ct2XpJRgTc+ LkcmHpFDNnCcOEYq7TmqyGQZgLBn7fwonX08Gk4oGLeSDfXxg91rU0AvGQWAMHHTvzPF kNZt8BGHWyKdybZgx9QAUa0EmWst4xsidvifmKMsHM+/CWmvvtVWpwAu+9mmMFHIUHsP 7n5kNuIazBh+H3BJ5EHfPyfVmYIqzAevD6SDmJC+ZbYPd14wBK7Vc+8qFBK0+zZKon8S eYzg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=wWl3maqSxVfS6QoGcN1BkpwI6y4eqleXnPCCyLmL2lw=; b=gWsLwAaXyBrznqkCpurh14exjEHbrJ6V+uX3PqmePwJ2I8clAyMH2I0BuMBeBT8QGc I9LVyutcgegPqJtcx5gBXqOIl7pg45kSrnbQj90umTCVuLCk0ziERKt/Xz5wHWALrNjF nTfm9gQBXqmMrpMz5vPYOZQEM7IJqkd9qIjmfeEqDlCwlPJPNB/gmmKhlbovapUKAu54 eCtgEe1RejVZmIG2kkav/J86CWrc1fWYW89R3LcXmNEEqzlLwnR1GyeKWtZHE+HrRDVC a/ollrdtR2fc9EVatEvRNYRLxk4UuPdsz4b3FMGBsenTIvTxcrAaUJ5KwGSSAI7uLFQY 4ajg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=GxDMLjbf; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si11362863pgd.787.2018.03.07.05.21.27; Wed, 07 Mar 2018 05:21:27 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=GxDMLjbf; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754352AbeCGNVY (ORCPT + 5 others); Wed, 7 Mar 2018 08:21:24 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:62584 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754480AbeCGNVT (ORCPT ); Wed, 7 Mar 2018 08:21:19 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w27DKiX1004059; Wed, 7 Mar 2018 07:20:44 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1520428844; bh=nnPNnmUxSzb0AkBwDVZFXBCd2t0CmQ9FI7fvcZygPfs=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=GxDMLjbfWfI/FgaCxjuSUPLg+WQhmWbN9qjpFgwyPRSy9zvf7Zh8BgQlhvLdCjE4f ITCctlywYhBY8VqzQ+hmtm77X7x47jc9WMWxexzXCh/gXCet9Q+Zi0TD5oSqcVQdsb 95uf/+rL1UB0iBmrHmDmmw4IeIY3ry+vRgyK4v68= Received: from DFLE103.ent.ti.com (dfle103.ent.ti.com [10.64.6.24]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DKi3N015827; Wed, 7 Mar 2018 07:20:44 -0600 Received: from DFLE107.ent.ti.com (10.64.6.28) by DFLE103.ent.ti.com (10.64.6.24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 7 Mar 2018 07:20:44 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE107.ent.ti.com (10.64.6.28) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 7 Mar 2018 07:20:44 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DKMnN018331; Wed, 7 Mar 2018 07:20:39 -0600 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Adrian Hunter CC: Rob Herring , Mark Rutland , Russell King , , , , , , Subject: [PATCH v3 03/11] mmc: sdhci-omap: Workaround for Errata i843 Date: Wed, 7 Mar 2018 18:50:12 +0530 Message-ID: <20180307132020.30951-4-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180307132020.30951-1-kishon@ti.com> References: <20180307132020.30951-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Errata i843 in AM572x Sitara Processors Silicon Revision 2.0, 1.1 (SPRZ429K July 2014–Revised March 2017 [1]) mentions PG 1.0/1.1 silicon has limitations w.r.t frequencies at which MMC1/2/3 can operate. Use soc_device_match() to identify rev 1.0/1.1 silicon and override mmc->f_max according to the errata workaround. "max-frequency" dt property cannot be used since the device tree is added for rev 2.0 silicon. soc_device_match() is also used in order to get the IODelay values for rev 1.0/1.1 silicon. [1] -> http://www.ti.com/lit/er/sprz429k/sprz429k.pdf Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/sdhci-omap.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 0c40b13fb67d..fbc20a4fbb23 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -26,6 +26,7 @@ #include #include #include +#include #include "sdhci-pltfm.h" @@ -100,6 +101,7 @@ struct sdhci_omap_data { }; struct sdhci_omap_host { + char *version; void __iomem *base; struct device *dev; struct regulator *pbias; @@ -733,12 +735,21 @@ static struct pinctrl_state u32 *caps, u32 capmask) { struct device *dev = omap_host->dev; + char *version = omap_host->version; struct pinctrl_state *pinctrl_state = ERR_PTR(-ENODEV); + char str[20]; if (!(*caps & capmask)) goto ret; - pinctrl_state = pinctrl_lookup_state(omap_host->pinctrl, mode); + if (version) { + snprintf(str, 20, "%s-%s", mode, version); + pinctrl_state = pinctrl_lookup_state(omap_host->pinctrl, str); + } + + if (IS_ERR(pinctrl_state)) + pinctrl_state = pinctrl_lookup_state(omap_host->pinctrl, mode); + if (IS_ERR(pinctrl_state)) { dev_err(dev, "no pinctrl state for %s mode", mode); *caps &= ~capmask; @@ -830,6 +841,16 @@ static int sdhci_omap_config_iodelay_pinctrl_state(struct sdhci_omap_host return 0; } +static const struct soc_device_attribute sdhci_omap_soc_devices[] = { + { + .machine = "DRA7[45]*", + .revision = "ES1.[01]", + }, + { + /* sentinel */ + } +}; + static int sdhci_omap_probe(struct platform_device *pdev) { int ret; @@ -841,6 +862,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) struct mmc_host *mmc; const struct of_device_id *match; struct sdhci_omap_data *data; + const struct soc_device_attribute *soc; match = of_match_device(omap_sdhci_match, dev); if (!match) @@ -875,6 +897,17 @@ static int sdhci_omap_probe(struct platform_device *pdev) if (ret) goto err_pltfm_free; + soc = soc_device_match(sdhci_omap_soc_devices); + if (soc) { + omap_host->version = "rev11"; + if (!strcmp(dev_name(dev), "4809c000.mmc")) + mmc->f_max = 96000000; + if (!strcmp(dev_name(dev), "480b4000.mmc")) + mmc->f_max = 48000000; + if (!strcmp(dev_name(dev), "480ad000.mmc")) + mmc->f_max = 48000000; + } + pltfm_host->clk = devm_clk_get(dev, "fck"); if (IS_ERR(pltfm_host->clk)) { ret = PTR_ERR(pltfm_host->clk); From patchwork Wed Mar 7 13:20:14 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 130884 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp5175512lja; Wed, 7 Mar 2018 05:21:29 -0800 (PST) X-Google-Smtp-Source: AG47ELt36OT+TYYlmV0HFhUtZpS9onZUZ9c2VJoiuzny+FEaiENh2crqfLcerlTUeRLWYo71uN9f X-Received: by 2002:a17:902:51ee:: with SMTP id y101-v6mr20692490plh.157.1520428889348; Wed, 07 Mar 2018 05:21:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520428889; cv=none; d=google.com; s=arc-20160816; b=ajocginhAePswvsF+J8O22iaq++2xVE/IsQKQnJsdKN2Hr0je/xr3P5C1tmqYKXCdy V0u7Z2r/mMQ/RIeya6LQM93PQDZtfwBTC44H8M5Cd4t2X/39/gnNWpvUxvKXo40vGOO/ mlL7QpS6PtMJykC1It+QraUI1yBufvChehYkAEiSOuDy75m42akXQxQDwX7sH7iilRcp LtnZXgux+hObyy7wXjF0oYtaqQppdfc0M7f7gH+x+L81sxUE17ax+a7SM8g2btvDN+L3 BNHAJwwEy5BB37OSZuNPqIkDF/ybLHY4Z5vQzs3vOLp2KpF1wZLPjLUMNXn09hycBnCR KqwQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=8NRbuYhEk7L9iJp/bG9j1J28Xz/hF9T4+Lr1OwCCoyc=; b=heNb0hA3FQsUTqhHR1OInB0chUk3FncnQ53RMYxHHLMB7SjCplvpeOHVd5AVnGB8qt TwEczyXy6RUAGU4i7r9sDZRCmWEybO4pvX4AsF0bNkePaQMJZHUqX0/p9Nx0+C//7Ec0 7pm5+pMZ52YP6x98T378F3GLBTjOjXavEPJSxVsroiOP72RmIQ0ztizI+n+raJXULPN5 ZWNe/kMYULxxSnJXP30CJyj6Al5zHej5nFkL8bUYhWl7UMAggQrJhtP33STS7nkRuKH9 hh6ciEBm6SySwEoGX0iHGyouWt+orw9nRS7a0yvsByB4GZcqFsS53yvAhbK8fnBZ2d/+ zLdQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=HKQDRVKM; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id a6si11362863pgd.787.2018.03.07.05.21.29; Wed, 07 Mar 2018 05:21:29 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=HKQDRVKM; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754505AbeCGNV1 (ORCPT + 5 others); Wed, 7 Mar 2018 08:21:27 -0500 Received: from fllnx210.ext.ti.com ([198.47.19.17]:52219 "EHLO fllnx210.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbeCGNVW (ORCPT ); Wed, 7 Mar 2018 08:21:22 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx210.ext.ti.com (8.15.1/8.15.1) with ESMTP id w27DKqol004116; Wed, 7 Mar 2018 07:20:52 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1520428852; bh=YTDzuY2kr6aE7jY/oJCUHLd716vEJ5gexYRAcH6/5pQ=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=HKQDRVKML+XUAEFBchAfHek2VDS4Ti+UdPQwfXbLfTm7NCSkoE859ICELXQkb6bUW jKrm84LVysyMJ+lsv7MNOfZ6i06L0pDkI8Lqi/6mvE/pMuJHw9debQZlfAhtIselkG Uk249V/yolDb9oKj8RRhi3hMCkp5GfMCB+n8/B9U= Received: from DLEE102.ent.ti.com (dlee102.ent.ti.com [157.170.170.32]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DKqAE016026; Wed, 7 Mar 2018 07:20:52 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE102.ent.ti.com (157.170.170.32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 7 Mar 2018 07:20:52 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 7 Mar 2018 07:20:52 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DKMnP018331; Wed, 7 Mar 2018 07:20:48 -0600 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Adrian Hunter CC: Rob Herring , Mark Rutland , Russell King , , , , , , Subject: [PATCH v3 05/11] mmc: sdhci: Disable HS200 mode if controller can't support 1.8v Date: Wed, 7 Mar 2018 18:50:14 +0530 Message-ID: <20180307132020.30951-6-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180307132020.30951-1-kishon@ti.com> References: <20180307132020.30951-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Though MMC controller can indicate HS200 mode capability (by using "mmc-hs200-1_8v" dt property), if the IO lines in the board is connected to 3.3v supply, HS200 mode cannot be supported. Such boards have "no-1-8-v" property in their dts file. Disable HS200 mode for boards which have "no-1-8-v" set. Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/sdhci.c | 1 + 1 file changed, 1 insertion(+) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 2ededa7f43df..aa8b5ca0d1b0 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -3672,6 +3672,7 @@ int sdhci_setup_host(struct sdhci_host *host) if (host->quirks2 & SDHCI_QUIRK2_NO_1_8_V) { host->caps1 &= ~(SDHCI_SUPPORT_SDR104 | SDHCI_SUPPORT_SDR50 | SDHCI_SUPPORT_DDR50); + mmc->caps2 &= ~MMC_CAP2_HS200; } /* Any UHS-I mode in caps implies SDR12 and SDR25 support. */ From patchwork Wed Mar 7 13:20:16 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 130888 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp5175973lja; Wed, 7 Mar 2018 05:21:56 -0800 (PST) X-Google-Smtp-Source: AG47ELtLduDYS/AJfpas/FVbr7bQzkNJEFo4zutSexRX8DJM9GYHqhmIunQZDVFI7OwT90F4T9sQ X-Received: by 10.99.95.81 with SMTP id t78mr18403411pgb.380.1520428916652; Wed, 07 Mar 2018 05:21:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520428916; cv=none; d=google.com; s=arc-20160816; b=vex9IF+tl78r3K1XcHwDGYhgXvRpejMmeOvCXT+m7GNslIcbfKcU2+Vn2FOR13tCew 8d2vBJxs33KIJnQbV1bE1cGBSbojjhkH/0r+JnSpu4CiKtVxD5d0bLPZhO2P6kEz2rz0 YvsAgzTu9FhMruxQfQV8T1THejz4ArFQr0DBZ2aFSk0BK//zAZKnWGMbfsuD6beF2BG2 hJhCl1vMAuCbrSAqO5xg65vQBpmYE+ePog7oNQMa6CVl1PqAro2hd5Y49lz3/uUl68X4 8j2aQ2As6zFFoBNjFIx8nR+OD5XzL2vjM9zgVlLLIP5uha4nKp6rDg6oWbfdOcU89g96 mc5Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=1gwdo/CKuRCnjpKAXeBGUro0b3mZzlF6GCGD9bxos6U=; b=tUig643E67At46gqkLENhI/sFPy7n+P89gu5erBSJb7POiTNKz1pZJctJwKRMYGO+L 9i7puHXktI7SvbceAH2KsssJJ5ggEY0zchPyyBX9m4mJUxPiTydWZRiLQGMVRnsGqDh+ Qz5Hw+XiY2glmYsSjsRc3mdSpQRJo2U/hBliyHeflImqk2v6YPCav8IW2VwquIfQtIhJ OZZhjsHDtZds0KFfv8K4owQoKisdBVvOWWjA+gHeZP+lPyDxraL/LBWmqS5Ayua75kIz EUYUm5YUbIysVzW5lNQlmnWccpa8F+ExfN83myFnRpXYnlfZ78BS/dAKgrNqI3Wv8IwM 8i8g== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=TRXFbhZ6; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id 102-v6si13016815plf.132.2018.03.07.05.21.56; Wed, 07 Mar 2018 05:21:56 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=TRXFbhZ6; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754599AbeCGNVy (ORCPT + 5 others); Wed, 7 Mar 2018 08:21:54 -0500 Received: from lelnx194.ext.ti.com ([198.47.27.80]:61935 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754591AbeCGNVt (ORCPT ); Wed, 7 Mar 2018 08:21:49 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w27DL0lo010844; Wed, 7 Mar 2018 07:21:00 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1520428860; bh=iatXKMiiDVqAIckIPJLyo8Odql8U4binSLFUrqOADEE=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=TRXFbhZ65Ku15/LwM801YusnI9ASGql2Nh9PPGKSIpPz9RGgHI4C/V6u00WLdPnzy KUuz4EXjddl718R/VSbD+7oXm/oFYAgjYLfuiAohV9kCgY8+FyaeYcBoOTq+f6wD60 /6KYHTOOvAOJ5cstmXYVgtd5grCvUdqkTs0ZGiXI= Received: from DLEE103.ent.ti.com (dlee103.ent.ti.com [157.170.170.33]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DL0TG003485; Wed, 7 Mar 2018 07:21:00 -0600 Received: from DLEE113.ent.ti.com (157.170.170.24) by DLEE103.ent.ti.com (157.170.170.33) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 7 Mar 2018 07:20:59 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE113.ent.ti.com (157.170.170.24) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 7 Mar 2018 07:20:59 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DKMnR018331; Wed, 7 Mar 2018 07:20:56 -0600 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Adrian Hunter CC: Rob Herring , Mark Rutland , Russell King , , , , , , Subject: [PATCH v3 07/11] mmc: sdhci: Program a relatively accurate SW timeout value Date: Wed, 7 Mar 2018 18:50:16 +0530 Message-ID: <20180307132020.30951-8-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180307132020.30951-1-kishon@ti.com> References: <20180307132020.30951-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org sdhci has a 10 second timeout to catch devices that stop responding. Instead of programming 10 second arbitrary value, calculate the total time it would take for the entire transfer to happen and program the timeout value accordingly. Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/sdhci.c | 47 ++++++++++++++++++++++++++++++++++++++++------- drivers/mmc/host/sdhci.h | 10 ++++++++++ 2 files changed, 50 insertions(+), 7 deletions(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Signed-off-by: Adrian Hunter Signed-off-by: Adrian Hunter Signed-off-by: Kishon Vijay Abraham I Signed-off-by: Adrian Hunter diff --git a/drivers/mmc/host/sdhci.c b/drivers/mmc/host/sdhci.c index 1dd117cbeb6e..baab67bfa39b 100644 --- a/drivers/mmc/host/sdhci.c +++ b/drivers/mmc/host/sdhci.c @@ -709,6 +709,36 @@ static u32 sdhci_sdma_address(struct sdhci_host *host) return sg_dma_address(host->data->sg); } +static void sdhci_calc_sw_timeout(struct sdhci_host *host, + struct mmc_command *cmd, + unsigned int target_timeout) +{ + struct mmc_data *data = cmd->data; + struct mmc_host *mmc = host->mmc; + u64 transfer_time; + struct mmc_ios *ios = &mmc->ios; + unsigned char bus_width = 1 << ios->bus_width; + unsigned int blksz; + unsigned int freq; + + if (data) { + blksz = data->blksz; + freq = host->mmc->actual_clock ? : host->clock; + transfer_time = (u64)blksz * NSEC_PER_SEC * (8 / bus_width); + do_div(transfer_time, freq); + /* multiply by '2' to account for any unknowns */ + transfer_time = transfer_time * 2; + /* calculate timeout for the entire data */ + host->data_timeout = (data->blocks * ((target_timeout * + NSEC_PER_USEC) + + transfer_time)); + } else { + host->data_timeout = (u64)target_timeout * NSEC_PER_USEC; + } + + host->data_timeout += MMC_CMD_TRANSFER_TIME; +} + static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd) { u8 count; @@ -766,6 +796,7 @@ static u8 sdhci_calc_timeout(struct sdhci_host *host, struct mmc_command *cmd) if (count >= 0xF) break; } + sdhci_calc_sw_timeout(host, cmd, target_timeout); return count; } @@ -1175,13 +1206,6 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) mdelay(1); } - timeout = jiffies; - if (!cmd->data && cmd->busy_timeout > 9000) - timeout += DIV_ROUND_UP(cmd->busy_timeout, 1000) * HZ + HZ; - else - timeout += 10 * HZ; - sdhci_mod_timer(host, cmd->mrq, timeout); - host->cmd = cmd; if (sdhci_data_line_cmd(cmd)) { WARN_ON(host->data_cmd); @@ -1221,6 +1245,15 @@ void sdhci_send_command(struct sdhci_host *host, struct mmc_command *cmd) cmd->opcode == MMC_SEND_TUNING_BLOCK_HS200) flags |= SDHCI_CMD_DATA; + timeout = jiffies; + if (host->data_timeout > 0) { + timeout += nsecs_to_jiffies(host->data_timeout); + host->data_timeout = 0; + } else { + timeout += 10 * HZ; + } + sdhci_mod_timer(host, cmd->mrq, timeout); + sdhci_writew(host, SDHCI_MAKE_CMD(cmd->opcode, flags), SDHCI_COMMAND); } EXPORT_SYMBOL_GPL(sdhci_send_command); diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h index ff283ee08854..29b242fd17de 100644 --- a/drivers/mmc/host/sdhci.h +++ b/drivers/mmc/host/sdhci.h @@ -332,6 +332,14 @@ struct sdhci_adma2_64_desc { /* Allow for a a command request and a data request at the same time */ #define SDHCI_MAX_MRQS 2 +/* + * 48bit command and 136 bit response in 100KHz clock could take upto 2.48ms. + * However since the start time of the command, the time between + * command and response, and the time between response and start of data is + * not known, set the command transfer time to 10ms. + */ +#define MMC_CMD_TRANSFER_TIME (10 * NSEC_PER_MSEC) /* max 10 ms */ + enum sdhci_cookie { COOKIE_UNMAPPED, COOKIE_PRE_MAPPED, /* mapped by sdhci_pre_req() */ @@ -555,6 +563,8 @@ struct sdhci_host { /* Host SDMA buffer boundary. */ u32 sdma_boundary; + u64 data_timeout; + unsigned long private[0] ____cacheline_aligned; }; From patchwork Wed Mar 7 13:20:17 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 130885 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp5175712lja; Wed, 7 Mar 2018 05:21:41 -0800 (PST) X-Google-Smtp-Source: AG47ELvqaJLRHHStXKTaQLPzW+82BdEN6S8C1UzdV98A4NPUBq0PF7g+eTV3Z9LitUYKkH45vayp X-Received: by 2002:a17:902:6909:: with SMTP id j9-v6mr19938473plk.447.1520428901203; Wed, 07 Mar 2018 05:21:41 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520428901; cv=none; d=google.com; s=arc-20160816; b=G2KOoGnXaKp97iWYQwejy2U02hggUD9VTb1E27RALgSMs/5ejE6A3Kmun67h3AD9jm d0l8upejUMCmKUIkB2r8Wfr7dnIIpBf5S6fPX6CniagGwMT9BSStwUih+UPY7rtdFq6b vZJf1jgyafcMYrDoZUchvdkeX0SvULRqDDbpEq5scS3YLsEnw7D08iFZtNzmxpUa2CFm 725kKZCZNpd+82X6FL6HLxIqpVj12EyaLZZATuyCai2M3pMIXIDrGWML9ClFBc+NEnCm O+qi+Sc9ApklU+7MRSmbyM/MkV1RjOCSsZBJzYnmKMVOSN1zz6U6lkc4XErFBxUekJAr sDoQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature:arc-authentication-results; bh=9OTRK2fBui68rMAGdp/uMDTW13O8eFWdaOyxMU7SQwQ=; b=c8JaOzfpvqgI3rzJeaxpbTMzl7AhKglIgBv9IT3SOIMs2L6rJFY9fttz0UCahRxxe1 E5SL0PiRVKxcpFQlHPEGIS9wkY+yuaB9zn0ZwPt/R6QLMVpgnHDD0yNhEuipDruluCCe xKhM/1wgdUK8xFLHf5vD5rRDF0AMch67j6tUrXQpTUimhpr7dj8K2orEacw9wLkXXTvD lhUqLgSXwPXEuP20hnJduHC38y8ajYQ4URLffOG6M1kHEtdeOUMv5TphuprbBL36FOFy hbWr72pXTWqVC2y8zmzpg+qeUkqWwKumBoK49S633lDjP/sbhOO5K8S0W64eRF6BMg2f bgRg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=msMcLP62; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15-v6si12786777plz.630.2018.03.07.05.21.40; Wed, 07 Mar 2018 05:21:41 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=msMcLP62; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754562AbeCGNVh (ORCPT + 5 others); Wed, 7 Mar 2018 08:21:37 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:62598 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751220AbeCGNVc (ORCPT ); Wed, 7 Mar 2018 08:21:32 -0500 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w27DL3CN004088; Wed, 7 Mar 2018 07:21:03 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1520428863; bh=oknaN+wDvhVV9sjwzCYU0B+jB+fYT088bamcQoiuRHM=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=msMcLP62Jp0H863JBJfKIheHyqo/hOL7zSBQsMtpJn5lvTYdYJUtGU88drMUPowJD cTUD5LL7R1Q2+WbaprXJpvMEh92xoeNXZcfXgxr+p9cE+tnFfZQBJ8eL69kPJKF9Vx lVCo91YyGO7PSjg4IB/7OCzz7X1LzAVX59H7nZdQ= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DL3Hk003819; Wed, 7 Mar 2018 07:21:03 -0600 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE104.ent.ti.com (10.64.6.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 7 Mar 2018 07:21:02 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DFLE102.ent.ti.com (10.64.6.23) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 7 Mar 2018 07:21:03 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DKMnS018331; Wed, 7 Mar 2018 07:21:00 -0600 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Adrian Hunter CC: Rob Herring , Mark Rutland , Russell King , , , , , , Subject: [PATCH v3 08/11] mmc: sdhci-omap: Workaround for Errata i834 Date: Wed, 7 Mar 2018 18:50:17 +0530 Message-ID: <20180307132020.30951-9-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180307132020.30951-1-kishon@ti.com> References: <20180307132020.30951-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Errata i834 in AM572x Sitara Processors Silicon Revision 2.0, 1.1 (SPRZ429K July 2014–Revised March 2017 [1]) mentions the maximum obtainable timeout through MMC host controller is 700ms. And for commands taking longer than 700ms, hardware timeout should be disabled and software timeout should be used. The workaround for Errata i834 can be achieved by adding SDHCI_QUIRK2_DISABLE_HW_TIMEOUT quirk in sdhci-omap. [1] -> http://www.ti.com/lit/er/sprz429k/sprz429k.pdf Signed-off-by: Kishon Vijay Abraham I --- drivers/mmc/host/sdhci-omap.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 314dbe4d7412..87206d2aaa77 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -715,7 +715,8 @@ static const struct sdhci_pltfm_data sdhci_omap_pdata = { SDHCI_QUIRK_BROKEN_ADMA_ZEROLEN_DESC, .quirks2 = SDHCI_QUIRK2_ACMD23_BROKEN | SDHCI_QUIRK2_PRESET_VALUE_BROKEN | - SDHCI_QUIRK2_RSP_136_HAS_CRC, + SDHCI_QUIRK2_RSP_136_HAS_CRC | + SDHCI_QUIRK2_DISABLE_HW_TIMEOUT, .ops = &sdhci_omap_ops, }; From patchwork Wed Mar 7 13:20:18 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Kishon Vijay Abraham I X-Patchwork-Id: 130886 Delivered-To: patch@linaro.org Received: by 10.46.66.2 with SMTP id p2csp5175742lja; Wed, 7 Mar 2018 05:21:42 -0800 (PST) X-Google-Smtp-Source: AG47ELtW732y/6+WN0+qMMSEnCarP8iro+/c6QdTdLSnRWUMcpH8u2VtM3JycjHuIP+ijrMSEk+W X-Received: by 10.99.168.8 with SMTP id o8mr18353566pgf.246.1520428902565; Wed, 07 Mar 2018 05:21:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1520428902; cv=none; d=google.com; s=arc-20160816; b=PZk5TNto+WVkg7Ze/WeT0M5k6kxQF/fVjqCvL08Zr93GsnkRR9MJ98VHCkQmzQsPct Q3/fo8odpw8A66m6BAB3evk06x0F5wV32Ax0WU67o2uWP3e9/2Eq22yQeoMbcngDxXag 8F1lo84h370szgaeyfOlE+tusIuF9vVULxipRQFiNYe5CXrmyPWBKywzPL0LpUMPec5T UUnSqIyUO7W5RBTILh/sV2diZU8HRJPQgEd6ziLxJTsGRQ8JlfJOpUvLLeLt0qf5LUXH p0VWoIFKCQqEdpFZRL+P5076QPktuvNzAntra7f5ekHh5vB4lxToaYY6cV6HhK3uHQ8G y4CQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:references:in-reply-to :message-id:date:subject:cc:to:from:dkim-signature :arc-authentication-results; bh=YKqWN89jZHayR2hhTS115V3yoaqeRw4jf6acqK+IQ6Y=; b=BWCYHBBwChLqFl+I/eg9W6eyYnb9nbtLXVXdXld7I8bwdBiSDOw/FR4mtJO8vkIVUF FnHvU/VZBzC88J87j3KqklXoDX+SiLJ/Cj1YUHY2MlMiR6kNyKvQYj/OOe/CBrLccQ9X FgSQectiXLZ1XuI17SXqWec0fbfqdr8ppVDEtFWr789gAHSyrG8ABd9w7n/Bumb19Oyo POLkiEFWsI4509Q4W1PH+O3V3FDueL9tLj3EOE0IidKFDFwXlPd1OFYRQUNQvsfNl9fX ABe9BEZgInvm1TWyZrtP9/YofZ1MzsA6CLxB3bZDVRXHWcSv7pe3I9/2cwvAfUCUpt4f TEmw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@ti.com header.s=ti-com-17Q1 header.b=cTKNUDEh; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c15-v6si12786777plz.630.2018.03.07.05.21.42; Wed, 07 Mar 2018 05:21:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-omap-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=@ti.com header.s=ti-com-17Q1 header.b=cTKNUDEh; spf=pass (google.com: best guess record for domain of linux-omap-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-omap-owner@vger.kernel.org; dmarc=fail (p=QUARANTINE sp=NONE dis=QUARANTINE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754566AbeCGNVj (ORCPT + 5 others); Wed, 7 Mar 2018 08:21:39 -0500 Received: from fllnx209.ext.ti.com ([198.47.19.16]:62596 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754545AbeCGNVb (ORCPT ); Wed, 7 Mar 2018 08:21:31 -0500 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w27DL763004104; Wed, 7 Mar 2018 07:21:07 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1520428867; bh=77oywQEqkuBA+0emxZpt5wTJCqT69AFTyPApfY1PN74=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=cTKNUDEhKfXIVUFpGEw/foECxIL4ryzvbX5tzOJFi8V9YPRiMM4DalrDNbJVWB51W YJJAqbw1jcLUZ1asKaO036tC7cr+5Xj6hXcc0JCtGAUaCxRHIZDSLVgIcEp0tyg72q vJvUlpJFSc2mqY8wneJVv2cnmuqJ1eO1Jtp8lK2g= Received: from DLEE105.ent.ti.com (dlee105.ent.ti.com [157.170.170.35]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DL72M016491; Wed, 7 Mar 2018 07:21:07 -0600 Received: from DLEE114.ent.ti.com (157.170.170.25) by DLEE105.ent.ti.com (157.170.170.35) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1261.35; Wed, 7 Mar 2018 07:21:06 -0600 Received: from dflp33.itg.ti.com (10.64.6.16) by DLEE114.ent.ti.com (157.170.170.25) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1261.35 via Frontend Transport; Wed, 7 Mar 2018 07:21:06 -0600 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dflp33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w27DKMnT018331; Wed, 7 Mar 2018 07:21:03 -0600 From: Kishon Vijay Abraham I To: Ulf Hansson , Tony Lindgren , Adrian Hunter CC: Rob Herring , Mark Rutland , Russell King , , , , , , Subject: [PATCH v3 09/11] dt-bindings: sdhci-omap: Add K2G specific binding Date: Wed, 7 Mar 2018 18:50:18 +0530 Message-ID: <20180307132020.30951-10-kishon@ti.com> X-Mailer: git-send-email 2.11.0 In-Reply-To: <20180307132020.30951-1-kishon@ti.com> References: <20180307132020.30951-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-omap-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-omap@vger.kernel.org Add binding for the TI's sdhci-omap controller present in K2G. Signed-off-by: Kishon Vijay Abraham I Reviewed-by: Rob Herring --- Documentation/devicetree/bindings/mmc/sdhci-omap.txt | 2 ++ 1 file changed, 2 insertions(+) -- 2.11.0 -- To unsubscribe from this list: send the line "unsubscribe linux-omap" 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-omap.txt b/Documentation/devicetree/bindings/mmc/sdhci-omap.txt index 51775a372c06..8d09b837e350 100644 --- a/Documentation/devicetree/bindings/mmc/sdhci-omap.txt +++ b/Documentation/devicetree/bindings/mmc/sdhci-omap.txt @@ -4,7 +4,9 @@ Refer to mmc.txt for standard MMC bindings. Required properties: - compatible: Should be "ti,dra7-sdhci" for DRA7 and DRA72 controllers + Should be "ti,k2g-sdhci" for K2G - ti,hwmods: Must be "mmc", is controller instance starting 1 + (Not required for K2G). Example: mmc1: mmc@4809c000 {