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>
This commit is contained in:
parent
7dd09b546d
commit
76d354f411
|
@ -341,7 +341,7 @@ phys_size_t initdram(int board_type)
|
||||||
#if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD)
|
#if defined(CONFIG_SPD_EEPROM) || defined(CONFIG_DDR_SPD)
|
||||||
return fsl_ddr_sdram_size();
|
return fsl_ddr_sdram_size();
|
||||||
#else
|
#else
|
||||||
return CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
|
return (phys_size_t)CONFIG_SYS_SDRAM_SIZE * 1024 * 1024;
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
#else /* CONFIG_SYS_RAMBOOT */
|
#else /* CONFIG_SYS_RAMBOOT */
|
||||||
|
|
Loading…
Reference in New Issue