From: Wolfgang Denk Date: Mon, 15 Sep 2008 14:30:43 +0200 Subject: [U-Boot] [PATCH] added autodetect of sdram size and nr of banks for ixp In-Reply-To: <4CD35CD1F8085945B597F80EEC8942130192DEC8@exc01.bk.prodrive.nl> References: <4CD35CD1F8085945B597F80EEC8942130192DEB0@exc01.bk.prodrive.nl> <20080913121215.B49EA24927@gemini.denx.de> <4CD35CD1F8085945B597F80EEC8942130192DEC8@exc01.bk.prodrive.nl> Message-ID: <20080915123043.C1395248C6@gemini.denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Dear "Martijn de Gouw", In message <4CD35CD1F8085945B597F80EEC8942130192DEC8@exc01.bk.prodrive.nl> you wrote: > > > > + > > > +#ifdef CFG_SDR_CONFIG > > > mov r1, #CFG_SDR_CONFIG > > > + mov r9, #0xff > > > +#else > > > + mov r1, #0x1d /* 256 MB, two banks of 128 MB */ > > > + mov r9, #0 > > > +#endif > > > > I don't want such $ifdef's in global code. Why do you thinkthat 2 x > > 128 MB would be a default configuration for all IXP based boards? > > When CFG_SDR_CONFIG is defined, it holds the memory size, which is set > in the config.h > When this value is not set, autodetection is assumed. > Setting up the board as 2 x 128Mb is used for the autodetection. You could set CFG_SDR_CONFIG to that value in your board config file and avoid the #ifdef ? > get_ram_size will nog set the memory controller to the correct size. No, it does not set the size, it auto-detects the size that can be seen for a specific configuration of the memory controller. > The ixp can not run C code when memory is not initialized. Has it not enough on-chip memory or caches for that like other processors? 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 Anarchy may not be the best form of government, but it's better than no government at all.