summaryrefslogtreecommitdiff
path: root/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-03-31 17:40:25 +0300
committerTom Rini <trini@konsulko.com>2017-04-05 20:59:20 +0300
commit088454cde245b4d431ce0181be8b3cbceea059d6 (patch)
treeec86ebe66961c9b06ab4b39ec83fd81d4a86e9be /arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
parent52c411805c090999f015df8bdf8016fb684746d0 (diff)
downloadu-boot-088454cde245b4d431ce0181be8b3cbceea059d6.tar.xz
board_f: Drop return value from initdram()
At present we cannot use this function as an init sequence call without a wrapper, since it returns the RAM size. Adjust it to set the RAM size in global_data instead, and return 0 on success. Signed-off-by: Simon Glass <sjg@chromium.org> Reviewed-by: Stefan Roese <sr@denx.de>
Diffstat (limited to 'arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c')
-rw-r--r--arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
index 3b79efb246..87fd5e65e0 100644
--- a/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
+++ b/arch/powerpc/cpu/ppc4xx/44x_spd_ddr2.c
@@ -33,6 +33,8 @@
#include "ecc.h"
+DECLARE_GLOBAL_DATA_PTR;
+
#define PPC4xx_IBM_DDR2_DUMP_REGISTER(mnemonic) \
do { \
u32 data; \
@@ -414,7 +416,7 @@ static unsigned char spd_read(uchar chip, uint addr)
* banks appropriately. If Auto Memory Configuration is
* not used, it is assumed that no DIMM is plugged
*-----------------------------------------------------------------------------*/
-phys_size_t initdram(void)
+int initdram(void)
{
unsigned char iic0_dimm_addr[] = SPD_EEPROM_ADDRESS;
unsigned long dimm_populated[MAXDIMMS] = {SDRAM_NONE, SDRAM_NONE};
@@ -429,7 +431,9 @@ phys_size_t initdram(void)
* Reduce RAM size to avoid overwriting memory used by
* current stack? Not sure what is happening.
*/
- return sdram_memsize() / 2;
+ gd->ram_size = sdram_memsize() / 2;
+
+ return 0;
}
num_dimm_banks = sizeof(iic0_dimm_addr);
@@ -650,7 +654,9 @@ phys_size_t initdram(void)
*/
set_mcsr(get_mcsr());
- return sdram_memsize();
+ gd->ram_size = sdram_memsize();
+
+ return 0;
}
static void get_spd_info(unsigned long *dimm_populated,
@@ -2855,7 +2861,7 @@ static void test(void)
* time parameters.
* Configures the PPC405EX(r) and PPC460EX/GT
*---------------------------------------------------------------------------*/
-phys_size_t initdram(void)
+int initdram(void)
{
unsigned long val;
@@ -3011,7 +3017,9 @@ phys_size_t initdram(void)
set_mcsr(get_mcsr());
#endif /* CONFIG_PPC4xx_DDR_AUTOCALIBRATION */
- return (CONFIG_SYS_MBYTES_SDRAM << 20);
+ gd->ram_size = CONFIG_SYS_MBYTES_SDRAM << 20;
+
+ return 0;
}
#endif /* CONFIG_SPD_EEPROM */