From patchwork Wed May 24 10:06:04 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Icenowy Zheng X-Patchwork-Id: 9745667 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 1B06F60210 for ; Wed, 24 May 2017 10:08:49 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0531828947 for ; Wed, 24 May 2017 10:08:49 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id EBECC2894A; Wed, 24 May 2017 10:08:48 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-1.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [65.50.211.133]) (using TLSv1.2 with cipher AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.wl.linuxfoundation.org (Postfix) with ESMTPS id 6B22E28947 for ; Wed, 24 May 2017 10:08:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20170209; h=Sender: Content-Transfer-Encoding:Content-Type:MIME-Version:Cc:List-Subscribe: List-Help:List-Post:List-Archive:List-Unsubscribe:List-Id:References: In-Reply-To:Message-Id:Date:Subject:To:From:Reply-To:Content-ID: Content-Description:Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc :Resent-Message-ID:List-Owner; bh=+9aF6gFKOSWqq+Bpqm8OwwZ9l4sKcCGZ11jJQil/lOA=; b=PfyBPmZER9vAvpEdUytfLiXXfj ncgNQ0UgaarzN9qCB97dHqGIYLUcF+crGPZxpwaY+O/UygrmNX7Nu2yY23dAnJwPZgXqipGG+dYcR LsJ1NnJJtu/6s2kHRMAlCM0zUDHJhGnazqsYg5+ywObNsX4Z75EIQujTrY7r5beZ4oZT3yK1/cqsi 3WZ6ZJwcwijVP1L8zABP4ngwMy68HVWxz70jUFIrwaJ2J4RiWHTK0CvX/FxR27hc/p6FPk9BPHZri BmFtSQvju/jbc3Z1/VXnQOf6Tg11+PlW7hLpzTAqE+cpwTIR6jjX8UZ9t+reQWkESpEzpaZqhDV34 C4SXzC7g==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.87 #1 (Red Hat Linux)) id 1dDTDi-0002oF-RZ; Wed, 24 May 2017 10:08:46 +0000 Received: from merlin.infradead.org ([2001:4978:20e::2]) by bombadil.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dDTDM-0002XZ-8d for linux-arm-kernel@bombadil.infradead.org; Wed, 24 May 2017 10:08:24 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=infradead.org; s=merlin.20170209; h=References:In-Reply-To:Message-Id:Date: Subject:Cc:To:From:Sender:Reply-To:MIME-Version:Content-Type: Content-Transfer-Encoding:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id: List-Help:List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=5KuCisf8DKy9V2BsUlw2fOIn7GF+9nWfnRx63wUqths=; b=Kh218cv7PTRjHIPVPQkSVPBNo wP9tHdIiOela6zzP0iZi0+pPVgDaK8uxcy23PJ15TiCNd45Tceqa0OBb4C0XwLyhQjvL7HD0h9zw6 wpH6Zrztx9DPnFKkY/CyUZvwiri9EuKYPmJHziQkqLwBEJNN5BmmcPQ09jaY/9kckDXCf/9Legrjl qb3U+a5kxtgUoYNlp0qB70C3QLsvN9SDIuwBPUqXBmEfSNpgwdWMJqfOv9+bGAtZdWus24TfZxtKK QGgW7R4tLIsmdlXcp5fXFzzxSBrL5xCv9MOLkCvi0XpCIuVqposjKkdH3F1VcZYcRJ/Ulp9ud3Gcw XLI7tSjiQ==; Received: from cadetblue.maple.relay.mailchannels.net ([23.83.214.28]) by merlin.infradead.org with esmtps (Exim 4.87 #1 (Red Hat Linux)) id 1dDTDK-00075C-3Y for linux-arm-kernel@lists.infradead.org; Wed, 24 May 2017 10:08:23 +0000 X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from relay.mailchannels.net (localhost [127.0.0.1]) by relay.mailchannels.net (Postfix) with ESMTP id 1866420536D; Wed, 24 May 2017 10:07:48 +0000 (UTC) Received: from hermes.aosc.io (unknown [100.96.126.214]) (Authenticated sender: lmn-TZDUIOWCRQMW) by relay.mailchannels.net (Postfix) with ESMTPA id 18EC4205E93; Wed, 24 May 2017 10:07:42 +0000 (UTC) X-Sender-Id: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io Received: from hermes.aosc.io (hermes.aosc.io [172.20.120.92]) (using TLSv1.2 with cipher DHE-RSA-AES256-GCM-SHA384) by 0.0.0.0:2500 (trex/5.9.3); Wed, 24 May 2017 10:07:47 +0000 X-MC-Relay: Neutral X-MailChannels-SenderId: lmn-tzduiowcrqmw|x-authsender|icenowy@aosc.io X-MailChannels-Auth-Id: lmn-TZDUIOWCRQMW X-Wiry-Print: 353c9372547302ae_1495620465531_2667683964 X-MC-Loop-Signature: 1495620465531:174704909 X-MC-Ingress-Time: 1495620465531 Received: from localhost (localhost [127.0.0.1]) (Authenticated sender: icenowy@aosc.io) by hermes.aosc.io (Postfix) with ESMTPSA id 58BB54FCDE; Wed, 24 May 2017 10:07:22 +0000 (UTC) From: Icenowy Zheng To: Vinod Koul , Maxime Ripard , Chen-Yu Tsai , Liam Girdwood , Mark Brown , Jaroslav Kysela , Takashi Iwai Subject: [PATCH v3 6/9] dmaengine: sun6i: support V3s SoC variant Date: Wed, 24 May 2017 18:06:04 +0800 Message-Id: <20170524100607.29790-7-icenowy@aosc.io> In-Reply-To: <20170524100607.29790-1-icenowy@aosc.io> References: <20170524100607.29790-1-icenowy@aosc.io> X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20170524_060822_316644_C29EEFBA X-CRM114-Status: GOOD ( 11.29 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.21 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, alsa-devel@alsa-project.org, linux-kernel@vger.kernel.org, linux-sunxi@googlegroups.com, Icenowy Zheng , dmaengine@vger.kernel.org, linux-arm-kernel@lists.infradead.org MIME-Version: 1.0 Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org X-Virus-Scanned: ClamAV using ClamSMTP From: Icenowy Zheng Allwinner V3s has a DMA engine similar to the ones from A31, but with fewer channels and DRQs. Add support for it. Signed-off-by: Icenowy Zheng Acked-by: Chen-Yu Tsai Acked-by: Rob Herring --- Changes in v3: - Added Chen-Yu's ACK. Documentation/devicetree/bindings/dma/sun6i-dma.txt | 1 + drivers/dma/sun6i-dma.c | 13 +++++++++++++ 2 files changed, 14 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/sun6i-dma.txt b/Documentation/devicetree/bindings/dma/sun6i-dma.txt index 6b267045f522..98fbe1a5c6dd 100644 --- a/Documentation/devicetree/bindings/dma/sun6i-dma.txt +++ b/Documentation/devicetree/bindings/dma/sun6i-dma.txt @@ -9,6 +9,7 @@ Required properties: "allwinner,sun8i-a23-dma" "allwinner,sun8i-a83t-dma" "allwinner,sun8i-h3-dma" + "allwinner,sun8i-v3s-dma" - reg: Should contain the registers base address and length - interrupts: Should contain a reference to the interrupt used by this device - clocks: Should contain a reference to the parent AHB clock diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index 69840cf6fe98..a57eaace8e7d 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c @@ -1034,11 +1034,24 @@ static struct sun6i_dma_config sun8i_h3_dma_cfg = { .nr_max_vchans = 34, }; +/* + * The V3s have only 8 physical channels, a maximum DRQ port id of 23, + * and a total of 24 usable source and destination endpoints. + */ + +static struct sun6i_dma_config sun8i_v3s_dma_cfg = { + .nr_max_channels = 8, + .nr_max_requests = 23, + .nr_max_vchans = 24, + .gate_needed = true, +}; + static const struct of_device_id sun6i_dma_match[] = { { .compatible = "allwinner,sun6i-a31-dma", .data = &sun6i_a31_dma_cfg }, { .compatible = "allwinner,sun8i-a23-dma", .data = &sun8i_a23_dma_cfg }, { .compatible = "allwinner,sun8i-a83t-dma", .data = &sun8i_a83t_dma_cfg }, { .compatible = "allwinner,sun8i-h3-dma", .data = &sun8i_h3_dma_cfg }, + { .compatible = "allwinner,sun8i-v3s-dma", .data = &sun8i_v3s_dma_cfg }, { /* sentinel */ } }; MODULE_DEVICE_TABLE(of, sun6i_dma_match);