From: Wolfgang Denk Date: Thu, 30 Sep 2010 19:29:35 +0200 Subject: [U-Boot] [PATCH] Kirkwood: dram_init is moved to dram.c In-Reply-To: <1285869240-17251-1-git-send-email-prafulla@marvell.com> References: <1285869240-17251-1-git-send-email-prafulla@marvell.com> Message-ID: <20100930172935.BA5F0134F56@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 Prafulla Wadaskar, In message <1285869240-17251-1-git-send-email-prafulla@marvell.com> you wrote: > For all Kirkwood boards so far dram_init function is duplicated > dram_init function is moved to dram.c and relevant code from all > board specific files removed > > If any board needs specific dram init handling than standard one, > then, a macro CONFIG_SYS_BOARD_DRAM_INIT should be defined in > board config header file and the dram_init function can be put > in board specific source file > For ex. keymile boards Thanks, I really appreciate this patch, but I have a minor request for change: > +#if !defined(CONFIG_SYS_ARM_WITHOUT_RELOC) > + gd->ram_size = 0; > +#endif > + for (i = 0; i < CONFIG_NR_DRAM_BANKS; i++) { > + gd->bd->bi_dram[i].start = kw_sdram_bar(i); > + gd->bd->bi_dram[i].size = kw_sdram_bs(i); > +#if !defined(CONFIG_SYS_ARM_WITHOUT_RELOC) > + gd->ram_size += gd->bd->bi_dram[i].size; > +#endif When you touch this board now and make it work with CONFIG_SYS_ARM_WITHOUT_RELOC not defined, we should also drop all references to CONFIG_SYS_ARM_WITHOUT_RELOC from the code to make it obvious that this board has been adapted. Thanks. 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 Anyone who doesn't believe in miracles is not a realist. - David Ben Gurion