linuxppc-dev.lists.ozlabs.org archive mirror
 help / color / mirror / Atom feed
From: Matt Porter <mporter@kernel.crashing.org>
To: Neil Wilson <NWilson@Airspan.com>
Cc: linuxppc-embedded@ozlabs.org
Subject: Re: mmap64/open64/pread etc on 440GX
Date: Wed, 10 Nov 2004 08:13:27 -0700	[thread overview]
Message-ID: <20041110081327.A20590@home.com> (raw)
In-Reply-To: <3506EDCDEC47904CBE6FD2E1DEEA8984020CFB71@fs5.airspan.com>; from NWilson@Airspan.com on Wed, Nov 10, 2004 at 01:58:29PM -0000

On Wed, Nov 10, 2004 at 01:58:29PM -0000, Neil Wilson wrote:
> Hi,
> 
> I am trying to write a command line utility for our dev board
> (440GX,2.6.9 kernel) in order to provide support for our hardware
> engineers.  As a test I am trying to dump the first few bytes of the
> U-boot header.
> 
> I though that this would work but using /dev/mem gives me a bad address
> error on the pread64, using /dev/kmem only reads back 0 bytes.  Is there
> something blindingly obvious that I am missing for using 36bit addresses
> ? I believe the address is correct as I can see the boot code from
> within the kernel. Thanks.

No, it's not blindingly obvious at all.  First, mmaping /dev/mem is
a completely non-portable way to get at devices in userspace. It
has no guarantees of working across architectures and is broken
in many ways.

One way is on PPC440 where we have a 36-bit physical address space.
The /dev/mem implementation simply allows you to mmap an offset
within a 32-bit physical address space. On PPC440, this means you can't
get to any of the useful devices since they are all above 4GB.
In post 2.6.9, remap_pfn_range() helps a bit but there is still a
local (arch/ppc/) problem...

I'm working on some patches to fix 36-bit support for
io_remap_page_range() and to fix some problems with set_pte()
and friends on 36-bit platforms. This is the first bit necessary
to make this work at all in 2.6. I should be posting something
RSN. ;)

-Matt

  reply	other threads:[~2004-11-10 21:16 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-11-10 13:58 mmap64/open64/pread etc on 440GX Neil Wilson
2004-11-10 15:13 ` Matt Porter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2004-11-11  7:32 Neil Wilson
2004-11-11 10:57 ` Mark Powell

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=20041110081327.A20590@home.com \
    --to=mporter@kernel.crashing.org \
    --cc=NWilson@Airspan.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).