Received: by 2002:a17:90a:88:0:0:0:0 with SMTP id a8csp523813pja; Thu, 7 Nov 2019 00:54:23 -0800 (PST) X-Google-Smtp-Source: APXvYqzyH8Tyuy0rdAWfWYaxKG0xMh/D1K9QTzESBix59fHwewDu0BLa5NbomPOR/w+DrQqxFJCX X-Received: by 2002:aa7:dcc4:: with SMTP id w4mr2270770edu.161.1573116863833; Thu, 07 Nov 2019 00:54:23 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573116863; cv=none; d=google.com; s=arc-20160816; b=gJwDX8ab3aNDnZAAiRTTWHSfD+F0hCh6QEGvR2mzdioGQ8Ve8Kzg4mobPeC37UVHLL coDVVywtisASmgSQkDx+gAveTj28jDQib2rM3CvtLGsjrPF1fYLRzoSj0vrOr2m0jHAD /XRkcQLtrt7GzhrFaJ8tnp5Rg8FjM3L7259LNayFvECyd00DGbjC0bNpxt0IRx+6dsEq zaUr8pZWWZRqt+S/1BAEo3IGSkvhp8vgQSE9Rh7azOGug0VRBPwtgF0lfL9hJ0BTKJ40 UM6Zp2be3C0g74DfEoqlF1QQO52X6/Jyrqd4zzpkIJ7BRm6oxt/8TOsopaAmnGIaBJCN gTkA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:message-id:date:subject:cc:from :dkim-signature; bh=wRSTyomOLDs6+V2ErS/oC2G/L0RCS7+9Zv3fKuKSwjg=; b=zskXAwd5ahhmIL4Rxr/mi7iZ7HKtMbpneDeORyJgsVwIbGbivLXgyQ0dYwH4mT5Ct7 OWIEe7pnjf/7dHhHx1XdJ/dABuvn1yV6vLrWP3BmuuQJGwHfjeqQcNXh7xr2IL6Z7zof 4B7ihdwDRdWE3fLCHy1zMd83FUY3QhsvZG4oeVv/dRAkjnhGlGjLChQ7kT1VkgUtwKxt LVLNZEi03BHa4dEefiZs3duiYf9z3QTlvyukr8mApTrX780eUTNrohsCCQ9kQLXEY+8j 86bQZOuofpThbX0xk7gPwVjKuLxt8AJaa2kgI91vR/76sridkdoxYwEyvMoXCN+NR+pJ zDkQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@sifive.com header.s=google header.b=AENY4Zn7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id l14si973058ejc.221.2019.11.07.00.54.00; Thu, 07 Nov 2019 00:54:23 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; dkim=fail header.i=@sifive.com header.s=google header.b=AENY4Zn7; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733219AbfKGIvS (ORCPT + 99 others); Thu, 7 Nov 2019 03:51:18 -0500 Received: from mail-pf1-f174.google.com ([209.85.210.174]:38994 "EHLO mail-pf1-f174.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1733142AbfKGIvR (ORCPT ); Thu, 7 Nov 2019 03:51:17 -0500 Received: by mail-pf1-f174.google.com with SMTP id x28so2122991pfo.6 for ; Thu, 07 Nov 2019 00:51:17 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id; bh=wRSTyomOLDs6+V2ErS/oC2G/L0RCS7+9Zv3fKuKSwjg=; b=AENY4Zn7wWImtkMCK8pNWAF3xkH4Ggiw1TeVZZxn9N/m3I9ECcqWZRo9NQ5hL0QkJg shLGmQ5htRKCntK70+mrIQrYdjDkXtZRGb74kwMGdBnXwe0157esau6X+mvIx2H8zVci OQPdZ2mMtn3hXqhVt0EpSx3KH8CtJe9hEWKNRY3RTcksLc5+XYyIXKYesCQjgrgLuM7p uPKdrE/M3TlAqRQ7v9JiBAjML52fJx+wbJHSQ5Y5mLRvxkVaM6DJZgUmKpvGUjDYTV4F V0GILPJtIgLLGMmfa4JwKqG7z2cvCCUn2dkpa+B1H/34P32Eu0x4unmgoEPAzUoIt8N4 e+6g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=wRSTyomOLDs6+V2ErS/oC2G/L0RCS7+9Zv3fKuKSwjg=; b=NCKANoXMbf/WeWifBbSVKbqD6jFofJm0HMo+DVgooIUw7l5+Vpo7+ny93tbTc418dC 7XdKp+0uS21QRKc4TDm01SJQUHWSI3CnbudBczkzbqmz6+hRTSyy/1GA7fI+cf/h8y7t 7wFfIDTuX6pjawQGKCwWxfHh85Veg5J8+fDEt1dGFqf1Kl/btQpVcGv5w7Pnr5z2+bB3 FzLFnnjPEDxqMjPMuCSjjNLORo3vSewir31iciR4Z338Wb8S28xUtFk5Cph8QXpNPtWK zQ2EnXZiF+zbIjvsI5JblnesVK+9tXTEV6oFK9cGFhsbLw1sQBsetdLuAU8/aYwJKEFT 1uGA== X-Gm-Message-State: APjAAAWj2e2uwPrFJyyqvy+fH9sZMA3PSayarYLkrsUIejLJjRX65ZgI VwT5d76MGNCKnsS8NOg9wu2oNQ== X-Received: by 2002:a63:2d43:: with SMTP id t64mr3037018pgt.428.1573116676572; Thu, 07 Nov 2019 00:51:16 -0800 (PST) Received: from localhost.localdomain (36-228-119-18.dynamic-ip.hinet.net. [36.228.119.18]) by smtp.gmail.com with ESMTPSA id a33sm2402361pgb.57.2019.11.07.00.51.12 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 00:51:15 -0800 (PST) From: Green Wan Cc: Green Wan , Vinod Koul , Rob Herring , Mark Rutland , Palmer Dabbelt , Paul Walmsley , Albert Ou , Dan Williams , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , "Paul E. McKenney" , Bin Meng , Yash Shah , Sagar Kadam , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v6 0/4] dmaengine: sf-pdma: Add platform dma driver Date: Thu, 7 Nov 2019 16:49:18 +0800 Message-Id: <20191107084955.7580-1-green.wan@sifive.com> X-Mailer: git-send-email 2.17.1 To: unlisted-recipients:; (no To-header on input) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Add PDMA driver support for SiFive HiFive Unleashed RevA00 board. Mainly follows DMAengine controller doc[1] to implement and take other DMA drivers as reference. Such as - drivers/dma/fsl-edma.c - drivers/dma/dw-edma/ - drivers/dma/pxa-dma.c Using DMA test client[2] to test. Detailed datasheet is doc[3]. Driver supports: - 4 physical DMA channels, share same DONE and error interrupt handler. - Support MEM_TO_MEM - Tested by DMA test client - patches include DT Bindgins document and dts for fu450-c000 SoC. Separate dts patch for easier review and apply to different branch or SoC platform. - retry 1 time if DMA error occurs. [Changelog] - v6 patch . Remove incorrect reviewer and fix commit number . Revise sf_pdma_desc_residue() to report residue according to cookie. The tx could be in completed, in-progress state or still in pending list. . Refer to fsl-edma.c to free irq and kill tasklet before exit. . Minor fixes include left-justisfied, empty line and unnecessary line. [Reference Doc] [1] ./Documentation/driver-api/dmaengine/provider.rst [2] ./Documentation/driver-api/dmaengine/dmatest.rst [3] https://static.dev.sifive.com/FU540-C000-v1.0.pdf [Simple steps to test of DMA Test client] $ echo 1 > /sys/module/dmatest/parameters/iterations $ echo dma0chan0 > /sys/module/dmatest/parameters/channel $ echo dma0chan1 > /sys/module/dmatest/parameters/channel $ echo dma0chan2 > /sys/module/dmatest/parameters/channel $ echo dma0chan3 > /sys/module/dmatest/parameters/channel $ echo 1 > /sys/module/dmatest/parameters/run [Expected test result] [ 267.563323] dmatest: dma0chan0-copy0: summary 45629 tests, 0 failures 38769.01 iops 309661 KB/s (0) [ 267.572427] dmatest: dma0chan1-copy0: summary 45863 tests, 0 failures 40286.85 iops 321643 KB/s (0) [ 267.581392] dmatest: dma0chan2-copy0: summary 45975 tests, 0 failures 41178.48 iops 328740 KB/s (0) [ 267.590542] dmatest: dma0chan3-copy0: summary 44768 tests, 0 failures 38560.29 iops 307726 KB/s (0) Green Wan (4): dt-bindings: dmaengine: sf-pdma: add bindins for SiFive PDMA riscv: dts: add support for PDMA device of HiFive Unleashed Rev A00 dmaengine: sf-pdma: add platform DMA support for HiFive Unleashed A00 MAINTAINERS: Add Green as SiFive PDMA driver maintainer .../bindings/dma/sifive,fu540-c000-pdma.yaml | 55 ++ MAINTAINERS | 6 + arch/riscv/boot/dts/sifive/fu540-c000.dtsi | 7 + drivers/dma/Kconfig | 2 + drivers/dma/Makefile | 1 + drivers/dma/sf-pdma/Kconfig | 6 + drivers/dma/sf-pdma/Makefile | 1 + drivers/dma/sf-pdma/sf-pdma.c | 621 ++++++++++++++++++ drivers/dma/sf-pdma/sf-pdma.h | 122 ++++ 9 files changed, 821 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/sifive,fu540-c000-pdma.yaml create mode 100644 drivers/dma/sf-pdma/Kconfig create mode 100644 drivers/dma/sf-pdma/Makefile create mode 100644 drivers/dma/sf-pdma/sf-pdma.c create mode 100644 drivers/dma/sf-pdma/sf-pdma.h base-commit: 4dd58158254c8a027f2bf5060b72ef64cafa3b9d -- 2.17.1