I never got a response, but found the answer by sheer dumb luck and
persistence. So I'm sending it for documentation purposes. My problem
was apparently that I needed to add the following line before the call
to remap_pfn_range.
vma->vm_page_prot = pgprot_noncached(vma->vm_page_prot);
Apparently it was doing something odd due to the cache operations. The
x86 port didn't have this issue, though.
Todd
On Wed, Jul 15, 2009 at 1:38 PM, Todd Blackmon <address@hidden
<mailto:address@hidden>> wrote:
I think I was completely confused on this before. I understand it
better now, but I still have an issue.
I have to communicate with a PCIe endpoint on an FPGA card using the
mpc8544ds. The example code that I have uses the mmap system call
to map the BAR0 addresses into the user space. The mmap succeeds,
but when the user code attempts to access the space (any size and it
is page/byte/word aligned), the program maxes out the CPU, and can
be stopped via ctrl-c.
The driver mmap handler function uses remap_pfn_range, which returns
0 so it seems to work. The call is:
sysErr = remap_pfn_range(vma,
(unsigned long)vma->vm_start,
(phys_start >> PAGE_SHIFT), // phys_start =
BAR0 address + (vma->vm_pgoff << PAGE_SHIFT)
mapSize,
// mapSize = vma->vm_end - vma->vm_start
vma->vm_page_prot);
This code works on ubuntu on an x86 architecture, but not on this
powerpc arch. Is there a fundamental reason (architectural
difference) that this would happen? I haven't been able to find
another PCI/PCIe driver that uses this mmaping method. Is that not
the *right* way to do it? Are there examples of the *right* way?
Thanks for all your help,
Todd Blackmon
------------------------------------------------------------------------
_______________________________________________
LTIB home page: http://ltib.org
Ltib mailing list
address@hidden
http://lists.nongnu.org/mailman/listinfo/ltib