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/esd/mecp5123/mecp5123.c | 6 ++++-- board/esd/pmc440/sdram.c | 12 ++++++++---- board/esd/vme8349/vme8349.c | 10 +++++++--- 3 files changed, 19 insertions(+), 9 deletions(-) (limited to 'board/esd') 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 #include +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 #include +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) -- cgit v1.2.3