[U-Boot] [PATCH] [RFC] memsize.c: adapt get_ram_size() for address spaces >32 bit

Wolfgang Denk wd at denx.de
Thu May 27 22:57:55 CEST 2010


Dear Timur Tabi,

In message <4BFECF82.60901 at freescale.com> you wrote:
> 
> Scott pointed out that writing/reading memory to determine how much memory
> actually exists is dangerous.  I'm not convinced that I should be using
> get_ram_size().  I still believe that I shouldn't.

And I point out that we have been doing this for a decade on tens of
different board configurations with millions of devices in the field.

> I have not been able to find any other PowerPC system in U-boot that
> supports more memory than is mapped.  If you know of one, please tell me.

The systems I know are the opposite - initially they map more memory
than they support, then they determine the real size, then they
adjust the mapping to the real size.

> My point is that sizeof(phys_addr_t) has got nothing to do with the size of
> the read/write operation, so I think it's wrong on all platforms.

Actually it will only be wrong on systems where phys_addr_t != ulong,
but you are right.

Best regards,

Wolfgang Denk

-- 
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
"The two most common things in the universe are hydrogen  and  stupi-
dity."


More information about the U-Boot mailing list