On Dec 9, 2004, at 8:12 AM, Dmitriy Tochansky wrote:
Look ret = io_remap_page_range(start, offset, size,
from "offset" which I got from pci_resource_start (curdev, IOMEM0);
from first board where it eq 0x40000000 but on second it 0x40002040
Read the memory mapping docuemntation and understand the APIs.
All of the Linux mapping functions, whether mmap() from an application
or in the kernel are going to align on page boundaries.
The address of 0x40002040 is going to be aligned to a page boundary,
so you have to consider the offset into that page to the base of the
device, plus the register offset. The kernel mapping functions,
like remap_page_range, are going to force the alignment because
that is what we expect in the kernel. An mmap() with an unaligned
address will generate an error.