From: Clem Taylor <clem.taylor@gmail.com>
To: linux-mips@linux-mips.org
Subject: troubles mmaping PCI device on Au1550
Date: Sun, 10 Apr 2005 18:16:17 -0400 [thread overview]
Message-ID: <ecb4efd10504101516482a9785@mail.gmail.com> (raw)
I'm working on a Au1550 driver for a PCI based co-processor. The
processor exports a 4Mbyte BAR that I want to mmap() into user space.
From inside the driver I can read and write to the BAR using an
address from ioremap_nocache(). I can read location with known values
and get back the expected data and with JTAG on the co-processor I saw
that data written from the 1550 really makes it into the PCI device.
From userspace with the llseek/read interface I can read the data well
known data and the data written by the driver.
However, I'm not having any luck getting mmap() to work. I must just
be mapping the wrong address... I tried a bunch of different
combinations of addresses, but so far I haven't had any luck getting
the mmap() to work.
The mmap() handler calls remap_pfn_range with a physical address
returned from pci_resource_start().
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 );
vma->pgoff is zero, so this should map starting at the beginning of
the BAR. From user space, the data at the mmap()ed address isn't what
I was expecting.
For a sanity check, I tried using /dev/mem to mmap the PCI address as
returned by lspci. This seems to return similar, but not identical
data as my device driver. But it isn't what I was expecting.
I tried a similar test using /dev/mem and the address the linear
framebuffer on my desktop machine (as returned by lspci). The mapped
data matches the pixels on the first line (as reported by xmag).
Has anyone tried something like this on the Alchemy processors with a
recent kernel?
Many thanks,
Clem Taylor
WARNING: multiple messages have this Message-ID (diff)
From: Clem Taylor <clem.taylor@gmail.com>
To: linux-mips@linux-mips.org
Subject: troubles mmaping PCI device on Au1550
Date: Sun, 10 Apr 2005 18:16:17 -0400 [thread overview]
Message-ID: <ecb4efd10504101516482a9785@mail.gmail.com> (raw)
Message-ID: <20050410221617.oBdES3jTRdgnCkmKNAhLW2kCvJSszfs8AOcmXn2zbdI@z> (raw)
I'm working on a Au1550 driver for a PCI based co-processor. The
processor exports a 4Mbyte BAR that I want to mmap() into user space.
next reply other threads:[~2005-04-10 22:16 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2005-04-10 22:16 Clem Taylor [this message]
2005-04-10 22:16 ` troubles mmaping PCI device on Au1550 Clem Taylor
2005-04-12 15:22 ` Dan Malek
2005-04-12 20:56 ` Clem Taylor
[not found] <20050410230001Z8226002-1340+5508@linux-mips.org>
2005-04-11 4:08 ` Alexey Shinkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=ecb4efd10504101516482a9785@mail.gmail.com \
--to=clem.taylor@gmail.com \
--cc=linux-mips@linux-mips.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox