Hi,
I am experimenting with GPIO on the dm816x evm. I am currently trying to toggle an IO pin as fast as possible. I tried two things :
- Manipulate the GPIO control registers directly from the kernel space using ioremap.
- mmap() the GPIO control registers without caching and using them from user space.
Both methods work, but the second is about 3 times slower than the first (observed on oscilloscope). I think I disabled all caching mechanisms.
Of course I'd like to get the best of the two worlds : flexibility and ease of development from user space with the speed of kernel space.
Does anybody know why the mmap() could be slower than the ioremap() ?
I attached my code, if you want to run it, you may need to do the following
- Adjust the makefiles to fit your environment
- Use the bootarg "omap_mux=sc1_data.gp0_io24=0x8"
- After inserting the kernel module, type "mknod /dev/ti81xx-usmap c 63 0"