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.6 required=3.0 tests=DKIM_INVALID,DKIM_SIGNED, 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 883C7C4CECE for ; Mon, 14 Oct 2019 07:55:37 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 5BE6D20673 for ; Mon, 14 Oct 2019 07:55:37 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=fail reason="signature verification failed" (2048-bit key) header.d=sifive.com header.i=@sifive.com header.b="XjAHdayt" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729874AbfJNHzg (ORCPT ); Mon, 14 Oct 2019 03:55:36 -0400 Received: from mail-pf1-f171.google.com ([209.85.210.171]:39849 "EHLO mail-pf1-f171.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726587AbfJNHzf (ORCPT ); Mon, 14 Oct 2019 03:55:35 -0400 Received: by mail-pf1-f171.google.com with SMTP id v4so9927218pff.6 for ; Mon, 14 Oct 2019 00:55:35 -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=MNI5mn/r/9PEydTyYbiuaqnRTU24OX4PsHrUiRu8H1E=; b=XjAHdaytuN27WH+qMN1Na/Sgfty15Gq3pXeDtv7UFpL81s6ZtkFfeO0KjOh3WUkY79 sUj8Ee/viGjKBeLPGQXAGXB4GlpXIEVqBTlC26OlXDppd6hQX5QvLbA+6mF1xtZRhQWe NsIGAp+t2mrThJhYbXYPlD8T01d/KURE0l7NVvvUPU75RWEi/xKU/L15mJtODActLRtF NReuM+P21xepmbaAC2XnD4jqORJHpW7vB5UZc5iRv0c3ylYtqnnFsRWQ/7PPRrUBDd3W Dhu77b2z3sSC3OplJ4XBYa5Uz0JRt7VZJ0F9DKWyanlFrS/VlEV0qjF5Y/tuQxlkaQLj pO/w== 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=MNI5mn/r/9PEydTyYbiuaqnRTU24OX4PsHrUiRu8H1E=; b=nlGsJv6KNoFdfL0pnuzCuUCG7SK5Ulj8gjLxcz7ivucoqSvgyO/D7/uo+82fkUlJHP e29aBZHjVNA9Tu01ehMoa5fLbuH+/LqHSO3fwaq6lb/uuuKCWAmoeicXt7rUPGkiZUVQ mvn9NvL26Gaqsu2USqlD/WeTIt6t8GD3BqnN/iST0o2eMeuKQg0OHOdBYxTbSWFMXaMC DmAs7UxqX/5BWIwfvbnQALaCRu63+apCDvFOc3DVJbrHCLLB2/1aMWQ4ae9/MDyY1HhP xRyrtJmbnkpg5/COs774nV3K6tiV9gPuVnMl2XE6kP+JG28AT+1faYA0Un2neANOXCbr uACg== X-Gm-Message-State: APjAAAUvHc5EDm2t1PraAffjDHvkXXXe4kC0qRKibAMiI2y0s+cZ8t4e 1CurHKs3pbZ4HbUON03qM53pjA== X-Google-Smtp-Source: APXvYqzjZQsECmJcjeJL+Kb/fahhGk640iRkKNvonQHNJJ4VgDDn32GAg0181aKdTuVxeQDLgKWDVg== X-Received: by 2002:a17:90a:b391:: with SMTP id e17mr35586164pjr.132.1571039734974; Mon, 14 Oct 2019 00:55:34 -0700 (PDT) Received: from localhost.localdomain (111-241-168-233.dynamic-ip.hinet.net. [111.241.168.233]) by smtp.gmail.com with ESMTPSA id j126sm16583137pfb.186.2019.10.14.00.55.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 14 Oct 2019 00:55:33 -0700 (PDT) From: Green Wan Cc: linux-hackers@sifive.com, 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" , 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: [RFC v2 0/4] dmaengine: sf-pdma: Add platform dma driver Date: Mon, 14 Oct 2019 15:54:23 +0800 Message-Id: <20191014075502.15105-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. [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 base-commit: 4f5cafb5cb8471e54afdc9054d973535614f7675 -- 2.17.1