October 2017
Intermediate to advanced
586 pages
14h 8m
English
The remap_pfn_range() function discussed does not apply anymore when it comes to mapping I/O memory to user space. In this case, the appropriate function is io_remap_pfn_range(), whose parameters are the same. The only thing that changes is where the PFN comes from. Its prototype looks like:
int io_remap_page_range(struct vm_area_struct *vma,
unsigned long virt_addr,
unsigned long phys_addr,
unsigned long size, pgprot_t prot);
There is no need to use ioremap() when attempting to map I/O memory to user space. ioremap() is intended for kernel purposes (mapping I/O memory into the kernel address space), whereas io_remap_pfn_range is for user space purposes.
Just pass your real physical I/O address (downshifted by