From mboxrd@z Thu Jan 1 00:00:00 1970 From: Troy Kisky Date: Mon, 08 Oct 2012 14:35:24 -0700 Subject: [U-Boot] [PATCH V3 25/32] imx-common: cpu: add imx_ddr_size In-Reply-To: <5072CFD0.3030203@denx.de> References: <1348281558-19520-1-git-send-email-troy.kisky@boundarydevices.com> <1349315254-21151-1-git-send-email-troy.kisky@boundarydevices.com> <1349315254-21151-26-git-send-email-troy.kisky@boundarydevices.com> <5072CFD0.3030203@denx.de> Message-ID: <5073471C.2060900@boundarydevices.com> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 >> > 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