From patchwork Fri Sep 12 07:36:47 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 37286 Return-Path: X-Original-To: linaro@patches.linaro.org Delivered-To: linaro@patches.linaro.org Received: from mail-lb0-f197.google.com (mail-lb0-f197.google.com [209.85.217.197]) by ip-10-151-82-157.ec2.internal (Postfix) with ESMTPS id 6D51A203EE for ; Fri, 12 Sep 2014 07:38:28 +0000 (UTC) Received: by mail-lb0-f197.google.com with SMTP id p9sf204128lbv.0 for ; Fri, 12 Sep 2014 00:38:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:delivered-to:from:to:subject:date:message-id:cc :precedence:list-id:list-unsubscribe:list-archive:list-post :list-help:list-subscribe:mime-version:sender:errors-to :x-original-sender:x-original-authentication-results:mailing-list :content-type:content-transfer-encoding; bh=tTGf3ta2z74Uy45/KXlinuTnA2C6FKbA5yHmBXPkeYQ=; b=AooAVri0C4Ks1FRmbeBmUsYqd9IgDQE5w3+jTzSuQM/HV3b9sY9R8LQMZuJgi/Eipq Z7h+Wv2lPuL/Bfb4iab7ncJQ9prKcx7FNo0kIbcVHT8T/sMiMTVJtCPXH6XPU1bP6R0G 84ZHQn279ndTH4I3j7sY+6xv1K0V/xrolkF4cD5fbQXftClhX0DPTjqDNrr8BtN4jUVd mDNlkR06HF25+JAc0AWYc7qmuHtmzLgwsatbYWRikkSEs4LnaUetoMvShCCmuV2f0j2q AURhkYdF3mJwz5H3qmWurQEu6II6Eo1Ib9T055a8M5PqcN/lHhMyxZCRSjRpcLsTGd+Z +N9w== X-Gm-Message-State: ALoCoQnvZlHV0HWgCUPyFW2b0qu7dRJ5I9jH3g9y+z6+QaPAScGHY7FGen+xifKK0SMXrli1j1rG X-Received: by 10.181.8.226 with SMTP id dn2mr50772wid.4.1410507507216; Fri, 12 Sep 2014 00:38:27 -0700 (PDT) X-BeenThere: patchwork-forward@linaro.org Received: by 10.152.43.69 with SMTP id u5ls136211lal.100.gmail; Fri, 12 Sep 2014 00:38:27 -0700 (PDT) X-Received: by 10.152.21.6 with SMTP id r6mr6916585lae.6.1410507507051; Fri, 12 Sep 2014 00:38:27 -0700 (PDT) Received: from mail-la0-f50.google.com (mail-la0-f50.google.com [209.85.215.50]) by mx.google.com with ESMTPS id c1si4981871lac.133.2014.09.12.00.38.27 for (version=TLSv1 cipher=ECDHE-RSA-RC4-SHA bits=128/128); Fri, 12 Sep 2014 00:38:27 -0700 (PDT) Received-SPF: pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) client-ip=209.85.215.50; Received: by mail-la0-f50.google.com with SMTP id ty20so405642lab.9 for ; Fri, 12 Sep 2014 00:38:26 -0700 (PDT) X-Received: by 10.152.42.136 with SMTP id o8mr6652730lal.71.1410507506939; Fri, 12 Sep 2014 00:38:26 -0700 (PDT) X-Forwarded-To: patchwork-forward@linaro.org X-Forwarded-For: patch@linaro.org patchwork-forward@linaro.org Delivered-To: patch@linaro.org Received: by 10.112.141.42 with SMTP id rl10csp686560lbb; Fri, 12 Sep 2014 00:38:26 -0700 (PDT) X-Received: by 10.69.26.74 with SMTP id iw10mr8910485pbd.137.1410507505399; Fri, 12 Sep 2014 00:38:25 -0700 (PDT) Received: from bombadil.infradead.org (bombadil.infradead.org. [2001:1868:205::9]) by mx.google.com with ESMTPS id we5si6057836pab.162.2014.09.12.00.38.24 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Sep 2014 00:38:25 -0700 (PDT) Received-SPF: none (google.com: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org does not designate permitted sender hosts) client-ip=2001:1868:205::9; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.80.1 #2 (Red Hat Linux)) id 1XSLPx-0000NN-BS; Fri, 12 Sep 2014 07:37:17 +0000 Received: from mail-wg0-f52.google.com ([74.125.82.52]) by bombadil.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1XSLPu-00007Q-RD for linux-arm-kernel@lists.infradead.org; Fri, 12 Sep 2014 07:37:15 +0000 Received: by mail-wg0-f52.google.com with SMTP id x13so296452wgg.11 for ; Fri, 12 Sep 2014 00:36:52 -0700 (PDT) X-Received: by 10.194.59.42 with SMTP id w10mr8572616wjq.15.1410507412435; Fri, 12 Sep 2014 00:36:52 -0700 (PDT) Received: from localhost.localdomain ([85.235.11.236]) by mx.google.com with ESMTPSA id lh5sm3618631wjb.12.2014.09.12.00.36.50 for (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 12 Sep 2014 00:36:51 -0700 (PDT) From: Linus Walleij To: linux-arm-kernel@lists.infradead.org, dmaengine@vger.kernel.org, Vinod Koul , Roland Stigge , Arnd Bergmann Subject: [PATCH 1/4] dma: pl08x: support fixed signal assignment Date: Fri, 12 Sep 2014 09:36:47 +0200 Message-Id: <1410507407-32408-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 1.9.3 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20140912_003715_029030_7270213D X-CRM114-Status: GOOD ( 18.18 ) X-Spam-Score: -0.7 (/) X-Spam-Report: SpamAssassin version 3.4.0 on bombadil.infradead.org summary: Content analysis details: (-0.7 points) pts rule name description ---- ---------------------- -------------------------------------------------- -0.7 RCVD_IN_DNSWL_LOW RBL: Sender listed at http://www.dnswl.org/, low trust [74.125.82.52 listed in list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record -0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [74.125.82.52 listed in wl.mailspike.net] -0.0 RCVD_IN_MSPIKE_WL Mailspike good senders Cc: Dan Williams , Russell King , Linus Walleij X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: , List-Help: , List-Subscribe: , MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patch=linaro.org@lists.infradead.org X-Removed-Original-Auth: Dkim didn't pass. X-Original-Sender: linus.walleij@linaro.org X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: domain of patch+caf_=patchwork-forward=linaro.org@linaro.org designates 209.85.215.50 as permitted sender) smtp.mail=patch+caf_=patchwork-forward=linaro.org@linaro.org Mailing-list: list patchwork-forward@linaro.org; contact patchwork-forward+owners@linaro.org X-Google-Group-Id: 836684582541 Some implementations such as the Nomadik do not place a mux in front of the DMA single/burst request signals into the PL08x DMA controller, instead they lock a certain signal to a certain device. This makes things simpler and the platform does not need to implement a muxing function. Implement this scheme and flag that the Nomadik uses this method. Signed-off-by: Linus Walleij --- drivers/dma/amba-pl08x.c | 31 +++++++++++++++++++++++++++++++ 1 file changed, 31 insertions(+) diff --git a/drivers/dma/amba-pl08x.c b/drivers/dma/amba-pl08x.c index e34024b000a4..1e523a094cc5 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -109,6 +109,11 @@ struct pl08x_driver_data; * missing * @pl080s: whether this version is a PL080S, which has separate register and * LLI word for transfer size. + * @fixed_signals: if the channel signal allocation on the PL08x is fixed, + * i.e. each device burst/single control signals are connected directly + * to the DMAC signal lines without any mux. + * @max_transfer_size: the maximum single element transfer size for this + * PL08x variant. */ struct vendor_data { u8 config_offset; @@ -116,6 +121,7 @@ struct vendor_data { bool dualmaster; bool nomadik; bool pl080s; + bool fixed_signals; u32 max_transfer_size; }; @@ -315,6 +321,15 @@ static int pl08x_request_mux(struct pl08x_dma_chan *plchan) const struct pl08x_platform_data *pd = plchan->host->pd; int ret; + /* + * For engines with fixed signal assignment for slave transfers, + * this signal is assigned during probe. + */ + if (plchan->host->vd->fixed_signals) { + BUG_ON(plchan->signal < 0); + return 0; + } + if (plchan->mux_use++ == 0 && pd->get_xfer_signal) { ret = pd->get_xfer_signal(plchan->cd); if (ret < 0) { @@ -331,6 +346,9 @@ static void pl08x_release_mux(struct pl08x_dma_chan *plchan) { const struct pl08x_platform_data *pd = plchan->host->pd; + if (plchan->host->vd->fixed_signals) + return; + if (plchan->signal >= 0) { WARN_ON(plchan->mux_use == 0); @@ -1892,6 +1910,18 @@ static int pl08x_dma_init_virtual_channels(struct pl08x_driver_data *pl08x, if (slave) { chan->cd = &pl08x->pd->slave_channels[i]; + /* + * Some implementations have muxed signals, whereas some + * use a mux in front of the signals and need dynamic + * assignment of signals. + */ + if (pl08x->vd->fixed_signals) { + chan->signal = i; + chan->name = chan->cd->bus_id; + dev_dbg(&pl08x->adev->dev, + "assign fixed signal %u to channel %s", + chan->signal, chan->name); + } pl08x_dma_slave_init(chan); } else { chan->cd = &pl08x->pd->memcpy_channel; @@ -2236,6 +2266,7 @@ static struct vendor_data vendor_nomadik = { .channels = 8, .dualmaster = true, .nomadik = true, + .fixed_signals = true, .max_transfer_size = PL080_CONTROL_TRANSFER_SIZE_MASK, };