From: <a.o...@bl...> - 2004-04-16 20:28:52
|
On Wed, Apr 14, 2004 at 06:44:55PM +0200, JockyW wrote: > Thanks for your assistance Arthur, > > My simple dvd characterdevice works quite well. I rewrote the linux IRQ2 > handler to handle all dvd irqs (not just the cover int). Block device, you mean ;) > But now I stumbled on a memory problem. My devicedriver uses a read buffer > which is a 2048 bytes static char array. When I print the address, it sits > on 0xC200EB24. That address doesn't work when I pass it to the DMA Memory > Address Register. It is a strange address, because in "yagcd" > http://www.gc-linux.org/docs/yagcd/chap4.html#sec4 it is written that > uncached logical ram addresses run from 0xc0000000-0xc17fffff > > What kind of address translation should I apply to get the dma to work? You want to use memory allocated from a dma pool for that instead. Create one with: struct dma_pool *dma_pool_create(const char *name, struct device *dev, size_t size, size_t align, size_t alloc); Allocate memory from it with: void *dma_pool_alloc(struct dma_pool *pool, int gfp_flags, dma_addr_t *dma_handle); Free alloc'd memory with dma_pool_free(), destroy the pool with dma_pool_destroy(). See drivers/base/dmapool.c and Documentation/DMA-API.txt for the gory details. Arthur |