Hi
I find a problem about mmap function in ti816x board.
I writen a char driver. In order to improve the performance
I use the mmap function and this is the realization.
int pci_ep_mmap(struct file *file,struct vm_area_struct *vma)
{
unsigned int mem_start;
unsigned int mem_length;
int ret = -EAGAIN;
mem_length = vma->vm_end - vma->vm_start;
mem_start = (u32)vma->vm_pgoff << PAGE_SHIFT;
printk(KERN_INFO "Mapping %02x bytes from address %02x\n",
mem_length,mem_start);
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
vma->vm_flags |= VM_RESERVED | VM_IO;
ret = io_remap_pfn_range(vma, vma->vm_start, vma->vm_pgoff,
vma->vm_end - vma->vm_start,
vma->vm_page_prot);
return ret;
}
I used the kzalloc() to allocate the memory which would be mapped to the
userspace. In the userspace,The application use the memset() function
or memcpy() function to operate the return value of mmap.
To my disapporintment,It is too to slowly to believe it.
The speed of reading(I use the memcpy)
and writting(memset) the mapped memory is about 40MB/s.
So I changed to DM6467T and it's the same code with ti816x.
However ,This times the speed can get to 350MB/s.
And then I inplemented the same testing in x86 pc
and the performance is the best,which can get to 1.5GByte.
So I'm very surprised to this phenomenon.
As far as I know, The DM8168 is much better than DM6467T.
Who can help me to solve this problem.
My DM816x's PSP version is 04.04.00.01.
Quan