From mboxrd@z Thu Jan 1 00:00:00 1970 From: Michael Roth Date: Thu, 05 Feb 2009 15:07:31 +0100 Subject: [U-Boot] [PATCH 2/2] Stamp9261 board support In-Reply-To: <20090204160554.118A08322908@gemini.denx.de> References: <1233757799-1165-1-git-send-email-mroth@nessie.de> <1233757799-1165-2-git-send-email-mroth@nessie.de> <1233757799-1165-3-git-send-email-mroth@nessie.de> <20090204160554.118A08322908@gemini.denx.de> Message-ID: <498AF2A3.2000004@nessie.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de Wolfgang Denk schrieb: >> +int dram_init(void) >> +{ >> + gd->bd->bi_dram[0].start = PHYS_SDRAM; >> + gd->bd->bi_dram[0].size = PHYS_SDRAM_SIZE; >> + return 0; >> +} > > You should auto-size the RAM instead of hardcoding it. [...] >> +#define CONFIG_NR_DRAM_BANKS 1 >> +#define PHYS_SDRAM 0x20000000 >> +#define PHYS_SDRAM_SIZE 0x04000000 /* 64 megs */ > > Please use get_ram_size() instead. On this board U-Boot runs from the same memory which get_ram_size() should probe for its actual size. Currently, as far as I can see, the implementation of get_ram_size() don't hit itself (by fortune?) while probing. But maybe the algorithm will change in some feature. Additionally the fixed RAM size is (implicit) needed in several other places for example CONFIG_SYS_MEMTEST_END and lowlevel initialization of SDRAM, relocation to TEXT_BASE and so on. Normally autoconf is a good thing (TM) but in this case I'm not sure. Michael Roth