summaryrefslogtreecommitdiff
path: root/board/keymile
diff options
context:
space:
mode:
Diffstat (limited to 'board/keymile')
-rw-r--r--board/keymile/km82xx/km82xx.c8
-rw-r--r--board/keymile/km83xx/km83xx.c10
-rw-r--r--board/keymile/kmp204x/ddr.c8
3 files changed, 19 insertions, 7 deletions
diff --git a/board/keymile/km82xx/km82xx.c b/board/keymile/km82xx/km82xx.c
index c2a7a5f995..51b4571d40 100644
--- a/board/keymile/km82xx/km82xx.c
+++ b/board/keymile/km82xx/km82xx.c
@@ -15,6 +15,8 @@
#include <i2c.h>
#include "../common/common.h"
+DECLARE_GLOBAL_DATA_PTR;
+
static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
/*
@@ -289,7 +291,7 @@ static long probe_sdram(memctl8260_t *memctl)
#endif /* CONFIG_SYS_SDRAM_LIST */
-phys_size_t initdram(int board_type)
+int dram_init(void)
{
immap_t *immap = (immap_t *) CONFIG_SYS_IMMR;
memctl8260_t *memctl = &immap->im_memctl;
@@ -305,7 +307,9 @@ phys_size_t initdram(int board_type)
icache_enable();
- return psize;
+ gd->ram_size = psize;
+
+ return 0;
}
int checkboard(void)
diff --git a/board/keymile/km83xx/km83xx.c b/board/keymile/km83xx/km83xx.c
index 154f97457b..8020c379fd 100644
--- a/board/keymile/km83xx/km83xx.c
+++ b/board/keymile/km83xx/km83xx.c
@@ -28,6 +28,8 @@
#include "../common/common.h"
+DECLARE_GLOBAL_DATA_PTR;
+
static uchar ivm_content[CONFIG_SYS_IVM_EEPROM_MAX_LEN];
const qe_iop_conf_t qe_iop_conf_tab[] = {
@@ -328,13 +330,13 @@ static int fixed_sdram(void)
return msize;
}
-phys_size_t initdram(int board_type)
+int dram_init(void)
{
immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
u32 msize = 0;
if ((in_be32(&im->sysconf.immrbar) & IMMRBAR_BASE_ADDR) != (u32)im)
- return -1;
+ return -ENXIO;
out_be32(&im->sysconf.ddrlaw[0].bar,
CONFIG_SYS_DDR_BASE & LAWBAR_BAR);
@@ -348,7 +350,9 @@ phys_size_t initdram(int board_type)
#endif
/* return total bus SDRAM size(bytes) -- DDR */
- return msize * 1024 * 1024;
+ gd->ram_size = msize * 1024 * 1024;
+
+ return 0;
}
int checkboard(void)
diff --git a/board/keymile/kmp204x/ddr.c b/board/keymile/kmp204x/ddr.c
index 77af184c82..6f82e15f82 100644
--- a/board/keymile/kmp204x/ddr.c
+++ b/board/keymile/kmp204x/ddr.c
@@ -14,6 +14,8 @@
#include <fsl_ddr_sdram.h>
#include <fsl_ddr_dimm_params.h>
+DECLARE_GLOBAL_DATA_PTR;
+
void fsl_ddr_board_options(memctl_options_t *popts,
dimm_params_t *pdimm,
unsigned int ctrl_num)
@@ -48,7 +50,7 @@ void fsl_ddr_board_options(memctl_options_t *popts,
popts->ddr_cdr1 = DDR_CDR1_DHC_EN | DDR_CDR_ODT_75ohm;
}
-phys_size_t initdram(int board_type)
+int dram_init(void)
{
phys_size_t dram_size = 0;
@@ -60,5 +62,7 @@ phys_size_t initdram(int board_type)
dram_size *= 0x100000;
debug(" DDR: ");
- return dram_size;
+ gd->ram_size = dram_size;
+
+ return 0;
}