All of lore.kernel.org
 help / color / mirror / Atom feed
From: Scott Wood <scottwood@freescale.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH v2] [RFC] memsize.c: adapt get_ram_size() for address spaces >32 bit
Date: Thu, 27 May 2010 15:00:03 -0500	[thread overview]
Message-ID: <4BFECF43.40600@freescale.com> (raw)
In-Reply-To: <20100527195715.CD042EAC238@gemini.denx.de>

On 05/27/2010 02:57 PM, Wolfgang Denk wrote:
> Dear Scott Wood,
>
> In message<20100527194618.GC5915@schlenkerla.am.freescale.net>  you wrote:
>> On Thu, May 27, 2010 at 08:16:28PM +0200, Wolfgang Denk wrote:
>>> get_ram_size() used to use "long" data types for addresses and data,
>>> which limited it to systems with less than 4 GiB memory. As more and
>>> more systems are coming up with bigger memory resources, we adapt the
>>> code to use phys_addr_t / phys_size_t data types instead.
>>
>> This cannot work as is.  The only systems where this makes a difference are
>> where physical addresses are larger than virtual pointers -- but you try to
>> shove the 64-bit physical offset into a 32-bit pointer.
>>
>> You need to create temporary mappings, if you really want to do this.
>
> ?
>
> Isn't phys_addr_t assumed to be the right data type to hold a
> physical address?

Yes.  But you can't dereference a physical address directly.

When you do "addr = base + cnt", you're throwing away the upper 32 bits.

"phys_addr_t *" is not a 64-bit pointer, it is a 32-bit pointer to a 
64-bit quantity.

-Scott

  reply	other threads:[~2010-05-27 20:00 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-05-27 18:11 [U-Boot] [PATCH] [RFC] memsize.c: adapt get_ram_size() for address spaces >32 bit Wolfgang Denk
2010-05-27 18:16 ` [U-Boot] [PATCH v2] " Wolfgang Denk
2010-05-27 19:46   ` Scott Wood
2010-05-27 19:57     ` Wolfgang Denk
2010-05-27 20:00       ` Scott Wood [this message]
2010-05-27 20:53         ` Wolfgang Denk
2010-05-27 18:23 ` [U-Boot] [PATCH] " Timur Tabi
2010-05-27 19:44   ` Wolfgang Denk
2010-05-27 20:01     ` Timur Tabi
2010-05-27 20:57       ` Wolfgang Denk
2010-05-27 21:05         ` Timur Tabi
2010-05-27 21:13           ` Wolfgang Denk
2010-05-27 21:10         ` Kumar Gala
2010-05-27 21:16           ` Wolfgang Denk
2010-05-27 20:06     ` Scott Wood
2010-05-27 21:06       ` Wolfgang Denk
2010-05-27 18:59 ` Wolfgang Wegner
2010-05-27 19:49   ` Wolfgang Denk

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=4BFECF43.40600@freescale.com \
    --to=scottwood@freescale.com \
    --cc=u-boot@lists.denx.de \
    /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.