Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1674871imu; Wed, 23 Jan 2019 23:15:57 -0800 (PST) X-Google-Smtp-Source: ALg8bN6wCNVkjtWZEnoa3+dkPuyd8nn/0PMckj9DhD9mn2/p9ubzvCIG6X3CDdKPxDS0lPLEv5QU X-Received: by 2002:a63:6150:: with SMTP id v77mr4837951pgb.266.1548314157230; Wed, 23 Jan 2019 23:15:57 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1548314157; cv=none; d=google.com; s=arc-20160816; b=S4E6UC3ywA9W4NI041wZgXTFXk1p9JR4AMYdYnkO1QvEm1TorhIMRSFZnIeVxwg1gg SrYPI+uVD9kw1GSG7bqG512T5XQIx5QmUoGG6DqF9U51+2HDUGO2/NQd63dhHbXzEmim T55HnaH6F5uMgA2zK07zVflFgN4ULEnM5ifh/kvZjkhlc17MFh7ECRfO7GI5XsbfyNhe KWAFXOvtkdeg0AsuyIfRdDjfHgX+/ctClDm8dOUGdQ3xpOeGInpVupovk3S0Mqp4jIe0 ssxuytnDmsh7OpN8guYisS6aSdnfAEfaEpJEducsBpwn5tZSDhgy1Z3oBuLaur3Qew2r qlcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:mime-version:message-id:date:subject:cc :to:from; bh=Pev/zPuMzkt9HD8TCragXZy4meUY5eLYf72wiS7OHT8=; b=ojdu98pQM5CHZLXPG44WftwxFXzoVxVEHCXm98x7gnjTR5cnwvFRf9p/OwF2hK9n9D kPwDTeE0nVqRm7QgBlb3/JhoX5UiHG6qRR2hdUCbZqAuMs82XmfjgSa0uJLQ41BrrUbJ 3o/8Vaz84gMN0flUClNXN2wncOF7T9vWa3u8d5nm4pG5eK/Y9ypokbDCNhHzZG0f/VmH 1q6G3ej+cyP2HnVzy2KBqnGV1Xxd87Kz5SPeecIp4T3mZw+Oar00fBXhZ1TNmtvE398i JO6LHNiWKhCes3OH5wTI7+DOyuCxqHAFiH3D5patET4njt/UmdX7lG8r8ZzyXZ6jGoNA Vejw== ARC-Authentication-Results: i=1; mx.google.com; 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 37si22659635plq.210.2019.01.23.23.15.40; Wed, 23 Jan 2019 23:15:57 -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; 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 S1727069AbfAXHP3 (ORCPT + 99 others); Thu, 24 Jan 2019 02:15:29 -0500 Received: from mailgw02.mediatek.com ([210.61.82.184]:30698 "EHLO mailgw02.mediatek.com" rhost-flags-OK-FAIL-OK-FAIL) by vger.kernel.org with ESMTP id S1726315AbfAXHP0 (ORCPT ); Thu, 24 Jan 2019 02:15:26 -0500 X-UUID: c1b493784ed94f7688ac39a10bdd1555-20190124 X-UUID: c1b493784ed94f7688ac39a10bdd1555-20190124 Received: from mtkcas06.mediatek.inc [(172.21.101.30)] by mailgw02.mediatek.com (envelope-from ) (mhqrelay.mediatek.com ESMTP with TLS) with ESMTP id 1218046010; Thu, 24 Jan 2019 15:14:52 +0800 Received: from MTKCAS06.mediatek.inc (172.21.101.30) by mtkmbs01n2.mediatek.inc (172.21.101.79) with Microsoft SMTP Server (TLS) id 15.0.1395.4; Thu, 24 Jan 2019 15:14:50 +0800 Received: from mtkswgap22.mediatek.inc (172.21.77.33) by MTKCAS06.mediatek.inc (172.21.101.73) with Microsoft SMTP Server id 15.0.1395.4 via Frontend Transport; Thu, 24 Jan 2019 15:14:50 +0800 From: To: Sean Wang , Vinod Koul , Rob Herring , Matthias Brugger , Dan Williams CC: , , , , , Subject: [PATCH v5] add support for Mediatek Command-Queue DMA controller on MT6765 SoC Date: Thu, 24 Jan 2019 15:14:18 +0800 Message-ID: <1548314060-4833-1-git-send-email-shun-chih.yu@mediatek.com> X-Mailer: git-send-email 1.7.9.5 MIME-Version: 1.0 Content-Type: text/plain X-TM-SNTS-SMTP: 5FFABE415C4988CF4BE118A90F62A42353F781F3C014EF2C7E41DB5436AEA0332000:8 X-MTK: N Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org This patchset introduces support for MediaTek Command-Queue DMA controller. MediaTek Command-Queue DMA controller (CQDMA) on MT6765 SoC is dedicated to memory-to-memory transfer through queue-based descriptor management. There are only 3 physical channels inside CQDMA, while the driver is extended to support 32 virtual channels for multiple dma users to issue dma requests onto the CQDMA simultaneously. dmatest result: dmatest: dma0chan0-copy2: summary 5000 tests, 0 failures 3500 iops 28037 KB/s (0) dmatest: dma0chan0-copy4: summary 5000 tests, 0 failures 3494 iops 27612 KB/s (0) dmatest: dma0chan0-copy1: summary 5000 tests, 0 failures 3491 iops 27749 KB/s (0) dmatest: dma0chan0-copy7: summary 5000 tests, 0 failures 3673 iops 29092 KB/s (0) dmatest: dma0chan0-copy6: summary 5000 tests, 0 failures 3763 iops 30237 KB/s (0) dmatest: dma0chan0-copy0: summary 5000 tests, 0 failures 3730 iops 30131 KB/s (0) dmatest: dma0chan0-copy3: summary 5000 tests, 0 failures 3717 iops 29569 KB/s (0) dmatest: dma0chan0-copy5: summary 5000 tests, 0 failures 3699 iops 29302 KB/s (0) Changes since v4: - remove redundant queue structure in mtk_cqdma_pchan - remove redundant completion management - fix wrong residue assignment in mtk_cqdma_tx_status - fix typos Changes since v3: - simplify the ISR and management on descriptors by removing tasklet and ASYNC_TX_ENABLE_CHANNEL_SWITCH - remove useless field in mtk_cqdma_vdesc structure - change dev_info to dev_dbg - fix typos Changes since v2: - fix build warning for kernel with DMA address in 32-bit Changes since v1: - remove unused macros, typos - leverage ASYNC_TX_ENABLE_CHANNEL_SWITCH to maintain DMA descriptor list Shun-Chih Yu (2): dt-bindings: dmaengine: Add MediaTek Command-Queue DMA controller bindings dmaengine: mediatek: Add MediaTek Command-Queue DMA controller for MT6765 SoC .../devicetree/bindings/dma/mtk-cqdma.txt | 31 + drivers/dma/mediatek/Kconfig | 12 + drivers/dma/mediatek/Makefile | 1 + drivers/dma/mediatek/mtk-cqdma.c | 748 ++++++++++++++++++++ 4 files changed, 792 insertions(+) create mode 100644 Documentation/devicetree/bindings/dma/mtk-cqdma.txt create mode 100644 drivers/dma/mediatek/mtk-cqdma.c