From mboxrd@z Thu Jan 1 00:00:00 1970 From: Stefano Babic Date: Wed, 20 Aug 2014 12:22:24 +0200 Subject: [U-Boot] [PATCH 2/4] ARM: mx6: Prevent overflow in DRAM size detection In-Reply-To: <1407109631-5470-2-git-send-email-marex@denx.de> References: <1407109631-5470-1-git-send-email-marex@denx.de> <1407109631-5470-2-git-send-email-marex@denx.de> Message-ID: <53F476E0.2010505@denx.de> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de On 04/08/2014 01:47, Marek Vasut wrote: > The MX6 DRAM controller can be configured to handle 4GiB of DRAM, but > only 3840 MiB of that can be really used. In case the controller is > configured to operate a 4GiB module, the imx_ddr_size() function will > correctly compute that there is 4GiB of DRAM in the system. Firstly, > the return value is 32-bit, so the function will effectively return > zero. Secondly, the MX6 cannot address the full 4GiB, but only 3840MiB > of all that. Thus, clamp the returned size to 3840MiB in such case. > > Signed-off-by: Marek Vasut > --- Applied to u-boot-imx, thanks ! Best regards, Stefano Babic -- ===================================================================== DENX Software Engineering GmbH, MD: Wolfgang Denk & Detlev Zundel HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sbabic at denx.de =====================================================================