> > What's the recommended function to call to go from a > > virtual -> physical address, but without doing a cache > > flush/invalidate? > > There is no generic function to do that in a driver since > no mainstream drivers in the kernel need to do it. Generally > you can rework the driver such that you cache the DMA address > as Dan suggested already. I don't know your exact usage, however, > you can allocate memory with dma_alloc_noncoherent() that is > cached on ppc32 NOT_CACHE_COHERENT prcoessors and stash the > dma_addr_t/void * for later use. The other way is to kmalloc and > dma_map_single() (stashing the same way) which is basically the > same thing.
For 8xx/82xx (and other PQ cpus) there is a lot of drivers liberally using __pa and __va to get physical and virtual adresses for structures and buffer descriptor tables for the CPM. What would the preferred way of handling both of these be? __pa() -> dma_map_single() ? __va() -> ?