2009-09-10 22:24:17 How to alloc right DMA memory in BF548?
Ray Zheng (CHINA)
Message: 79758
Hi, everyone! our board uses bf548 and has two SAA7113 chips with 64M DRAM. I use kmalloc function to alloc memory for DMA, but the output video is mess, also I try to add a 'GFP_DMA' flag to be the second argument, but it doesn't make any imporment.
Through many experiments, I found it's right if the allocated memory is in the low address(less than 44M). but I don't know why, either I can't control if the address is in the low range. Your help will be appreciated greatly.
TranslateQuoteReplyEditDelete
2009-09-10 22:55:54 Re: How to alloc right DMA memory in BF548?
Yi Li (CHINA)
Message: 79761
You may use dma_alloc_coherent() to allocate memory for DMA (and you need to make sure you have configured CONFIG_DMA_UNCACHED_*M).
-Yi
QuoteReplyEditDelete
2009-09-10 23:04:06 Re: How to alloc right DMA memory in BF548?
Yi Li (CHINA)
Message: 79762
> I found it's right if the allocated memory is in the low address(less than 44M). but I don't know why,
There is only one memory zone - ZONE_DMA for blackfin,
If you don't want to use dma_alloc_coherent() to alloc from the uncached memory region, you may use dma_map_sg() or dma_map_single(). Please refer to arch/blackfin/kernel/dma-mapping.c for details.
QuoteReplyEditDelete
2009-09-14 21:50:55 Re: How to alloc right DMA memory in BF548?
Ray Zheng (CHINA)
Message: 79889
Actually I have tried this function, but it doesn't work. my DMA region is 2M as default.
TranslateQuoteReplyEditDelete
2009-09-14 22:38:54 Re: How to alloc right DMA memory in BF548?
Yi Li (CHINA)
Message: 79891
What is the details of your problem?