[U-Boot] [PATCH V3 25/32] imx-common: cpu: add imx_ddr_size

Troy Kisky troy.kisky at boundarydevices.com
Mon Oct 8 23:35:24 CEST 2012


On 10/8/2012 6:06 AM, Stefano Babic wrote:
> On 04/10/2012 03:47, Troy Kisky wrote:
>> Read memory setup registers to determine size
>> of available ram. This routine works for mx53/mx6x
>>
>> I need this because when mx6solo called get_ram_size
>> with a too large maximum size, the system hanged.
>>
>> Signed-off-by: Troy Kisky <troy.kisky at boundarydevices.com>
>>
> Hi Troy,
>
> I am interested to better understand why get_ram_size() does not work.
> It seems to me you discovered a bug in this function, and you circumvent
> it decoding the DRAM controller setup to get the RAM size.
>
> Because the max size is added to the start address in get_ram_size(), I
> have the feeling that this overwlow the long value, and maybe can be
> fixed swithcing to a "long long". With which parameters to
> get_ram_size() does your board hang ?
>
>
#define MMDC0_ARB_BASE_ADDR             0x10000000
#define PHYS_SDRAM                     MMDC0_ARB_BASE_ADDR
#define PHYS_SDRAM_SIZE                        (1u * 1024 * 1024 * 1024)

get_ram_size((void *)PHYS_SDRAM, PHYS_SDRAM_SIZE);

So, base + size = 0x50000000


More information about the U-Boot mailing list