[lkml]   [2007]   [Dec]   [12]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Subjectmmaping an IO port device

Can I implement mmap with an io port connected device on an x86 based CPU?


I've got a device driver which can be compiled for either x86 or ARM.
The driver provides an interface to an FPGA via either an IO port
(0x180) on the x86 or as a memory mapped SRAM-like device (0x30000000)
on the ARM.

To get myself an "address" for ioread calls I use:

FPGA_base = (u32) ioremap_nocache(FPGA_REG_IO_BASE, SZ_4K) for both CPU

FPGA_REG_IO_BASE is set to either 0x180 or 0x30000000 for x86 and ARM

I then call ioread16(FPGA_base + FPGA_register) for both x86 and ARM and
it all works perfectly. No problems there.

My problem is that I am now moving from ioctl calls to a mmap interface.
This isn't a problem with ARM as I can pass (0x30000000 >> PAGE_SHIFT)
to remap_pfn_range() in the .mmap fops function but I can't pass 0x180
because ... well, it's obvious.

Is there a trick?


This email has been scanned by the MessageLabs Email Security System.
For more information please visit

 \ /
  Last update: 2007-12-13 00:47    [W:0.026 / U:13.884 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site