[U-Boot] [PATCH 21/31] mpc83xx, kmeter1: autodetect size of DDR II Ram.

Kim Phillips kim.phillips at freescale.com
Thu Jan 29 03:10:36 CET 2009


On Wed, 28 Jan 2009 10:40:20 +0100
Heiko Schocher <hs at denx.de> wrote:

> Signed-off-by: Heiko Schocher <hs at denx.de>
> ---

please be more verbose in your commit messages.

> @@ -135,6 +128,24 @@ int fixed_sdram(void)
>  	udelay (200);
>  	im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
> 
> +	msize = CONFIG_SYS_DDR_SIZE;
> +	msize *= 1024;
> +	msize *= 1024;

can we make these 3 lines one line?

> +	disable_addr_trans ();
> +	msize = get_ram_size (CONFIG_SYS_DDR_BASE, msize);
> +	enable_addr_trans ();
> +	msize /= (1024 * 1024);
> +	if (CONFIG_SYS_DDR_SIZE != msize) {
> +		for (ddr_size = msize << 20, ddr_size_log2 = 0;
> +		     (ddr_size > 1); ddr_size = ddr_size >> 1, ddr_size_log2++) {
> +			if (ddr_size & 1)
> +				return -1;
> +		}

I realize they existed before, but the braces are not necessary here.

Kim


More information about the U-Boot mailing list