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

Timur Tabi timur at freescale.com
Thu May 27 23:05:20 CEST 2010


Wolfgang Denk wrote:
> 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.

But we don't ever do that, at least not on systems that use SPD.  We query
the DIMMs directly via SPD and calculate how much memory is in the system.

Most of our boards support both SPD and "fixed" DDR programming.  In fixed
mode, the actual values to be programmed in the controller are hard-coded in
the board header file, like this:

#define CONFIG_SYS_DDR_CS0_BNDS		0x0000003F
#define CONFIG_SYS_DDR_CS1_BNDS		0x00000000
#define CONFIG_SYS_DDR_CS0_CONFIG	0x80014202
#define CONFIG_SYS_DDR_CS1_CONFIG	0x00000000
...

So in this case, as long as there's <= 2GB of DDR expected, then
get_ram_size() can work.

But on the P1022DS, I don't support fixed DDR mode.  Only SPD is supported,
so I have no idea at compile-time how much memory is in the system.  That's
why I don't think calling get_ram_size() is appropriate for the P1022DS board.

-- 
Timur Tabi
Linux kernel developer at Freescale


More information about the U-Boot mailing list