
Dear Timur Tabi,
In message 4BFEDE90.6070802@freescale.com you wrote:
Wolfgang Denk wrote:
The systems I know are the opposite - initially they map more memory than they support, then they determine the real size, then they adjust the mapping to the real size.
But we don't ever do that, at least not on systems that use SPD. We query the DIMMs directly via SPD and calculate how much memory is in the system.
Most of our boards support both SPD and "fixed" DDR programming. In fixed mode, the actual values to be programmed in the controller are hard-coded in the board header file, like this:
When you have SPD information you can of course use this for size information. In the "fixed" case you get a max size from the #defines.
But on the P1022DS, I don't support fixed DDR mode. Only SPD is supported, so I have no idea at compile-time how much memory is in the system. That's why I don't think calling get_ram_size() is appropriate for the P1022DS board.
You do not need to know this at compile time - it is sufficient to know it when calling get_ram_size().
Best regards,
Wolfgang Denk