From 088454cde245b4d431ce0181be8b3cbceea059d6 Mon Sep 17 00:00:00 2001 From: Simon Glass Date: Fri, 31 Mar 2017 08:40:25 -0600 Subject: 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 Reviewed-by: Stefan Roese --- board/mpl/mip405/mip405.c | 6 ++++-- board/mpl/pati/pati.c | 10 +++++++--- board/mpl/pip405/pip405.c | 6 ++++-- 3 files changed, 15 insertions(+), 7 deletions(-) (limited to 'board/mpl') diff --git a/board/mpl/mip405/mip405.c b/board/mpl/mip405/mip405.c index e2961d1d4a..e6422965f9 100644 --- a/board/mpl/mip405/mip405.c +++ b/board/mpl/mip405/mip405.c @@ -622,7 +622,7 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ static int test_dram (unsigned long ramsize); -phys_size_t initdram(void) +int initdram(void) { unsigned long bank_reg[4], tmp, bank_size; @@ -655,7 +655,9 @@ phys_size_t initdram(void) printf ("ECC "); test_dram (TotalSize * MEGA_BYTE); - return (TotalSize * MEGA_BYTE); + gd->ram_size = TotalSize * MEGA_BYTE; + + return 0; } /* ------------------------------------------------------------------------- */ diff --git a/board/mpl/pati/pati.c b/board/mpl/pati/pati.c index 951010a6a3..7b7b93f682 100644 --- a/board/mpl/pati/pati.c +++ b/board/mpl/pati/pati.c @@ -55,6 +55,8 @@ asm (GEN_SYMNAME(name) " = " GEN_VALUE(value)) +DECLARE_GLOBAL_DATA_PTR; + /************************************************************************ * Early debug routines */ @@ -133,7 +135,7 @@ extern int mem_test (unsigned long start, unsigned long ramsize, int quiet); /* * Get RAM size. */ -phys_size_t initdram(void) +int initdram(void) { unsigned char board_rev; unsigned long reg; @@ -209,8 +211,10 @@ phys_size_t initdram(void) /* we have a x32 bit bus to the SDRAM, so shift the addr with 2 */ lmr<<=2; in32(CONFIG_SYS_SDRAM_BASE + lmr); - /* ok, we're done, return SDRAM size */ - return ((0x400000 << sdram_table[i].sz)); /* log2 value of 4MByte */ + /* ok, we're done, set SDRAM size to log2 value of 4MByte*/ + gd->ram_size = 0x400000 << sdram_table[i].sz; + + return 0; } diff --git a/board/mpl/pip405/pip405.c b/board/mpl/pip405/pip405.c index 07b30ed293..c07d8f88b9 100644 --- a/board/mpl/pip405/pip405.c +++ b/board/mpl/pip405/pip405.c @@ -612,7 +612,7 @@ int checkboard (void) /* ------------------------------------------------------------------------- */ static int test_dram (unsigned long ramsize); -phys_size_t initdram(void) +int initdram(void) { unsigned long bank_reg[4], tmp, bank_size; int i, ds; @@ -648,7 +648,9 @@ phys_size_t initdram(void) (void) get_clocks(); if (gd->cpu_clk > 220000000) TotalSize /= 2; - return (TotalSize * 1024 * 1024); + gd->ram_size = TotalSize * 1024 * 1024; + + return 0; } /* ------------------------------------------------------------------------- */ -- cgit v1.2.3