
Dear Wolfgang Denk,
as the systems I was working on always had far less memory, I can not comment much on the extension you propose here, but as Timur Tabi's comments seem to go in a direction which could lead to a bigger overhaul/discussion, I would like to add 2C from my point of view on coldfire...
- MCF53xx/MCF5445x both simply lock up if non-existent memory is accessed. So if the SDRAM controller is set up for a too big size of memory, get_ram_size() will fail. I assume this applies to most coldfire devices. - How about systems/configurations using CONFIG_MONITOR_IS_IN_RAM? I could not see special precautions for this, but in case an address to be tested by accident is occupied by a part of get_ram_size() itself, the result would be ... interesting. ;-) Of course, this is a rare thing (both using CONFIG_MONITOR_IS_IN_RAM and the chance to have get_ram_size() at such a crucial location), but still I fear it might have an impact if get_ram_size() gets "mandatory". - at least in the coldfire world, CONFIG_SYS_SDRAM_SIZE is quite often used for cache setup in the assembly code. This contradicts changing/setting the SDRAM size at runtime...
(Please don't see this as a vote against using and promoting get_ram_size() - I just see some problems that I am not aware of an easy solution for.)
Best regards, Wolfgang Wegner