From patchwork Tue Nov 10 04:05:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Frank Lee X-Patchwork-Id: 11893255 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-12.8 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_PATCH, MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_HELO_NONE,SPF_PASS,UNPARSEABLE_RELAY, URIBL_BLOCKED,USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C6803C5517A for ; Tue, 10 Nov 2020 04:07:30 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6477420663 for ; Tue, 10 Nov 2020 04:07:30 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ZGGMjsPH" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6477420663 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=allwinnertech.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version: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=FjHf0vLD4ixK3cd6ZOpFta9CYRtIjbzuXR9MyZX3vfw=; b=ZGGMjsPHa5k3lo4bePTiWIXKN gMBSRmSzrpA57vBjeLyEfjjDqaDf6Pcm7tkHEP1dj1dU/lKiwKO6BPKW1qnueJs5cPbZ6g9g6BLcU AVXHudP3AKRbWWOSfqif9iK/nnppk6s6C6kIPwnpkIBaeIns5cL/cX373pTUd669hmWQF6gYQnDb5 WodKB8Do+xmTN3XVRpb2ku0tsU5ZWoAOJu1SdDMJ44YJmIHITtUggrVzrX3c/Ji3VO+iuf3JtPqy/ ty8OT60LOKZ9TA4o2eLmnzDBvdV+QV1aJTUQ/1tIOCLWS2nCgDkM/KXJwDmgOI9WPpRLjStOLvkX7 phxvTQAbw==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcKvz-00061S-4e; Tue, 10 Nov 2020 04:07:07 +0000 Received: from smtp2207-205.mail.aliyun.com ([121.197.207.205]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kcKvL-0005ky-CE for linux-arm-kernel@lists.infradead.org; Tue, 10 Nov 2020 04:06:32 +0000 X-Alimail-AntiSpam: AC=CONTINUE; BC=0.3740237|-1; CH=green; DM=|CONTINUE|false|; DS=CONTINUE|ham_system_inform|0.0519488-8.64106e-05-0.947965; FP=0|0|0|0|0|-1|-1|-1; HT=ay29a033018047207; MF=frank@allwinnertech.com; NM=1; PH=DS; RN=28; RT=28; SR=0; TI=SMTPD_---.IulFdj5_1604981159; Received: from allwinnertech.com(mailfrom:frank@allwinnertech.com fp:SMTPD_---.IulFdj5_1604981159) by smtp.aliyun-inc.com(10.147.42.135); Tue, 10 Nov 2020 12:06:19 +0800 From: Frank Lee To: vkoul@kernel.org, robh+dt@kernel.org, mripard@kernel.org, wens@csie.org, ulf.hansson@linaro.org, kishon@ti.com, wim@linux-watchdog.org, linux@roeck-us.net, dan.j.williams@intel.com, linus.walleij@linaro.org, wsa+renesas@sang-engineering.com, dianders@chromium.org, marex@denx.de, colin.king@canonical.com, rdunlap@infradead.org, krzk@kernel.org, gregkh@linuxfoundation.org, megous@megous.com, rikard.falkeborn@gmail.com, dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, linux-mmc@vger.kernel.org, linux-watchdog@vger.kernel.org, linux-gpio@vger.kernel.org, tiny.windzz@gmail.com Subject: [PATCH 05/19] dmaengine: sun6i: Add support for A100 DMA Date: Tue, 10 Nov 2020 12:05:39 +0800 Message-Id: <20201110040553.1381-6-frank@allwinnertech.com> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20201110040553.1381-1-frank@allwinnertech.com> References: <20201110040553.1381-1-frank@allwinnertech.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20201109_230627_727897_34B17094 X-CRM114-Status: GOOD ( 12.00 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: Yangtao Li Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org From: Yangtao Li The dma of a100 is similar to h6, with some minor changes to support greater addressing capabilities. Add support for it. Signed-off-by: Yangtao Li --- drivers/dma/sun6i-dma.c | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/drivers/dma/sun6i-dma.c b/drivers/dma/sun6i-dma.c index f5f9c86c50bc..5cadd4d2b824 100644 --- a/drivers/dma/sun6i-dma.c +++ b/drivers/dma/sun6i-dma.c @@ -1173,6 +1173,30 @@ static struct sun6i_dma_config sun50i_a64_dma_cfg = { BIT(DMA_SLAVE_BUSWIDTH_8_BYTES), }; +/* + * TODO: Add support for more than 4g physical addressing. + * + * The A100 binding uses the number of dma channels from the + * device tree node. + */ +static struct sun6i_dma_config sun50i_a100_dma_cfg = { + .clock_autogate_enable = sun6i_enable_clock_autogate_h3, + .set_burst_length = sun6i_set_burst_length_h3, + .set_drq = sun6i_set_drq_h6, + .set_mode = sun6i_set_mode_h6, + .src_burst_lengths = BIT(1) | BIT(4) | BIT(8) | BIT(16), + .dst_burst_lengths = BIT(1) | BIT(4) | BIT(8) | BIT(16), + .src_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | + BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | + BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) | + BIT(DMA_SLAVE_BUSWIDTH_8_BYTES), + .dst_addr_widths = BIT(DMA_SLAVE_BUSWIDTH_1_BYTE) | + BIT(DMA_SLAVE_BUSWIDTH_2_BYTES) | + BIT(DMA_SLAVE_BUSWIDTH_4_BYTES) | + BIT(DMA_SLAVE_BUSWIDTH_8_BYTES), + .has_mbus_clk = true, +}; + /* * The H6 binding uses the number of dma channels from the * device tree node. @@ -1225,6 +1249,7 @@ static const struct of_device_id sun6i_dma_match[] = { { .compatible = "allwinner,sun8i-h3-dma", .data = &sun8i_h3_dma_cfg }, { .compatible = "allwinner,sun8i-v3s-dma", .data = &sun8i_v3s_dma_cfg }, { .compatible = "allwinner,sun50i-a64-dma", .data = &sun50i_a64_dma_cfg }, + { .compatible = "allwinner,sun50i-a100-dma", .data = &sun50i_a100_dma_cfg }, { .compatible = "allwinner,sun50i-h6-dma", .data = &sun50i_h6_dma_cfg }, { /* sentinel */ } };