Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp8083435imu; Tue, 4 Dec 2018 02:39:33 -0800 (PST) X-Google-Smtp-Source: AFSGD/W2Mpwy6t/nVQ3VIpINs3AWBIsxonYKZTT1yTc7+dLdpNU42efUUKknh3FBOyU8A+M/2pca X-Received: by 2002:a63:36c4:: with SMTP id d187mr16014305pga.404.1543919973623; Tue, 04 Dec 2018 02:39:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1543919973; cv=none; d=google.com; s=arc-20160816; b=PPgk+P1sJgoVc/OqWPneE2ehhVQMwYIkppAwHrfbnIpj8QVpcHNUR6gGRN0zhjNaZq WZ3hoiANmsM+4MuFYWJA6/TJl6ZgHFgxnKYDGUn7HNXldC8C7QJLmK/r9OSwIHBVskIZ MHvVQa2ntW8SeXTGbP6rhrwCebtwptKKmln+4m2EVmCby6PDHbhEjdmKQY+ISWg6PW6p cHOyPn8ujsPB5NkODeIiXmEywxfgLmncfPUH4XwhuhAl0N1+r4XhcOYABcEyKmck+ksx HJooXTdsZcr+kpbwB2yjRhFeP/kwQ/ez031MEHYIAczdsUgYQwLJgvHVcC3gV1u10M5J IN8w== 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 :content-language:in-reply-to:mime-version:user-agent:date :message-id:from:references:cc:to:subject:dkim-signature; bh=bRgLyaRcKZ/kesJRlA39/0dJLLBW1qnez5tzo7GjSqg=; b=mO/rrVwVImRtA9JkOF5Q94rsJ7CnnGGQwLNbiqU9GqHsXy48NUt0BTrmC1917mQp0k IPVd8xgoAfio+B1fr92zJlchaP5w7duXLgKC4LEXZcuNwAGV5XyW1ql9EELhGT4NjtIl r/JbLaFE2/BccR30Y24lCKZ5pAMm2Vg1ufPOziF4DWLEplxrLa9DHAIrdY9ETOPnPm4O BX+ogE43c1nzt9cuxC1N+Rc2Hu1IOVt914ATLH9f67LfxkJEE68jJYDXylMCnNpIp+d8 x82+ngFqekJ/UYEjV4PtGM4hKUQMzCBar4IU0U7+tp9dstwOPL48BjdEC8fUzbDEfKKR NUnA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ti.com header.s=ti-com-17Q1 header.b=QdoLPWf+; 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 p9si14719150pgc.448.2018.12.04.02.39.17; Tue, 04 Dec 2018 02:39:33 -0800 (PST) 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=QdoLPWf+; 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 S1726134AbeLDKig (ORCPT + 99 others); Tue, 4 Dec 2018 05:38:36 -0500 Received: from lelv0143.ext.ti.com ([198.47.23.248]:48570 "EHLO lelv0143.ext.ti.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725797AbeLDKig (ORCPT ); Tue, 4 Dec 2018 05:38:36 -0500 Received: from lelv0266.itg.ti.com ([10.180.67.225]) by lelv0143.ext.ti.com (8.15.2/8.15.2) with ESMTP id wB4AcTb2026591; Tue, 4 Dec 2018 04:38:29 -0600 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ti.com; s=ti-com-17Q1; t=1543919909; bh=bRgLyaRcKZ/kesJRlA39/0dJLLBW1qnez5tzo7GjSqg=; h=Subject:To:CC:References:From:Date:In-Reply-To; b=QdoLPWf+IIDVEkBFPDo7jqNS+XSgzj9vd8JhSFRAhWPXAalpe8s9/r8OKamk8rKJ5 ri7ScUu5gDvpary3I/eKR5IVuATyCa1/MtUSy4hWMoYEy8h80mWU7NrSzG2vTm8swR vf1WneUK+jkhqbh9RuNNw0ct1WkH4vsGXmL8d2cE= Received: from DFLE104.ent.ti.com (dfle104.ent.ti.com [10.64.6.25]) by lelv0266.itg.ti.com (8.15.2/8.15.2) with ESMTPS id wB4AcTak063763 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=FAIL); Tue, 4 Dec 2018 04:38:29 -0600 Received: from DFLE108.ent.ti.com (10.64.6.29) 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.1591.10; Tue, 4 Dec 2018 04:38:29 -0600 Received: from dlep32.itg.ti.com (157.170.170.100) by DFLE108.ent.ti.com (10.64.6.29) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.1.1591.10 via Frontend Transport; Tue, 4 Dec 2018 04:38:29 -0600 Received: from [172.24.190.215] (ileax41-snat.itg.ti.com [10.172.224.153]) by dlep32.itg.ti.com (8.14.3/8.13.8) with ESMTP id wB4AcPPW000306; Tue, 4 Dec 2018 04:38:26 -0600 Subject: Re: [PATCH V3 1/3] mmc: sdhci: add support for using external DMA devices To: Chunyan Zhang , Ulf Hansson , Adrian Hunter CC: , , Arnd Bergmann , Mark Brown , Kishon Vijay Abraham I , Sekhar Nori , Chunyan Zhang References: <1543908270-13953-1-git-send-email-zhang.chunyan@linaro.org> <1543908270-13953-2-git-send-email-zhang.chunyan@linaro.org> From: Faiz Abbas Message-ID: <5167ffb5-77f8-ab66-2eca-602df5f4e3e8@ti.com> Date: Tue, 4 Dec 2018 16:11:14 +0530 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.2.1 MIME-Version: 1.0 In-Reply-To: <1543908270-13953-2-git-send-email-zhang.chunyan@linaro.org> Content-Type: text/plain; charset="utf-8" Content-Language: en-US Content-Transfer-Encoding: 7bit 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 Hi, On 04/12/18 12:54 PM, Chunyan Zhang wrote: > Some standard SD host controllers can support both external dma > controllers as well as ADMA/SDMA in which the SD host controller > acts as DMA master. TI's omap controller is the case as an example. > > Currently the generic SDHCI code supports ADMA/SDMA integrated in > the host controller but does not have any support for external DMA > controllers implemented using dmaengine, meaning that custom code is > needed for any systems that use an external DMA controller with SDHCI. > ... > diff --git a/drivers/mmc/host/sdhci.h b/drivers/mmc/host/sdhci.h > index b001cf4..8e50a97 100644 > --- a/drivers/mmc/host/sdhci.h > +++ b/drivers/mmc/host/sdhci.h > @@ -475,6 +475,7 @@ struct sdhci_host { > > int irq; /* Device IRQ */ > void __iomem *ioaddr; /* Mapped address */ > + phys_addr_t mapbase; /* physical address base */ > char *bounce_buffer; /* For packing SDMA reads/writes */ > dma_addr_t bounce_addr; > unsigned int bounce_buffer_size; > @@ -524,6 +525,7 @@ struct sdhci_host { > bool pending_reset; /* Cmd/data reset is pending */ > bool irq_wake_enabled; /* IRQ wakeup is enabled */ > bool v4_mode; /* Host Version 4 Enable */ > + bool use_external_dma; > > struct mmc_request *mrqs_done[SDHCI_MAX_MRQS]; /* Requests done */ > struct mmc_command *cmd; /* Current command */ > @@ -552,6 +554,11 @@ struct sdhci_host { > struct timer_list timer; /* Timer for timeouts */ > struct timer_list data_timer; /* Timer for data timeouts */ > > +#if IS_ENABLED(CONFIG_MMC_SDHCI_EXTERNAL_DMA) > + struct dma_chan *rx_chan; > + struct dma_chan *tx_chan; > +#endif > + > u32 caps; /* CAPABILITY_0 */ > u32 caps1; /* CAPABILITY_1 */ > bool read_caps; /* Capability flags have been read */ > @@ -785,5 +792,6 @@ void sdhci_start_tuning(struct sdhci_host *host); > void sdhci_end_tuning(struct sdhci_host *host); > void sdhci_reset_tuning(struct sdhci_host *host); > void sdhci_send_tuning(struct sdhci_host *host, u32 opcode); > +void sdhci_switch_external_dma(struct sdhci_host *host, bool en); > Can you also add a new attribute in sdhci_host->flags for external dma in this file? The log still shows [ 3.675028] mmc2: SDHCI controller on 4809c000.mmc [4809c000.mmc] using ADMA when using external dma. Thanks, Faiz