summaryrefslogtreecommitdiff
path: root/board/esd
diff options
context:
space:
mode:
authorSimon Glass <sjg@chromium.org>2017-03-31 08:40:25 -0600
committerTom Rini <trini@konsulko.com>2017-04-05 13:59:20 -0400
commit088454cde245b4d431ce0181be8b3cbceea059d6 (patch)
treeec86ebe66961c9b06ab4b39ec83fd81d4a86e9be /board/esd
parent52c411805c090999f015df8bdf8016fb684746d0 (diff)
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 'board/esd')
-rw-r--r--board/esd/mecp5123/mecp5123.c6
-rw-r--r--board/esd/pmc440/sdram.c12
-rw-r--r--board/esd/vme8349/vme8349.c10
3 files changed, 19 insertions, 9 deletions
diff --git a/board/esd/mecp5123/mecp5123.c b/board/esd/mecp5123/mecp5123.c
index b8eb32b1fb..80963fefa5 100644
--- a/board/esd/mecp5123/mecp5123.c
+++ b/board/esd/mecp5123/mecp5123.c
@@ -62,9 +62,11 @@ int board_early_init_f(void)
return 0;
}
-phys_size_t initdram(void)
+int initdram(void)
{
- return get_ram_size(0, fixed_sdram(NULL, NULL, 0));
+ gd->ram_size = get_ram_size(0, fixed_sdram(NULL, NULL, 0));
+
+ return 0;
}
int misc_init_r(void)
diff --git a/board/esd/pmc440/sdram.c b/board/esd/pmc440/sdram.c
index 82ee289aa6..e962d4c4bb 100644
--- a/board/esd/pmc440/sdram.c
+++ b/board/esd/pmc440/sdram.c
@@ -24,6 +24,8 @@
#include <asm/mmu.h>
#include <asm/ppc440.h>
+DECLARE_GLOBAL_DATA_PTR;
+
extern int denali_wait_for_dlllock(void);
extern void denali_core_search_data_eye(void);
@@ -105,7 +107,7 @@ int initdram_by_rb(int rows, int banks)
return 0;
}
-phys_size_t initdram(void)
+int initdram(void)
{
phys_size_t size;
int n;
@@ -125,12 +127,14 @@ phys_size_t initdram(void)
sdram_conf[n].banks);
/* check for suitable configuration */
- if (get_ram_size(CONFIG_SYS_SDRAM_BASE, size) == size)
- return size;
+ if (get_ram_size(CONFIG_SYS_SDRAM_BASE, size) == size) {
+ gd->ram_size = size;
+ return 0;
+ }
/* delete TLB entries */
remove_tlb(CONFIG_SYS_SDRAM_BASE, size);
}
- return 0;
+ return -ENXIO;
}
diff --git a/board/esd/vme8349/vme8349.c b/board/esd/vme8349/vme8349.c
index bf6ee7a73d..0e7f8b130a 100644
--- a/board/esd/vme8349/vme8349.c
+++ b/board/esd/vme8349/vme8349.c
@@ -26,15 +26,17 @@
#include <i2c.h>
#include <netdev.h>
+DECLARE_GLOBAL_DATA_PTR;
+
void ddr_enable_ecc(unsigned int dram_size);
-phys_size_t initdram(void)
+int initdram(void)
{
volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
u32 msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)
- return -1;
+ return -ENXIO;
/* DDR SDRAM - Main memory */
im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
@@ -52,7 +54,9 @@ phys_size_t initdram(void)
msize = get_ram_size(0, msize);
/* return total bus SDRAM size(bytes) -- DDR */
- return msize * 1024 * 1024;
+ gd->ram_size = msize * 1024 * 1024;
+
+ return 0;
}
int checkboard(void)