10-30-2019 06:06 AM
I have seen other posts about accessing RAM through mmap(). Unfortunately those other post have not helped yet, which is why I am hoping for your help to access physical addresses within Linux through mmap()-calls. I am using the Ultrazed-EG from Avnet with a 4.19.0 Linux Kernel and Debian, and I am currently debugging both kernel module and user space application.
In the driver I am using kmalloc to get a memory area. using the following functions I am trying to map this area directly to userspace:
pfn = ( virt_to_phys( virt_addr_from_kmalloc ) >> PAGE_SHIFT ); remap_pfn_range(vma, vma->vm_start, pfn, vma->vm_end - vma->vm_start, vma->vm_page_prot)
But unfortunately this memory area always stays random and using a bare-metal program I have validated that the PL is working correctly. Does anyone have experience with this or a similar issue?
I would add further code, screenshots, etc. if required.
Furthermore I am using the write functions to write from userspace to kernel, and using iowrite32/ioread32 to write from kernel to PL which seems to work. I dont have that much experience with Embedded Linux which is why I would appreciate all tips I can get.
10-31-2019 01:20 AM