From patchwork Wed Apr 25 12:09:27 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: 134262 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp782092lji; Wed, 25 Apr 2018 05:12:59 -0700 (PDT) X-Google-Smtp-Source: AIpwx4+1Jcz3Rmvr7vL1d4Hxq+6DdV04oCT4waU9cjAn6seLuN2BVQwXcOCWbluw1dev37pUW3w8 X-Received: by 10.99.127.80 with SMTP id p16mr23303807pgn.79.1524658379387; Wed, 25 Apr 2018 05:12:59 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524658379; cv=none; d=google.com; s=arc-20160816; b=LPksyOZIGrwKXNSJjtZVyKcqbkAQRDfYWuNvyVuwn+vBdwpsT/+zlxMXZWLfr0iGZD dfZQ0YhnDe4GqS/SZU2dIo6ppQMuEFa6XyrYq+P2Id+RXIMiF+oxWqrcJ82FkVlDcHMq oD5pPe+BQpo+/UK2SkC/D84gGWjPFANwDDBE49VV4r5QJ2r6Q/Be0qAaM0MpW35sgliD ngWykdvqrpY2E80c406mse/m1D4orBuDBs++T4JMBi6M9Yp6ME4WTxyCF6q5C6fSGFTa MiOz0ILUivuSItj7EXH1l2h9OgqX3QOsmTPv47vYXm8Vs1kcp676Bu0GX8DdoPi+krRM 4VWw== 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=B5KeSDiemyGE8GHyHyIJj6NgBsLpk5L1OzAwTMhbKB4=; b=TOR3z7yBt54j01IOB71GILVilUlGSwzF8jg1Bmatp9R63fVN9g9iZw52FYG6kuj3uk aAsV2DrzUErck0fRtQIzCqVfq3b4XNQFEUoIOn7zusf7LCLWUnsV5DqoNcKeoJx6rc11 f+6YtYLXZVh3/2JSEpSxEQe0lW+HMLLxLYz8EsgLOSqXLMaAREKDgJpTqCsy6wdJ1nA+ gUX5Mqsggatp+7SdyYrfmSiRjWnLs8bOkknpQM/xFbGWzQLMsqAh/a4uPfAvGP3B5/jH 7ROzu51N6EQF5LvmVEQFsGGtS0FO4CBbtLVy+X1+dbDCWiZouIf59/An7ynZVfKGYbID 3+sg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=tAcRQkwa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) 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 q87si16184333pfa.272.2018.04.25.05.12.58; Wed, 25 Apr 2018 05:12:59 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=tAcRQkwa; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753015AbeDYMKI (ORCPT + 29 others); Wed, 25 Apr 2018 08:10:08 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:63420 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752775AbeDYMKB (ORCPT ); Wed, 25 Apr 2018 08:10:01 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3PC9rgM018836; Wed, 25 Apr 2018 07:09:53 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524658193; bh=Qoz1HtnEynflk8MgXDv1oV131m8EbAYSXX4+x5tZGsY=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=tAcRQkwaUfN/WGozsP0sbRmrf5keKLUlJdqqlLkE3NiXeaKNTk+ZUCgIAyz8nfTge 5qLNkTQ54wi2xb6S0jJYYqLw9KCHQWSrDulKngEzrwtiMJ/0qdFfuppy3B08hU2UcD qsLrj8BegP3xJ/xe0yOLS4Blc4qkHnD0pNpz3zqE= 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 w3PC9rjF015812; Wed, 25 Apr 2018 07:09:53 -0500 Received: from DLEE108.ent.ti.com (157.170.170.38) 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.1466.3; Wed, 25 Apr 2018 07:09:53 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE108.ent.ti.com (157.170.170.38) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 25 Apr 2018 07:09:53 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3PC9hhP009970; Wed, 25 Apr 2018 07:09:50 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: , Rob Herring , Mark Rutland , , , , , Tony Lindgren Subject: [PATCH v4 02/12] mmc: sdhci-omap: Remove setting ADMA capability in driver Date: Wed, 25 Apr 2018 17:39:27 +0530 Message-ID: <20180425120937.29867-3-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425120937.29867-1-kishon@ti.com> References: <20180425120937.29867-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org sdhci can directly get ADMA capability from MMCHS_CAPA register. Remove explicitly setting ADMA here as some instances might not have ADMA enabled. (sdhci_read_caps() is also removed from here since sdhci_setup_host() invokes it). Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter Acked-by: Tony Lindgren --- drivers/mmc/host/sdhci-omap.c | 3 --- 1 file changed, 3 deletions(-) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 9bb53702e0e5..6e2cf4cfeec0 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -923,9 +923,6 @@ static int sdhci_omap_probe(struct platform_device *pdev) host->mmc_host_ops.card_busy = sdhci_omap_card_busy; host->mmc_host_ops.execute_tuning = sdhci_omap_execute_tuning; - sdhci_read_caps(host); - host->caps |= SDHCI_CAN_DO_ADMA2; - ret = sdhci_setup_host(host); if (ret) goto err_put_sync; From patchwork Wed Apr 25 12:09:28 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: 134264 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp782775lji; Wed, 25 Apr 2018 05:13:33 -0700 (PDT) X-Google-Smtp-Source: AB8JxZqI0G8jvIxv9VdyG3w9jl+uFUb6GVQTLQHAmEPjMV1qWdybqO/mF1Maezxl4YhwPlDfE96t X-Received: by 10.99.181.75 with SMTP id u11mr6270173pgo.365.1524658413434; Wed, 25 Apr 2018 05:13:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524658413; cv=none; d=google.com; s=arc-20160816; b=tESmoJPOLiC7Vm+0h2hYt1if+Lg1ig4r4qJpJqx3o+Ya5aDUu4DmG2BKBzfANrTh8G 3HwU1FVzKZfW6saHDkHDNP2AK7t57Yj6aVy9u/airDZbYw/JfSzXBlvqUZ1XbwAeWDJ4 swXxseP9yH6csFdOm+BW7eEcFvWu7qUDHYkzOiI02ItxzTyek7cETQWp1XBtnBjpf5pz 9k0oeC9mg9zEgEZzaBda0uHvmpdA+5ixP8xY8gm0IXKlA/jD00Ku0nIRn1VO8g38eOK3 hY56VxTbbR9b1FmuUR5JcyG8wrpoRCiP71RTkYPthEmbmbe1rSiuHOjr/1rZ4+17VW3+ NdNQ== 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=MNlPWpIlOYx7sDDR6OP69qxuklBes3eA9yXxO09aRdo=; b=ulXdtYgEK1UGHXC3gOcsL46nv2cXUwBrOjKxStakq7KvbxDppdf2Q+sv0igSYu18Zi FxVBk4neifT5yZCx9pvvkdFbNlNGAKUziNdQwEiurmBbX02fCBbXM4acI+x1an/meK1A mUQanjEdkTjMUkBwX6KQMw1xOpX4OMLZjuXfxry5rM4OD/q84opuaXLlTNk+bV/u0+De +yb84v1J7V2AOG8Xs9KZ63ubwTxbXbXoqvclefEXiBkpUQNGg21gRbB8aPZKEryTK694 taLkB/z0yWrurfBXQFvSU+zM1FPx1QXoHlsGi/xHfMPzSNh+XkMF2781BPdCsDoNO2c3 bFyQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SPvKbKUz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) 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 e9si13308606pgv.306.2018.04.25.05.13.33; Wed, 25 Apr 2018 05:13:33 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=SPvKbKUz; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753690AbeDYMNb (ORCPT + 29 others); Wed, 25 Apr 2018 08:13:31 -0400 Received: from fllnx209.ext.ti.com ([198.47.19.16]:13726 "EHLO fllnx209.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752110AbeDYMKE (ORCPT ); Wed, 25 Apr 2018 08:10:04 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by fllnx209.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3PC9uvw017398; Wed, 25 Apr 2018 07:09:56 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524658196; bh=9GiF4dRmUdnKn+BluZubikb+LEytNCDeC1hesRCKTFo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=SPvKbKUzbFzBkFm9UekG7D2bDMrFzo5/J685UpSumRu31EM4xjCp5CmfZzN2Ean11 xj8MEX8dXWJmGUHshnLZgaC5SS6f7o/mWtNn8jUvcBKOlK9QSgO0RSw80O3Cv1j02C ueommczEw6kewp1GeCYT81xc2t2fy04iLpb1BmlE= Received: from DFLE106.ent.ti.com (dfle106.ent.ti.com [10.64.6.27]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3PC9uXC016572; Wed, 25 Apr 2018 07:09:56 -0500 Received: from DFLE109.ent.ti.com (10.64.6.30) by DFLE106.ent.ti.com (10.64.6.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 25 Apr 2018 07:09:56 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DFLE109.ent.ti.com (10.64.6.30) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 25 Apr 2018 07:09:56 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3PC9hhQ009970; Wed, 25 Apr 2018 07:09:53 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: , Rob Herring , Mark Rutland , , , , , Tony Lindgren Subject: [PATCH v4 03/12] mmc: sdhci-omap: Workaround for Errata i843 Date: Wed, 25 Apr 2018 17:39:28 +0530 Message-ID: <20180425120937.29867-4-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425120937.29867-1-kishon@ti.com> References: <20180425120937.29867-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Errata i843 in AM572x Sitara Processors Silicon Revision 2.0, 1.1 (SPRZ429L July 2014–Revised April 2018 [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/sprz429l/sprz429l.pdf Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter Acked-by: Tony Lindgren --- drivers/mmc/host/sdhci-omap.c | 35 ++++++++++++++++++++++++++++++++++- 1 file changed, 34 insertions(+), 1 deletion(-) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 6e2cf4cfeec0..b4400be0606f 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 Apr 25 12:09:36 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: 134257 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp779432lji; Wed, 25 Apr 2018 05:10:41 -0700 (PDT) X-Google-Smtp-Source: AIpwx48txE7TXB/rFSyxVyksieyM4+XhQd7dpnmLD/iNjGiSoICwBht8NDcNOpsY1nnDZ0ltT3WN X-Received: by 10.101.88.68 with SMTP id s4mr23663702pgr.232.1524658241777; Wed, 25 Apr 2018 05:10:41 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524658241; cv=none; d=google.com; s=arc-20160816; b=D764SnU2Ho5x+G2k+NbLUPssEqJpqb4HwLnH0w5S3MGtIO4EWxAtu0KcRdW53miPJv CJRv+zDhCaIC1caLPdeiIiPoDNdvqWsttXToIFH5zq/I2uQMFLsdbn/TbKT1Mm8jnoss jaqwgKh6TdcPqMsIlqbQm0xALqKS/dygV/jDzRTFgJMoKUCg1sa10QaAINzhD/3JmV3R IZuglErrr1vl9OV4ywL+DWOvkuJDjhCYFqYoxlYMccSQNenB8iqjqO3nDfUO4vwLS+p4 0f7WbShEH2l9eml6FVzOox31uG9kNJrTrDAr9u4PNAuvpXQfwWbzfM9ni7zBrk4EqV0I 6wiw== 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=WnOPpS5SCBkAnWw0uFtkCjGs/gBBNc576A/UhaBcdbY=; b=EgrRSJ6VIjRBPvFA0OA/SBaa633t+qkpPY+wl1TPyEgybTygXElGMlWD7bnnJeX9uX WniIKdh++pndQBUQOLrZcsqxGGqHp4CT4qpf1Dxm113g7k3tSRSCXhUX7IxoDrD9kVDE ZyniltlleXxzopAI3GXFPQQAEL5Pt2nZaoxR7Qx+hqr5y+iaGkVE+LC5kHDLzoB/Shxb cqm95NldYH6JCJpW7IobB+iriLcxB693TkMAxMHgkGQeF0Do3TMuPYcaEXl0Qe7MXzbp 4fCUQYONFVexNlStBga3OfUdhaOFHeE3petZml8PD6r80HFSJu12BUqXw2PN6ItKxBr/ BPOg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=PYZIhiNu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) 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 z7si2240540pgv.228.2018.04.25.05.10.41; Wed, 25 Apr 2018 05:10:41 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=PYZIhiNu; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753452AbeDYMKj (ORCPT + 29 others); Wed, 25 Apr 2018 08:10:39 -0400 Received: from lelnx194.ext.ti.com ([198.47.27.80]:63466 "EHLO lelnx194.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753297AbeDYMK3 (ORCPT ); Wed, 25 Apr 2018 08:10:29 -0400 Received: from dlelxv90.itg.ti.com ([172.17.2.17]) by lelnx194.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3PCANsl018927; Wed, 25 Apr 2018 07:10:23 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524658223; bh=1ATxya0nbjA84+i41a3o4f/VzXwUSDWkOquhoeWh29Q=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=PYZIhiNuDkY766etC4ZDmsCx4tMxlYrl25CeEn7MkxCW3JwKyNTbAJLUQBObrhIbK pgi9tH0Pxoxh3Y58zaRqm2eig4c/+9MqGqyFNH8WZeJsvh+BfkI7DF9VWIzqtSHwjB l+KVqtwE7BI1kNVglg2jUKxHAC+wzR59OQVZ9bVM= Received: from DFLE100.ent.ti.com (dfle100.ent.ti.com [10.64.6.21]) by dlelxv90.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3PCAN93016762; Wed, 25 Apr 2018 07:10:23 -0500 Received: from DFLE102.ent.ti.com (10.64.6.23) by DFLE100.ent.ti.com (10.64.6.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 25 Apr 2018 07:10:23 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) 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.1466.3 via Frontend Transport; Wed, 25 Apr 2018 07:10:23 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3PC9hhY009970; Wed, 25 Apr 2018 07:10:20 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: , Rob Herring , Mark Rutland , , , , , Tony Lindgren Subject: [PATCH v4 11/12] mmc: sdhci-omap: Add support for MMC/SD controller in k2g SoC Date: Wed, 25 Apr 2018 17:39:36 +0530 Message-ID: <20180425120937.29867-12-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425120937.29867-1-kishon@ti.com> References: <20180425120937.29867-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add support for the new compatible added specifically to support k2g's MMC/SD controller. Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter Acked-by: Tony Lindgren --- drivers/mmc/host/sdhci-omap.c | 5 +++++ 1 file changed, 5 insertions(+) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index b2c54940d032..c1a19e8d0a08 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -720,6 +720,10 @@ static const struct sdhci_pltfm_data sdhci_omap_pdata = { .ops = &sdhci_omap_ops, }; +static const struct sdhci_omap_data k2g_data = { + .offset = 0x200, +}; + static const struct sdhci_omap_data dra7_data = { .offset = 0x200, .flags = SDHCI_OMAP_REQUIRE_IODELAY, @@ -727,6 +731,7 @@ static const struct sdhci_omap_data dra7_data = { static const struct of_device_id omap_sdhci_match[] = { { .compatible = "ti,dra7-sdhci", .data = &dra7_data }, + { .compatible = "ti,k2g-sdhci", .data = &k2g_data }, {}, }; MODULE_DEVICE_TABLE(of, omap_sdhci_match); From patchwork Wed Apr 25 12:09:37 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: 134258 Delivered-To: patch@linaro.org Received: by 10.46.151.6 with SMTP id r6csp779745lji; Wed, 25 Apr 2018 05:10:58 -0700 (PDT) X-Google-Smtp-Source: AIpwx499IrWmsap0aT6HIxm/N7ADGxoCag5Txojoyd+crIorDO25yIoJpX5QQjgUZjQU+3dfIpro X-Received: by 10.99.117.26 with SMTP id q26mr23222802pgc.338.1524658258801; Wed, 25 Apr 2018 05:10:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1524658258; cv=none; d=google.com; s=arc-20160816; b=HYfXCkviTNd/iRC+V4CwYC5Wy2eZ6KkX5MDunx1qawENobQ7L6ujf/0y6rulkPoRmZ QUzglxIV9wZ/Xc55GliwsCWQ4GnNxdsu+MzSNV8MjwNBa2kb3Nr0UzZx5qwMUWQ8dqo9 L1nSVOORx+zjpQ+nxFjtFKNa/UScjsaJpCE7Uv0S4gfKDpzkrqZCtERUZGJ984TKNY9z WvvZTqdGojlyLbBhjam2ACZq/t/qcETjBZtgdnSUJPyAnYvZMPRIbcEDZgI+AQYTtZag 8/Wu7Qber27VB3FvXtMCnci89viNp85ST+nw6XceMdn3p2oqAc8SW4sAkHjre4Uy74tj AkqA== 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=H2YpbJqzPvRgvlUEuTnfgwTWKs3YGRvFh1reL3g0aKk=; b=caX7LOU8bjAZQ8nHrpzpvRnWWFTi/8P6ywp+pgBVnEV3O67H2kiAAFwM7BbjXRlGDu GpfYclT/7jLo7nk1PDwIAEvRwQnw+tMxWzaYRuU+r+HXN3TRpKdeAwf6pTuAbtIeZISY C9L8znOEtz4TkpRGeTsBpDv9pFy8ZiqX6XW9XeD9lRvs83RrbQqZhV57MgTKLNSjmMW8 cI/dMhiQnhqfKA8EV9VaOy2HjkyUJKRnVdjhw850VD5DOuy9IkqXdakq79vwZG4+Kfrq 0LjF8vzFvY/62Vfe7zR7fsfA4zaoRCZDeQbuC1/5BocywPqnx7AT0xx4nWv0jGeYSIet 7EZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fJx9ONRv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) 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 q12si13640169pgc.614.2018.04.25.05.10.58; Wed, 25 Apr 2018 05:10:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=fJx9ONRv; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=NONE dis=NONE) header.from=ti.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753524AbeDYMKz (ORCPT + 29 others); Wed, 25 Apr 2018 08:10:55 -0400 Received: from lelnx193.ext.ti.com ([198.47.27.77]:10515 "EHLO lelnx193.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753336AbeDYMKc (ORCPT ); Wed, 25 Apr 2018 08:10:32 -0400 Received: from dflxv15.itg.ti.com ([128.247.5.124]) by lelnx193.ext.ti.com (8.15.1/8.15.1) with ESMTP id w3PCAQQr002129; Wed, 25 Apr 2018 07:10:26 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=ti.com; s=ti-com-17Q1; t=1524658226; bh=xHTu1mZERdcadZmEJukMqVmytZnMg8EOmIBXRBRtXpo=; h=From:To:CC:Subject:Date:In-Reply-To:References; b=fJx9ONRv7HVaIMcWX7VEJ9mlnSpmlYNI8+1BQzBtL3WzmoZNUscCqzKZ3U9WCxXgp 5CI5ZdegT8RGHb2TfnQv8o2fxJbNnX1pF7bigykaFbPy72slpdeYt5CsHQLDYjzpe/ zHKBDjCw4ztTGyeCu1s2nlIfm8o2aucFdWgWqeqc= Received: from DLEE106.ent.ti.com (dlee106.ent.ti.com [157.170.170.36]) by dflxv15.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3PCAQbZ017633; Wed, 25 Apr 2018 07:10:26 -0500 Received: from DLEE106.ent.ti.com (157.170.170.36) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_CBC_SHA256_P256) id 15.1.1466.3; Wed, 25 Apr 2018 07:10:26 -0500 Received: from dlep33.itg.ti.com (157.170.170.75) by DLEE106.ent.ti.com (157.170.170.36) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1466.3 via Frontend Transport; Wed, 25 Apr 2018 07:10:26 -0500 Received: from a0393678ub.india.ti.com (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep33.itg.ti.com (8.14.3/8.13.8) with ESMTP id w3PC9hhZ009970; Wed, 25 Apr 2018 07:10:23 -0500 From: Kishon Vijay Abraham I To: Ulf Hansson , Adrian Hunter CC: , Rob Herring , Mark Rutland , , , , , Tony Lindgren Subject: [PATCH v4 12/12] mmc: sdhci-omap: Add sdhci_omap specific ops for enable_sdio_irq Date: Wed, 25 Apr 2018 17:39:37 +0530 Message-ID: <20180425120937.29867-13-kishon@ti.com> X-Mailer: git-send-email 2.17.0 In-Reply-To: <20180425120937.29867-1-kishon@ti.com> References: <20180425120937.29867-1-kishon@ti.com> MIME-Version: 1.0 X-EXCLAIMER-MD-CONFIG: e1e8a2fd-e40a-4ac6-ac9b-f7e9cc9ee180 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add sdhci_omap_enable_sdio_irq to set CTPL and CLKEXTFREE bits in MMCHS_CON register required to detect asynchronous card interrupt on DAT[1]. Signed-off-by: Kishon Vijay Abraham I Acked-by: Adrian Hunter Acked-by: Tony Lindgren --- drivers/mmc/host/sdhci-omap.c | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) -- 2.17.0 diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index c1a19e8d0a08..912b48df9dd1 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -36,6 +36,7 @@ #define CON_DDR BIT(19) #define CON_CLKEXTFREE BIT(16) #define CON_PADEN BIT(15) +#define CON_CTPL BIT(11) #define CON_INIT BIT(1) #define CON_OD BIT(0) @@ -226,6 +227,23 @@ static void sdhci_omap_conf_bus_power(struct sdhci_omap_host *omap_host, } } +static void sdhci_omap_enable_sdio_irq(struct mmc_host *mmc, int enable) +{ + struct sdhci_host *host = mmc_priv(mmc); + struct sdhci_pltfm_host *pltfm_host = sdhci_priv(host); + struct sdhci_omap_host *omap_host = sdhci_pltfm_priv(pltfm_host); + u32 reg; + + reg = sdhci_omap_readl(omap_host, SDHCI_OMAP_CON); + if (enable) + reg |= (CON_CTPL | CON_CLKEXTFREE); + else + reg &= ~(CON_CTPL | CON_CLKEXTFREE); + sdhci_omap_writel(omap_host, SDHCI_OMAP_CON, reg); + + sdhci_enable_sdio_irq(mmc, enable); +} + static inline void sdhci_omap_set_dll(struct sdhci_omap_host *omap_host, int count) { @@ -962,6 +980,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) host->mmc_host_ops.set_ios = sdhci_omap_set_ios; host->mmc_host_ops.card_busy = sdhci_omap_card_busy; host->mmc_host_ops.execute_tuning = sdhci_omap_execute_tuning; + host->mmc_host_ops.enable_sdio_irq = sdhci_omap_enable_sdio_irq; ret = sdhci_setup_host(host); if (ret)