mirror of
https://github.com/hardkernel/linux.git
synced 2026-06-09 12:17:12 +09:00
NAND DRIVER: rk3368 support nand.
using __dma_map_area and virt_to_phys instead of rknand_dma_map_single
and rknand_dma_unmap_single.
dma_map_single need dev config dma ops struct and config dma_mask.
NAND flash driver has not this config and got the incorrect phy addr return by
dma_map_single.
This commit is contained in:
@@ -156,13 +156,22 @@ EXPORT_SYMBOL(rknand_dma_flush_dcache);
|
||||
|
||||
unsigned long rknand_dma_map_single(unsigned long ptr,int size,int dir)
|
||||
{
|
||||
#ifdef CONFIG_ARM64
|
||||
__dma_map_area((void*)ptr, size, dir);
|
||||
return ((unsigned long )virt_to_phys((void *)ptr));
|
||||
#else
|
||||
return dma_map_single(NULL,(void*)ptr,size, dir?DMA_TO_DEVICE:DMA_FROM_DEVICE);
|
||||
#endif
|
||||
}
|
||||
EXPORT_SYMBOL(rknand_dma_map_single);
|
||||
|
||||
void rknand_dma_unmap_single(unsigned long ptr,int size,int dir)
|
||||
{
|
||||
#ifdef CONFIG_ARM64
|
||||
__dma_unmap_area(phys_to_virt(ptr), size, dir);
|
||||
#else
|
||||
dma_unmap_single(NULL, (dma_addr_t)ptr,size, dir?DMA_TO_DEVICE:DMA_FROM_DEVICE);
|
||||
#endif
|
||||
}
|
||||
EXPORT_SYMBOL(rknand_dma_unmap_single);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user