Patchwork [U-Boot] mpc8xxx: fix DDR init value to use CONFIG_MEM_INIT_VALUE

login
register
mail settings
Submitter Anatolij Gustschin
Date Jan. 22, 2013, 9:50 a.m.
Message ID <1358848227-4328-1-git-send-email-agust@denx.de>
Download mbox | patch
Permalink /patch/214481/
State Accepted, archived
Delegated to: Andy Fleming
Headers show

Comments

Anatolij Gustschin - Jan. 22, 2013, 9:50 a.m.
Configuring custom memory init value using CONFIG_MEM_INIT_VALUE in
the board config file doesn't work and memory is always initialized
to the value 0xdeadbeef. Only use this default value if a board doesn't
define CONFIG_MEM_INIT_VALUE.

Signed-off-by: Anatolij Gustschin <agust@denx.de>
Cc: Andy Fleming <afleming@freescale.com>
---
 arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c | 4 ++++
 1 file changed, 4 insertions(+)

Patch

diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c b/arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c
index 8016bcd..26c42f7 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c
@@ -1190,7 +1190,11 @@  static void set_ddr_data_init(fsl_ddr_cfg_regs_t *ddr)
 {
 	unsigned int init_value;	/* Initialization value */
 
+#ifdef CONFIG_MEM_INIT_VALUE
+	init_value = CONFIG_MEM_INIT_VALUE;
+#else
 	init_value = 0xDEADBEEF;
+#endif
 	ddr->ddr_data_init = init_value;
 }