linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Felix Radensky <felix@embedded-sol.com>
To: Ayman El-Khashab <AymanE@tanisys.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: Accessing PCI-E resources on 460EX
Date: Tue, 04 Nov 2008 00:53:21 +0200	[thread overview]
Message-ID: <490F80E1.1060909@embedded-sol.com> (raw)
In-Reply-To: <16691A8B34B5D9458EA3A1C37A11555A0137F852@tanisys-ex2.Tanisys.Local>

Ayman El-Khashab wrote:
>
> What works for me is using the mmap64 as in the following example to
> map the physical address, fd is the file descriptor for /dev/mem
>
> off64_t offset = static_cast<off64_t>(your physical address);
> void * const p =
> mmap64(0,256,PROT_WRITE|PROT_READ,MAP_SHARED,fd,offset);
>
> The only thing to note is that the address you pass should be aligned 
> to the page boundry even though some devices are not.
>   

Thanks, Ayman. I've tried that, but I'm still getting the same error.
My physical address is 0xe80000000, length is 0x100000.

Felix.

  reply	other threads:[~2008-11-03 22:53 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-11-03 21:09 Accessing PCI-E resources on 460EX Felix Radensky
2008-11-03 21:31 ` Ayman El-Khashab
2008-11-03 22:53   ` Felix Radensky [this message]
2008-11-04 18:40     ` Henry Bausley
2008-12-01  7:54 ` Benjamin Herrenschmidt
2008-12-01 11:08   ` Felix Radensky
2008-12-01 21:04     ` Benjamin Herrenschmidt
2008-12-02 22:38       ` Felix Radensky
2008-12-04  9:22         ` Felix Radensky

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=490F80E1.1060909@embedded-sol.com \
    --to=felix@embedded-sol.com \
    --cc=AymanE@tanisys.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).