summaryrefslogtreecommitdiffstats
path: root/board/freescale/mpc8349emds/mpc8349emds.c
diff options
context:
space:
mode:
authorYork Sun <yorksun@freescale.com>2011-08-26 11:32:45 -0700
committerKumar Gala <galak@kernel.crashing.org>2011-09-29 19:01:06 -0500
commitd4b9106609a67617d8cef3bb6bce124974865388 (patch)
tree4bd57192ca2396fe074460924100062b24bf1feb /board/freescale/mpc8349emds/mpc8349emds.c
parentd29d17d7badcf90a31e5d6d1d9a82838ea039a42 (diff)
downloadtalos-obmc-uboot-d4b9106609a67617d8cef3bb6bce124974865388.tar.gz
talos-obmc-uboot-d4b9106609a67617d8cef3bb6bce124974865388.zip
powerpc/mpc8349emds: Migrate from spd_sdram to unified DDR driver
Update MPC8349EMDS to use unified DDR driver instead of spd_sdram.c. The unified driver can initialize data using DDR controller. No need to use DMA if just to initialze for ECC. Signed-off-by: York Sun <yorksun@freescale.com> Signed-off-by: Kim Phillips <kim.phillips@freescale.com> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
Diffstat (limited to 'board/freescale/mpc8349emds/mpc8349emds.c')
-rw-r--r--board/freescale/mpc8349emds/mpc8349emds.c26
1 files changed, 15 insertions, 11 deletions
diff --git a/board/freescale/mpc8349emds/mpc8349emds.c b/board/freescale/mpc8349emds/mpc8349emds.c
index 365ac3792f..620540f830 100644
--- a/board/freescale/mpc8349emds/mpc8349emds.c
+++ b/board/freescale/mpc8349emds/mpc8349emds.c
@@ -29,7 +29,11 @@
#include <i2c.h>
#include <spi.h>
#include <miiphy.h>
+#ifdef CONFIG_FSL_DDR2
+#include <asm/fsl_ddr_sdram.h>
+#else
#include <spd_sdram.h>
+#endif
#if defined(CONFIG_OF_LIBFDT)
#include <libfdt.h>
@@ -62,7 +66,7 @@ int board_early_init_f (void)
phys_size_t initdram (int board_type)
{
volatile immap_t *im = (immap_t *)CONFIG_SYS_IMMR;
- u32 msize = 0;
+ phys_size_t msize = 0;
if ((im->sysconf.immrbar & IMMRBAR_BASE_ADDR) != (u32)im)
return -1;
@@ -70,24 +74,24 @@ phys_size_t initdram (int board_type)
/* DDR SDRAM - Main SODIMM */
im->sysconf.ddrlaw[0].bar = CONFIG_SYS_DDR_BASE & LAWBAR_BAR;
#if defined(CONFIG_SPD_EEPROM)
- msize = spd_sdram();
+#ifndef CONFIG_FSL_DDR2
+ msize = spd_sdram() * 1024 * 1024;
+#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
+ ddr_enable_ecc(msize);
+#endif
+#else
+ msize = fsl_ddr_sdram();
+#endif
#else
- msize = fixed_sdram();
+ msize = fixed_sdram() * 1024 * 1024;
#endif
/*
* Initialize SDRAM if it is on local bus.
*/
sdram_init();
-#if defined(CONFIG_DDR_ECC) && !defined(CONFIG_ECC_INIT_VIA_DDRCONTROLLER)
- /*
- * Initialize and enable DDR ECC.
- */
- ddr_enable_ecc(msize * 1024 * 1024);
-#endif
-
/* return total bus SDRAM size(bytes) -- DDR */
- return (msize * 1024 * 1024);
+ return msize;
}
#if !defined(CONFIG_SPD_EEPROM)
OpenPOWER on IntegriCloud