Skip to contentSkip to conversation

powerpc/mpc8xxx: Fix compiling error caused in DDR driver

PATCH New York Sun 2 participants 3 messages Nov 7, 2012 – Nov 8, 2012 PowerPC

lore
Share & tools
lore

York Sun

author
#0 lore raw

PATCH 1/1 powerpc/mpc8xxx: Fix compiling error caused in DDR driver

mpc86xx platforms should use CONFIG_SYS_MPC86xx_DDR2_ADDR in utils.c if applicable.

---
 arch/powerpc/cpu/mpc8xxx/ddr/util.c |    4 ++++
 1 file changed, 4 insertions(+)
arch/powerpc/cpu/mpc8xxx/ddr/util.c +4 -0
index 940ffff..9a07d9d 100644
@@ -152,7 +152,11 @@ void board_add_ram_info(int use_default)
 
 #if CONFIG_NUM_DDR_CONTROLLERS >= 2
 	if (!(sdram_cfg & SDRAM_CFG_MEM_EN)) {
+#ifdef CONFIG_MPC86xx
+		ddr = (void __iomem *)CONFIG_SYS_MPC86xx_DDR2_ADDR;
+#else
 		ddr = (void __iomem *)CONFIG_SYS_MPC85xx_DDR2_ADDR;
+#endif
 		sdram_cfg = in_be32(&ddr->sdram_cfg);
 	}
 #endif
Signature · 1 line
1.7.9.5
#1 lore raw

PATCH 1/1 powerpc/mpc8xxx: Fix compiling error caused in DDR driver

Quoted 13 lines · York Sun

mpc86xx platforms should use CONFIG_SYS_MPC86xx_DDR2_ADDR in utils.c if applicable.

---
arch/powerpc/cpu/mpc8xxx/ddr/util.c | 4 ++++

1 file changed, 4 insertions(+)
arch/powerpc/cpu/mpc8xxx/ddr/util.c +0 -0
index 940ffff..9a07d9d 100644

arch/powerpc/cpu/mpc8xxx/ddr/util.c void board_add_ram_info(int use_default) · line 159

Quoted 8 lines
arch/powerpc/cpu/mpc8xxx/ddr/util.c +4 -0
@@ -152,7 +152,11 @@ void board_add_ram_info(int use_default)
 
 #if CONFIG_NUM_DDR_CONTROLLERS >= 2
 	if (!(sdram_cfg & SDRAM_CFG_MEM_EN)) {
+#ifdef CONFIG_MPC86xx
+		ddr = (void __iomem *)CONFIG_SYS_MPC86xx_DDR2_ADDR;
+#else
 		ddr = (void __iomem *)CONFIG_SYS_MPC85xx_DDR2_ADDR;
+#endif

Argh, I submitted a patch to fix this more completely, but haven't applied it, yet. See: http://patchwork.ozlabs.org/patch/193611/

Andy

author
#2 lore raw

PATCH 1/1 powerpc/mpc8xxx: Fix compiling error caused in DDR driver

Quoted 17 lines · Fleming Andy-AFLEMING
Quoted 14 lines · York Sun

mpc86xx platforms should use CONFIG_SYS_MPC86xx_DDR2_ADDR in utils.c if applicable.

---
arch/powerpc/cpu/mpc8xxx/ddr/util.c | 4 ++++

1 file changed, 4 insertions(+)
arch/powerpc/cpu/mpc8xxx/ddr/util.c +0 -0
index 940ffff..9a07d9d 100644
@@ -152,7 +152,11 @@ void board_add_ram_info(int use_default)
 
Quoted 12 lines

arch/powerpc/cpu/mpc8xxx/ddr/util.c void board_add_ram_info(int use_default) · line 159

Quoted 7 lines
arch/powerpc/cpu/mpc8xxx/ddr/util.c +4 -0
 #if CONFIG_NUM_DDR_CONTROLLERS >= 2
 	if (!(sdram_cfg & SDRAM_CFG_MEM_EN)) {
+#ifdef CONFIG_MPC86xx
+		ddr = (void __iomem *)CONFIG_SYS_MPC86xx_DDR2_ADDR;
+#else
 		ddr = (void __iomem *)CONFIG_SYS_MPC85xx_DDR2_ADDR;
+#endif

Argh, I submitted a patch to fix this more completely, but haven't applied it, yet. See: http://patchwork.ozlabs.org/patch/193611/

Thanks. You may want to add #else clause to catch errors. I'd rather see compiling error than debugging run time error.

York