ltib
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Ltib] Re: 8544ds pcie mmap fails


From: Todd Blackmon
Subject: [Ltib] Re: 8544ds pcie mmap fails
Date: Wed, 15 Jul 2009 13:38:20 -0500

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


reply via email to

[Prev in Thread] Current Thread [Next in Thread]