Subject: Re: bus_dma on jazzio (Re: asc driver???)
To: Izumi Tsutsui <tsutsui@ceres.dti.ne.jp>
From: Shuichiro URATA <ur@a-r.org>
List: port-arc
Date: 02/22/2001 15:49:12
At Wed, 21 Feb 2001 20:10:15 +0900 (JST),
Izumi Tsutsui wrote:
> I take a look at current asc.c and bus_dma_jazz.c functions,
> and now have some questions:
> 
> 1) I guess jazzio devices use virtual address translated by
>    jazz_dmatlb_*() functions on DMA transfers. Is this right?

Yes.

> 2) Even in MD device drivers, should we use MI bus_dma(9) framework
>    to handle DMA rather than private DMA functions like jazz/dma.c?

I think so. DMA address space handling should concentrate to
bus_dma framework. DMA mapping functions in jazz/dma.c are for
backward compatibility. They will disappear when asc, fdc and sn
drivers are bus_dma'ified.

> 3) I think DMA buffer which has linear address in CPU VA space
>    can also be mapped to linear jazzio DMA VA space.
>    But current jazz_bus_dmamap_load() calls generic _bus_dmamap_load()
>    and jazz_bus_dmamap_alloc_sgmap(), so returned dm_segs[] would not
>    fit in one segment. Isn't it better to call jazz_dmatlp_map_va()
>    from jazz_bus_dmamap_load() directly like jazz/dma.c:picaDmaMap() ?

Hmm, yes.
One thing need to consider is that when BUS_DMA_NOWAIT is specified,
we can't guarantee to allocate linear DMA VA space.

---
Shuichiro URATA
ur@a-r.org