Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751522AbcCaG6U (ORCPT ); Thu, 31 Mar 2016 02:58:20 -0400 Received: from mail-sn1nam02on0089.outbound.protection.outlook.com ([104.47.36.89]:20845 "EHLO NAM02-SN1-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1753058AbcCaG6R convert rfc822-to-8bit (ORCPT ); Thu, 31 Mar 2016 02:58:17 -0400 Authentication-Results: spf=pass (sender IP is 149.199.60.83) smtp.mailfrom=xilinx.com; lists.infradead.org; dkim=none (message not signed) header.d=none;lists.infradead.org; dmarc=bestguesspass action=none header.from=xilinx.com; From: Appana Durga Kedareswara Rao To: Rob Herring CC: "pawel.moll@arm.com" , "mark.rutland@arm.com" , "ijc+devicetree@hellion.org.uk" , "galak@codeaurora.org" , Michal Simek , Soren Brinkmann , "vinod.koul@intel.com" , "dan.j.williams@intel.com" , Anurag Kumar Vulisha , "moritz.fischer@ettus.com" , "laurent.pinchart@ideasonboard.com" , "luis@debethencourt.com" , Srikanth Vemula , Anirudha Sarangi , "dmaengine@vger.kernel.org" , "devicetree@vger.kernel.org" , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , Punnaiah Choudary Kalluri Subject: RE: [PATCH v3 1/2] dmaengine: vdma: Add 64 bit addressing support to the driver Thread-Topic: [PATCH v3 1/2] dmaengine: vdma: Add 64 bit addressing support to the driver Thread-Index: AQHRhncBkxI0b+28CEqIePUiE7PKsJ9wRheAgAFOMFA= Date: Thu, 31 Mar 2016 06:58:11 +0000 Message-ID: References: <1458897378-3852-1-git-send-email-appanad@xilinx.com> <20160329185531.GA19517@rob-hp-laptop> In-Reply-To: <20160329185531.GA19517@rob-hp-laptop> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [172.23.94.217] 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-22228.005 X-TM-AS-User-Approved-Sender: Yes;Yes X-EOPAttributedMessage: 0 X-Forefront-Antispam-Report: CIP:149.199.60.83;IPV:NLI;CTRY:US;EFV:NLI;SFV:NSPM;SFS:(10009020)(6009001)(2980300002)(438002)(199003)(377454003)(13464003)(24454002)(164054003)(51914003)(189002)(189998001)(5008740100001)(76176999)(4001430100002)(19580395003)(47776003)(50466002)(55846006)(5004730100002)(19580405001)(106466001)(107886002)(46406003)(86362001)(106116001)(110136002)(87936001)(11100500001)(54356999)(5250100002)(33656002)(92566002)(6806005)(102836003)(2906002)(63266004)(50986999)(5003600100002)(3846002)(2900100001)(2920100001)(6116002)(23726003)(81166005)(1220700001)(586003)(2950100001)(1096002)(107986001);DIR:OUT;SFP:1101;SCL:1;SRVR:SN1NAM02HT173;H:xsj-pvapsmtpgw01;FPR:;SPF:Pass;MLV:sfv;A:1;MX:1;LANG:en; X-MS-Office365-Filtering-Correlation-Id: 5423141a-9314-487e-6a46-08d35931d50c X-Microsoft-Antispam: UriScan:;BCL:0;PCL:0;RULEID:(8251501002);SRVR:SN1NAM02HT173; X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; X-Exchange-Antispam-Report-CFA-Test: BCL:0;PCL:0;RULEID:(601004)(2401047)(13024025)(13015025)(13018025)(13023025)(8121501046)(13017025)(5005006)(10201501046)(3002001);SRVR:SN1NAM02HT173;BCL:0;PCL:0;RULEID:;SRVR:SN1NAM02HT173; X-Forefront-PRVS: 0898A6E028 X-OriginatorOrg: xilinx.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 31 Mar 2016 06:58:14.6377 (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: SN1NAM02HT173 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 4875 Lines: 115 Hi Rob, Thanks for the review... > -----Original Message----- > From: Rob Herring [mailto:robh@kernel.org] > Sent: Wednesday, March 30, 2016 12:26 AM > To: Appana Durga Kedareswara Rao > Cc: pawel.moll@arm.com; mark.rutland@arm.com; > ijc+devicetree@hellion.org.uk; galak@codeaurora.org; Michal Simek; Soren > Brinkmann; vinod.koul@intel.com; dan.j.williams@intel.com; Anurag Kumar > Vulisha; Appana Durga Kedareswara Rao; moritz.fischer@ettus.com; > laurent.pinchart@ideasonboard.com; luis@debethencourt.com; Srikanth > Vemula; Anirudha Sarangi; dmaengine@vger.kernel.org; > devicetree@vger.kernel.org; linux-kernel@vger.kernel.org; linux-arm- > kernel@lists.infradead.org > Subject: Re: [PATCH v3 1/2] dmaengine: vdma: Add 64 bit addressing support to > the driver > > On Fri, Mar 25, 2016 at 02:46:18PM +0530, Kedareswara rao Appana wrote: > > This VDMA is a soft ip, which can be programmed to support > > 32 bit addressing or greater than 32 bit addressing. > > > > When the VDMA ip is configured for 32 bit address space the buffer > > address is specified by a single register (0x5C for MM2S and 0xAC for > > S2MM channel). > > > > When the VDMA core is configured for an address space greater than 32 > > then each buffer 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 32 bits while 60h will specify > > the MSB 32 bits of the first start address. > > So we need to program two registers at a time. > > > > This patch adds the 64 bit addressing support to the vdma driver. > > > > Signed-off-by: Anurag Kumar Vulisha > > Signed-off-by: Kedareswara rao Appana > > --- > > Changes for v3: > > --> Improved commit message as suggested by vinod. > > --> removed unnecessary braces for single line if conditions. > > Changes for v2: > > ---> Added dma-ranges property in device tree as suggested by Arnd > Bergmann. > > ---> Added device tree property(xlnx,addrwidth) for an identification > > ---> of whether > > the IP block itself is configured in 64-bit or 32-bit mode as suggested by > > Laurent Pinchart. > > ---> Modified the driver code based on the xlnx,addrwidth. > > > > .../devicetree/bindings/dma/xilinx/xilinx_vdma.txt | 4 ++ > > drivers/dma/Kconfig | 2 +- > > drivers/dma/xilinx/xilinx_vdma.c | 73 +++++++++++++++++++--- > > 3 files changed, 70 insertions(+), 9 deletions(-) > > > > diff --git > > a/Documentation/devicetree/bindings/dma/xilinx/xilinx_vdma.txt > > b/Documentation/devicetree/bindings/dma/xilinx/xilinx_vdma.txt > > index e4c4d47..a86737c 100644 > > --- a/Documentation/devicetree/bindings/dma/xilinx/xilinx_vdma.txt > > +++ b/Documentation/devicetree/bindings/dma/xilinx/xilinx_vdma.txt > > @@ -8,6 +8,8 @@ Required properties: > > - #dma-cells: Should be <1>, see "dmas" property below > > - reg: Should contain VDMA registers location and length. > > - xlnx,num-fstores: Should be the number of framebuffers as configured in > h/w. > > +- xlnx,addrwidth: Should be the vdma addressing size in bits(ex: 32 bits). > > +- dma-ranges: Should be as the following . > > Doesn't the log2 of the dma-ranges size provide you with the address width? VDMA IP configurable for 32-bit or 64-bit addressing. In any of the configuration I mean if it is a 32-bit or 64-bit addressing there is a flexibility for the vdma to choose the Memory range supported by the VDMA... For example if vdma is configured for 40-bit addressing. Theoretically it can access memory up to 1TB if it is true we can get the Address width using log2 of the dma-ranges size as you mentioned above. But in real use case user won't map the entire memory He will map only the memory of his own choice... For example user mapped 2GB then dma-ranges property will be like below. dma-ranges = <0x00000000 0x00000000 0x80000000>; In this case log2 of the dma-ranges size won't give exact value for address width. That's why used separate h/w property for getting address width of the IP... Thanks, Kedar. > > > - dma-channel child node: Should have at least one channel and can have up > to > > two channels per device. This node specifies the properties of each > > DMA channel (see child node properties below). > > @@ -41,8 +43,10 @@ axi_vdma_0: axivdma@40030000 { > > compatible = "xlnx,axi-vdma-1.00.a"; > > #dma_cells = <1>; > > reg = < 0x40030000 0x10000 >; > > + dma-ranges = <0x00000000 0x00000000 0x40000000>; > > xlnx,num-fstores = <0x8>; > > xlnx,flush-fsync = <0x1>; > > + xlnx,addrwidth = <0x20>; > > dma-channel@40030000 { > > compatible = "xlnx,axi-vdma-mm2s-channel"; > > interrupts = < 0 54 4 >;