Subject: Re: Valid use of bus_dma(9)?
To: Matt Thomas <matt@3am-software.com>
From: Manuel Bouyer <bouyer@antioche.eu.org>
List: tech-kern
Date: 07/24/2004 13:46:15
On Fri, Jul 23, 2004 at 04:04:54PM -0700, Matt Thomas wrote:
> >System physical addresses != DMA addresses. At least, on many platforms
> >this is the case.
> >
> >The whole idea is that bus_dmamem_alloc() returns addresses that are
> >opaque to the driver. The driver MUST use bus_dmamap_load*() in order to
> >translate an address to one valid for use in DMA.
>
> which fpa does. It allocates a 8KB chunk of which only a small portion
> should be coherent. it try to map/load this small chunk as coherent which
> is what that code is trying to do.
The problem is that at this point, the values returned by bus_dmamem_alloc()
are opaque to the driver, and only for use by the other bus_dma funtions.
The values that fpa handles as memory adress and lenght may be some
internal values to bus_dma, and may not have the linearity property
that this driver assumes it has.
--
Manuel Bouyer <bouyer@antioche.eu.org>
NetBSD: 26 ans d'experience feront toujours la difference
--