From patchwork Mon Sep 14 14:09:50 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11773841 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 0856314F6 for ; Mon, 14 Sep 2020 14:10:27 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id A9E4C214F1 for ; Mon, 14 Sep 2020 14:10:26 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="2w+f0hKV"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="pj5dlszd" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org A9E4C214F1 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=MuZD3Xxhxk1P+hL6+qK4wGCdBKALNUTgxLwOWmnMe3o=; b=2w+f0hKVFtCH/XV8nCIw3z5H7 EDacxDEfwXxEJ7t/ONHHcRHT3DkXYxuJQyX2XF4KQaVJ/lFC1gG1Cr4PvrfCCvfKuSpwaZ0dFgbkg o02RsL9SJbQojkmVPoDr8ZRWxDX/8EVarMDxconWv0ncObSv+Zgfza7t7tWFq4IPdqXvr+xNdiJpN 9+CPME4Wx1QekJybVB9Z9UxbVwPHzrPKr2utjF1AhGHOYHdHdho7C/TdJlc9pBYrwuvblGuzK9str 20Ugs/n5WFY1F272MyCyMMSDZ9QHgHxCueQZV0jmB17szsHVUKEL9V0x4HmoTUQVEMTfuR4/8xPrl +uk6ZGDTQ==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBO-0005TP-Rn; Mon, 14 Sep 2020 14:10:14 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBK-0005Rs-1M for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 14:10:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1600092609; x=1631628609; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=xYDhd/FJLml3imudNetsFooMTS+ot8GWqvv/6Oq+a1Q=; b=pj5dlszdlV0WUBLYHmEMD9xFwbyAR+KuhM+z/Xn7GuL08XNoX+Pmrb4C 6TpQXGlmAB0z4fOtAo5wwPhm/c4juyYD0F54ZpfclFtMnWozxMK9cmDhz cr6mJwq/b9O2bU+yU3SGjPXVjIqoYh6dKC8Clg/GkbE/eC2gRLcMtTf9u zD5L0en84D8pXbkMT2XmDD47Il9j62eMTjYlR0VFF2swqx3ZwZk5IwLvp XB2Tf8J/RWOq5CiJY+k+vHrA7cWRixfte1lyYubwzidatdF3HxBUfKeig QxBTXJbe2wMM7BgaOp9Zs8GqCwbAD2uqU3Q/zL47S8HHuF6tDEOfnE6DH Q==; IronPort-SDR: RTplavA7CAXz2qi+5rKFZpGD9LooTK0NUnyrnDCakhp7nXGs6wiluMLji816czsfXwBXeEIL7n 9rBTmXfvTNbfY8kGIXxniIMSCIvo886MnfdutJVJuRESVbHzI4yY6ZKuxNQhnW1g41R7j1kRgQ 4jYue+qLtqerOvR59p0cMeEm3B9tB7+txwSwgWQkaZtQnI5t0ch0zX7CsFZdNs/+5j5jYXUjHV Sk1+CZVt+Cm+0qZLyo15HvV0xH9M68y6+JrwoA+luuqP7flMf1p/obWIy0K8Vn4WrnIzRqikre o3s= X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="88993907" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2020 07:10:09 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 14 Sep 2020 07:10:06 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 14 Sep 2020 07:10:01 -0700 From: Eugen Hristev To: , , , Subject: [PATCH 1/7] dmaengine: at_xdmac: separate register defines into header file Date: Mon, 14 Sep 2020 17:09:50 +0300 Message-ID: <20200914140956.221432-2-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914140956.221432-1-eugen.hristev@microchip.com> References: <20200914140956.221432-1-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_101010_373665_66CDED6D X-CRM114-Status: GOOD ( 13.91 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Eugen Hristev , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Separate register defines into header file. This is required to support a slightly different version of the register map in new hardware versions of the XDMAC. Signed-off-by: Eugen Hristev --- drivers/dma/at_xdmac.c | 143 +-------------------------------- drivers/dma/at_xdmac_regs.h | 154 ++++++++++++++++++++++++++++++++++++ 2 files changed, 155 insertions(+), 142 deletions(-) create mode 100644 drivers/dma/at_xdmac_regs.h diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index fd92f048c491..fab19e00a7be 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -24,148 +24,7 @@ #include "dmaengine.h" -/* Global registers */ -#define AT_XDMAC_GTYPE 0x00 /* Global Type Register */ -#define AT_XDMAC_NB_CH(i) (((i) & 0x1F) + 1) /* Number of Channels Minus One */ -#define AT_XDMAC_FIFO_SZ(i) (((i) >> 5) & 0x7FF) /* Number of Bytes */ -#define AT_XDMAC_NB_REQ(i) ((((i) >> 16) & 0x3F) + 1) /* Number of Peripheral Requests Minus One */ -#define AT_XDMAC_GCFG 0x04 /* Global Configuration Register */ -#define AT_XDMAC_GWAC 0x08 /* Global Weighted Arbiter Configuration Register */ -#define AT_XDMAC_GIE 0x0C /* Global Interrupt Enable Register */ -#define AT_XDMAC_GID 0x10 /* Global Interrupt Disable Register */ -#define AT_XDMAC_GIM 0x14 /* Global Interrupt Mask Register */ -#define AT_XDMAC_GIS 0x18 /* Global Interrupt Status Register */ -#define AT_XDMAC_GE 0x1C /* Global Channel Enable Register */ -#define AT_XDMAC_GD 0x20 /* Global Channel Disable Register */ -#define AT_XDMAC_GS 0x24 /* Global Channel Status Register */ -#define AT_XDMAC_GRS 0x28 /* Global Channel Read Suspend Register */ -#define AT_XDMAC_GWS 0x2C /* Global Write Suspend Register */ -#define AT_XDMAC_GRWS 0x30 /* Global Channel Read Write Suspend Register */ -#define AT_XDMAC_GRWR 0x34 /* Global Channel Read Write Resume Register */ -#define AT_XDMAC_GSWR 0x38 /* Global Channel Software Request Register */ -#define AT_XDMAC_GSWS 0x3C /* Global channel Software Request Status Register */ -#define AT_XDMAC_GSWF 0x40 /* Global Channel Software Flush Request Register */ -#define AT_XDMAC_VERSION 0xFFC /* XDMAC Version Register */ - -/* Channel relative registers offsets */ -#define AT_XDMAC_CIE 0x00 /* Channel Interrupt Enable Register */ -#define AT_XDMAC_CIE_BIE BIT(0) /* End of Block Interrupt Enable Bit */ -#define AT_XDMAC_CIE_LIE BIT(1) /* End of Linked List Interrupt Enable Bit */ -#define AT_XDMAC_CIE_DIE BIT(2) /* End of Disable Interrupt Enable Bit */ -#define AT_XDMAC_CIE_FIE BIT(3) /* End of Flush Interrupt Enable Bit */ -#define AT_XDMAC_CIE_RBEIE BIT(4) /* Read Bus Error Interrupt Enable Bit */ -#define AT_XDMAC_CIE_WBEIE BIT(5) /* Write Bus Error Interrupt Enable Bit */ -#define AT_XDMAC_CIE_ROIE BIT(6) /* Request Overflow Interrupt Enable Bit */ -#define AT_XDMAC_CID 0x04 /* Channel Interrupt Disable Register */ -#define AT_XDMAC_CID_BID BIT(0) /* End of Block Interrupt Disable Bit */ -#define AT_XDMAC_CID_LID BIT(1) /* End of Linked List Interrupt Disable Bit */ -#define AT_XDMAC_CID_DID BIT(2) /* End of Disable Interrupt Disable Bit */ -#define AT_XDMAC_CID_FID BIT(3) /* End of Flush Interrupt Disable Bit */ -#define AT_XDMAC_CID_RBEID BIT(4) /* Read Bus Error Interrupt Disable Bit */ -#define AT_XDMAC_CID_WBEID BIT(5) /* Write Bus Error Interrupt Disable Bit */ -#define AT_XDMAC_CID_ROID BIT(6) /* Request Overflow Interrupt Disable Bit */ -#define AT_XDMAC_CIM 0x08 /* Channel Interrupt Mask Register */ -#define AT_XDMAC_CIM_BIM BIT(0) /* End of Block Interrupt Mask Bit */ -#define AT_XDMAC_CIM_LIM BIT(1) /* End of Linked List Interrupt Mask Bit */ -#define AT_XDMAC_CIM_DIM BIT(2) /* End of Disable Interrupt Mask Bit */ -#define AT_XDMAC_CIM_FIM BIT(3) /* End of Flush Interrupt Mask Bit */ -#define AT_XDMAC_CIM_RBEIM BIT(4) /* Read Bus Error Interrupt Mask Bit */ -#define AT_XDMAC_CIM_WBEIM BIT(5) /* Write Bus Error Interrupt Mask Bit */ -#define AT_XDMAC_CIM_ROIM BIT(6) /* Request Overflow Interrupt Mask Bit */ -#define AT_XDMAC_CIS 0x0C /* Channel Interrupt Status Register */ -#define AT_XDMAC_CIS_BIS BIT(0) /* End of Block Interrupt Status Bit */ -#define AT_XDMAC_CIS_LIS BIT(1) /* End of Linked List Interrupt Status Bit */ -#define AT_XDMAC_CIS_DIS BIT(2) /* End of Disable Interrupt Status Bit */ -#define AT_XDMAC_CIS_FIS BIT(3) /* End of Flush Interrupt Status Bit */ -#define AT_XDMAC_CIS_RBEIS BIT(4) /* Read Bus Error Interrupt Status Bit */ -#define AT_XDMAC_CIS_WBEIS BIT(5) /* Write Bus Error Interrupt Status Bit */ -#define AT_XDMAC_CIS_ROIS BIT(6) /* Request Overflow Interrupt Status Bit */ -#define AT_XDMAC_CSA 0x10 /* Channel Source Address Register */ -#define AT_XDMAC_CDA 0x14 /* Channel Destination Address Register */ -#define AT_XDMAC_CNDA 0x18 /* Channel Next Descriptor Address Register */ -#define AT_XDMAC_CNDA_NDAIF(i) ((i) & 0x1) /* Channel x Next Descriptor Interface */ -#define AT_XDMAC_CNDA_NDA(i) ((i) & 0xfffffffc) /* Channel x Next Descriptor Address */ -#define AT_XDMAC_CNDC 0x1C /* Channel Next Descriptor Control Register */ -#define AT_XDMAC_CNDC_NDE (0x1 << 0) /* Channel x Next Descriptor Enable */ -#define AT_XDMAC_CNDC_NDSUP (0x1 << 1) /* Channel x Next Descriptor Source Update */ -#define AT_XDMAC_CNDC_NDDUP (0x1 << 2) /* Channel x Next Descriptor Destination Update */ -#define AT_XDMAC_CNDC_NDVIEW_NDV0 (0x0 << 3) /* Channel x Next Descriptor View 0 */ -#define AT_XDMAC_CNDC_NDVIEW_NDV1 (0x1 << 3) /* Channel x Next Descriptor View 1 */ -#define AT_XDMAC_CNDC_NDVIEW_NDV2 (0x2 << 3) /* Channel x Next Descriptor View 2 */ -#define AT_XDMAC_CNDC_NDVIEW_NDV3 (0x3 << 3) /* Channel x Next Descriptor View 3 */ -#define AT_XDMAC_CUBC 0x20 /* Channel Microblock Control Register */ -#define AT_XDMAC_CBC 0x24 /* Channel Block Control Register */ -#define AT_XDMAC_CC 0x28 /* Channel Configuration Register */ -#define AT_XDMAC_CC_TYPE (0x1 << 0) /* Channel Transfer Type */ -#define AT_XDMAC_CC_TYPE_MEM_TRAN (0x0 << 0) /* Memory to Memory Transfer */ -#define AT_XDMAC_CC_TYPE_PER_TRAN (0x1 << 0) /* Peripheral to Memory or Memory to Peripheral Transfer */ -#define AT_XDMAC_CC_MBSIZE_MASK (0x3 << 1) -#define AT_XDMAC_CC_MBSIZE_SINGLE (0x0 << 1) -#define AT_XDMAC_CC_MBSIZE_FOUR (0x1 << 1) -#define AT_XDMAC_CC_MBSIZE_EIGHT (0x2 << 1) -#define AT_XDMAC_CC_MBSIZE_SIXTEEN (0x3 << 1) -#define AT_XDMAC_CC_DSYNC (0x1 << 4) /* Channel Synchronization */ -#define AT_XDMAC_CC_DSYNC_PER2MEM (0x0 << 4) -#define AT_XDMAC_CC_DSYNC_MEM2PER (0x1 << 4) -#define AT_XDMAC_CC_PROT (0x1 << 5) /* Channel Protection */ -#define AT_XDMAC_CC_PROT_SEC (0x0 << 5) -#define AT_XDMAC_CC_PROT_UNSEC (0x1 << 5) -#define AT_XDMAC_CC_SWREQ (0x1 << 6) /* Channel Software Request Trigger */ -#define AT_XDMAC_CC_SWREQ_HWR_CONNECTED (0x0 << 6) -#define AT_XDMAC_CC_SWREQ_SWR_CONNECTED (0x1 << 6) -#define AT_XDMAC_CC_MEMSET (0x1 << 7) /* Channel Fill Block of memory */ -#define AT_XDMAC_CC_MEMSET_NORMAL_MODE (0x0 << 7) -#define AT_XDMAC_CC_MEMSET_HW_MODE (0x1 << 7) -#define AT_XDMAC_CC_CSIZE(i) ((0x7 & (i)) << 8) /* Channel Chunk Size */ -#define AT_XDMAC_CC_DWIDTH_OFFSET 11 -#define AT_XDMAC_CC_DWIDTH_MASK (0x3 << AT_XDMAC_CC_DWIDTH_OFFSET) -#define AT_XDMAC_CC_DWIDTH(i) ((0x3 & (i)) << AT_XDMAC_CC_DWIDTH_OFFSET) /* Channel Data Width */ -#define AT_XDMAC_CC_DWIDTH_BYTE 0x0 -#define AT_XDMAC_CC_DWIDTH_HALFWORD 0x1 -#define AT_XDMAC_CC_DWIDTH_WORD 0x2 -#define AT_XDMAC_CC_DWIDTH_DWORD 0x3 -#define AT_XDMAC_CC_SIF(i) ((0x1 & (i)) << 13) /* Channel Source Interface Identifier */ -#define AT_XDMAC_CC_DIF(i) ((0x1 & (i)) << 14) /* Channel Destination Interface Identifier */ -#define AT_XDMAC_CC_SAM_MASK (0x3 << 16) /* Channel Source Addressing Mode */ -#define AT_XDMAC_CC_SAM_FIXED_AM (0x0 << 16) -#define AT_XDMAC_CC_SAM_INCREMENTED_AM (0x1 << 16) -#define AT_XDMAC_CC_SAM_UBS_AM (0x2 << 16) -#define AT_XDMAC_CC_SAM_UBS_DS_AM (0x3 << 16) -#define AT_XDMAC_CC_DAM_MASK (0x3 << 18) /* Channel Source Addressing Mode */ -#define AT_XDMAC_CC_DAM_FIXED_AM (0x0 << 18) -#define AT_XDMAC_CC_DAM_INCREMENTED_AM (0x1 << 18) -#define AT_XDMAC_CC_DAM_UBS_AM (0x2 << 18) -#define AT_XDMAC_CC_DAM_UBS_DS_AM (0x3 << 18) -#define AT_XDMAC_CC_INITD (0x1 << 21) /* Channel Initialization Terminated (read only) */ -#define AT_XDMAC_CC_INITD_TERMINATED (0x0 << 21) -#define AT_XDMAC_CC_INITD_IN_PROGRESS (0x1 << 21) -#define AT_XDMAC_CC_RDIP (0x1 << 22) /* Read in Progress (read only) */ -#define AT_XDMAC_CC_RDIP_DONE (0x0 << 22) -#define AT_XDMAC_CC_RDIP_IN_PROGRESS (0x1 << 22) -#define AT_XDMAC_CC_WRIP (0x1 << 23) /* Write in Progress (read only) */ -#define AT_XDMAC_CC_WRIP_DONE (0x0 << 23) -#define AT_XDMAC_CC_WRIP_IN_PROGRESS (0x1 << 23) -#define AT_XDMAC_CC_PERID(i) (0x7f & (i) << 24) /* Channel Peripheral Identifier */ -#define AT_XDMAC_CDS_MSP 0x2C /* Channel Data Stride Memory Set Pattern */ -#define AT_XDMAC_CSUS 0x30 /* Channel Source Microblock Stride */ -#define AT_XDMAC_CDUS 0x34 /* Channel Destination Microblock Stride */ - -#define AT_XDMAC_CHAN_REG_BASE 0x50 /* Channel registers base address */ - -/* Microblock control members */ -#define AT_XDMAC_MBR_UBC_UBLEN_MAX 0xFFFFFFUL /* Maximum Microblock Length */ -#define AT_XDMAC_MBR_UBC_NDE (0x1 << 24) /* Next Descriptor Enable */ -#define AT_XDMAC_MBR_UBC_NSEN (0x1 << 25) /* Next Descriptor Source Update */ -#define AT_XDMAC_MBR_UBC_NDEN (0x1 << 26) /* Next Descriptor Destination Update */ -#define AT_XDMAC_MBR_UBC_NDV0 (0x0 << 27) /* Next Descriptor View 0 */ -#define AT_XDMAC_MBR_UBC_NDV1 (0x1 << 27) /* Next Descriptor View 1 */ -#define AT_XDMAC_MBR_UBC_NDV2 (0x2 << 27) /* Next Descriptor View 2 */ -#define AT_XDMAC_MBR_UBC_NDV3 (0x3 << 27) /* Next Descriptor View 3 */ - -#define AT_XDMAC_MAX_CHAN 0x20 -#define AT_XDMAC_MAX_CSIZE 16 /* 16 data */ -#define AT_XDMAC_MAX_DWIDTH 8 /* 64 bits */ -#define AT_XDMAC_RESIDUE_MAX_RETRIES 5 +#include "at_xdmac_regs.h" #define AT_XDMAC_DMA_BUSWIDTHS\ (BIT(DMA_SLAVE_BUSWIDTH_UNDEFINED) |\ diff --git a/drivers/dma/at_xdmac_regs.h b/drivers/dma/at_xdmac_regs.h new file mode 100644 index 000000000000..3f7dda4c5743 --- /dev/null +++ b/drivers/dma/at_xdmac_regs.h @@ -0,0 +1,154 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ +/* + * Header file for the Atmel Extensible DMA Controller (aka XDMAC on AT91 systems) + * + * Copyright (C) 2014-2020 Microchip Technology, Inc. and its subsidiaries + * + */ +#ifndef AT_XDMAC_REGS_H +#define AT_XDMAC_REGS_H + +/* Global registers */ +#define AT_XDMAC_GTYPE 0x00 /* Global Type Register */ +#define AT_XDMAC_NB_CH(i) (((i) & 0x1F) + 1) /* Number of Channels Minus One */ +#define AT_XDMAC_FIFO_SZ(i) (((i) >> 5) & 0x7FF) /* Number of Bytes */ +#define AT_XDMAC_NB_REQ(i) ((((i) >> 16) & 0x3F) + 1) /* Number of Peripheral Requests Minus One */ +#define AT_XDMAC_GCFG 0x04 /* Global Configuration Register */ +#define AT_XDMAC_GWAC 0x08 /* Global Weighted Arbiter Configuration Register */ +#define AT_XDMAC_GIE 0x0C /* Global Interrupt Enable Register */ +#define AT_XDMAC_GID 0x10 /* Global Interrupt Disable Register */ +#define AT_XDMAC_GIM 0x14 /* Global Interrupt Mask Register */ +#define AT_XDMAC_GIS 0x18 /* Global Interrupt Status Register */ +#define AT_XDMAC_GE 0x1C /* Global Channel Enable Register */ +#define AT_XDMAC_GD 0x20 /* Global Channel Disable Register */ +#define AT_XDMAC_GS 0x24 /* Global Channel Status Register */ +#define AT_XDMAC_GRS 0x28 /* Global Channel Read Suspend Register */ +#define AT_XDMAC_GWS 0x2C /* Global Write Suspend Register */ +#define AT_XDMAC_GRWS 0x30 /* Global Channel Read Write Suspend Register */ +#define AT_XDMAC_GRWR 0x34 /* Global Channel Read Write Resume Register */ +#define AT_XDMAC_GSWR 0x38 /* Global Channel Software Request Register */ +#define AT_XDMAC_GSWS 0x3C /* Global channel Software Request Status Register */ +#define AT_XDMAC_GSWF 0x40 /* Global Channel Software Flush Request Register */ +#define AT_XDMAC_VERSION 0xFFC /* XDMAC Version Register */ + +/* Channel relative registers offsets */ +#define AT_XDMAC_CIE 0x00 /* Channel Interrupt Enable Register */ +#define AT_XDMAC_CIE_BIE BIT(0) /* End of Block Interrupt Enable Bit */ +#define AT_XDMAC_CIE_LIE BIT(1) /* End of Linked List Interrupt Enable Bit */ +#define AT_XDMAC_CIE_DIE BIT(2) /* End of Disable Interrupt Enable Bit */ +#define AT_XDMAC_CIE_FIE BIT(3) /* End of Flush Interrupt Enable Bit */ +#define AT_XDMAC_CIE_RBEIE BIT(4) /* Read Bus Error Interrupt Enable Bit */ +#define AT_XDMAC_CIE_WBEIE BIT(5) /* Write Bus Error Interrupt Enable Bit */ +#define AT_XDMAC_CIE_ROIE BIT(6) /* Request Overflow Interrupt Enable Bit */ +#define AT_XDMAC_CID 0x04 /* Channel Interrupt Disable Register */ +#define AT_XDMAC_CID_BID BIT(0) /* End of Block Interrupt Disable Bit */ +#define AT_XDMAC_CID_LID BIT(1) /* End of Linked List Interrupt Disable Bit */ +#define AT_XDMAC_CID_DID BIT(2) /* End of Disable Interrupt Disable Bit */ +#define AT_XDMAC_CID_FID BIT(3) /* End of Flush Interrupt Disable Bit */ +#define AT_XDMAC_CID_RBEID BIT(4) /* Read Bus Error Interrupt Disable Bit */ +#define AT_XDMAC_CID_WBEID BIT(5) /* Write Bus Error Interrupt Disable Bit */ +#define AT_XDMAC_CID_ROID BIT(6) /* Request Overflow Interrupt Disable Bit */ +#define AT_XDMAC_CIM 0x08 /* Channel Interrupt Mask Register */ +#define AT_XDMAC_CIM_BIM BIT(0) /* End of Block Interrupt Mask Bit */ +#define AT_XDMAC_CIM_LIM BIT(1) /* End of Linked List Interrupt Mask Bit */ +#define AT_XDMAC_CIM_DIM BIT(2) /* End of Disable Interrupt Mask Bit */ +#define AT_XDMAC_CIM_FIM BIT(3) /* End of Flush Interrupt Mask Bit */ +#define AT_XDMAC_CIM_RBEIM BIT(4) /* Read Bus Error Interrupt Mask Bit */ +#define AT_XDMAC_CIM_WBEIM BIT(5) /* Write Bus Error Interrupt Mask Bit */ +#define AT_XDMAC_CIM_ROIM BIT(6) /* Request Overflow Interrupt Mask Bit */ +#define AT_XDMAC_CIS 0x0C /* Channel Interrupt Status Register */ +#define AT_XDMAC_CIS_BIS BIT(0) /* End of Block Interrupt Status Bit */ +#define AT_XDMAC_CIS_LIS BIT(1) /* End of Linked List Interrupt Status Bit */ +#define AT_XDMAC_CIS_DIS BIT(2) /* End of Disable Interrupt Status Bit */ +#define AT_XDMAC_CIS_FIS BIT(3) /* End of Flush Interrupt Status Bit */ +#define AT_XDMAC_CIS_RBEIS BIT(4) /* Read Bus Error Interrupt Status Bit */ +#define AT_XDMAC_CIS_WBEIS BIT(5) /* Write Bus Error Interrupt Status Bit */ +#define AT_XDMAC_CIS_ROIS BIT(6) /* Request Overflow Interrupt Status Bit */ +#define AT_XDMAC_CSA 0x10 /* Channel Source Address Register */ +#define AT_XDMAC_CDA 0x14 /* Channel Destination Address Register */ +#define AT_XDMAC_CNDA 0x18 /* Channel Next Descriptor Address Register */ +#define AT_XDMAC_CNDA_NDAIF(i) ((i) & 0x1) /* Channel x Next Descriptor Interface */ +#define AT_XDMAC_CNDA_NDA(i) ((i) & 0xfffffffc) /* Channel x Next Descriptor Address */ +#define AT_XDMAC_CNDC 0x1C /* Channel Next Descriptor Control Register */ +#define AT_XDMAC_CNDC_NDE (0x1 << 0) /* Channel x Next Descriptor Enable */ +#define AT_XDMAC_CNDC_NDSUP (0x1 << 1) /* Channel x Next Descriptor Source Update */ +#define AT_XDMAC_CNDC_NDDUP (0x1 << 2) /* Channel x Next Descriptor Destination Update */ +#define AT_XDMAC_CNDC_NDVIEW_NDV0 (0x0 << 3) /* Channel x Next Descriptor View 0 */ +#define AT_XDMAC_CNDC_NDVIEW_NDV1 (0x1 << 3) /* Channel x Next Descriptor View 1 */ +#define AT_XDMAC_CNDC_NDVIEW_NDV2 (0x2 << 3) /* Channel x Next Descriptor View 2 */ +#define AT_XDMAC_CNDC_NDVIEW_NDV3 (0x3 << 3) /* Channel x Next Descriptor View 3 */ +#define AT_XDMAC_CUBC 0x20 /* Channel Microblock Control Register */ +#define AT_XDMAC_CBC 0x24 /* Channel Block Control Register */ +#define AT_XDMAC_CC 0x28 /* Channel Configuration Register */ +#define AT_XDMAC_CC_TYPE (0x1 << 0) /* Channel Transfer Type */ +#define AT_XDMAC_CC_TYPE_MEM_TRAN (0x0 << 0) /* Memory to Memory Transfer */ +#define AT_XDMAC_CC_TYPE_PER_TRAN (0x1 << 0) /* Peripheral to Memory or Memory to Peripheral Transfer */ +#define AT_XDMAC_CC_MBSIZE_MASK (0x3 << 1) +#define AT_XDMAC_CC_MBSIZE_SINGLE (0x0 << 1) +#define AT_XDMAC_CC_MBSIZE_FOUR (0x1 << 1) +#define AT_XDMAC_CC_MBSIZE_EIGHT (0x2 << 1) +#define AT_XDMAC_CC_MBSIZE_SIXTEEN (0x3 << 1) +#define AT_XDMAC_CC_DSYNC (0x1 << 4) /* Channel Synchronization */ +#define AT_XDMAC_CC_DSYNC_PER2MEM (0x0 << 4) +#define AT_XDMAC_CC_DSYNC_MEM2PER (0x1 << 4) +#define AT_XDMAC_CC_PROT (0x1 << 5) /* Channel Protection */ +#define AT_XDMAC_CC_PROT_SEC (0x0 << 5) +#define AT_XDMAC_CC_PROT_UNSEC (0x1 << 5) +#define AT_XDMAC_CC_SWREQ (0x1 << 6) /* Channel Software Request Trigger */ +#define AT_XDMAC_CC_SWREQ_HWR_CONNECTED (0x0 << 6) +#define AT_XDMAC_CC_SWREQ_SWR_CONNECTED (0x1 << 6) +#define AT_XDMAC_CC_MEMSET (0x1 << 7) /* Channel Fill Block of memory */ +#define AT_XDMAC_CC_MEMSET_NORMAL_MODE (0x0 << 7) +#define AT_XDMAC_CC_MEMSET_HW_MODE (0x1 << 7) +#define AT_XDMAC_CC_CSIZE(i) ((0x7 & (i)) << 8) /* Channel Chunk Size */ +#define AT_XDMAC_CC_DWIDTH_OFFSET 11 +#define AT_XDMAC_CC_DWIDTH_MASK (0x3 << AT_XDMAC_CC_DWIDTH_OFFSET) +#define AT_XDMAC_CC_DWIDTH(i) ((0x3 & (i)) << AT_XDMAC_CC_DWIDTH_OFFSET) /* Channel Data Width */ +#define AT_XDMAC_CC_DWIDTH_BYTE 0x0 +#define AT_XDMAC_CC_DWIDTH_HALFWORD 0x1 +#define AT_XDMAC_CC_DWIDTH_WORD 0x2 +#define AT_XDMAC_CC_DWIDTH_DWORD 0x3 +#define AT_XDMAC_CC_SIF(i) ((0x1 & (i)) << 13) /* Channel Source Interface Identifier */ +#define AT_XDMAC_CC_DIF(i) ((0x1 & (i)) << 14) /* Channel Destination Interface Identifier */ +#define AT_XDMAC_CC_SAM_MASK (0x3 << 16) /* Channel Source Addressing Mode */ +#define AT_XDMAC_CC_SAM_FIXED_AM (0x0 << 16) +#define AT_XDMAC_CC_SAM_INCREMENTED_AM (0x1 << 16) +#define AT_XDMAC_CC_SAM_UBS_AM (0x2 << 16) +#define AT_XDMAC_CC_SAM_UBS_DS_AM (0x3 << 16) +#define AT_XDMAC_CC_DAM_MASK (0x3 << 18) /* Channel Source Addressing Mode */ +#define AT_XDMAC_CC_DAM_FIXED_AM (0x0 << 18) +#define AT_XDMAC_CC_DAM_INCREMENTED_AM (0x1 << 18) +#define AT_XDMAC_CC_DAM_UBS_AM (0x2 << 18) +#define AT_XDMAC_CC_DAM_UBS_DS_AM (0x3 << 18) +#define AT_XDMAC_CC_INITD (0x1 << 21) /* Channel Initialization Terminated (read only) */ +#define AT_XDMAC_CC_INITD_TERMINATED (0x0 << 21) +#define AT_XDMAC_CC_INITD_IN_PROGRESS (0x1 << 21) +#define AT_XDMAC_CC_RDIP (0x1 << 22) /* Read in Progress (read only) */ +#define AT_XDMAC_CC_RDIP_DONE (0x0 << 22) +#define AT_XDMAC_CC_RDIP_IN_PROGRESS (0x1 << 22) +#define AT_XDMAC_CC_WRIP (0x1 << 23) /* Write in Progress (read only) */ +#define AT_XDMAC_CC_WRIP_DONE (0x0 << 23) +#define AT_XDMAC_CC_WRIP_IN_PROGRESS (0x1 << 23) +#define AT_XDMAC_CC_PERID(i) (0x7f & (i) << 24) /* Channel Peripheral Identifier */ +#define AT_XDMAC_CDS_MSP 0x2C /* Channel Data Stride Memory Set Pattern */ +#define AT_XDMAC_CSUS 0x30 /* Channel Source Microblock Stride */ +#define AT_XDMAC_CDUS 0x34 /* Channel Destination Microblock Stride */ + +#define AT_XDMAC_CHAN_REG_BASE 0x50 /* Channel registers base address */ + +/* Microblock control members */ +#define AT_XDMAC_MBR_UBC_UBLEN_MAX 0xFFFFFFUL /* Maximum Microblock Length */ +#define AT_XDMAC_MBR_UBC_NDE (0x1 << 24) /* Next Descriptor Enable */ +#define AT_XDMAC_MBR_UBC_NSEN (0x1 << 25) /* Next Descriptor Source Update */ +#define AT_XDMAC_MBR_UBC_NDEN (0x1 << 26) /* Next Descriptor Destination Update */ +#define AT_XDMAC_MBR_UBC_NDV0 (0x0 << 27) /* Next Descriptor View 0 */ +#define AT_XDMAC_MBR_UBC_NDV1 (0x1 << 27) /* Next Descriptor View 1 */ +#define AT_XDMAC_MBR_UBC_NDV2 (0x2 << 27) /* Next Descriptor View 2 */ +#define AT_XDMAC_MBR_UBC_NDV3 (0x3 << 27) /* Next Descriptor View 3 */ + +#define AT_XDMAC_MAX_CHAN 0x20 +#define AT_XDMAC_MAX_CSIZE 16 /* 16 data */ +#define AT_XDMAC_MAX_DWIDTH 8 /* 64 bits */ +#define AT_XDMAC_RESIDUE_MAX_RETRIES 5 + +#endif From patchwork Mon Sep 14 14:09:51 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11773843 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id ABE6D14F6 for ; Mon, 14 Sep 2020 14:10:31 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 73ED620672 for ; Mon, 14 Sep 2020 14:10:31 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="I0LaQ1XQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="qn4y2v2D" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 73ED620672 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=b2b84v0W4yDdHYu03+i+iPOiJs/rOEu4F25gI3x8Zqk=; b=I0LaQ1XQgAsOMz3VRCNJa/5p9 SHA1r4CNYn1zKZcd6GyELdEV4yer0gqNaGVgG22JsnS+rT9/KsiNYCXvPmiQYRDJQ4PzIHgWhxKjo lg/yR8ZUIWj7dyDK020ipjhycSxrOER3ZOlPBWRXmDd3QOVoBgWfNSXENRemEt7NGt5SnGHRGkzvb gvi0itozb2S/jx5iQqY/0pfxt7vh/t4/k89HFUm2nmPVkmmigazBMqDRgn/e4SbVmVXyX7Ex9x3/A nvzRh6YCuGAoidzvae1J9BfvepR3cKUomvZHAgLhdW4eDUd03DPO7OI/ufjkOZG2/Gh1KQQh148Nl GZ9vIQudA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBT-0005UU-GX; Mon, 14 Sep 2020 14:10:19 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBP-0005TW-QA for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 14:10:16 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1600092616; x=1631628616; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=zjX1ZDoVN5vFk7RnBEDR4gK3lHRk1XPsYEMncXzHsNU=; b=qn4y2v2D5TwugvzYPR/SUfaAgz9G277/Yi+61UKEty/uSmoX8hRvHPTG 0RMPR4emvyyz3CPXux4Yy135G+2AqX60il4U+pk0SNBnB/cPUBQHwvg6B WLsav0BTs/yu+abhzQriVxh1FUgqOosJSZU2AmRrOOYnVM59X3M/ScTIf AbFFn4neFRp0yEp2wcYOcYxRMTE0P4lKzmH/0CgJzcJOdoM0/NLB3/Tdd eTIUnJ/mi9QtPLfQuTVvHJ1nDzo7I3qMUWDZ20/dt5EaAexAMY+P216xZ AJBG/aVVJ9UOXs+u39zXsPN5cL43xO872rGKV31c9k2ySnlib55198yJI g==; IronPort-SDR: z9NpU5wBJB0GfIMljjJHMN82jM/EqbxZuXX92hCUm00lvWZJP4U9kL+hAMzpChaFgql4wsnw7g O+92Cd/FlPYCT6qquXVJhBo+RFN8Y2AIXNHKOjgBVpdawvRQGMDw7peb7DvWOLxJxeCFjqw623 t8FBkp2z3+Mz9boAX/KA8ql6Z3XNf36Dp7bUWU3fXIi2iNCwtWx3bxIvgNmFvOGdgPU9YmmqAX vnRqRuT1jGI9WIVxI10hMwk3+61k2yZG2Mr/5HfjRu+0YSjUEsLzhvUQivhUYFQu49icaGxcBO tn8= X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="90900764" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2020 07:10:14 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 14 Sep 2020 07:10:10 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 14 Sep 2020 07:10:06 -0700 From: Eugen Hristev To: , , , Subject: [PATCH 2/7] MAINTAINERS: add dma/at_xdmac_regs.h to XDMAC driver entry Date: Mon, 14 Sep 2020 17:09:51 +0300 Message-ID: <20200914140956.221432-3-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914140956.221432-1-eugen.hristev@microchip.com> References: <20200914140956.221432-1-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_101016_048518_D5E48ED5 X-CRM114-Status: UNSURE ( 9.81 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [216.71.150.166 listed in wl.mailspike.net] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.150.166 listed in list.dnswl.org] 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Eugen Hristev , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add new header file for the at_xdmac regs definition to the proper MAINTAINERS entry. Signed-off-by: Eugen Hristev --- MAINTAINERS | 1 + 1 file changed, 1 insertion(+) diff --git a/MAINTAINERS b/MAINTAINERS index b5cfab015bd6..312ba6ae5fc7 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -11361,6 +11361,7 @@ F: Documentation/devicetree/bindings/dma/atmel-dma.txt F: drivers/dma/at_hdmac.c F: drivers/dma/at_hdmac_regs.h F: drivers/dma/at_xdmac.c +F: drivers/dma/at_xdmac_regs.h F: include/dt-bindings/dma/at91.h F: include/linux/platform_data/dma-atmel.h From patchwork Mon Sep 14 14:09:52 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11773847 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B89A014F6 for ; Mon, 14 Sep 2020 14:10:42 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 7773B20672 for ; Mon, 14 Sep 2020 14:10:42 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="A3lrGptL"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="sqFtk4vZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 7773B20672 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=wymoocMByn4EwadHJ/wTkiGkw71q8wWU7198rk3XpN4=; b=A3lrGptLBiTwK0gc3IVtQvQLs 39l3DYuFEjVPoj/MAHfLzInGS9PAVX0KG7FATBTb+HlX8RBhond1LF4kI4yfwMp1GUyQG5MXpNKOQ a6u18M7KbgIIVE9DTq7YhUunjfKAi2F7ZrlQT04RtcP803Grj6YJurMPuPCnM8Gto8JYOlsRt89qR 6kyJU2c9NQ8yG+soNZ8u6YJM1y/iCT4o1yhd/hIF0LfexjC79zUHC5yANzZ2RN7Erxp3SkJet8sWx K6raE0Ld5YUyV6+FdaUOxi1BcLkJJSmO93DMM40bug0712xSiGFbHzND/c4NjgFUWJmXLCFe4uhfQ lnuw8QEag==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBd-0005Wh-E5; Mon, 14 Sep 2020 14:10:29 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBS-0005UG-Mm for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 14:10:19 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1600092618; x=1631628618; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=qoBNbkKAab5vCz1WzJd2Q0kui0rzQACYA42GOpjUIoU=; b=sqFtk4vZ1mR9Zup6N6O2zXLo4NazmweOXkXU6W+bxcIURXY4GEb0Tfuz dWAnBCg8pinUooFZthNnWFV4pd/b7FK4PB8uVvdxzeNrmK2KywSQbtI95 YFvZJRcdEtLid8CO3UlYEN8aveMjmpDpahAPbFlH/6QfIOjRB1Yu/KMMD lZfGOmyA4GbdCN1ib8WcWD03h1JqTMn6zdaL/7E478iBqluoMOaZIYoBm CtGD1nMxFtcUPzmBi0+m8rW+0a2yz+alFT5HxBUPRpIa24i5ovB9911XC RCfPzfO0tc9uR6HNVJHC8x2H0TG7yUw18HyewDcWFS6VDBtoRJMTf/cqI g==; IronPort-SDR: 7oIQZaexsHimlVNbzcxjtkuhCzaBKIp8DHYo+1Cl4koOINEVVpTpio8OvfzfbuYE06Knkw9LIU 8rJ9ewawn/oSznX4Zn2ihrZyikJDyBrLOVLe4wDhibgPv4zV6N+tb5KCGUuPGGkjaubiQurP+S 74Vmo9VgswC+2n80uOLfftzu7RdnfXj0RssSmfAEzwEkBd4aNUNS+zovXQGBjV4Vl97o3GshDc zSy31tM4fXiDv5pMY4c0jgdzDIcRgKgLEz2je4riqroz9ZDPFau4Gq/V+R/xOAoRJsRoFgSohf jhw= X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="88993937" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2020 07:10:17 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 14 Sep 2020 07:10:14 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 14 Sep 2020 07:10:11 -0700 From: Eugen Hristev To: , , , Subject: [PATCH 3/7] dt-bindings: dmaengine: at_xdmac: add compatible with microchip, sama7g5 Date: Mon, 14 Sep 2020 17:09:52 +0300 Message-ID: <20200914140956.221432-4-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914140956.221432-1-eugen.hristev@microchip.com> References: <20200914140956.221432-1-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_101018_868706_0FD37750 X-CRM114-Status: UNSURE ( 8.96 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Eugen Hristev , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add compatible to sama7g5 SoC. Signed-off-by: Eugen Hristev Acked-by: Rob Herring --- Documentation/devicetree/bindings/dma/atmel-xdma.txt | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/Documentation/devicetree/bindings/dma/atmel-xdma.txt b/Documentation/devicetree/bindings/dma/atmel-xdma.txt index 4dc398e1a371..510b7f25ba24 100644 --- a/Documentation/devicetree/bindings/dma/atmel-xdma.txt +++ b/Documentation/devicetree/bindings/dma/atmel-xdma.txt @@ -2,7 +2,8 @@ * XDMA Controller Required properties: -- compatible: Should be "atmel,sama5d4-dma" or "microchip,sam9x60-dma". +- compatible: Should be "atmel,sama5d4-dma", "microchip,sam9x60-dma" or + "microchip,sama7g5-dma". - reg: Should contain DMA registers location and length. - interrupts: Should contain DMA interrupt. - #dma-cells: Must be <1>, used to represent the number of integer cells in From patchwork Mon Sep 14 14:09:53 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11773849 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5791F14F6 for ; Mon, 14 Sep 2020 14:10:48 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 23D0B20672 for ; Mon, 14 Sep 2020 14:10:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="ECIXLXyQ"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="eoEDbUsZ" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23D0B20672 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=bKA6OKM923pk38NJXhLlCE8DdiECHeR2PQWvmz03T+w=; b=ECIXLXyQXZUR11wXwK7hMPVG8 VKYDRkx63YneT+hKXLK/Zwy7ydCX/Xuf36vQIfx4O/+397qvhZmeESlXjvsyynFViycrHt5EP5KUA Yk3ESX0A9VgTivqTTwYxFxQ7P8oxdK7wDjQS1ky18ZcsrFyILJEIuE8yoyjaFLvwRIrThsB5azXS9 mtLbBPfy960ovxZdiTANFi8NvYmYGtWeOA/7EZ8h7uTVMbIhYDrBFsu3KyhXClRsPBz3PLfKPr7Ue pk7EoLLQOBTdiASOUfPPkvDjuvolXUY0odqjyQsQM11MTskeW9gyIYzOlaY+an3OUIK4mHu+9vohK oJohd2aGg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBj-0005YX-Rn; Mon, 14 Sep 2020 14:10:35 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBZ-0005VQ-FW for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 14:10:27 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1600092625; x=1631628625; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=sYRccNXwySLX58revlIKoNQBOK8H5HsF57JSqx1w6TE=; b=eoEDbUsZB2X2IEnJF1rZwbUeHdnQADY7DVkCA/9NvexftKQEVcKX+vid m5VeOBIk2EzrTKsENMBYW1EDV3cNooePzSfC6OBGbkr42/rCyPziXHicN MTOs4j7pIVrEN9Nrdp82eSie0OuNDjd5NRffaPj3O7hhRHUynqNXl1B06 Xlp40zua8mgLKRlc4337MrM+ydLLYl7cmZE/qFVLcAAYhx/f1QTGLrRus o9HuuXe1dpcr2SooQV0VsHai39kF8S0pczAR8t/eVd0f4QBHYaoKRHUjX to3MRSDs2h3LGW3lUH2rog0xhfDn8NYInwbTsdq6I2lwPjh3cA4Hap4eH w==; IronPort-SDR: eojmRW+qCHdtuviNt2OGagycY38wXXA8TVYNr0bbaqWQLX6sYBFgbjhIlLCgdfsOCdFclaps7W Eff3f4PgTA68HcVGIpaJeL0xjO5/8KwFpNYHlI2WT/TNvosjn5ObXkwjNsJiGzSJrg50sJaCDP o9A/pn98aA6/rQVea5/A90ekUDHAq/an2f2wPn8zG0lggk5jaONeeiP+oYDs7LkDGXdpCc18vr /Rc1z43ABisgnLDzxx6FeH8gTI20zAo5PRY6c8d5NFVbVLYkAweyzq9sjrjeKSrFvYs9aCK53U TfY= X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="90900801" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2020 07:10:23 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex03.mchp-main.com (10.10.85.151) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 14 Sep 2020 07:10:19 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 14 Sep 2020 07:10:15 -0700 From: Eugen Hristev To: , , , Subject: [PATCH 4/7] dmaengine: at_xdmac: adapt perid for mem2mem operations Date: Mon, 14 Sep 2020 17:09:53 +0300 Message-ID: <20200914140956.221432-5-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914140956.221432-1-eugen.hristev@microchip.com> References: <20200914140956.221432-1-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_101026_039196_948B5112 X-CRM114-Status: UNSURE ( 9.63 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [216.71.150.166 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.150.166 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Eugen Hristev , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The PERID in the CC register for mem2mem operations must match an unused PERID. The PERID field is 7 bits, but the selected value is 0x3f. On later products we can have more reserved PERIDs for actual peripherals, thus this needs to be increased to maximum size. Changing the value to 0x7f, which is the maximum for 7 bits field. Signed-off-by: Eugen Hristev Reviewed-by: Tudor Ambarus --- drivers/dma/at_xdmac.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index fab19e00a7be..81bb90206092 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -726,7 +726,7 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan, * match the one of another channel. If not, it could lead to spurious * flag status. */ - u32 chan_cc = AT_XDMAC_CC_PERID(0x3f) + u32 chan_cc = AT_XDMAC_CC_PERID(0x7f) | AT_XDMAC_CC_DIF(0) | AT_XDMAC_CC_SIF(0) | AT_XDMAC_CC_MBSIZE_SIXTEEN @@ -908,7 +908,7 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, * match the one of another channel. If not, it could lead to spurious * flag status. */ - u32 chan_cc = AT_XDMAC_CC_PERID(0x3f) + u32 chan_cc = AT_XDMAC_CC_PERID(0x7f) | AT_XDMAC_CC_DAM_INCREMENTED_AM | AT_XDMAC_CC_SAM_INCREMENTED_AM | AT_XDMAC_CC_DIF(0) @@ -1014,7 +1014,7 @@ static struct at_xdmac_desc *at_xdmac_memset_create_desc(struct dma_chan *chan, * match the one of another channel. If not, it could lead to spurious * flag status. */ - u32 chan_cc = AT_XDMAC_CC_PERID(0x3f) + u32 chan_cc = AT_XDMAC_CC_PERID(0x7f) | AT_XDMAC_CC_DAM_UBS_AM | AT_XDMAC_CC_SAM_INCREMENTED_AM | AT_XDMAC_CC_DIF(0) From patchwork Mon Sep 14 14:09:54 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11773855 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id B1508618 for ; Mon, 14 Sep 2020 14:11:11 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 6A5F520672 for ; Mon, 14 Sep 2020 14:11:11 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="LRb9IwKy"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="EVkh5bnz" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 6A5F520672 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=1QfXEd1u58P0WzgZectMVqx2XLQVMmm3tVHURIz1gv0=; b=LRb9IwKybEBJSqrB7FzNk39QP o/aNpxBAyffeblkMLdRmnSHcQjbCOmobOV7fYYceOs8u2nBuGTJHuw3xqePKBD+80HznxjSmWDaj7 MoHEcNv+k+3I3jtjUjfULDcgh6D3LO74INv37i9yGG+rNkYMxI+KO3qnnAY1SBzg9nx+74VmAfqcJ SmBlFqIaJ9q78tZrRAfWeoUtKtcAklkmK/NMDKtPTvgAeTYQqWxkd4Xo1Hni5yy2WlOyXasmMNRoQ 9hpIqJdx0ADM09YyqDKHBEzzEMxa1j32mWBDp9+V8JOxvdJ2hArGn4U8UEDPEHLsMhSY70iizBnAL D5CRkxSoA==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpC3-0005ee-Fg; Mon, 14 Sep 2020 14:10:55 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBc-0005VQ-4L for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 14:10:39 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1600092628; x=1631628628; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=geI8agSqDEl8zMk40bc/l3d67Msd8KIhzsqdRKAzC9k=; b=EVkh5bnzNRP8pQhRtQHWvgqOjEMwFcCuFQqiN6rDXU583yTXEvooWQ46 g+YhkzZG2rqH9bGuUomy2iP81q2CoqiJkTFQwF4xnmJJBSqBTyHdvvJOb WKKZh7uTBAI5rXxlsqsA7ogczzhTLWYdDYQDzyRxHoNHovFgAp0NXx4Ax LU/ZvDtX7CTCj0PX2r2is8ve0J3kaIa9EpN/MA+h3Q6wLCT3MxTdxYcRt BpwCAKN+EpXLA9XNfJvsyVtDf20vOEHEFYmF+W+HfHzv0+acMiKozulOD QpidhAPM+/jgtSTkHjOsV4sM0SPMzNsE8Bq7rVkekPhjSK3BwLDv+EPhX g==; IronPort-SDR: PZl5BTWGTYH55D0umY7G/R7xoLASER18KV/GmTlzTODcpQeDQwkSOYfkkosPuCy5LXaq5hk4vv rfUDQUrER10SCtwNCuZ97rW3hF5Liqpg6c7K1QlGQoUimER5+RTu3VQAdeSQyhqeK2sjJXhwY5 /M6ohUKX8QjhcXc4hFB3lON153zqeYhZXoS+M25Q559YL+gdkXgupBji80mj0hWnJtZXMm5qvd c+QeFweJ9E1ATBbIcXXUOpvSxPLw5r0N3DCCNeq/c7soDTnNuXe22pHXtJ6lL/HO0HaO7ZKJAF R74= X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="90900819" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2020 07:10:27 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 14 Sep 2020 07:10:23 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 14 Sep 2020 07:10:19 -0700 From: Eugen Hristev To: , , , Subject: [PATCH 5/7] dmaengine: at_xdmac: add support for sama7g5 based at_xdmac Date: Mon, 14 Sep 2020 17:09:54 +0300 Message-ID: <20200914140956.221432-6-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914140956.221432-1-eugen.hristev@microchip.com> References: <20200914140956.221432-1-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_101029_198461_40B23585 X-CRM114-Status: GOOD ( 18.73 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [216.71.150.166 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.150.166 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Eugen Hristev , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org SAMA7G5 SoC uses a slightly different variant of the AT_XDMAC. Added support by a new compatible and a layout struct that copes to the specific version considering the compatible string. Only the differences in register map are present in the layout struct. I reworked the register access for this part that has the differences. Also the Source/Destination Interface bits are no longer valid for this variant of the XDMAC. Thus, the layout also has a bool for specifying whether these bits are required or not. Signed-off-by: Eugen Hristev Reviewed-by: Tudor Ambarus --- drivers/dma/at_xdmac.c | 99 ++++++++++++++++++++++++++++++------- drivers/dma/at_xdmac_regs.h | 9 ---- 2 files changed, 82 insertions(+), 26 deletions(-) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index 81bb90206092..874484a4e79f 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -38,6 +38,27 @@ enum atc_status { AT_XDMAC_CHAN_IS_PAUSED, }; +struct at_xdmac_layout { + /* Global Channel Read Suspend Register */ + u8 grs; + /* Global Write Suspend Register */ + u8 gws; + /* Global Channel Read Write Suspend Register */ + u8 grws; + /* Global Channel Read Write Resume Register */ + u8 grwr; + /* Global Channel Software Request Register */ + u8 gswr; + /* Global channel Software Request Status Register */ + u8 gsws; + /* Global Channel Software Flush Request Register */ + u8 gswf; + /* Channel reg base */ + u8 chan_cc_reg_base; + /* Source/Destination Interface must be specified or not */ + bool sdif; +}; + /* ----- Channels ----- */ struct at_xdmac_chan { struct dma_chan chan; @@ -71,6 +92,7 @@ struct at_xdmac { struct clk *clk; u32 save_gim; struct dma_pool *at_xdmac_desc_pool; + const struct at_xdmac_layout *layout; struct at_xdmac_chan chan[]; }; @@ -103,9 +125,33 @@ struct at_xdmac_desc { struct list_head xfer_node; } __aligned(sizeof(u64)); +static struct at_xdmac_layout at_xdmac_sama5d4_layout = { + .grs = 0x28, + .gws = 0x2C, + .grws = 0x30, + .grwr = 0x34, + .gswr = 0x38, + .gsws = 0x3C, + .gswf = 0x40, + .chan_cc_reg_base = 0x50, + .sdif = true, +}; + +static struct at_xdmac_layout at_xdmac_sama7g5_layout = { + .grs = 0x30, + .gws = 0x38, + .grws = 0x40, + .grwr = 0x44, + .gswr = 0x48, + .gsws = 0x4C, + .gswf = 0x50, + .chan_cc_reg_base = 0x60, + .sdif = false, +}; + static inline void __iomem *at_xdmac_chan_reg_base(struct at_xdmac *atxdmac, unsigned int chan_nb) { - return atxdmac->regs + (AT_XDMAC_CHAN_REG_BASE + chan_nb * 0x40); + return atxdmac->regs + (atxdmac->layout->chan_cc_reg_base + chan_nb * 0x40); } #define at_xdmac_read(atxdmac, reg) readl_relaxed((atxdmac)->regs + (reg)) @@ -204,8 +250,10 @@ static void at_xdmac_start_xfer(struct at_xdmac_chan *atchan, first->active_xfer = true; /* Tell xdmac where to get the first descriptor. */ - reg = AT_XDMAC_CNDA_NDA(first->tx_dma_desc.phys) - | AT_XDMAC_CNDA_NDAIF(atchan->memif); + reg = AT_XDMAC_CNDA_NDA(first->tx_dma_desc.phys); + if (atxdmac->layout->sdif) + reg |= AT_XDMAC_CNDA_NDAIF(atchan->memif); + at_xdmac_chan_write(atchan, AT_XDMAC_CNDA, reg); /* @@ -400,6 +448,7 @@ static int at_xdmac_compute_chan_conf(struct dma_chan *chan, enum dma_transfer_direction direction) { struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan); + struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device); int csize, dwidth; if (direction == DMA_DEV_TO_MEM) { @@ -407,12 +456,14 @@ static int at_xdmac_compute_chan_conf(struct dma_chan *chan, AT91_XDMAC_DT_PERID(atchan->perid) | AT_XDMAC_CC_DAM_INCREMENTED_AM | AT_XDMAC_CC_SAM_FIXED_AM - | AT_XDMAC_CC_DIF(atchan->memif) - | AT_XDMAC_CC_SIF(atchan->perif) | AT_XDMAC_CC_SWREQ_HWR_CONNECTED | AT_XDMAC_CC_DSYNC_PER2MEM | AT_XDMAC_CC_MBSIZE_SIXTEEN | AT_XDMAC_CC_TYPE_PER_TRAN; + if (atxdmac->layout->sdif) + atchan->cfg |= AT_XDMAC_CC_DIF(atchan->memif) + | AT_XDMAC_CC_SIF(atchan->perif); + csize = ffs(atchan->sconfig.src_maxburst) - 1; if (csize < 0) { dev_err(chan2dev(chan), "invalid src maxburst value\n"); @@ -430,12 +481,14 @@ static int at_xdmac_compute_chan_conf(struct dma_chan *chan, AT91_XDMAC_DT_PERID(atchan->perid) | AT_XDMAC_CC_DAM_FIXED_AM | AT_XDMAC_CC_SAM_INCREMENTED_AM - | AT_XDMAC_CC_DIF(atchan->perif) - | AT_XDMAC_CC_SIF(atchan->memif) | AT_XDMAC_CC_SWREQ_HWR_CONNECTED | AT_XDMAC_CC_DSYNC_MEM2PER | AT_XDMAC_CC_MBSIZE_SIXTEEN | AT_XDMAC_CC_TYPE_PER_TRAN; + if (atxdmac->layout->sdif) + atchan->cfg |= AT_XDMAC_CC_DIF(atchan->perif) + | AT_XDMAC_CC_SIF(atchan->memif); + csize = ffs(atchan->sconfig.dst_maxburst) - 1; if (csize < 0) { dev_err(chan2dev(chan), "invalid src maxburst value\n"); @@ -711,6 +764,7 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan, struct data_chunk *chunk) { struct at_xdmac_desc *desc; + struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device); u32 dwidth; unsigned long flags; size_t ublen; @@ -727,10 +781,10 @@ at_xdmac_interleaved_queue_desc(struct dma_chan *chan, * flag status. */ u32 chan_cc = AT_XDMAC_CC_PERID(0x7f) - | AT_XDMAC_CC_DIF(0) - | AT_XDMAC_CC_SIF(0) | AT_XDMAC_CC_MBSIZE_SIXTEEN | AT_XDMAC_CC_TYPE_MEM_TRAN; + if (atxdmac->layout->sdif) + chan_cc |= AT_XDMAC_CC_DIF(0) | AT_XDMAC_CC_SIF(0); dwidth = at_xdmac_align_width(chan, src | dst | chunk->size); if (chunk->size >= (AT_XDMAC_MBR_UBC_UBLEN_MAX << dwidth)) { @@ -893,6 +947,7 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, size_t len, unsigned long flags) { struct at_xdmac_chan *atchan = to_at_xdmac_chan(chan); + struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device); struct at_xdmac_desc *first = NULL, *prev = NULL; size_t remaining_size = len, xfer_size = 0, ublen; dma_addr_t src_addr = src, dst_addr = dest; @@ -911,12 +966,13 @@ at_xdmac_prep_dma_memcpy(struct dma_chan *chan, dma_addr_t dest, dma_addr_t src, u32 chan_cc = AT_XDMAC_CC_PERID(0x7f) | AT_XDMAC_CC_DAM_INCREMENTED_AM | AT_XDMAC_CC_SAM_INCREMENTED_AM - | AT_XDMAC_CC_DIF(0) - | AT_XDMAC_CC_SIF(0) | AT_XDMAC_CC_MBSIZE_SIXTEEN | AT_XDMAC_CC_TYPE_MEM_TRAN; unsigned long irqflags; + if (atxdmac->layout->sdif) + chan_cc |= AT_XDMAC_CC_DIF(0) | AT_XDMAC_CC_SIF(0); + dev_dbg(chan2dev(chan), "%s: src=%pad, dest=%pad, len=%zd, flags=0x%lx\n", __func__, &src, &dest, len, flags); @@ -999,6 +1055,7 @@ static struct at_xdmac_desc *at_xdmac_memset_create_desc(struct dma_chan *chan, int value) { struct at_xdmac_desc *desc; + struct at_xdmac *atxdmac = to_at_xdmac(atchan->chan.device); unsigned long flags; size_t ublen; u32 dwidth; @@ -1017,11 +1074,11 @@ static struct at_xdmac_desc *at_xdmac_memset_create_desc(struct dma_chan *chan, u32 chan_cc = AT_XDMAC_CC_PERID(0x7f) | AT_XDMAC_CC_DAM_UBS_AM | AT_XDMAC_CC_SAM_INCREMENTED_AM - | AT_XDMAC_CC_DIF(0) - | AT_XDMAC_CC_SIF(0) | AT_XDMAC_CC_MBSIZE_SIXTEEN | AT_XDMAC_CC_MEMSET_HW_MODE | AT_XDMAC_CC_TYPE_MEM_TRAN; + if (atxdmac->layout->sdif) + chan_cc |= AT_XDMAC_CC_DIF(0) | AT_XDMAC_CC_SIF(0); dwidth = at_xdmac_align_width(chan, dst_addr); @@ -1297,7 +1354,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie, mask = AT_XDMAC_CC_TYPE | AT_XDMAC_CC_DSYNC; value = AT_XDMAC_CC_TYPE_PER_TRAN | AT_XDMAC_CC_DSYNC_PER2MEM; if ((desc->lld.mbr_cfg & mask) == value) { - at_xdmac_write(atxdmac, AT_XDMAC_GSWF, atchan->mask); + at_xdmac_write(atxdmac, atxdmac->layout->gswf, atchan->mask); while (!(at_xdmac_chan_read(atchan, AT_XDMAC_CIS) & AT_XDMAC_CIS_FIS)) cpu_relax(); } @@ -1355,7 +1412,7 @@ at_xdmac_tx_status(struct dma_chan *chan, dma_cookie_t cookie, * FIFO flush ensures that data are really written. */ if ((desc->lld.mbr_cfg & mask) == value) { - at_xdmac_write(atxdmac, AT_XDMAC_GSWF, atchan->mask); + at_xdmac_write(atxdmac, atxdmac->layout->gswf, atchan->mask); while (!(at_xdmac_chan_read(atchan, AT_XDMAC_CIS) & AT_XDMAC_CIS_FIS)) cpu_relax(); } @@ -1620,7 +1677,7 @@ static int at_xdmac_device_pause(struct dma_chan *chan) return 0; spin_lock_irqsave(&atchan->lock, flags); - at_xdmac_write(atxdmac, AT_XDMAC_GRWS, atchan->mask); + at_xdmac_write(atxdmac, atxdmac->layout->grws, atchan->mask); while (at_xdmac_chan_read(atchan, AT_XDMAC_CC) & (AT_XDMAC_CC_WRIP | AT_XDMAC_CC_RDIP)) cpu_relax(); @@ -1643,7 +1700,7 @@ static int at_xdmac_device_resume(struct dma_chan *chan) return 0; } - at_xdmac_write(atxdmac, AT_XDMAC_GRWR, atchan->mask); + at_xdmac_write(atxdmac, atxdmac->layout->grwr, atchan->mask); clear_bit(AT_XDMAC_CHAN_IS_PAUSED, &atchan->status); spin_unlock_irqrestore(&atchan->lock, flags); @@ -1845,6 +1902,10 @@ static int at_xdmac_probe(struct platform_device *pdev) atxdmac->regs = base; atxdmac->irq = irq; + atxdmac->layout = of_device_get_match_data(&pdev->dev); + if (!atxdmac->layout) + return -ENODEV; + atxdmac->clk = devm_clk_get(&pdev->dev, "dma_clk"); if (IS_ERR(atxdmac->clk)) { dev_err(&pdev->dev, "can't get dma_clk\n"); @@ -1988,6 +2049,10 @@ static const struct dev_pm_ops atmel_xdmac_dev_pm_ops = { static const struct of_device_id atmel_xdmac_dt_ids[] = { { .compatible = "atmel,sama5d4-dma", + .data = &at_xdmac_sama5d4_layout, + }, { + .compatible = "microchip,sama7g5-dma", + .data = &at_xdmac_sama7g5_layout, }, { /* sentinel */ } diff --git a/drivers/dma/at_xdmac_regs.h b/drivers/dma/at_xdmac_regs.h index 3f7dda4c5743..7b4b4e24de70 100644 --- a/drivers/dma/at_xdmac_regs.h +++ b/drivers/dma/at_xdmac_regs.h @@ -22,13 +22,6 @@ #define AT_XDMAC_GE 0x1C /* Global Channel Enable Register */ #define AT_XDMAC_GD 0x20 /* Global Channel Disable Register */ #define AT_XDMAC_GS 0x24 /* Global Channel Status Register */ -#define AT_XDMAC_GRS 0x28 /* Global Channel Read Suspend Register */ -#define AT_XDMAC_GWS 0x2C /* Global Write Suspend Register */ -#define AT_XDMAC_GRWS 0x30 /* Global Channel Read Write Suspend Register */ -#define AT_XDMAC_GRWR 0x34 /* Global Channel Read Write Resume Register */ -#define AT_XDMAC_GSWR 0x38 /* Global Channel Software Request Register */ -#define AT_XDMAC_GSWS 0x3C /* Global channel Software Request Status Register */ -#define AT_XDMAC_GSWF 0x40 /* Global Channel Software Flush Request Register */ #define AT_XDMAC_VERSION 0xFFC /* XDMAC Version Register */ /* Channel relative registers offsets */ @@ -134,8 +127,6 @@ #define AT_XDMAC_CSUS 0x30 /* Channel Source Microblock Stride */ #define AT_XDMAC_CDUS 0x34 /* Channel Destination Microblock Stride */ -#define AT_XDMAC_CHAN_REG_BASE 0x50 /* Channel registers base address */ - /* Microblock control members */ #define AT_XDMAC_MBR_UBC_UBLEN_MAX 0xFFFFFFUL /* Maximum Microblock Length */ #define AT_XDMAC_MBR_UBC_NDE (0x1 << 24) /* Next Descriptor Enable */ From patchwork Mon Sep 14 14:09:55 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11773853 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3A4B8618 for ; Mon, 14 Sep 2020 14:10:57 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id E7B2020672 for ; Mon, 14 Sep 2020 14:10:56 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="Fzy0/U3G"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="Z4RnIFkL" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org E7B2020672 Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=3QHZA5kNMc/OnZxEXGaxZVhnmYoZo2wc4RWzQnpJ/Dw=; b=Fzy0/U3GDiw+SPbiP8BNgIhoN OM2RXcmzkK9R/FT5tWElC1f6KD9VKLWo6M0Xng+yVvR5uCE5nSBmOnQvL6xzjqZ7kDt+om2/S3CWW /wsJQQH8VTHVEQbb1lE8sFSkPlMHbhydllf0Md4Acqg7QpQj42IazqeleZ3tOfeS4VEXqBAHTdGai zjH21yvTCBLAmM5c3aF0sRmca54vQH/n89fCb3pcLqI7fi2xcYcoXr/kU7zawPvQVC+mEJBVM4sZU JIaHw/K0028nR8L8TpwymSkXqhJm7QQwhFAi+Tx9KggkI7GrxRyy/Uv/N0tGvVzfijN/A5Q3uDuNu PZgA6KFbg==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBu-0005cS-0r; Mon, 14 Sep 2020 14:10:46 +0000 Received: from esa5.microchip.iphmx.com ([216.71.150.166]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBf-0005Wd-Qe for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 14:10:37 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1600092632; x=1631628632; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=3vcZ3ZLnnd6S54k/d0i4PUQ85b1B7wkAsBhm1WELjkw=; b=Z4RnIFkLmXjcpu/Y9HkurTGhqCWo0aV7L3P/3AbPmH+hfV1pOcEehHKm hwd8sRywod0SAhYXmECSk+JVps+8efFNI7MlOwWN4DF0IV7rd6aTynOLn fhmSyfhsrdR4RBMieelRDDgdRycRLKti9383ldF7ioGnqvQFDhPChb19Q z9DNC1t0GOMFS7LRMtIiVBlMmhBqTI+bzG7cIIHcHvg3WlNRxzjJjXZYQ vYK31A3X35q2v3SXgaRT9FsfLtpdW5xFoKVkkUVeuzXeToVaQccJSZIBu Bm+A10UqKfZWKDovpBZd+CMUClEGw5W/lX4HAYlBQD4sdCclv4C6OQxeY Q==; IronPort-SDR: 90DgTnYAFRQBucT4e3cNm+/hJMKFgwu5B2J/IyFUYT00CWnayQizJ3ngYiQJraAEvXuozBGWe2 prKUfcezWkEB7x2phFBJb1LjY9gl5Dhcie3MG9IiU6LPuJrluUC0I4qTXLr6Z3R3DdJKHX+dER HRcO7dQ4MKlCNJAaX7tJMZj58NP4f4Hm5G3OaYVwUJxy1L+hT6DyZefHiXADlut+r4lMXzGrrg 6WivrINUyJrnlfc/EZ7GpTPc76RONDapd4IwzjlvCOAlUlNsTfIVwYtCM9h22sdrEFzmU2Pveu 3vM= X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="90900856" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa5.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2020 07:10:31 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 14 Sep 2020 07:10:27 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 14 Sep 2020 07:10:23 -0700 From: Eugen Hristev To: , , , Subject: [PATCH 6/7] dt-bindings: dmaengine: at_xdmac: add optional microchip, m2m property Date: Mon, 14 Sep 2020 17:09:55 +0300 Message-ID: <20200914140956.221432-7-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914140956.221432-1-eugen.hristev@microchip.com> References: <20200914140956.221432-1-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_101032_163270_20E09050 X-CRM114-Status: UNSURE ( 9.51 ) X-CRM114-Notice: Please train this message. X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H4 RBL: Very Good reputation (+4) [216.71.150.166 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [216.71.150.166 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Eugen Hristev , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org Add optional microchip,m2m property that specifies if a controller is dedicated to memory to memory operations only. Signed-off-by: Eugen Hristev --- Documentation/devicetree/bindings/dma/atmel-xdma.txt | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/Documentation/devicetree/bindings/dma/atmel-xdma.txt b/Documentation/devicetree/bindings/dma/atmel-xdma.txt index 510b7f25ba24..642da6b95a29 100644 --- a/Documentation/devicetree/bindings/dma/atmel-xdma.txt +++ b/Documentation/devicetree/bindings/dma/atmel-xdma.txt @@ -15,6 +15,12 @@ the dmas property of client devices. interface identifier, - bit 30-24: PERID, peripheral identifier. +Optional properties: +- microchip,m2m: this controller is connected on AXI only to memory and it's + dedicated to memory to memory DMA operations. If this option is + missing, it's assumed that the DMA controller is connected to + peripherals, thus it's a per2mem and mem2per. + Example: dma1: dma-controller@f0004000 { From patchwork Mon Sep 14 14:09:56 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Eugen Hristev X-Patchwork-Id: 11773869 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 6B58114F6 for ; Mon, 14 Sep 2020 14:12:33 +0000 (UTC) Received: from merlin.infradead.org (merlin.infradead.org [205.233.59.134]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPS id 2EA6E20EDD for ; Mon, 14 Sep 2020 14:12:33 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=lists.infradead.org header.i=@lists.infradead.org header.b="sM8/FNpH"; dkim=fail reason="signature verification failed" (2048-bit key) header.d=microchip.com header.i=@microchip.com header.b="O3LaUZYn" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 2EA6E20EDD Authentication-Results: mail.kernel.org; dmarc=fail (p=quarantine dis=none) header.from=microchip.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=merlin.20170209; h=Sender:Content-Transfer-Encoding: Content-Type:Cc:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To:Message-ID:Date: Subject:To:From:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=8jihlnDuFQa/GIw6gZL/3tOv2v98WYyVGs1knW6L4k4=; b=sM8/FNpH2s26k6gWkc9oL9clC 8CkpY5cy6PA5pevlYgccOpGGvtmLZHearQZh/LPGTIkg2yHoukf3VM85cIAB+/EtzrEN3Mje2dFaV eOncqWPTwVb6GlqyJb6/76vUoMaoYvWMFNVSUR7Gz4gjzt/xfaO9NA+q4YpRATq59sldG1jA3j5fa +REZxll8tuDCq0TlwYDWcKI7GWvun9rfaL/Rm0Ui/6DILfpyGGVuh1Yj2GHVRkxQ6GTEC5rNPtmR2 Nm8RORmpgfhH1Vik+hVF5XjdOKHkG4ovBhpM29qaVPdNcFvWsyifA9uIGTDdUvhBGc2i+6oOMLraC 0+gQ0SY9w==; Received: from localhost ([::1] helo=merlin.infradead.org) by merlin.infradead.org with esmtp (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpCB-0005ji-VE; Mon, 14 Sep 2020 14:11:04 +0000 Received: from esa2.microchip.iphmx.com ([68.232.149.84]) by merlin.infradead.org with esmtps (Exim 4.92.3 #3 (Red Hat Linux)) id 1kHpBk-0005ZO-Fe for linux-arm-kernel@lists.infradead.org; Mon, 14 Sep 2020 14:10:40 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=microchip.com; i=@microchip.com; q=dns/txt; s=mchp; t=1600092636; x=1631628636; h=from:to:cc:subject:date:message-id:in-reply-to: references:mime-version:content-transfer-encoding; bh=GDtWNy+1+8dO3cpS3XKMQB+I0oBFyD9met/Amvo/jek=; b=O3LaUZYn3Ikjafa4j0fmyvIo8CGW6tB1EQgaAzVU4sNGSknLfRCxM8K1 eqzl66Pxzb+OJ+2edbBt/RHA8Y87b80InFKveFjj5/MD5RU9UDuhGIbRV 6SIoKesITFBpMtbY7PsLCoA6pbwUzbkA7nJ8AZjyX5vj5GMQIyIRkEPkF b4W6dBU36AtwD2/8Q0e0xA1xYlpjd9Y67YrkTt/NIVVsHXNdFfyVifJ5c obQfqgbe1vL/ozDTPC0PRBtXos0LkAwHkDGb1Yu52tzLW5UkGlgSRb+sA 2Ph+NYBIK0+oD44DwPQfXezCbepoImB8iPJFkRIDpyjMnP04KRK1GhnEd A==; IronPort-SDR: /7xip98nvSlOkhfbD+4LyobSyZjGN7uGnpeahPrDwiaUNX0ZUnzqlvQHsoI/ASFDsPFIrJLtkt gjkiTvVrCmAQiuGrHyMR4DwPHYkuywQ7aIvnVx38IWCCM7rcf5CTPeLhfFwstTLSRvCmQ9sKwE msdeQ10obqzBmCUp25zB+NYpIGHNEhPaL+mvvlvGVuBdnFND8oWppk77OEB7rKDbjQPPm56Weu YFH2YOt5UWkJri+/egPpVLFRAZFP+FdHjIR7wSH0hywg6TrKqCCO7r7cJXx6UNn/xenwXy0lc7 fQ8= X-IronPort-AV: E=Sophos;i="5.76,426,1592895600"; d="scan'208";a="88993972" Received: from smtpout.microchip.com (HELO email.microchip.com) ([198.175.253.82]) by esa2.microchip.iphmx.com with ESMTP/TLS/AES256-SHA256; 14 Sep 2020 07:10:35 -0700 Received: from chn-vm-ex01.mchp-main.com (10.10.85.143) by chn-vm-ex02.mchp-main.com (10.10.85.144) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id 15.1.1979.3; Mon, 14 Sep 2020 07:10:32 -0700 Received: from ROB-ULT-M18282.microchip.com (10.10.115.15) by chn-vm-ex01.mchp-main.com (10.10.85.143) with Microsoft SMTP Server id 15.1.1979.3 via Frontend Transport; Mon, 14 Sep 2020 07:10:28 -0700 From: Eugen Hristev To: , , , Subject: [PATCH 7/7] dmaengine: at_xdmac: add AXI priority support and recommended settings Date: Mon, 14 Sep 2020 17:09:56 +0300 Message-ID: <20200914140956.221432-8-eugen.hristev@microchip.com> X-Mailer: git-send-email 2.25.1 In-Reply-To: <20200914140956.221432-1-eugen.hristev@microchip.com> References: <20200914140956.221432-1-eugen.hristev@microchip.com> MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20200914_101036_720407_8FFB644D X-CRM114-Status: GOOD ( 15.18 ) X-Spam-Score: -2.5 (--) X-Spam-Report: SpamAssassin version 3.4.4 on merlin.infradead.org summary: Content analysis details: (-2.5 points) pts rule name description ---- ---------------------- -------------------------------------------------- 0.0 RCVD_IN_MSPIKE_H3 RBL: Good reputation (+3) [68.232.149.84 listed in wl.mailspike.net] -2.3 RCVD_IN_DNSWL_MED RBL: Sender listed at https://www.dnswl.org/, medium trust [68.232.149.84 listed in list.dnswl.org] -0.0 SPF_HELO_PASS SPF: HELO matches SPF record -0.0 SPF_PASS SPF: sender matches SPF record -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.0 RCVD_IN_MSPIKE_WL Mailspike good senders X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: devicetree@vger.kernel.org, linux-kernel@vger.kernel.org, dmaengine@vger.kernel.org, Eugen Hristev , linux-arm-kernel@lists.infradead.org Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+patchwork-linux-arm=patchwork.kernel.org@lists.infradead.org The sama7g5 version of the XDMAC supports priority configuration and outstanding capabilities. Add defines for the specific registers for this configuration, together with recommended settings. However the settings are very different if the XDMAC is a mem2mem or a per2mem controller. Thus, we need to differentiate according to device tree property. Signed-off-by: Eugen Hristev --- drivers/dma/at_xdmac.c | 25 +++++++++++++++++++++++++ drivers/dma/at_xdmac_regs.h | 16 ++++++++++++++++ 2 files changed, 41 insertions(+) diff --git a/drivers/dma/at_xdmac.c b/drivers/dma/at_xdmac.c index 874484a4e79f..8ea5558e127d 100644 --- a/drivers/dma/at_xdmac.c +++ b/drivers/dma/at_xdmac.c @@ -57,6 +57,8 @@ struct at_xdmac_layout { u8 chan_cc_reg_base; /* Source/Destination Interface must be specified or not */ bool sdif; + /* AXI queue priority configuration supported */ + bool axi_config; }; /* ----- Channels ----- */ @@ -135,6 +137,7 @@ static struct at_xdmac_layout at_xdmac_sama5d4_layout = { .gswf = 0x40, .chan_cc_reg_base = 0x50, .sdif = true, + .axi_config = false, }; static struct at_xdmac_layout at_xdmac_sama7g5_layout = { @@ -147,6 +150,7 @@ static struct at_xdmac_layout at_xdmac_sama7g5_layout = { .gswf = 0x50, .chan_cc_reg_base = 0x60, .sdif = false, + .axi_config = true, }; static inline void __iomem *at_xdmac_chan_reg_base(struct at_xdmac *atxdmac, unsigned int chan_nb) @@ -1863,6 +1867,25 @@ static int atmel_xdmac_resume(struct device *dev) } #endif /* CONFIG_PM_SLEEP */ +static void at_xdmac_axi_config(struct platform_device *pdev) +{ + struct at_xdmac *atxdmac = (struct at_xdmac *)platform_get_drvdata(pdev); + bool dev_m2m; + + if (!atxdmac->layout->axi_config) + return; /* Not supported */ + + dev_m2m = of_property_read_bool(pdev->dev.of_node, "microchip,m2m"); + + if (dev_m2m) { + at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_M2M); + at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_M2M); + } else { + at_xdmac_write(atxdmac, AT_XDMAC_GCFG, AT_XDMAC_GCFG_P2M); + at_xdmac_write(atxdmac, AT_XDMAC_GWAC, AT_XDMAC_GWAC_P2M); + } +} + static int at_xdmac_probe(struct platform_device *pdev) { struct at_xdmac *atxdmac; @@ -2008,6 +2031,8 @@ static int at_xdmac_probe(struct platform_device *pdev) dev_info(&pdev->dev, "%d channels, mapped at 0x%p\n", nr_channels, atxdmac->regs); + at_xdmac_axi_config(pdev); + return 0; err_dma_unregister: diff --git a/drivers/dma/at_xdmac_regs.h b/drivers/dma/at_xdmac_regs.h index 7b4b4e24de70..e5a58f6194aa 100644 --- a/drivers/dma/at_xdmac_regs.h +++ b/drivers/dma/at_xdmac_regs.h @@ -14,7 +14,23 @@ #define AT_XDMAC_FIFO_SZ(i) (((i) >> 5) & 0x7FF) /* Number of Bytes */ #define AT_XDMAC_NB_REQ(i) ((((i) >> 16) & 0x3F) + 1) /* Number of Peripheral Requests Minus One */ #define AT_XDMAC_GCFG 0x04 /* Global Configuration Register */ +#define AT_XDMAC_WRHP(i) (((i) & 0xF) << 4) +#define AT_XDMAC_WRMP(i) (((i) & 0xF) << 8) +#define AT_XDMAC_WRLP(i) (((i) & 0xF) << 12) +#define AT_XDMAC_RDHP(i) (((i) & 0xF) << 16) +#define AT_XDMAC_RDMP(i) (((i) & 0xF) << 20) +#define AT_XDMAC_RDLP(i) (((i) & 0xF) << 24) +#define AT_XDMAC_RDSG(i) (((i) & 0xF) << 28) +#define AT_XDMAC_GCFG_M2M (AT_XDMAC_RDLP(0xF) | AT_XDMAC_WRLP(0xF)) +#define AT_XDMAC_GCFG_P2M (AT_XDMAC_RDSG(0x1) | AT_XDMAC_RDHP(0x3) | \ + AT_XDMAC_WRHP(0x5)) #define AT_XDMAC_GWAC 0x08 /* Global Weighted Arbiter Configuration Register */ +#define AT_XDMAC_PW0(i) (((i) & 0xF) << 0) +#define AT_XDMAC_PW1(i) (((i) & 0xF) << 4) +#define AT_XDMAC_PW2(i) (((i) & 0xF) << 8) +#define AT_XDMAC_PW3(i) (((i) & 0xF) << 12) +#define AT_XDMAC_GWAC_M2M 0 +#define AT_XDMAC_GWAC_P2M (AT_XDMAC_PW0(0xF) | AT_XDMAC_PW2(0xF)) #define AT_XDMAC_GIE 0x0C /* Global Interrupt Enable Register */ #define AT_XDMAC_GID 0x10 /* Global Interrupt Disable Register */ #define AT_XDMAC_GIM 0x14 /* Global Interrupt Mask Register */