public inbox for linuxppc-dev@ozlabs.org 
 help / color / mirror / Atom feed
From: Arnd Bergmann <arnd@arndb•de>
To: linuxppc-embedded@ozlabs•org
Cc: vb <vb@vsbe•com>, Roland Dreier <rdreier@cisco•com>
Subject: Re: mmap and ppc460gt
Date: Wed, 27 Aug 2008 10:13:18 +0200	[thread overview]
Message-ID: <200808271013.18659.arnd@arndb.de> (raw)
In-Reply-To: <ada3akri1i5.fsf@cisco.com>

On Wednesday 27 August 2008, Roland Dreier wrote:
> =A0> I don't seem to be able to port this to ppc460gt: on this architectu=
re
> =A0> the PCI register space can be mapped only to 36 bit address ranges
> =A0> with nonzero top nibbles. But mmap() =A0(at least the one I have in
> =A0> 2.6.25) =A0accepts only 32 bit values for addresses, hence there is =
no
> =A0> way to map PCI space into user space.
>=20
> In the past I've been able to use mmap64() on ppc440 to get at 36-bit
> addresses. =A0As far as I know this should still work.

Right, this is supposed to work. If it doesn't, report it as a bug.

> Also you should be able to get at the BAR of a PCI device by using
> mmap() on a resource file under /sys/devices, eg something like
> /sys/devices/pci0000:00/0000:00:04.0/0000:0b:00.0/resource0
> (where the bus numbers obviously depend on your system and the resource
> number depends on what BAR your device has registers in)

This should work as well.

The best way to do it however would be to implement a UIO device driver
for your device, see e.g. http://lwn.net/Articles/232575/.

That gives you proper control over the permissions and lets you handle
interrupts and other things as well.

	Arnd <><

  reply	other threads:[~2008-08-27  8:13 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-08-27  2:26 mmap and ppc460gt vb
2008-08-27  3:24 ` Roland Dreier
2008-08-27  8:13   ` Arnd Bergmann [this message]
2008-08-27 23:13     ` vb
2008-08-28  0:11       ` Roland Dreier
2008-08-28  0:21         ` vb
2008-08-28  3:12         ` Roland Dreier
2008-08-28  3:47           ` vb
2008-08-28 10:36             ` Josh Boyer
2008-08-30  3:39           ` [PATCH] powerpc: Avoid integer overflow in page_is_ram() Roland Dreier
2008-09-01  0:27             ` Benjamin Herrenschmidt

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=200808271013.18659.arnd@arndb.de \
    --to=arnd@arndb$(echo .)de \
    --cc=linuxppc-embedded@ozlabs$(echo .)org \
    --cc=rdreier@cisco$(echo .)com \
    --cc=vb@vsbe$(echo .)com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html
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