From patchwork Tue Aug 16 11:31:20 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugeniy Paltsev X-Patchwork-Id: 9283693 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id 11476607FD for ; Tue, 16 Aug 2016 11:31:59 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 0192B28A33 for ; Tue, 16 Aug 2016 11:31:59 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id E8EF628B3D; Tue, 16 Aug 2016 11:31:58 +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=-6.9 required=2.0 tests=BAYES_00,RCVD_IN_DNSWL_HI autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4039D28A33 for ; Tue, 16 Aug 2016 11:31:58 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753624AbcHPLb5 (ORCPT ); Tue, 16 Aug 2016 07:31:57 -0400 Received: from us01smtprelay-2.synopsys.com ([198.182.60.111]:56205 "EHLO smtprelay.synopsys.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753246AbcHPLb4 (ORCPT ); Tue, 16 Aug 2016 07:31:56 -0400 Received: from us02secmta1.synopsys.com (us02secmta1.synopsys.com [10.12.235.96]) by smtprelay.synopsys.com (Postfix) with ESMTP id E23E210C0667; Tue, 16 Aug 2016 04:31:25 -0700 (PDT) Received: from us02secmta1.internal.synopsys.com (us02secmta1.internal.synopsys.com [127.0.0.1]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id D48684E213; Tue, 16 Aug 2016 04:31:25 -0700 (PDT) Received: from mailhost.synopsys.com (mailhost1.synopsys.com [10.12.238.239]) by us02secmta1.internal.synopsys.com (Service) with ESMTP id A533F4E202; Tue, 16 Aug 2016 04:31:25 -0700 (PDT) Received: from mailhost.synopsys.com (localhost [127.0.0.1]) by mailhost.synopsys.com (Postfix) with ESMTP id 8F817DA6; Tue, 16 Aug 2016 04:31:25 -0700 (PDT) Received: from paltsev-8460-lab.internal.synopsys.com (paltsev-8460-lab.internal.synopsys.com [10.121.14.112]) by mailhost.synopsys.com (Postfix) with ESMTP id 87612D9B; Tue, 16 Aug 2016 04:31:23 -0700 (PDT) From: Eugeniy Paltsev To: dmaengine@vger.kernel.org Cc: linux-kernel@vger.kernel.org, viresh.kumar@linaro.org, Nelson.Pereira@synopsys.com, vinod.koul@intel.com, linux-snps-arc@lists.infradead.org, andriy.shevchenko@linux.intel.com, Eugeniy Paltsev Subject: [PATCH] DW: Read "is_memcpy" and "is_nollp" property from device tree. Date: Tue, 16 Aug 2016 14:31:20 +0300 Message-Id: <1471347080-1411-1-git-send-email-Eugeniy.Paltsev@synopsys.com> X-Mailer: git-send-email 2.5.5 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP DW DMAC on ARC SDP became broken after df5c7386 ("dmaengine: dw: some Intel devices has no memcpy support") and 30cb2639 ("dmaengine: dw: don't override platform data with autocfg") commits. * After df5c7386 commit "DMA_MEMCPY" capability option doesn't get set correctly in platform driver version. * After 30cb2639 commit "nollp" parameters don't get set correctly in platform driver version. This happens because in old driver version there are three sources of parameters: pdata, device tree and autoconfig hardware registers. Some parameters were read from pdata and others from autoconfig hardware registers. If pdata was absent some pdata structure fields were filled with parameters from device tree. But 30cb2639 commit disabled overriding pdata with autocfg, so if we use platform driver version without pdata some parameters will not be set. This leads to inoperability of DW DMAC. This patch adds reading missed parameters from device tree. Note there's a prerequisite http://www.spinics.net/lists/dmaengine/msg10682.html Signed-off-by: Eugeniy Paltsev --- drivers/dma/dw/platform.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/drivers/dma/dw/platform.c b/drivers/dma/dw/platform.c index 5bda0eb..2712602 100644 --- a/drivers/dma/dw/platform.c +++ b/drivers/dma/dw/platform.c @@ -129,6 +129,12 @@ dw_dma_parse_dt(struct platform_device *pdev) if (of_property_read_bool(np, "is_private")) pdata->is_private = true; + if (of_property_read_bool(np, "is_memcpy")) + pdata->is_memcpy = true; + + if (of_property_read_bool(np, "is_nollp")) + pdata->is_nollp = true; + if (!of_property_read_u32(np, "chan_allocation_order", &tmp)) pdata->chan_allocation_order = (unsigned char)tmp;