summaryrefslogtreecommitdiff
path: root/arch
diff options
context:
space:
mode:
authorMingkai Hu <Mingkai.hu@freescale.com>2013-04-12 15:56:28 +0800
committerAndy Fleming <afleming@freescale.com>2013-06-20 13:51:24 -0500
commit76d354f411696d6e19fd3156d18cb0359887ce8a (patch)
tree549152a7a89175058dacd37a5a697b67c2014451 /arch
parent7dd09b546d11722284d48ade55d0f800ee3cff75 (diff)
downloadu-boot-imx-76d354f411696d6e19fd3156d18cb0359887ce8a.zip
u-boot-imx-76d354f411696d6e19fd3156d18cb0359887ce8a.tar.gz
u-boot-imx-76d354f411696d6e19fd3156d18cb0359887ce8a.tar.bz2
powerpc/mpc85xx: explicit cast the SDRAM size to type phys_size_t
To avoid sign extension problem, use explicit casting to cast the SDRAM size to type phys_size_t, or else, if the SDRAM size is 2G(0x80000000), it will be extended to 0xffffffff80000000 when phys_size_t is type 'unsigned long long'. Signed-off-by: Mingkai Hu <Mingkai.Hu@freescale.com> Signed-off-by: Andy Fleming <afleming@freescale.com>
Diffstat (limited to 'arch')
-rw-r--r--arch/powerpc/cpu/mpc85xx/cpu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/powerpc/cpu/mpc85xx/cpu.c b/arch/powerpc/cpu/mpc85xx/cpu.c
index 6ce483e..128daba 100644
--- a/arch/powerpc/cpu/mpc85xx/cpu.c
+++ b/arch/powerpc/cpu/mpc85xx/cpu.c
@@ -341,7 +341,7 @@ phys_size_t initdram(int board_type)
#if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD)
return fsl_ddr_sdram_size();
#else
- return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
+ return (phys_size_t)CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
#endif
}
#else /* CONFIG_SYS_RAMBOOT */