From mboxrd@z Thu Jan 1 00:00:00 1970 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=-3.9 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_GIT autolearn=no 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 329CDC32792 for ; Thu, 3 Oct 2019 09:10:10 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 07EE021A4C for ; Thu, 3 Oct 2019 09:10:09 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="bByRo3SH" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728839AbfJCJKJ (ORCPT ); Thu, 3 Oct 2019 05:10:09 -0400 Received: from mail-pl1-f182.google.com ([209.85.214.182]:42839 "EHLO mail-pl1-f182.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727382AbfJCJKJ (ORCPT ); Thu, 3 Oct 2019 05:10:09 -0400 Received: by mail-pl1-f182.google.com with SMTP id e5so1193249pls.9 for ; Thu, 03 Oct 2019 02:10:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sifive.com; s=google; h=from:to:cc:subject:date:message-id; bh=iMtypI6KAEMcJ9rYi5Q4bPpiz/5ORhxuJ1l1aCrdEbI=; b=bByRo3SHUyhiwyJbLrcdfQjTPirjMvPtcf3RppEl/w+VbKdFA+wURYYRn+SB1WOfU/ rJLBKRm7f1HTY51dvB7v+Y/HISSu/LTvBi1DfHBOryRw8YQKyEYepfaWNIWhZaG5TdjV mxJlgkgGDEg2gQlcg8mwuaYalNfMlpkEkMJcNENJY18VVOtaLK1H8vj46wCYyj7fecNd X1N5BMAXzLLPDM1/akeRy3dfp2JQJjJa43RMVQxAblSamCTlQ0opAXWffIqBkPDHJsK5 bzupQuUdQu0EeZJhXIS/Ch7CiIWM1TXwVneZFQSmT5BKm72MgWVWDRAswjQ9OpLEGcf7 vM0w== 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=iMtypI6KAEMcJ9rYi5Q4bPpiz/5ORhxuJ1l1aCrdEbI=; b=lxSBKyAzvr/0OG36omSC68l7Ix/eD4L97dLsTilyFoQ1ouYAdPKbALirzhC1CKeu9C 56evmMOOagQM5cnUbeHaq6bUJTGtkzCen4R+iv0mUzGZuGDFyiHHrgmWNmUz0IrDaWHQ Y4WUku8Rtv+hDxNVUCElyn8O0R+ZG2lvHD69cRkWTLCtCehSLFWhN3ZqX4+fsT5oQevI 6pXPK/i3N3v4iXwvrGTUvQSDaEg3sSvTyuB2Tx70EBMKILT3CqRzqHvZa0WLlF0JyNTm hSdoogn+QH81MZnF+6tUcOT6ghIaliN+NGXzXD+Z1xTlJXQpghh+/6+QwXxFKflizDnv /8bA== X-Gm-Message-State: APjAAAV+v1vejZos3J5mN5gLDsKIVisn+sO2NVP9FA4ykRFmrE7y04JX 6VmmDkwujQuxXK4S5T/knWDTMw== X-Google-Smtp-Source: APXvYqzyE9oM4lS/SzNWMKW5+lppU+ud83w4p3tCW57BC7S0wD+m/pVotdICLfarV0z6n6L75nCJTA== X-Received: by 2002:a17:902:bcc4:: with SMTP id o4mr8164748pls.142.1570093808283; Thu, 03 Oct 2019 02:10:08 -0700 (PDT) Received: from localhost.localdomain (111-241-164-136.dynamic-ip.hinet.net. [111.241.164.136]) by smtp.gmail.com with ESMTPSA id f128sm3445422pfg.143.2019.10.03.02.10.04 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 03 Oct 2019 02:10:07 -0700 (PDT) From: Green Wan To: linux-hackers@sifive.com Cc: Green Wan , Vinod Koul , Rob Herring , Mark Rutland , Paul Walmsley , Palmer Dabbelt , Albert Ou , Dan Williams , Mauro Carvalho Chehab , "David S. Miller" , Greg Kroah-Hartman , Jonathan Cameron , "Paul E. McKenney" , Yash Shah , Bin Meng , Sagar Kadam , dmaengine@vger.kernel.org, devicetree@vger.kernel.org, linux-riscv@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH v4 0/4] dmaengine: sf-pdma: Add platform dma driver Date: Thu, 3 Oct 2019 17:09:00 +0800 Message-Id: <20191003090945.29210-1-green.wan@sifive.com> X-Mailer: git-send-email 2.17.1 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@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. [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 | 601 ++++++++++++++++++ drivers/dma/sf-pdma/sf-pdma.h | 124 ++++ 9 files changed, 803 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 -- 2.17.1