From 5b211ac848071690303a8455b9b376e3ba2e6d3e Mon Sep 17 00:00:00 2001 From: Arne Welzel Date: Wed, 14 Nov 2012 22:43:42 +0100 Subject: [PATCH] libaudiodriver: allocate mem lower 16 MB and 64K aligned Righ now, the DMA controller will access some random memory below 16 MB, as the physical address returned by alloc_contig() is simply truncated when given to the DMA controller. Yes, it's bad... --- lib/libaudiodriver/audio_fw.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/libaudiodriver/audio_fw.c b/lib/libaudiodriver/audio_fw.c index 5b9ea47e3..58ce03a4f 100644 --- a/lib/libaudiodriver/audio_fw.c +++ b/lib/libaudiodriver/audio_fw.c @@ -929,7 +929,7 @@ static int init_buffers(sub_dev_t *sub_dev_ptr) /* allocate dma buffer space */ size= sub_dev_ptr->DmaSize + 64 * 1024; - base= alloc_contig(size, AC_ALIGN4K, &ph); + base= alloc_contig(size, AC_ALIGN64K|AC_LOWER16M, &ph); if (!base) { printf("%s: failed to allocate dma buffer for a channel\n", drv.DriverName); -- 2.44.0