Re: troubles mmaping PCI device on Au1550

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

 




On Apr 10, 2005, at 6:16 PM, Clem Taylor wrote:

My driver code has something like:
remap_pfn_range ( vma, vma->vm_start,
     ( pci_resource_start ( pdev, BAR ) >> PAGE_SHIFT ) + vma->pgoff,
     vma->vm_end - vma->vm_start, vma->vm_page_prot );

The Au15xx uses 36-bit addressing for the PCI (among other) physical addresses. The mmap() in your driver is the right thing, but you need to use io_remap_page_range() where the 2nd parameter is a phys_t. Your offset should be a phys_t type, and pci_resource_start() also returns a phys_t.

I tried a similar test using /dev/mem and the address the linear
framebuffer on my desktop machine (as returned by lspci).

You can't use /dev/mem for this on Au15xx because it doesn't have provisions for more than 32-bit addresses. Be careful with lspci, as it only returns the 32-bit BAR, not the 36-bit Au15xx address nor the 32-bit ioremapped address.

Thanks.


-- Dan



[Index of Archives]     [Linux MIPS Home]     [LKML Archive]     [Linux ARM Kernel]     [Linux ARM]     [Linux]     [Git]     [Yosemite News]     [Linux SCSI]     [Linux Hams]

  Powered by Linux