summaryrefslogtreecommitdiff
path: root/board/freescale/p2041rdb/ddr.c
diff options
context:
space:
mode:
Diffstat (limited to 'board/freescale/p2041rdb/ddr.c')
-rw-r--r--board/freescale/p2041rdb/ddr.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/board/freescale/p2041rdb/ddr.c b/board/freescale/p2041rdb/ddr.c
index b2493e1f61..1ab98fc089 100644
--- a/board/freescale/p2041rdb/ddr.c
+++ b/board/freescale/p2041rdb/ddr.c
@@ -12,6 +12,8 @@
#include <fsl_ddr_dimm_params.h>
#include <asm/fsl_law.h>
+DECLARE_GLOBAL_DATA_PTR;
+
struct board_specific_parameters {
u32 n_ranks;
u32 datarate_mhz_high;
@@ -116,7 +118,7 @@ found:
popts->ddr_cdr1 = DDR_CDR1_DHC_EN;
}
-phys_size_t initdram(int board_type)
+int dram_init(void)
{
phys_size_t dram_size = 0;
@@ -127,12 +129,14 @@ phys_size_t initdram(int board_type)
dram_size = fsl_ddr_sdram();
} else {
puts("no SPD and fixed parameters\n");
- return dram_size;
+ return -ENXIO;
}
dram_size = setup_ddr_tlbs(dram_size / 0x100000);
dram_size *= 0x100000;
debug(" DDR: ");
- return dram_size;
+ gd->ram_size = dram_size;
+
+ return 0;
}