On Monday 25 April 2005 02:43 am, Pierre TARDY wrote:
> Hi all,
>
> Koen Kooi wrote:
> >
> > DMA is almost always worthwhile, but I remember Pierre saying that it
> > won't matter much. He wrote a dma and a non-dma driver for samcop a
> > while ago for Freescale. He couldn't publish the sources, but he could
> > say dma was slightly faster.
>
> Hmm, I can't say DMA is faster, AFAIK, it is often the case. Here, it
> will certainly be slower. The fact is that you have to setup the hamcop
> dma first to transfer a little amount of memory to samcop's internal
> sram, then you have to setup the PXA dma to transfer from hamcop sram to
> PXA sdram. If you had done this with PXA polling, you would have done
> only one memory access and would not have been delayed by interrupt
> latencies.
> Then, the fact is that in polling mode, the PXA wont have enough time to
> play the mp3, cause it will be waiting for SDIO transfer all the time..
>
> I only know the samcop from h5400, but I can say you wont gain much by
> using DMA from sram to sdram. It is always a little transfer (the sram
> is not very big, and shared with USB). I ve done some bench with a quite
> slow sdcard and all the time was spend from sdhc to sram, the other
> transfer is negligible. Then setting up dma transfer from sram to sdram
> will add you several synchronisations problem ( you set up PXA dma,
> while hamcop dma is transfering the next block, etc..)
> I ve always been disapointed by sdcards performances, but I had even
> less perfs with WinCE, so..
Pierre,
Thank you for that information; it's very helpful. I won't pursue PXA DMA from
from SRAM.
What transfer rates are you able to get?
I had another idea about trying to use only PXA DMA. (Caution: I'm about to
get in over my head here.) HAMCOP (and probably SAMCOP) are not busmasters,
but they can do flow-through DMA. Apparently, the HAMCOP DMA controller has
its own DREQ/DACK that connects to its DMA sources (e.g. SD), but no DREQ
that connects directly to PXA. Instead, HAMCOP's interrupt controller
generates DREQ to PXA when the DMA interrupt is asserted (and the DREQ stuff
is properly configured). But DMA interrupts only happen when CURR_TC goes to
0, so if we wanted PXA DMA to get the data directly from SDIDATA, we'd have
to set up a small dummy HAMCOP DMA transfer just to get it to trigger an
interrupt, which would in turn assert DREQ to the PXA. Then PXA DMA would
start copying the data directly from SDIDATA.
Here's how I think it is all connected, judging from 03-int.pdf, 04-dma.pdf,
and the PXA 255 documentation:
DREQ
PXA <--------------- HAMCOP interrupt controller
^
|
|
HAMCOP
DMA <----- SD DREQ
-----> SD DACK
But I don't know if this would work, or whether it would be worth the effort.
It definitely is messy.
Matt
Received on Mon Apr 25 2005 - 12:27:15 EDT
This archive was generated by hypermail 2.2.0 : Mon Jul 25 2005 - 17:20:11 EDT