All of lore.kernel.org
 help / color / mirror / Atom feed
From: David Hawkins <dwh@ovro.caltech.edu>
To: Phil.Nitschke@avalon.com.au
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Memory mapping PCI memory region to user space
Date: Mon, 27 Mar 2006 08:05:25 -0800	[thread overview]
Message-ID: <44280D45.7090103@ovro.caltech.edu> (raw)
In-Reply-To: <1143446542.24304.8.camel@lamorak.int.avalon.com.au>



> I have some custom hardware that appears on the PCI bus as follows:
> 
> bash-3.00# lspci -vv
> 00:01.0 Class 0680: 1172:0004 (rev 01)
> 	Control: I/O+ Mem+ BusMaster+ SpecCycle- MemWINV- VGASnoop- ParErr-
> Stepping- SERR- FastB2B-
> 	Status: Cap- 66Mhz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort+
> <TAbort- <MAbort- >SERR- <PERR-
> 	Latency: 128, Cache Line Size 08
> 	Interrupt: pin A routed to IRQ 71
> 	Region 0: Memory at 000000009ffff000 (32-bit, non-prefetchable)
> [size=4K]
> 	Region 1: Memory at 000000009fc00000 (32-bit, non-prefetchable)
> [size=2M]
> 
> But when I try to access resource0 or resource1, I get a read error.
> What characteristic of the device or driver determines whether it will
> allow mmap-ing?
> 
> (I've written the driver for this device myself.)
> 

Hi Phil,

The board tells you you have 4K of non-prefetchable memory in two BAR
regions. Which is what you've already determined I am sure.

Try building an insmodding the pci_io driver I posted, it'll pick
up the two BAR regions and allow you to access them, and you can
add more debugging comments to that code fairly easily.

If things don't work then, you probably have a hardware error and
would benefit from looking at the PCI bus with a logic analyzer to
see if the device is generating an error.

http://www.ovro.caltech.edu/~dwh/pci_io.tar.gz

Regards,
Dave

  reply	other threads:[~2006-03-27 16:03 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2006-03-23 14:21 Memory mapping PCI memory region to user space Wyse, Chris
2006-03-23 15:44 ` Kumar Gala
2006-03-23 17:12   ` David Hawkins
2006-03-23 17:19     ` Kumar Gala
2006-03-23 17:43       ` Mark Chambers
2006-03-23 17:54         ` David Hawkins
2006-03-23 19:55           ` Mark Chambers
2006-03-23 20:26             ` David Hawkins
2006-03-23 17:46       ` David Hawkins
2006-03-27  8:02   ` Phil Nitschke
2006-03-27 16:05     ` David Hawkins [this message]
2006-03-28  4:21       ` Phil Nitschke
2006-03-28  4:55         ` David Hawkins
2006-03-28  6:44           ` Phil Nitschke
2006-03-28 16:35             ` David Hawkins
2006-03-27 16:18     ` Kumar Gala
2006-03-29  2:26       ` Phil Nitschke
2006-03-23 17:04 ` David Hawkins
  -- strict thread matches above, loose matches on Subject: below --
2006-03-23 19:52 Wyse, Chris
2006-03-23 20:01 ` Kumar Gala

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=44280D45.7090103@ovro.caltech.edu \
    --to=dwh@ovro.caltech.edu \
    --cc=Phil.Nitschke@avalon.com.au \
    --cc=linuxppc-embedded@ozlabs.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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.