linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: David Hawkins <dwh@ovro.caltech.edu>
To: Kumar Gala <galak@kernel.crashing.org>
Cc: "Wyse, Chris" <chris.wyse@windriver.com>,
	+linux-embedded <linux-embedded@mail.wrs.com>,
	linuxppc-embedded@ozlabs.org
Subject: Re: Memory mapping PCI memory region to user space
Date: Thu, 23 Mar 2006 09:12:03 -0800	[thread overview]
Message-ID: <4422D6E3.1010407@ovro.caltech.edu> (raw)
In-Reply-To: <204E7000-3E88-4497-86C0-5AF786D72F75@kernel.crashing.org>



> Why don't use the mmap file exposed by sysfs so you dont have to  
> write your own code?
> 
> See Documentation/filesystems/sysfs-pci.txt.  But effectively down  
> under /sys/bus/pci/devices/[domain:bus:dev:func]/ you will get  
> resource[0..N-1] that corresponds to each BAR on the device.  This is  
> a mmap file to access that region.

Hi Kumar,

Most likely he didn't know about it, I didn't :)

When I was testing the Yosemite board as the host, I found
that I could set the endian flag on the mmapped page, which
then made the PCI device registers read as 32-bit quantities
read back with the same layout under both x86 and PPC
hosts.

So, if someone planned on using that 'feature', that would
be a reason for writing your own mmap() implementation.
I didn't see any option in the sysfs file for setting that
page flag (but, I didn't look around in other sysfs files).

Thanks for the pointer to the sysfs node!

Cheers
Dave

  reply	other threads:[~2006-03-23 17:10 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 [this message]
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
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=4422D6E3.1010407@ovro.caltech.edu \
    --to=dwh@ovro.caltech.edu \
    --cc=chris.wyse@windriver.com \
    --cc=galak@kernel.crashing.org \
    --cc=linux-embedded@mail.wrs.com \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).