From patchwork Tue Oct 6 10:27:13 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Linus Walleij X-Patchwork-Id: 7334321 Return-Path: X-Original-To: patchwork-dmaengine@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id C5AA49F1B9 for ; Tue, 6 Oct 2015 10:27:23 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id C859020619 for ; Tue, 6 Oct 2015 10:27:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id C46B420618 for ; Tue, 6 Oct 2015 10:27:21 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751597AbbJFK1V (ORCPT ); Tue, 6 Oct 2015 06:27:21 -0400 Received: from mail-lb0-f172.google.com ([209.85.217.172]:33041 "EHLO mail-lb0-f172.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751416AbbJFK1U (ORCPT ); Tue, 6 Oct 2015 06:27:20 -0400 Received: by lbos8 with SMTP id s8so73397434lbo.0 for ; Tue, 06 Oct 2015 03:27:19 -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=KD4fa8vPf932b/iHK4TQrr//N+alc+vt3jJegriUcU0=; b=BQ9pABYgI/b728fhy+Zo1CicDBvI3n3+M9xr8PNN7tUxcqfiAzvK5IaSFBq9fbVfY8 j9amim/QY6fDsisLcH0pK4c1nutm3Hh6nA6TJmZIzEStRTcnV69tLDzmQzUZ7Eld2Tbq 3PdOCxlh2fEWUj3fxhJikhGe2frdE63f1t2dc0W7TZ9/v7Bh4LXhx78r1fGLL2UorQST QIfAanV31LRSX7uhhnvGSrHRFeJz4d34SZFzcINivhBA83jvhtmMEs6FOiOA+o3dTB2f SOZznGuf1hTWhTdSq9KQtqARtM9MToASw7rIARJVnO91ZfoNO/rgmQ8enVYuWs7P5pwX Vngw== X-Gm-Message-State: ALoCoQk2Fo9hXOSRcrhWA+c4tMVBdI0VNoxrVInW4HHPS9u/Tq3fOuDlBXKgn+HUdVc4681bIkuI X-Received: by 10.112.146.2 with SMTP id sy2mr14355012lbb.104.1444127239265; Tue, 06 Oct 2015 03:27:19 -0700 (PDT) Received: from localhost.localdomain.localdomain (c-297471d5.01-192-6c756e10.cust.bredbandsbolaget.se. [213.113.116.41]) by smtp.gmail.com with ESMTPSA id b193sm5169239lfb.46.2015.10.06.03.27.17 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Tue, 06 Oct 2015 03:27:18 -0700 (PDT) From: Linus Walleij To: Vinod Koul , dmaengine@vger.kernel.org, Joachim Eastwood Cc: Linus Walleij , Maxime Ripard Subject: [PATCH 1/3] dma: pl08x: support fixed signal assignment Date: Tue, 6 Oct 2015 12:27:13 +0200 Message-Id: <1444127233-636-1-git-send-email-linus.walleij@linaro.org> X-Mailer: git-send-email 2.4.3 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Spam-Status: No, score=-6.9 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, T_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. While we're at it, add a missing kerneldoc entry. Cc: Maxime Ripard Cc: Joachim Eastwood Signed-off-by: Linus Walleij --- Joachim: I think I need your teste-by on this to make sure the LPC machine survives this patch set. --- 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 9b42c0588550..dc864846f0a9 100644 --- a/drivers/dma/amba-pl08x.c +++ b/drivers/dma/amba-pl08x.c @@ -113,6 +113,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; @@ -120,6 +125,7 @@ struct vendor_data { bool dualmaster; bool nomadik; bool pl080s; + bool fixed_signals; u32 max_transfer_size; }; @@ -319,6 +325,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) { @@ -335,6 +350,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); @@ -1909,6 +1927,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; @@ -2447,6 +2477,7 @@ static struct vendor_data vendor_nomadik = { .channels = 8, .dualmaster = true, .nomadik = true, + .fixed_signals = true, .max_transfer_size = PL080_CONTROL_TRANSFER_SIZE_MASK, };