From patchwork Mon May 27 06:55:16 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10962167 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 88C241575 for ; Mon, 27 May 2019 06:55:26 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 78205287E3 for ; Mon, 27 May 2019 06:55:26 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 69B0228947; Mon, 27 May 2019 06:55:26 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 F1F18287E3 for ; Mon, 27 May 2019 06:55:25 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725973AbfE0GzZ (ORCPT ); Mon, 27 May 2019 02:55:25 -0400 Received: from mail-eopbgr800041.outbound.protection.outlook.com ([40.107.80.41]:25312 "EHLO NAM03-DM3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725940AbfE0GzZ (ORCPT ); Mon, 27 May 2019 02:55:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=XXZfOS/dQAXD9SPIEbxJDyZi8Wiwx0sdPDTxJ9BF/kE=; b=RnpXeancvfB8hcYbUVs9xARr4/moRQmkiUUq4e/2IW1X92+M2fQ4ddt/aNia7sX0cg8N7MY50agY1EuQIJBilroGCy0M8DRvrd8twh5vIXK3/8g+Nh7/VnYACn2Ld9I5yt7coJmrJ7VdHWV3Z9qkmNJEHmDBcZwL2UcrF9K0T58= Received: from DM6PR03CA0004.namprd03.prod.outlook.com (2603:10b6:5:40::17) by CY1PR03MB2268.namprd03.prod.outlook.com (2a01:111:e400:c614::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.18; Mon, 27 May 2019 06:55:23 +0000 Received: from CY1NAM02FT040.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by DM6PR03CA0004.outlook.office365.com (2603:10b6:5:40::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.15 via Frontend Transport; Mon, 27 May 2019 06:55:22 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by CY1NAM02FT040.mail.protection.outlook.com (10.152.75.135) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1922.16 via Frontend Transport; Mon, 27 May 2019 06:55:22 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x4R6tLQq029720 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK) for ; Sun, 26 May 2019 23:55:21 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Mon, 27 May 2019 02:55:21 -0400 From: Alexandru Ardelean To: CC: Alexandru Ardelean Subject: [PATCH 1/3][V3] include: fpga: adi-axi-common.h: add common regs & defs header Date: Mon, 27 May 2019 09:55:16 +0300 Message-ID: <20190527065518.18613-1-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(396003)(136003)(376002)(346002)(39860400002)(2980300002)(189003)(199004)(54534003)(305945005)(50466002)(2906002)(7636002)(2351001)(246002)(70206006)(70586007)(48376002)(8936002)(44832011)(4326008)(86362001)(50226002)(53416004)(8676002)(47776003)(107886003)(6306002)(106002)(7696005)(51416003)(316002)(1076003)(2616005)(126002)(476003)(16586007)(486006)(36756003)(6916009)(356004)(6666004)(77096007)(14444005)(26005)(5660300002)(186003)(478600001)(966005)(336012)(426003);DIR:OUT;SFP:1101;SCL:1;SRVR:CY1PR03MB2268;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: 92f4714c-0af9-43ae-e102-08d6e2704a24 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709054)(1401327)(2017052603328);SRVR:CY1PR03MB2268; X-MS-TrafficTypeDiagnostic: CY1PR03MB2268: X-MS-Exchange-PUrlCount: 2 X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:3968; X-Forefront-PRVS: 0050CEFE70 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: Qw14zDPZufz+WQ9HPFIp6ZACS/BDdIQz80/8Iody+Ywj4rkHZsQSUBsLUBdRMHUkJpE4op4b3F/7mPjeDHfv4V+n2bW5vjYgmktwm8ylZRv2a2HdvMJbdndiBt8smHnEQhZ3AD2dCoLceW2ui7ljjY8WrGjzdWRekSf6SIMeWOQ10jX0yIEyZUnoTbT6sB5Bc/4F4Tr4uE1o/r4tnmBwwOqV2sw0x22iGyDLiQp+urTD9rZpKOfDuheoBfr5X30GS7ziOCUvGc0qjFOD/SJM3TAhxGfg5PlOGDfs9GZLz8KMrC0IbSUo88A3pWFtQM2XKZX9Qvp5ksvkmvfUkk9R2Qs/eM+FngfYEKzNAv1j3LH5zR3/ifMYb3Jr2UrWKpwfW7/5ovaPiTadxMShRNAxcds4zd341+m9qrvQ8y9x1VA= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2019 06:55:22.4878 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 92f4714c-0af9-43ae-e102-08d6e2704a24 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: CY1PR03MB2268 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The AXI HDL cores provided for Analog Devices reference designs all share some common base registers (e.g. version register at address 0x00). To reduce duplication for this, a common header is added to define these registers as well as bitfields & macros to work with these registers. Signed-off-by: Alexandru Ardelean --- Changelog v2 -> v3: * fixed style for SPDX-License-Identifier in C header * fixed minor checkpatch complaint about 80 col limit include/linux/fpga/adi-axi-common.h | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 include/linux/fpga/adi-axi-common.h diff --git a/include/linux/fpga/adi-axi-common.h b/include/linux/fpga/adi-axi-common.h new file mode 100644 index 000000000000..7fc95d5c95bb --- /dev/null +++ b/include/linux/fpga/adi-axi-common.h @@ -0,0 +1,19 @@ +/* SPDX-License-Identifier: GPL-2.0 */ +/* + * Analog Devices AXI common registers & definitions + * + * Copyright 2019 Analog Devices Inc. + * + * https://wiki.analog.com/resources/fpga/docs/axi_ip + * https://wiki.analog.com/resources/fpga/docs/hdl/regmap + */ + +#ifndef ADI_AXI_COMMON_H_ +#define ADI_AXI_COMMON_H_ + +#define ADI_AXI_REG_VERSION 0x0000 + +#define ADI_AXI_PCORE_VER(major, minor, patch) \ + (((major) << 16) | ((minor) << 8) | (patch)) + +#endif /* ADI_AXI_COMMON_H_ */ From patchwork Mon May 27 06:55:17 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10962169 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id D7DD376 for ; Mon, 27 May 2019 06:55:28 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C5D0C287E3 for ; Mon, 27 May 2019 06:55:28 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id B93EC28947; Mon, 27 May 2019 06:55:28 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 254DB287E3 for ; Mon, 27 May 2019 06:55:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726073AbfE0Gz1 (ORCPT ); Mon, 27 May 2019 02:55:27 -0400 Received: from mail-eopbgr790053.outbound.protection.outlook.com ([40.107.79.53]:53504 "EHLO NAM03-CO1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725940AbfE0Gz1 (ORCPT ); Mon, 27 May 2019 02:55:27 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=gIWyfdaWBynJxAnjUQrRvBzfSKIvDO6mdNLId1SYJuc=; b=5Tq6BlT7vS4K0EDfYlxa/rIRMa1v7aBa7Pb8SfxVqsNJk4Jz+J6vae2BC+yTwo6vZVk/DOw79rlIryfYkVqXafL5fXgrVMThrLjHrIij64mKL6t5dnMYImn/1Od9bwN5YdIrXzmO6BoYaTHtbR4zZ9TtGLnlRoxD+aHxnCmJLI8= Received: from BN6PR03CA0005.namprd03.prod.outlook.com (2603:10b6:404:23::15) by DM2PR03MB558.namprd03.prod.outlook.com (2a01:111:e400:241d::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.17; Mon, 27 May 2019 06:55:24 +0000 Received: from CY1NAM02FT024.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::201) by BN6PR03CA0005.outlook.office365.com (2603:10b6:404:23::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.16 via Frontend Transport; Mon, 27 May 2019 06:55:24 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by CY1NAM02FT024.mail.protection.outlook.com (10.152.74.210) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1922.16 via Frontend Transport; Mon, 27 May 2019 06:55:23 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x4R6tMZw029725 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK); Sun, 26 May 2019 23:55:23 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Mon, 27 May 2019 02:55:22 -0400 From: Alexandru Ardelean To: CC: Lars-Peter Clausen , Alexandru Ardelean Subject: [PATCH 2/3][V3] dmaengine: axi-dmac: Discover length alignment requirement Date: Mon, 27 May 2019 09:55:17 +0300 Message-ID: <20190527065518.18613-2-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190527065518.18613-1-alexandru.ardelean@analog.com> References: <20190527065518.18613-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(39860400002)(396003)(376002)(346002)(2980300002)(199004)(189003)(43544003)(7636002)(50226002)(26005)(51416003)(7696005)(1076003)(54906003)(106002)(5660300002)(70586007)(316002)(16586007)(186003)(70206006)(2906002)(246002)(77096007)(305945005)(426003)(336012)(8936002)(48376002)(446003)(126002)(486006)(2616005)(86362001)(44832011)(478600001)(2351001)(11346002)(53416004)(476003)(107886003)(76176011)(8676002)(6666004)(36756003)(356004)(6916009)(14444005)(50466002)(47776003)(4326008);DIR:OUT;SFP:1101;SCL:1;SRVR:DM2PR03MB558;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;A:1;MX:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: e2c61f23-3de8-4c7a-de61-08d6e2704b02 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709054)(1401327)(2017052603328);SRVR:DM2PR03MB558; X-MS-TrafficTypeDiagnostic: DM2PR03MB558: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:4303; X-Forefront-PRVS: 0050CEFE70 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: wuXWCDOeXLxPl7IGoEi0x1AQfR97SV3tJJg5rOOJDbJb/DVvAUdULm+y+RY7y/ZtBRKYC+erkzUV9JsjoE+g8Eg0qjY8NV53CqAbopWCFHfxgISDSmmOGn2PdYTgs6O6e0cSBMBqlWcIme4THhfVtuDZPl/PlzUyJKmZvqDPvbsTcP+z5ByQDUntXgwkvxfqKfYlQZMVX16UNDHZ9qGPf5ylB+u804CZdZt/XBB4MYbSeRIrfeW8qiXORO3ZlW8wqa4T+9rNu3mFmbEGcg5d93Q8w2hGAWKVhjP8te59j7mjoKtZ9SivqqC7LqVg63LrNOELq3nIvyBWr7HJgEI9TRdg70e9t2L7G0aESRw1srYziZ/x7RhupPhnq+ZtKlkTbcaEdglIVTUUa1etw+oeBbQfQKanG4OtihauaY2DKQg= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2019 06:55:23.9405 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: e2c61f23-3de8-4c7a-de61-08d6e2704b02 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DM2PR03MB558 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From: Lars-Peter Clausen Starting with version 4.1.a the AXI-DMAC is capable of reporting the required length alignment. The LSBs that are required to be set for alignment will always read back as set from the transfer length register. It is not possible to clear them by writing a 0. This means the driver can discover the length alignment requirement by writing 0 to that register and reading back the value. Since the DMA will support length alignment requirements that are different from the address alignment requirement track both of them independently. For older versions of the peripheral assume that the length alignment requirement is equal to the address alignment requirement. Signed-off-by: Lars-Peter Clausen Signed-off-by: Alexandru Ardelean --- drivers/dma/dma-axi-dmac.c | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 0984ae6eb155..74ae6246d9a5 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -20,6 +20,7 @@ #include #include #include +#include #include @@ -110,7 +111,8 @@ struct axi_dmac_chan { unsigned int dest_type; unsigned int max_length; - unsigned int align_mask; + unsigned int address_align_mask; + unsigned int length_align_mask; bool hw_cyclic; bool hw_2d; @@ -169,14 +171,14 @@ static bool axi_dmac_check_len(struct axi_dmac_chan *chan, unsigned int len) { if (len == 0) return false; - if ((len & chan->align_mask) != 0) /* Not aligned */ + if ((len & chan->length_align_mask) != 0) /* Not aligned */ return false; return true; } static bool axi_dmac_check_addr(struct axi_dmac_chan *chan, dma_addr_t addr) { - if ((addr & chan->align_mask) != 0) /* Not aligned */ + if ((addr & chan->address_align_mask) != 0) /* Not aligned */ return false; return true; } @@ -394,7 +396,7 @@ static struct axi_dmac_sg *axi_dmac_fill_linear_sg(struct axi_dmac_chan *chan, num_segments = DIV_ROUND_UP(period_len, chan->max_length); segment_size = DIV_ROUND_UP(period_len, num_segments); /* Take care of alignment */ - segment_size = ((segment_size - 1) | chan->align_mask) + 1; + segment_size = ((segment_size - 1) | chan->length_align_mask) + 1; for (i = 0; i < num_periods; i++) { len = period_len; @@ -623,7 +625,7 @@ static int axi_dmac_parse_chan_dt(struct device_node *of_chan, return ret; chan->dest_width = val / 8; - chan->align_mask = max(chan->dest_width, chan->src_width) - 1; + chan->address_align_mask = max(chan->dest_width, chan->src_width) - 1; if (axi_dmac_dest_is_mem(chan) && axi_dmac_src_is_mem(chan)) chan->direction = DMA_MEM_TO_MEM; @@ -640,6 +642,9 @@ static int axi_dmac_parse_chan_dt(struct device_node *of_chan, static int axi_dmac_detect_caps(struct axi_dmac *dmac) { struct axi_dmac_chan *chan = &dmac->chan; + unsigned int version; + + version = axi_dmac_read(dmac, ADI_AXI_REG_VERSION); axi_dmac_write(dmac, AXI_DMAC_REG_FLAGS, AXI_DMAC_FLAG_CYCLIC); if (axi_dmac_read(dmac, AXI_DMAC_REG_FLAGS) == AXI_DMAC_FLAG_CYCLIC) @@ -670,6 +675,14 @@ static int axi_dmac_detect_caps(struct axi_dmac *dmac) return -ENODEV; } + if (version >= ADI_AXI_PCORE_VER(4, 1, 'a')) { + axi_dmac_write(dmac, AXI_DMAC_REG_X_LENGTH, 0x00); + chan->length_align_mask = + axi_dmac_read(dmac, AXI_DMAC_REG_X_LENGTH); + } else { + chan->length_align_mask = chan->address_align_mask; + } + return 0; } From patchwork Mon May 27 06:55:18 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexandru Ardelean X-Patchwork-Id: 10962171 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 67BBC15A6 for ; Mon, 27 May 2019 06:55:29 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 58580287E3 for ; Mon, 27 May 2019 06:55:29 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 4D29128947; Mon, 27 May 2019 06:55:29 +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=-7.9 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,MAILING_LIST_MULTI,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 EF8EB287E3 for ; Mon, 27 May 2019 06:55:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725940AbfE0Gz2 (ORCPT ); Mon, 27 May 2019 02:55:28 -0400 Received: from mail-eopbgr740058.outbound.protection.outlook.com ([40.107.74.58]:2055 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1726052AbfE0Gz2 (ORCPT ); Mon, 27 May 2019 02:55:28 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=analog.onmicrosoft.com; s=selector1-analog-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=Gd3rrgEbfhQwUv63GAX/GSD8JVBVuNt7XKDKnNeukRY=; b=RoOmTJD5j3iLNJQ+WNrOs+uZ/ilkqMjV1mTLPIoRwBTKHeZINYj2QPdfGBGIEW2QNW9tzrk9/Pl9aI9/+7DWrp7PrfCYIVbbPzGAmLNfRG3mPFHeuN6Ka9v1at6rFzZEPGmwyDYz0uf091K+uR/6BKAlH0zrRIPrZu78jYI5V6U= Received: from DM6PR03CA0016.namprd03.prod.outlook.com (2603:10b6:5:40::29) by MWHPR03MB3136.namprd03.prod.outlook.com (2603:10b6:301:3c::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1922.17; Mon, 27 May 2019 06:55:25 +0000 Received: from CY1NAM02FT051.eop-nam02.prod.protection.outlook.com (2a01:111:f400:7e45::208) by DM6PR03CA0016.outlook.office365.com (2603:10b6:5:40::29) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384) id 15.20.1922.15 via Frontend Transport; Mon, 27 May 2019 06:55:25 +0000 Authentication-Results: spf=pass (sender IP is 137.71.25.55) smtp.mailfrom=analog.com; vger.kernel.org; dkim=none (message not signed) header.d=none;vger.kernel.org; dmarc=bestguesspass action=none header.from=analog.com; Received-SPF: Pass (protection.outlook.com: domain of analog.com designates 137.71.25.55 as permitted sender) receiver=protection.outlook.com; client-ip=137.71.25.55; helo=nwd2mta1.analog.com; Received: from nwd2mta1.analog.com (137.71.25.55) by CY1NAM02FT051.mail.protection.outlook.com (10.152.74.148) with Microsoft SMTP Server (version=TLS1_0, cipher=TLS_RSA_WITH_AES_256_CBC_SHA) id 15.20.1922.16 via Frontend Transport; Mon, 27 May 2019 06:55:25 +0000 Received: from NWD2HUBCAS7.ad.analog.com (nwd2hubcas7.ad.analog.com [10.64.69.107]) by nwd2mta1.analog.com (8.13.8/8.13.8) with ESMTP id x4R6tOlC029729 (version=TLSv1/SSLv3 cipher=AES256-SHA bits=256 verify=OK) for ; Sun, 26 May 2019 23:55:24 -0700 Received: from saturn.analog.com (10.50.1.244) by NWD2HUBCAS7.ad.analog.com (10.64.69.107) with Microsoft SMTP Server id 14.3.408.0; Mon, 27 May 2019 02:55:23 -0400 From: Alexandru Ardelean To: CC: Alexandru Ardelean Subject: [PATCH 3/3][V3] dmaengine: axi-dmac: assign `copy_align` property Date: Mon, 27 May 2019 09:55:18 +0300 Message-ID: <20190527065518.18613-3-alexandru.ardelean@analog.com> X-Mailer: git-send-email 2.17.1 In-Reply-To: <20190527065518.18613-1-alexandru.ardelean@analog.com> References: <20190527065518.18613-1-alexandru.ardelean@analog.com> MIME-Version: 1.0 X-ADIRoutedOnPrem: True X-EOPAttributedMessage: 0 X-MS-Office365-Filtering-HT: Tenant X-Forefront-Antispam-Report: CIP:137.71.25.55;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(136003)(376002)(39860400002)(396003)(346002)(2980300002)(189003)(199004)(5660300002)(186003)(4744005)(77096007)(26005)(7636002)(70206006)(53416004)(48376002)(50466002)(50226002)(8936002)(316002)(16586007)(47776003)(2351001)(478600001)(86362001)(305945005)(70586007)(6916009)(2906002)(106002)(126002)(7696005)(11346002)(426003)(44832011)(1076003)(336012)(486006)(36756003)(107886003)(4326008)(8676002)(246002)(6666004)(356004)(446003)(51416003)(2616005)(76176011)(476003)(81973001);DIR:OUT;SFP:1101;SCL:1;SRVR:MWHPR03MB3136;H:nwd2mta1.analog.com;FPR:;SPF:Pass;LANG:en;PTR:nwd2mail10.analog.com;MX:1;A:1; X-MS-PublicTrafficType: Email X-MS-Office365-Filtering-Correlation-Id: b30776f0-3c48-4eb5-c7b7-08d6e2704bb4 X-Microsoft-Antispam: BCL:0;PCL:0;RULEID:(2390118)(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600148)(711020)(4605104)(4709054)(1401327)(2017052603328);SRVR:MWHPR03MB3136; X-MS-TrafficTypeDiagnostic: MWHPR03MB3136: X-Microsoft-Antispam-PRVS: X-MS-Oob-TLC-OOBClassifiers: OLM:5516; X-Forefront-PRVS: 0050CEFE70 X-MS-Exchange-SenderADCheck: 1 X-Microsoft-Antispam-Message-Info: NF2hvDjdrcpSUaunWsOEBuh9FeQnZRR/sD7MJBYTQqTL2WqlNH6pv6pMlgds1VGvo5Y8CNRo87dBA1hDyARkB1P6d+1jPhBx8I3C/2QSI5G9VOfk9zqIVYDHLaTVOh9wA6o+cp5ouIserdkLyWJXON+lCleatyVySsH0x+uhvpN8Pz2/TcW1joi2ihkTW107XD/zFuICcBgspwXGJj/5WpsCS/PhtU3t7+YPYiuYxgvrdr937rgeoRHZPU52SgdqN3nfu1XPGRCb4ILaTOkuIlDZEv56yXrMq/grBrdPlSv9XJgvIQApvlPREJRcPUiKtxWzzt3TVDWQJ3Z4u2q2rC1UIJg26dk0fh0si9f8vOyUbQkMYDBWa3RjyHGydivttYqtTHXkE2hgXf775PWAlrzkKroGT2nafFuOdmYB3Xo= X-OriginatorOrg: analog.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 27 May 2019 06:55:25.0934 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b30776f0-3c48-4eb5-c7b7-08d6e2704bb4 X-MS-Exchange-CrossTenant-Id: eaa689b4-8f87-40e0-9c6f-7228de4d754a X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=eaa689b4-8f87-40e0-9c6f-7228de4d754a;Ip=[137.71.25.55];Helo=[nwd2mta1.analog.com] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR03MB3136 Sender: dmaengine-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: dmaengine@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP The `copy_align` property is a generic property that describes alignment for DMA memcpy & sg ops. It serves mostly an informational purpose, and can be used in DMA tests, to pass the info to know what alignment to expect. Signed-off-by: Alexandru Ardelean --- drivers/dma/dma-axi-dmac.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/dma/dma-axi-dmac.c b/drivers/dma/dma-axi-dmac.c index 74ae6246d9a5..d5e29bbc3d43 100644 --- a/drivers/dma/dma-axi-dmac.c +++ b/drivers/dma/dma-axi-dmac.c @@ -763,6 +763,8 @@ static int axi_dmac_probe(struct platform_device *pdev) if (ret) goto err_clk_disable; + dma_dev->copy_align = (dmac->chan.address_align_mask + 1); + axi_dmac_write(dmac, AXI_DMAC_REG_IRQ_MASK, 0x00); ret = dma_async_device_register(dma_dev);