[U-Boot] [PATCH v3 2/3] mpc5121: add support for PDM360NG board

Stefan Roese
2010-04-15T12:43:45Z

Hi Anatolij,

On Thursday 15 April 2010 14:32:14 Anatolij Gustschin wrote:
> > With this change, can we then not also get rid of manually defining
> > CONFIG_PDM360NG_BIG ? We should be able to auto-detect the
> > configuration from the actual RAM size now, right?
>
> But another configuration for 128 MB uses different values
> for DDR System Configuration Register and DDR Time Config[0-2]
> Registers. We still need this config option.

On some 4xx boards, we have a similar SDRAM size auto-detection, using
different SDRAM controller setup's. It's done by first configuring the
max. size config option and testing its memory size (get_ram_size()).
If this size doesn't match the configured one (mirroring), then the next
smaller config option is used. And so on. This way we can have one binary
image supporting multiple SDRAM configurations.

I suggest you take a look at arch/ppc/cpu/ppc4xx/sdram.c:

sdram_conf_t mb0cf[] = {
{(128 << 20), 13, 0x000A4001}, /* (0-128MB) Address Mode 3, 13x10(4) */
{(64 << 20), 13, 0x00084001}, /* (0-64MB) Address Mode 3, 13x9(4) */
{(32 << 20), 12, 0x00062001}, /* (0-32MB) Address Mode 2, 12x9(4) */
{(16 << 20), 12, 0x00046001}, /* (0-16MB) Address Mode 4, 12x8(4) */
{(4 << 20), 11, 0x00008001}, /* (0-4MB) Address Mode 5, 11x8(2) */
};

and initdram() where these struct is used.

Cheers,
Stefan

--
DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-0 Fax: (+49)-8142-66989-80 Email: office@denx.de