From patchwork Tue Mar 15 19:12:47 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Miquel Raynal X-Patchwork-Id: 12781753 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C4181C433F5 for ; Tue, 15 Mar 2022 19:13:09 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S245710AbiCOTOU (ORCPT ); Tue, 15 Mar 2022 15:14:20 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:45962 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S245232AbiCOTOT (ORCPT ); Tue, 15 Mar 2022 15:14:19 -0400 Received: from relay6-d.mail.gandi.net (relay6-d.mail.gandi.net [IPv6:2001:4b98:dc4:8::226]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id ACCC4C78; Tue, 15 Mar 2022 12:13:00 -0700 (PDT) Received: (Authenticated sender: miquel.raynal@bootlin.com) by mail.gandi.net (Postfix) with ESMTPSA id E1059C0003; Tue, 15 Mar 2022 19:12:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=bootlin.com; s=gm1; t=1647371579; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=u/D6SPGhBpyZWC2aFb7aJ6eFgcFPSvIErLak7uOUgJw=; b=i36aWtw+u0tKkOfg00+abz853z0qOK6sKfT3Vlcw7y24U5AO6XehDFkk2y+Yu0gwqMvk30 6+AXFGV7xre+YUd0GUMrfOx2BUAFO0cRXy9m5io2AXDNh57WCQhTf98zD/YC7vBatyJz5t Opz2abLPnaPJsKekuFEHQHDSSc7ZHFa8cFwlr3Q7Ow/SKOgq/8C+upbuuL0rHqPtnzLUaW mi6YzGb8wysMtHu/axGKMkMW91/J6Ueo0jYfrQ9oONkuYQ1MMcyT+dyRA/6opAzI0r7RRZ 6K/9jawK+WrlUM26GrDWXlKVKj/49kEUmQPmQ7Z7mLytacYygq7KeTfqikTinQ== From: Miquel Raynal To: linux-renesas-soc@vger.kernel.org, Magnus Damm , Gareth Williams , Phil Edworthy , Geert Uytterhoeven , Stephen Boyd , Michael Turquette , linux-clk@vger.kernel.org, Vinod Koul , dmaengine@vger.kernel.org Cc: Milan Stevanovic , Jimmy Lalande , Pascal Eberhard , Thomas Petazzoni , Herve Codina , Clement Leger , Andy Shevchenko , Viresh Kumar , Miquel Raynal Subject: [PATCH v5 0/8] RZN1 DMA support Date: Tue, 15 Mar 2022 20:12:47 +0100 Message-Id: <20220315191255.221473-1-miquel.raynal@bootlin.com> X-Mailer: git-send-email 2.27.0 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: linux-renesas-soc@vger.kernel.org Hello, Here is a first series bringing DMA support to RZN1 platforms. Soon a second series will come with changes made to the UART controller driver, in order to interact with the RZN1 DMA controller. Cheers, Miquèl Changes in v5: * Used gotos in rzn1_dmamux_route_allocate(). * Changed the prefix to "dmaengine:". * Dropped the partial transfers fix. * Added Rob's acks. Changes in v4: * Freed "map" in the error path of the dmamux driver. * Improved a bit the style as requested by Prabhakar. * Dropped a __maybe_unused. * Reorder the includes. * Added a dependency on ARCH_RZN1. * Added Rob's Ack. * Added a reg property to the dmamux binding file. * Referenced the dmamux binding from the system controller file. * Called of_platform_populate from the end of the system controller (clock) driver probe in order to probe the dmamux if it was populated. * Added DMA properties to all the relevant UARTs. Changes in v3: * Added Reviewed-by tags. * Exported the set_dmamux* symbol properly. * Dropped a useless check in the probe and moved the sysctrl_priv assignation to the end of the probe. * Renamed the dmamux driver * Added a couple of missing MODULE_ macros in the dmamux driver. * Decided to use a regular platform init call instead of the arch_initcall() initially proposed. * s/%d/%u/ in printk's when appropriate. * Used a hardcoded value instead of dmamux->dmac_requests when appropriate. * Changed the variable name "master" to "dmac_idx" to be more descriptive. * Dropped most of the of_* calls in favor of #define's. * Fixed a typo. * Exported two symbols from 8250_dma.c. Changes in v2: * Clarified that the 'fix' regarding non aligned reads would only apply to the DEV_TO_MEM case. * Fix the DMA controller compatible string (copy-paste error). * s/syscon/sysctrl/ as advised by Geert. * Disabled irqs when taking the spinlock from the clocks driver. * Moved the DMAMUX offset inside the driver. * Removed extra commas. * Improved the style as suggested by Andy. * Removed a dupplicated check against the device node presence. * Reduced the number of lines of code by using dev_err_probe(). * Created a Kconfig symbol for DMAMUX to fix the two robot reports received and be sure there was no useless overhead with other platforms. * Exported the serial8250_{tx,rx}_dma() symbols. Miquel Raynal (8): dt-bindings: dmaengine: Introduce RZN1 dmamux bindings dt-bindings: clock: r9a06g032-sysctrl: Reference the DMAMUX subnode dt-bindings: dmaengine: Introduce RZN1 DMA compatible soc: renesas: rzn1-sysc: Export function to set dmamux dmaengine: dw: dmamux: Introduce RZN1 DMA router support dmaengine: dw: Add RZN1 compatible ARM: dts: r9a06g032: Add the two DMA nodes ARM: dts: r9a06g032: Describe the DMA router .../clock/renesas,r9a06g032-sysctrl.yaml | 11 ++ .../bindings/dma/renesas,rzn1-dmamux.yaml | 51 ++++++ .../bindings/dma/snps,dma-spear1340.yaml | 8 +- MAINTAINERS | 1 + arch/arm/boot/dts/r9a06g032.dtsi | 40 +++++ drivers/clk/renesas/r9a06g032-clocks.c | 36 +++- drivers/dma/dw/Kconfig | 9 + drivers/dma/dw/Makefile | 2 + drivers/dma/dw/platform.c | 1 + drivers/dma/dw/rzn1-dmamux.c | 157 ++++++++++++++++++ include/linux/soc/renesas/r9a06g032-sysctrl.h | 11 ++ 11 files changed, 325 insertions(+), 2 deletions(-) create mode 100644 Documentation/devicetree/bindings/dma/renesas,rzn1-dmamux.yaml create mode 100644 drivers/dma/dw/rzn1-dmamux.c create mode 100644 include/linux/soc/renesas/r9a06g032-sysctrl.h