From patchwork Tue Sep 11 07:26:53 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pierre Yves MORDRET X-Patchwork-Id: 10595173 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id CB464920 for ; Tue, 11 Sep 2018 07:27:50 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B112F2927F for ; Tue, 11 Sep 2018 07:27:50 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A3B442928D; Tue, 11 Sep 2018 07:27:50 +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=-2.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.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 0B4C22927F for ; Tue, 11 Sep 2018 07:27:49 +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:Cc:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version: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:In-Reply-To:References: List-Owner; bh=fSYdjmn2KjWz5XclH08gzFKHzk67CONL/HAnxWDbwVY=; b=WqmmB+bo0LUQ0+ piKes9g2U7rI59qgJqJBsvLXs3su6dFVxKEsan+cdFDYb3wiwJsh9ceqYfBJKC0zsc1yhCcINcLlM dAQePhL19UL8bpuCEvuoxVyjzT1b+bBnvYbKVrsMW7jbCZC/2gsSpwwocZpF4R597ywtK9vCU4BN3 +WwDm1h+eOPkMbrJGEgEL9H8+4bmjFpWPwHShiBy/Lqu8yziP7f9SYxxhZF2YtftIaOzYJw+/XP2C Ay13mAz5L7vf0DGxFUJT0XHdF2YPVB7J9+h5GODTQjB+nMW1ojjvZIeI1cq3Ln8PwlJ0zvCR1X0Nb KIs0vlp2y1dyaYh+sM+w==; Received: from localhost ([127.0.0.1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.90_1 #2 (Red Hat Linux)) id 1fzd5F-0007a3-If; Tue, 11 Sep 2018 07:27:37 +0000 Received: from mx07-00178001.pphosted.com ([62.209.51.94]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fzd55-0007QB-OF for linux-arm-kernel@lists.infradead.org; Tue, 11 Sep 2018 07:27:30 +0000 Received: from pps.filterd (m0046668.ppops.net [127.0.0.1]) by mx07-.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id w8B7Oa0C026425; Tue, 11 Sep 2018 09:27:06 +0200 Received: from beta.dmz-eu.st.com (beta.dmz-eu.st.com [164.129.1.35]) by mx07-00178001.pphosted.com with ESMTP id 2me62r0ycc-1 (version=TLSv1 cipher=ECDHE-RSA-AES256-SHA bits=256 verify=NOT); Tue, 11 Sep 2018 09:27:06 +0200 Received: from zeta.dmz-eu.st.com (zeta.dmz-eu.st.com [164.129.230.9]) by beta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 7235A31; Tue, 11 Sep 2018 07:27:04 +0000 (GMT) Received: from Webmail-eu.st.com (sfhdag5node2.st.com [10.75.127.14]) by zeta.dmz-eu.st.com (STMicroelectronics) with ESMTP id 4104A1DF8; Tue, 11 Sep 2018 07:27:04 +0000 (GMT) Received: from localhost (10.75.127.45) by SFHDAG5NODE2.st.com (10.75.127.14) with Microsoft SMTP Server (TLS) id 15.0.1347.2; Tue, 11 Sep 2018 09:27:03 +0200 From: Pierre-Yves MORDRET To: Vinod Koul , Rob Herring , Mark Rutland , Alexandre Torgue , Maxime Coquelin , Dan Williams , , , , Subject: [PATCH v1 0/7] Add-DMA-MDMA-chaining-support Date: Tue, 11 Sep 2018 09:26:53 +0200 Message-ID: <1536650820-16076-1-git-send-email-pierre-yves.mordret@st.com> X-Mailer: git-send-email 2.7.4 MIME-Version: 1.0 X-Originating-IP: [10.75.127.45] X-ClientProxiedBy: SFHDAG3NODE1.st.com (10.75.127.7) To SFHDAG5NODE2.st.com (10.75.127.14) X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2018-09-11_03:, , signatures=0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20180911_002728_123522_5938F071 X-CRM114-Status: GOOD ( 10.58 ) 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: Pierre-Yves MORDRET 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 This serie adds support for M2M transfer triggered by STM32 DMA in order to transfer data from/to SRAM to/from DDR. Normally, this mode should not be needed as transferring data from/to DDR is supported by the STM32 DMA. However, the STM32 DMA don't have the ability to generate burst transfer on the DDR as it only embeds only a 4-word FIFO although the minimal burst length on the DDR is 8 words. Due to this constraint, the STM32 DMA transfers data from/to DDR in a single way and could lead to pollute the DDR. To avoid this, we have to use SRAM for all transfers where STM32 DMA is involved. An Hw design has been specially put in place to allow this chaining where DMA interrupt is connected on GIC and MDMA request line as well. This grants the possibility to trigger an MDMA transfer from the completion of DMA. At the same time MDMA has the ability to acknowlege DMA. The aim is to have an self refreching mechanism to transfer from/to device to/from DDR with minimal sw support. For instance the DMA is set in cyclic double buffering to feed SRAM and MDMA transfer to DDR thanks to LLI. Pierre-Yves MORDRET (7): dt-bindings: stm32-dma: Add DMA/MDMA chaining support bindings dt-bindings: stm32-dmamux: Add one cell to support DMA/MDMA chain dt-bindings: stm32-mdma: Add DMA/MDMA chaining support bindings dmaengine: stm32-dma: Add DMA/MDMA chaining support dmaengine: stm32-mdma: Add DMA/MDMA chaining support dmaengine: stm32-dma: enable descriptor_reuse dmaengine: stm32-mdma: enable descriptor_reuse .../devicetree/bindings/dma/stm32-dma.txt | 32 +- .../devicetree/bindings/dma/stm32-dmamux.txt | 5 +- .../devicetree/bindings/dma/stm32-mdma.txt | 22 +- drivers/dma/stm32-dma.c | 903 ++++++++++++++++++--- drivers/dma/stm32-mdma.c | 133 ++- 5 files changed, 954 insertions(+), 141 deletions(-)