Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751591AbbHELrs (ORCPT ); Wed, 5 Aug 2015 07:47:48 -0400 Received: from mail-by2on0064.outbound.protection.outlook.com ([207.46.100.64]:44864 "EHLO na01-by2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1750742AbbHELrp (ORCPT ); Wed, 5 Aug 2015 07:47:45 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; vger.kernel.org; dkim=none (message not signed) header.d=none; From: Anurag Kumar Vulisha To: , , , , , , , CC: , , , Anurag Kumar Vulisha Subject: [PATCH] dmaengine: vdma: Add 64 bit addressing support to the driver Date: Wed, 5 Aug 2015 17:17:37 +0530 Message-ID: <1438775257-3511-1-git-send-email-anuragku@xilinx.com> X-Mailer: git-send-email 1.7.4 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21726.003 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11FD049;1:lBYY+J9bg0+QdUSExPalE+KVxc22WoJ0iUTOWNgeohoVn374V2DJaklHlgn46csyFCCxFt2WQMQfeb8ds3GZ2YRCL3q8Lvw7iohyQM0J6gP1486mvvQrfiBZSKbwuktbxU3HMkpnjAblMqGeLDly5HXzodR1Olu728B9JbKFwfeVcRYVyxZdBijsIp5lzscmqgEliT53iAgAJsG9ZTmzG4br28KiHlXtL/HsITIXHIEpJXmXvqo1m1rB19FeFh7UJ/cOOa16hMsL7HvXUpr8UsPgpjdjCOvQ4ahGF9nO/uteZPrLDvcx5Fm7QsDeN6gbJ9ubUkb/IQinM5C8PV7O6g== X-Forefront-Antispam-Report: CIP:149.199.60.83;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(199003)(189002)(50986999)(107886002)(5003940100001)(52956003)(47776003)(2201001)(64706001)(45336002)(87936001)(36386004)(77156002)(50226001)(36756003)(62966003)(575784001)(19580395003)(19580405001)(6806004)(86362001)(4001450100002)(50466002)(92566002)(4001540100001)(229853001)(5001770100001)(33646002)(63266004)(5001830100001)(42186005)(5001860100001)(189998001)(48376002)(5001960100002)(106466001)(81156007)(103686003)(46386002)(46102003)(107986001)(90966001)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1AFFO11HUB011;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;PTR:unknown-60-83.xilinx.com;A:1;MX:1;LANG:en; MIME-Version: 1.0 Content-Type: text/plain X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11HUB011;2:7rsks7YMiBnpuBFtdJB1V8jL0U4jzmgyGQFcKX/oiv7QJ+l68UJ3cBlI4Q/u2WUDoAx8Lhq19aszMXh4/YX/4Lb8OwLaa47X9pcsa0i+bb7p3b+SnPMFa6DHxwZK4Rj6XpKAef911Q5ueMpLqtf+2kS513Eq2leJhzg4yN0/AbA=;3:icIQauHgF2lCG67nQkgeMxsEjeS8O/I6Lddz5afoFzew9G1tFbDh+8m0mEQza3l07+fHw5TbaydRzYk/0bHxarLi87CVK2cffRG4tO2Crk5G5Utq5zk+lRU5XZP+fMbbiR5s56DkgVq+TJ1Xv34ArlC1p72p7RP6+P+UhNkGtwXcMdW5oz1dLGn+pPOvtyuCaeWfoDWELMUnfpFRvzDAVRxTz4KJETolBzjPqDgSbyI=;25:YcQhhV2RMx5Uynh9kOQu2hmXSsCyd30Jmi8iz2Xwri7lnC1BhmZv+MWdes6615oR0aNPHKqfdvV4+aFnAgCV93l3BMwp2ogON61AD0hNGrcqGo3+Z0hUtghzcHXic2BIM7nUPp87fjga7+UwcNQArdlrhNBzsVzzvESBXTUi6orN2VU2IH6rOSrxcxA27X7li5vPf3DijjZx5bvsxNjVk5Bxjob6HuC3QMopUEQ7NavYTy1uq10qhCwJqQ2VPJRh X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB011; X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11HUB011;20:djaA26HGeVJ/Eiv8iUYnugv7IVknwXzR7eOxFgRVWQu6sp/XGQOlfOpTQ+ArT6oLCLagFJJvxxKLdVtZImXK+tdx/KnotcafRlyEnO68i4SLQRo5Ip0sysZsa7lP0Ge3cONA2SgW01Nxp0PKAnTfLaC078zTlwaRMyIELkQI7pWo6yuOld2jkCCbw+uG7XVnebctww8IiwxP6rvGTGMxWhZaghLJBHq8u61hqIIaExEK+QkGYC2teEbRMFOcvU5w0fvyu3Z1WXiqYVGOEwdmEk+tL71IOaoRInh7+j9NXeigHU7bEuDcsz2uhmj7k7vjOilHsKa9GxsBLHiC4hTsAmg1TLmii9o+W1jM/0+cPdzzhSKGi1gT9pRJNYkJUP/uihQe/tmx9PMaoEx5EY6Fd4eDqecQSEnUN68j+vPOuNVy2VqEMQdjb5z4uF2G0BXdCZ7+0OZkOXkHfM7TprFqKbbau8obf3SSn81xZYpmluYV7dhAZSNreRXLZ8JR2x3h;4:DV+J8b1ezVsQylT5C9jhoPvG+Zuvq+C2Tx156cf509RVLef8JW3FJZCdkC9Y6M8eqaTsBKZPZzJvwdzH8lrQPgneJ8M1iz0L2u/ODMY09d1GDs6OxfLTdKxSK9rnMZygkbHIR9WVkQbpVYCe8ma4Uq3sPjMiPrfaqrVX3kOoxENcp0SFLYzOVAV6aIc6kQX6c6A6qO4QJjMpykDTtGtz57/amUzPk2m2YhYK+gaV76k7BdRB0o5jS9+WXQyWRB9dJ5A/mOWIEwRe8AhW7l9MOC6a3zMnJ1b8YPI9iXQ0tS8= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(3002001);SRVR:BN1AFFO11HUB011;BCL:0;PCL:0;RULEID:;SRVR:BN1AFFO11HUB011; X-Forefront-PRVS: 06592CCE58 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN1AFFO11HUB011;23:yuxaotyx7fRJwTS0v06dKi3B2e0FzUIuXHyLfA9?= =?us-ascii?Q?gXSqzu50MZlpdUBNlHC73NsBhv8mMn46j60WQ3miMYGZv/z+YSA6/1ztlu91?= =?us-ascii?Q?xI7sOb6/x70QazudYEKeWhsfwKfwAPklfEftbCpj48unh4ovtoXtvEtcNv01?= =?us-ascii?Q?pVx6mep8cXlN2CNQpY04R1X2E5GET1ZMgx04PEmt66EnS3RJUaQij1hBNcnU?= =?us-ascii?Q?GwnFy0m14/ckHkKOJasApEL+8yzdiBZCSxVFT9w5bPaHuk5JjBeWvVTnb/HC?= =?us-ascii?Q?HLYmkj58TLkwYZBlWDXeNN/DSmwQIvVeT6Q/pGZpFLOCfxLY7gJNjtREvqqR?= =?us-ascii?Q?NB+WRiz201zCFaQlmCYuNSmnZNKAlM/VqjF24EQxk5tixKJwEXMM5kGmtMJL?= =?us-ascii?Q?HJepPwROY4/CuBUxioiG8tbLdEIVr3Ip/ODf56/7d9seKXsMC6c1DUejP/pU?= =?us-ascii?Q?j9x+0HQSh5uGSfR3EYoy4RfJXF86H1lawD/J+DuVXFVplAGJDxkM6jdo49VE?= =?us-ascii?Q?CmklPMMdYpvGx1jBymtp9uN9sRrz74zWg5Y2EmTu8/fkIoMg9tFxE5vPogwy?= =?us-ascii?Q?PO2vzbD6zEPEj+bsPdJiK3LyBwT0m51sY3XhSDLjAxpch368Q8MJ+EGPrF+d?= =?us-ascii?Q?K9ArJ4q5rq6IZGBql+bTXn+zD2HfUQ19ZnMft92tYI6WnnKQC5/4y02c0hsY?= =?us-ascii?Q?BGX91X6R5JDfoNEO7oS5iC59JK5e/Rk9vsC9n1jAffn67ti2GBhNnyMLe/i5?= =?us-ascii?Q?BNVYlbs80uPg9d3ZTqiQaVKk4SWrkDoCrxTwGANXrlj7GZPfsO3CZ4RgtH44?= =?us-ascii?Q?xu9ubX+rJ4Rx1fDCb7u9aI4B7HJK5MVE/+9+hWxhvoxYPKzFmu9a2hDejhx2?= =?us-ascii?Q?pJRUGO2KZbrTHC9B0WEyTsJSHRHQri8//9J8I4vxgLotJsp5sBnle0JacdrT?= =?us-ascii?Q?uumxu6DOGS7Y3KpTlLEI8QRXBm22npXLJqJ/Q/YSFCfDtu4KDDlmiSRvk8cI?= =?us-ascii?Q?KYVkuHvWt3KqL+i8kqOthdyXUuIs6L3gEBGRrMKOAiJLgOHHWRMAfVpekfyc?= =?us-ascii?Q?6AiWYkjz30Fw+DzeNVtotFH7LtlW6vkmehinfplQb0Bzdw2rvanxYeYFtTYc?= =?us-ascii?Q?gUTHIGcejnnHIIOlb+RLt3DOoU83qb0T1mrzjFHFJf0cwxIb/2knyGU9S4DW?= =?us-ascii?Q?JZQ7ZN/4aO1rCho4pZ9Ev12DxzcXrzVD9hqDI5lmVxwZeh2DTXD95fMdplHx?= =?us-ascii?Q?p0VRKgOPLUPfDCq8OvQE=3D?= X-Microsoft-Exchange-Diagnostics: 1;BN1AFFO11HUB011;5:Qua6P37cjUuq5Yazm5mHvLERhBwEzn4hkpUHkl7CzoYkofg1e3GKU35l5rlwTaKJXSJ3Du3HK2TIQV9z9rrpuCFzxo9vvUCg2fCKarfsJWaY4V5SG/lxA14mOYrQcaYZ1HL0lntUbYaEx5dgFR9ldQ==;24:QaiQ9i3XqkONnH1ZazvaL7HEZlZsrqdu2vzUdPMBjt3TUi/fiwVEQr9O/s3mP8F0AeMUeZQVUf3YIZJQkXZtN2HxqdtD5vb67V0Z7CJDnFE= X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Aug 2015 11:47:43.7542 (UTC) X-MS-Exchange-CrossTenant-Id: 657af505-d5df-48d0-8300-c31994686c5c X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=657af505-d5df-48d0-8300-c31994686c5c;Ip=[149.199.60.83];Helo=[xsj-pvapsmtpgw01] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1AFFO11HUB011 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 3233 Lines: 105 This patch adds the 64 bit addressing support to the vdma driver. Signed-off-by: Anurag Kumar Vulisha --- drivers/dma/Kconfig | 2 +- drivers/dma/xilinx/xilinx_vdma.c | 36 ++++++++++++++++++++++++++++++------ 2 files changed, 31 insertions(+), 7 deletions(-) diff --git a/drivers/dma/Kconfig b/drivers/dma/Kconfig index bda2cb0..a7cd0a8 100644 --- a/drivers/dma/Kconfig +++ b/drivers/dma/Kconfig @@ -398,7 +398,7 @@ config FSL_EDMA config XILINX_VDMA tristate "Xilinx AXI VDMA Engine" - depends on (ARCH_ZYNQ || MICROBLAZE) + depends on (ARCH_ZYNQ || MICROBLAZE || ARM64) select DMA_ENGINE help Enable support for Xilinx AXI VDMA Soft IP. diff --git a/drivers/dma/xilinx/xilinx_vdma.c b/drivers/dma/xilinx/xilinx_vdma.c index d8434d4..3dcbd29 100644 --- a/drivers/dma/xilinx/xilinx_vdma.c +++ b/drivers/dma/xilinx/xilinx_vdma.c @@ -98,7 +98,11 @@ #define XILINX_VDMA_FRMDLY_STRIDE_FRMDLY_SHIFT 24 #define XILINX_VDMA_FRMDLY_STRIDE_STRIDE_SHIFT 0 +#if defined(CONFIG_PHYS_ADDR_T_64BIT) +#define XILINX_VDMA_REG_START_ADDRESS(n) (0x000c + 8 * (n)) +#else #define XILINX_VDMA_REG_START_ADDRESS(n) (0x000c + 4 * (n)) +#endif /* HW specific definitions */ #define XILINX_VDMA_MAX_CHANS_PER_DEVICE 0x2 @@ -143,16 +147,16 @@ * @next_desc: Next Descriptor Pointer @0x00 * @pad1: Reserved @0x04 * @buf_addr: Buffer address @0x08 - * @pad2: Reserved @0x0C - * @vsize: Vertical Size @0x10 - * @hsize: Horizontal Size @0x14 + * @pad2: Reserved @0x10 + * @vsize: Vertical Size @0x14 + * @hsize: Horizontal Size @0x18 * @stride: Number of bytes between the first - * pixels of each horizontal line @0x18 + * pixels of each horizontal line @0x1C */ struct xilinx_vdma_desc_hw { u32 next_desc; u32 pad1; - u32 buf_addr; + u64 buf_addr; u32 pad2; u32 vsize; u32 hsize; @@ -272,6 +276,20 @@ static inline void vdma_desc_write(struct xilinx_vdma_chan *chan, u32 reg, vdma_write(chan, chan->desc_offset + reg, value); } +#if defined(CONFIG_PHYS_ADDR_T_64BIT) +static inline void vdma_desc_write_64(struct xilinx_vdma_chan *chan, u32 reg, + u64 value) +{ + /* Write the lsb 32 bits*/ + writel(lower_32_bits(value), + chan->xdev->regs + chan->desc_offset + reg); + + /* Write the msb 32 bits */ + writel(upper_32_bits(value), + chan->xdev->regs + chan->desc_offset + reg + 4); +} +#endif + static inline u32 vdma_ctrl_read(struct xilinx_vdma_chan *chan, u32 reg) { return vdma_read(chan, chan->ctrl_offset + reg); @@ -700,9 +718,15 @@ static void xilinx_vdma_start_transfer(struct xilinx_vdma_chan *chan) int i = 0; list_for_each_entry(segment, &desc->segments, node) { - vdma_desc_write(chan, +#if defined(CONFIG_PHYS_ADDR_T_64BIT) + vdma_desc_write_64(chan, XILINX_VDMA_REG_START_ADDRESS(i++), segment->hw.buf_addr); +#else + vdma_desc_write(chan, + XILINX_VDMA_REG_START_ADDRESS(i++), + (u32)segment->hw.buf_addr); +#endif last = segment; } -- 1.7.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/