mmap from user space to already mapped IO address
Have a particular problem without an solution yet ( after much googling). Hope somebody could throw some light. Thanks.
We have a ARM11 based board supporting some custom ASIC. Have already ported linux kernel 2.6-23 onto it and able to boot and execute busybox on it.
The ASIC's register's are memory mapped ( say physical address 0x40000000)
We have particular requirement that the ASIC register space should be available to both kernel and user space. The best solution was to user 'ioremap' in kernel and 'mmap' in user space. This works but for the reason that the uart, timer and PIC are part of the ASIC register space and needs to be statically mapped ( iotable_init using map_desc structure providing the virtual address, page number, size and type to create the mapping in the page table (mmu)).
Once the ASIC register space is statically mapped in kernel, 'mmap' from user space fails.
We tried to implement a custom 'char' driver supporting the 'mmap' op. We tried to use remap_pfn_range for the given physical address from the user space. The call succeeds but when accessing the virtual address from user space it gives an 'bus error' or hangs sometimes.
Is there way to statically map IO addresses in kernel ( through iotable_init ) as well as use mmap to the same physical address from user space? ( Particularly on ARM11 based systems).
Had referred to:
Linux: mapping driver memory into user space
Linux device drivers 3rd Edition. O'reilly
Understanding the linux kernel 3rd Edition. O'reilly
Any help is highly appreciated.