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...
This commit is contained in:
		
							parent
							
								
									f0d27a9570
								
							
						
					
					
						commit
						5b211ac848
					
				@ -929,7 +929,7 @@ static int init_buffers(sub_dev_t *sub_dev_ptr)
 | 
				
			|||||||
 | 
					
 | 
				
			||||||
	/* allocate dma buffer space */
 | 
						/* allocate dma buffer space */
 | 
				
			||||||
	size= sub_dev_ptr->DmaSize + 64 * 1024;
 | 
						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) {
 | 
						if (!base) {
 | 
				
			||||||
		printf("%s: failed to allocate dma buffer for a channel\n", 
 | 
							printf("%s: failed to allocate dma buffer for a channel\n", 
 | 
				
			||||||
				drv.DriverName);
 | 
									drv.DriverName);
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user