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: 4892281 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id C3B7CBEEA5 for ; Fri, 12 Sep 2014 07:36:56 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 57E7A20200 for ; Fri, 12 Sep 2014 07:36:55 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 7040420148 for ; Fri, 12 Sep 2014 07:36:54 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752784AbaILHgy (ORCPT ); Fri, 12 Sep 2014 03:36:54 -0400 Received: from mail-we0-f173.google.com ([74.125.82.173]:50316 "EHLO mail-we0-f173.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752643AbaILHgx (ORCPT ); Fri, 12 Sep 2014 03:36:53 -0400 Received: by mail-we0-f173.google.com with SMTP id u56so299314wes.32 for ; Fri, 12 Sep 2014 00:36:52 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=obF4WyF4Gi/NjkuvR1sJGy4dxgurHHZJW0awrModImM=; b=V5iKTw5XtbRHOmRVq4o/riifZIgfjbGeBA7z3Qksdr4TYyFZCS1HdP+KoJ6ywZp0EW XiquDSOi+rk+vIGViqWn27y7qnbAnuKsmocCV036JtA+FY8EEe8D9D6vM/ksBRFj8vTM 5yAzwYKm7spNn8rdPclNegNpNzIK4+IrlqZ/pVE6XuxYHKo0u5bAv5VEXTfMqM9CIjhf OBgbs+5IA2et/NabbyO/pr/GsOVBvrhCoyen5yGmE45BEfoTpRZEonAh36j57Kgo1VPJ ezi6AoYHzGZJQ5rqZJYGOrIKMzCZKAuOIpJZdFogGBlfFhKjAYef+YYtoaNFElJ4lBa+ Nx2A== X-Gm-Message-State: ALoCoQnJTh/tsK9RrZbNyDBnSeHp8GTPeUoMhgAgvUvMrUbYVLQHWtUFjHj90sZBFrvndPGP2jRm 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 Cc: Russell King , Dan Williams , Linus Walleij 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 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-9.1 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP 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, };