[U-Boot] [PATCH 2/2] Stamp9261 board support

Michael Roth mroth at nessie.de
Thu Feb 5 15:07:31 CET 2009


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



More information about the U-Boot mailing list