From patchwork Tue Dec 11 09:12:51 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Chunyan Zhang X-Patchwork-Id: 153408 Delivered-To: patch@linaro.org Received: by 2002:a2e:299d:0:0:0:0:0 with SMTP id p29-v6csp390854ljp; Tue, 11 Dec 2018 01:13:18 -0800 (PST) X-Google-Smtp-Source: AFSGD/XEBB6qzYYsLQewbwJ4kMoBi34lsZEqeXHY8US5MFBk4SlGNMtlVkm9quuSHeyNgPosQZt3 X-Received: by 2002:a62:3305:: with SMTP id z5mr15934913pfz.112.1544519598290; Tue, 11 Dec 2018 01:13:18 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1544519598; cv=none; d=google.com; s=arc-20160816; b=ALV+V/L4TvyhMEJtK9g/I9nFiSFIg1x+82DS0c9+t8URKQlS9HqR/DNoHJ56scNTyQ et4WLq5hrGyhvtN3Izi/UAL7goiSqPCb90srfiMRobzRjz7J9em8BLUzc1OGlrxd1y7m viJFC9qtVPpSP/vqwyco9cYIfr7p00sosPlrNnoiZCB42Ks2BLNlkx6Jxun4VyaGbISq ErSl5uJyS+g35Y2dvWszgQDytI9zq5zoUhyeNzyHWkzc6Vb28rKDduC4hT3fztvMCFnq Sn4iBQzxWh2hG/w+fd6eI4nCQ+gEXykS6wHm5qnrGPcU/zjFHGTGZi1sjWN5QSUDDUFt AYUg== 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; bh=9T3V3dRQcYZgkMYQsaWnQOC7H3nxxKjjTTP7EfZrByg=; b=cO/4lPLEnO67aWXwwfG06vYeM2I9X6QBpg7eS0qlc67HzcouiiosyimVeTW+q+YPCX I+Gs55d8V1Kh984rkJL/SCoXa4KBeK5g9D/x/F1AYPOcNpp8moz1mWy65koMsklWCb6v fZS3chX6hpbIG26gazXSbtRgV3j72k1cfHMYh5LhYu+C1OL/RGAJUS/Q9dbycLWstz0L RN8vyABXpuV9gvWrwXYQULAUTVGYirYSUog1tT/Cfj3F97ygoibjpjmw+7L4SIxUSM3g LRzrKyzeyI4deOAkCLLvxZrmIcpxDSAC1l7damfDcd7+lLaklcNpLTOhroY5OuO13W4Y MVkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linaro.org header.s=google header.b=XuWfY9of; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (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 o1si1988954plk.257.2018.12.11.01.13.17; Tue, 11 Dec 2018 01:13:18 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-mmc-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=@linaro.org header.s=google header.b=XuWfY9of; spf=pass (google.com: best guess record for domain of linux-mmc-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-mmc-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linaro.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726248AbeLKJNQ (ORCPT + 5 others); Tue, 11 Dec 2018 04:13:16 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:38302 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726085AbeLKJNP (ORCPT ); Tue, 11 Dec 2018 04:13:15 -0500 Received: by mail-pl1-f196.google.com with SMTP id e5so6643310plb.5 for ; Tue, 11 Dec 2018 01:13:15 -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=9T3V3dRQcYZgkMYQsaWnQOC7H3nxxKjjTTP7EfZrByg=; b=XuWfY9ofLnr1STsykVT2f6eoB2JkAl3ZNwoIe+pEZ2xUaxDnRITERShTW48YrcWbhu MALOzWEJ1SpurS7tWGY0NtsM3SaK+2fDYu+fHGMjSPWH0doI2Smz00HcP+GWEkE1UhsC ls348AN7v11cGn4OLeT4dVsNwQFjW1m8O8EHA= 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=9T3V3dRQcYZgkMYQsaWnQOC7H3nxxKjjTTP7EfZrByg=; b=W2bkLLrtQLkkgfHlsQmutVXfguBvbhnt49jYI3mJcJ/CvWyMjMKtYGENN5m58zUBR1 /QiVq92Y1JB1Dv7vSvDXyn9/AtUvC0c3gXJySVUvd8wJ1dT+m2qoHk/Rz6xPjmC8reRg u2v9FLVSGv0ldcpG8ThYyTvsknXksAC2C0HfrcKsVw2RVAeGyaOyBH+lWoUcM1Xs7JhJ AFArUrGo+KuYzrR3tBQ1xc/MSQrLxfvJ2/WE9rBapNr/8KpsuLLknN+U4tXdjsgfAbXT MrY+NZSEGwRVpRNFtz6DSdawJsocGPpjnNr3liRm4GW7J7nUN1YronvXbbdAe4KHiIqh /QDA== X-Gm-Message-State: AA+aEWYyTbgiFYAKCfemAmcDO7xqClOft2J8d1XTjglR6l4GarLODiMo Tyi76RCfhCtpIkkn17R/FlMayA== X-Received: by 2002:a17:902:50e3:: with SMTP id c32mr15506965plj.318.1544519595136; Tue, 11 Dec 2018 01:13:15 -0800 (PST) Received: from ubt.spreadtrum.com ([117.18.48.82]) by smtp.gmail.com with ESMTPSA id a90sm27202214pfj.109.2018.12.11.01.13.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 11 Dec 2018 01:13:14 -0800 (PST) From: Chunyan Zhang To: Ulf Hansson , Adrian Hunter , Faiz Abbas Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, Arnd Bergmann , Mark Brown , Kishon Vijay Abraham I , Sekhar Nori , Chunyan Zhang Subject: [PATCH V4 2/3] mmc: sdhci-omap: Add using external dma Date: Tue, 11 Dec 2018 17:12:51 +0800 Message-Id: <1544519572-21921-3-git-send-email-zhang.chunyan@linaro.org> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1544519572-21921-1-git-send-email-zhang.chunyan@linaro.org> References: <1544519572-21921-1-git-send-email-zhang.chunyan@linaro.org> Sender: linux-mmc-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-mmc@vger.kernel.org sdhci-omap can support both external dma controller via dmaengine framework as well as ADMA which standard SD host controller provides. Signed-off-by: Chunyan Zhang --- drivers/mmc/host/Kconfig | 1 + drivers/mmc/host/sdhci-omap.c | 10 ++++++++++ 2 files changed, 11 insertions(+) -- 2.7.4 diff --git a/drivers/mmc/host/Kconfig b/drivers/mmc/host/Kconfig index 3101da6..7846754 100644 --- a/drivers/mmc/host/Kconfig +++ b/drivers/mmc/host/Kconfig @@ -969,6 +969,7 @@ config MMC_SDHCI_XENON config MMC_SDHCI_OMAP tristate "TI SDHCI Controller Support" depends on MMC_SDHCI_PLTFM && OF + select MMC_SDHCI_EXTERNAL_DMA if DMA_ENGINE help This selects the Secure Digital Host Controller Interface (SDHCI) support present in TI's DRA7 SOCs. The controller supports diff --git a/drivers/mmc/host/sdhci-omap.c b/drivers/mmc/host/sdhci-omap.c index 88347ce..b164fcc 100644 --- a/drivers/mmc/host/sdhci-omap.c +++ b/drivers/mmc/host/sdhci-omap.c @@ -896,6 +896,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) const struct of_device_id *match; struct sdhci_omap_data *data; const struct soc_device_attribute *soc; + struct resource *regs; match = of_match_device(omap_sdhci_match, dev); if (!match) @@ -908,6 +909,10 @@ static int sdhci_omap_probe(struct platform_device *pdev) } offset = data->offset; + regs = platform_get_resource(pdev, IORESOURCE_MEM, 0); + if (!regs) + return -ENXIO; + host = sdhci_pltfm_init(pdev, &sdhci_omap_pdata, sizeof(*omap_host)); if (IS_ERR(host)) { @@ -924,6 +929,7 @@ static int sdhci_omap_probe(struct platform_device *pdev) omap_host->timing = MMC_TIMING_LEGACY; omap_host->flags = data->flags; host->ioaddr += offset; + host->mapbase = regs->start; mmc = host->mmc; sdhci_get_of_property(pdev); @@ -991,6 +997,10 @@ static int sdhci_omap_probe(struct platform_device *pdev) host->mmc_host_ops.execute_tuning = sdhci_omap_execute_tuning; host->mmc_host_ops.enable_sdio_irq = sdhci_omap_enable_sdio_irq; + /* Switch to external DMA only if there is the "dmas" property */ + if (of_find_property(dev->of_node, "dmas", NULL)) + sdhci_switch_external_dma(host, true); + ret = sdhci_setup_host(host); if (ret) goto err_put_sync;