From: Scott Wood Date: Fri, 11 Apr 2014 17:43:11 -0500 Subject: [U-Boot] [PATCH v7] nand/denali: Adding Denali NAND driver support In-Reply-To: <20140404173118.D724.AA925319@jp.panasonic.com> References: <20140328182101.DB51.AA925319@jp.panasonic.com> <1396018720.2560.1.camel@clsee-VirtualBox.altera.com> <20140404173118.D724.AA925319@jp.panasonic.com> Message-ID: <1397256191.20280.171.camel@snotra.buserror.net> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On Fri, 2014-04-04 at 17:31 +0900, Masahiro Yamada wrote: > So my question is, what should we do to improve the performance? > Is it a bad idea to use DMA? > > > The sequence of page_read in this patch is like this: > (1) Cache flush of DMA buffer area > (2) DMA transfer from NAND device to DMA buffer > (3) memcpy() from DMA buffer to destination memory > > In Linux Kernel, I guess there is DMA sync process between (2) and (3). > But we don't have DMA API in U-Boot. flush_dcache_range() plays the same role as the Linux DMA sync. > If we do not use DMA, the read sequence is like this > (1) Copy data directly from NAND register to destination memory > > According to my benchmark, this is about twice faster. Have you measured the performance in the Linux driver? > Scott, do you have any advice? Do some profiling to see where the time is spent. I don't know how easy it is to do automated profiling of U-Boot, but you could add some manual instrumentation of the driver to measure min/avg/max/total time taken over various intervals. -Scott