Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751955AbbHTLDY (ORCPT ); Thu, 20 Aug 2015 07:03:24 -0400 Received: from mail-bn1on0082.outbound.protection.outlook.com ([157.56.110.82]:1104 "EHLO na01-bn1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1751812AbbHTLDT convert rfc822-to-8bit (ORCPT ); Thu, 20 Aug 2015 07:03:19 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.100) smtp.mailfrom=xilinx.com; lists.infradead.org; dkim=none (message not signed) header.d=none; From: Anurag Kumar Vulisha To: Laurent Pinchart CC: "dan.j.williams@intel.com" , "vinod.koul@intel.com" , Michal Simek , Soren Brinkmann , "srikanth.thokala@xilinx.com" , "maxime.ripard@free-electrons.com" , Appana Durga Kedareswara Rao , "dmaengine@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Anirudha Sarangi , Srikanth Vemula Subject: RE: [PATCH] dmaengine: vdma: Add 64 bit addressing support to the driver Thread-Topic: [PATCH] dmaengine: vdma: Add 64 bit addressing support to the driver Thread-Index: AQHQz3SXQrB7LtrlOkerbFxW68pzd54R6aqAgALf8ZA= Date: Thu, 20 Aug 2015 10:47:48 +0000 Message-ID: <3802E9A6666DF54886E2B9CBF743BA9801BF8264@XAP-PVEXMBX01.xlnx.xilinx.com> References: <1438775257-3511-1-git-send-email-anuragku@xilinx.com> <2214014.FVHbR3JRBK@avalon> In-Reply-To: <2214014.FVHbR3JRBK@avalon> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.94.178] Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 8BIT MIME-Version: 1.0 X-RCIS-Action: ALLOW X-TM-AS-Product-Ver: IMSS-7.1.0.1224-8.0.0.1202-21758.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11FD027;1:kp5kizbGRrcwuVVnknozDfVQmtDfl52VLMO8wCoRDw0hEe8KV5kX1RJL2uQTl4MXjkvWKhZ6RObjU2k0oXDtX6OaMlORxn8qEg3punBlHqnAx8TiIp6VGwPHbfYRWiuSNdJ+7naTwwRatyxFgXwx6yP/1nFPnDFzpBnnXb08BPMVstg1bgn9Ox82YEl0c+fPvTlG2I8pQuKTVCyTirPOWPHSa18acNSHtpkvcVsOE5jmzdYlJGNnzVFgncXxrpNv7CkBjVnPAgpkZf1JRE7guHjM7Q2auzQj52et/N2rWvDIG4BMh5LWKzk7akpogOtBW4JsgN8+S5MMqZlFLCyUPm3sq1nDa94yQz0bKgYQVYsQs6xjA9vE20ioIKqmFjQ31IL39Io9xOu21rV0vh5zyA== X-Forefront-Antispam-Report: CIP:149.199.60.100;CTRY:US;IPV:NLI;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(3050300001)(13464003)(24454002)(164054003)(377454003)(199003)(189002)(23726002)(55846006)(50466002)(5250100002)(36386004)(33656002)(189998001)(54356999)(50986999)(76176999)(2920100001)(97756001)(2656002)(5007970100001)(2900100001)(92566002)(2950100001)(5001960100002)(63266004)(5001860100001)(19580405001)(106466001)(106116001)(110136002)(47776003)(86362001)(87936001)(575784001)(19580395003)(5001920100001)(5003600100002)(4001540100001)(5001830100001)(77156002)(102836002)(46406003)(6806004)(62966003)(46102003)(81156007)(64706001)(107886002)(107986001)(5001870100001)(4001430100001);DIR:OUT;SFP:1101;SCL:1;SRVR:BN1BFFO11HUB047;H:xsj-pvapsmtpgw02;FPR:;SPF:Pass;PTR:unknown-60-100.xilinx.com,xapps1.xilinx.com;A:1;MX:1;LANG:en; X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11HUB047;2:snuL+DQ+0TE0v9vcJM4F1OXOZrbEgaMW4v3E5sOu5JyIgj5TPKaSLn1jnjtBbAt0ON9KJTpm55EsucbooUcofDXhIOW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SWMNAPmMaKk823GeEbNYPMp9VPZx/0OONmY++7PtZo/THK5geVdXl4TYTyx8t5L977eKhWzZvRRaTQ75Ybzhx+RcLxHkdyxwPr+gsGwL1SaUYrcJwsKqjVtGgpBusBY3znTYskBsKwPZ2BMXHiosvmPlvg+;4:eSKErMuYxO4P+xF0LUZOifxwGu7c+8prwRxTV9eJDm6cnbDht6sZaUysFFiQkqcA/m0QABqmD92tlcItknuiJu25+aJJayZ7veruPG7HWnApEs1xUJTdt1o5+rM8wo1xTgxl4XqhAKH9zVim/rl5eADrCUTkmztxpuyFKUON4VtdiCziPtGnEa17TlY3PC7olakmC7bRottLK4Wy4qx5IMoqhWXhvJAn3p4/ssJYdArdfeW/DgSLIOW/fS+qiXf5nSKjuTi3eZYmhpKbFetWVS50/F5SaeUA67yYnTBilNwAev7SHmj41LcNHe/S83bQlCQpt0WnXZsIUNbXr/ZJShJ/LIjSgas4Iy61AB39LFc= X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(5005006)(8121501046)(8121501027)(3002001);SRVR:BN1BFFO11HUB047;BCL:0;PCL:0;RULEID:;SRVR:BN1BFFO11HUB047; X-Forefront-PRVS: 0674DC6DD3 X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1;BN1BFFO11HUB047;23:RCEJssEX9WhxPh3eZADisvhFXfYdyd0OPnkxV0T?= =?us-ascii?Q?O+aHFclia8TUmK7K4d1YGBlp7ESTHcTyiJM1eZP46Zt08Es4jjrl5AB9o/wT?= =?us-ascii?Q?WTW0KK0bPf3G7fnkmyDxBsJhbrAlVbdNrdWeQu2G5JdTPp29w5Rf12mYf/yg?= =?us-ascii?Q?vWGy6mwcd1aFNOYUEeerXK3ufQqjDtJamV644QoKezIREarct2vEI6ULD57A?= =?us-ascii?Q?x2i3/oJ9AA+HFoUktS2IWlV0oCFSXeU7ARtQ5HdDEOePnmR9jcv8DSp3D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CLN2EM5Mbne9Wq9PlIJqtI5D0N4dJwg?= =?us-ascii?Q?arCUL9S1qO87y4oxzGaOsY/oF6lez7AXfO26HR9K4pzafhOJgBZWRfkZkujb?= =?us-ascii?Q?fY5zOf99AQHnXJO0KLSMGcVhM7OHMwM8RfvCSKJqbKE8ZTzfGgverf5va3bJ?= =?us-ascii?Q?bLzZHrd/klFQerYkDo4Q2Op1Dh0z092jX+nj63h7rBILDJbuTUF+sWKAow+Q?= =?us-ascii?Q?VpyoV1oEp6LAH02VwLXNGGnMueaEO1P9EqYw9vERb6rOdmilF0Xmwx0uPyTL?= =?us-ascii?Q?lCKNUowluYMs5bKPS5nfDYHfhLJtrkI3L0LnwrAJFYYfAzBiql8qC?= X-Microsoft-Exchange-Diagnostics: 1;BN1BFFO11HUB047;5:tzeDJmf79/00V1yRTfdRJLiAC9/Lhdrcu+HCsStBG0FaqN3cysSpwflo5/YvHwiWkTktGfGpJU+ghfuy7SOmg6BOkk7g4V+ypjd6SNRHn/C25r19MbO49VaOXUFG/9a6dQ/0Bb21nAUiMxF2ZBwjUg==;24:CdIuOV6VWmEbix+qJG93WxkiQj2kZ8sq6a+amcSAlxzse/3vq5OgzWazVnqDTKtP7+WLJx0Xs2X3yuruviSlDveFcDBET6gx6qE1csd8gOU= SpamDiagnosticOutput: 1:23 SpamDiagnosticMetadata: NSPM X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 20 Aug 2015 10:47:58.6155 (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.100];Helo=[xsj-pvapsmtpgw02] X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN1BFFO11HUB047 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 5758 Lines: 171 Hi Laurent, > -----Original Message----- > From: Anurag Kumar Vulisha > Sent: Thursday, August 20, 2015 2:41 PM > To: Anurag Kumar Vulisha > Subject: RE:[PATCH] dmaengine: vdma: Add 64 bit addressing support to the > driver > > > Hi Anurag, > > Thank you for the patch. > > On Wednesday 05 August 2015 17:17:37 Anurag Kumar Vulisha wrote: > > 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) > > Strictly speaking that should be CONFIG_ARCH_DMA_ADDR_T_64BIT. > Will change this in v2 > > +#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; > > This will change the descriptor layout for 32-bit VDMA, I don't think that's > right. > Will change this in v2 > > 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); > > So the CPU can't perform 64-bit register access ? > We are trying to write at a register address(0x5c) which is not aligned on 8 bytes boundary.So if I try to use 64 bit write on it, unalignment fault will be generated. Because of this we are using two separate 32 bit writes. > How is 64 bit DMA addressing implemented ? Can you use a 64-bit VDMA on > a 32- bit platform with LPAE ? Can you use a 32-bit VDMA on a 64-bit platform > ? > Given that VDMA is an IP core you can instantiate in the programmable logic I > expect some level of flexibility to be possible, but this patch doesn't seem to > support it. Please provide more context to allow a proper review (and please > include it in the commit message of v2). > The VDMA core is a soft ip, which can be programmed to support both 32 bit and 64 bit addressing.When the VDMA core is configured for 32 bit address space , transfer start address is specified by a single register. When the VDMA core is configured for an address space greater than 32, each start address is specified by a combination of two registers.The first register specifies the LSB 32 bits of address, while the next register specifies the MSB 32 bits of address.For example,5Ch will specify the LSB bits while 60h will specify the MSB bits of the first start address. So we need to program two registers at a time. Yes,64 bit vdma can be used on 32 bit platform and 32 bit vdma can also be used on 64 bit platform.As far as i know , there is no use case where 64 bit dma can be used on 32 bit platform.Please correct me if i am wrong. > > +} > > +#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; > > } > > -- Thanks, Anurag Kumar V -- 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/