From cab19911ff54f5ffa3cd140a6871755140a768c8 Mon Sep 17 00:00:00 2001 From: David Hendricks Date: Fri, 27 Jun 2014 13:25:02 -0700 Subject: ipq806x: Fix casting in cbmem_top() so >=2GB can be used MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This explicitly casts CONFIG_SYS_SDRAM_BASE to an unsigned type so we don't get compilation errors when increasing CONFIG_DRAM_SIZE_MB. BUG=chrome-os-partner:29871 BRANCH=storm TEST=compilation no longer fails with DRAM_SIZE set to 1024 Original-Signed-off-by: David Hendricks Original-Change-Id: I9717c39d87682d43ec4e7a4042d9b559a1d7eedb Original-Reviewed-on: https://chromium-review.googlesource.com/206010 Original-Reviewed-by: Stefan Reinauer (cherry picked from commit 178db896346ae8cbc5ddec5373a83688f32c62ba) Signed-off-by: Marc Jones Change-Id: I68c11d398820684ad928bdfdd74f7a6885247333 Reviewed-on: http://review.coreboot.org/8059 Reviewed-by: Stefan Reinauer Reviewed-by: Kyösti Mälkki Tested-by: build bot (Jenkins) --- src/soc/qualcomm/ipq806x/cbmem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src/soc/qualcomm') diff --git a/src/soc/qualcomm/ipq806x/cbmem.c b/src/soc/qualcomm/ipq806x/cbmem.c index b175d6a543..ecb02e47e8 100644 --- a/src/soc/qualcomm/ipq806x/cbmem.c +++ b/src/soc/qualcomm/ipq806x/cbmem.c @@ -18,8 +18,10 @@ */ #include +#include void *cbmem_top(void) { - return (void *)(CONFIG_SYS_SDRAM_BASE + (CONFIG_DRAM_SIZE_MB << 20)); + return (void *)((uintptr_t)CONFIG_SYS_SDRAM_BASE + + (CONFIG_DRAM_SIZE_MB << 20)); } -- cgit v1.2.3