Skip to contentSkip to conversation

powerpc/83xx: fix sdram initialization for keymile boards

PATCH New Holger Brunck 3 participants 7 messages Nov 10, 2011 – Nov 11, 2011

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 powerpc/83xx: fix sdram initialization for keymile boards

From: Andreas Huber <[email protected]>

commit b11f53f3 (keymile: Fix Coding style issues for keymile boards) introduces a bug according the SDRAM initialization for all km83xx boards.

im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
was replaced with
out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); and this is wrong, because this overwrites the intial value CONFIG_SYS_DDR_SDRAM_CFG.

---
 board/keymile/km83xx/km83xx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
board/keymile/km83xx/km83xx.c +2 -1
index 17560c8..c0238c8 100644
@@ -217,7 +217,8 @@ int fixed_sdram(void)
 	out_be32(&im->ddr.sdram_interval, CONFIG_SYS_DDR_INTERVAL);
 	out_be32(&im->ddr.sdram_clk_cntl, CONFIG_SYS_DDR_CLK_CNTL);
 	udelay(200);
-	out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
+	out_be32(&im->ddr.sdram_cfg,
+		SDRAM_CFG_MEM_EN | CONFIG_SYS_DDR_SDRAM_CFG);
 
 	msize = CONFIG_SYS_DDR_SIZE << 20;
 	disable_addr_trans();
Signature · 1 line
1.7.1
#1 lore raw

PATCH 1/1 powerpc/83xx: fix sdram initialization for keymile boards

Hello Holger,

Quoted 25 lines · Holger Brunck

From: Andreas Huber <[email protected]>

commit b11f53f3 (keymile: Fix Coding style issues for keymile boards) introduces a bug according the SDRAM initialization for all km83xx boards.

im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
was replaced with
out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); and this is wrong, because this overwrites the intial value CONFIG_SYS_DDR_SDRAM_CFG.

---
 board/keymile/km83xx/km83xx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
board/keymile/km83xx/km83xx.c +0 -0
index 17560c8..c0238c8 100644

board/keymile/km83xx/km83xx.c int fixed_sdram(void) · line 221

Quoted 6 lines
board/keymile/km83xx/km83xx.c +2 -1
@@ -217,7 +217,8 @@ int fixed_sdram(void)
 	out_be32(&im->ddr.sdram_interval, CONFIG_SYS_DDR_INTERVAL);
 	out_be32(&im->ddr.sdram_clk_cntl, CONFIG_SYS_DDR_CLK_CNTL);
 	udelay(200);
-	out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
+	out_be32(&im->ddr.sdram_cfg,
+		SDRAM_CFG_MEM_EN | CONFIG_SYS_DDR_SDRAM_CFG);

Wouldn't a

setbits_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);

be better?

board/keymile/km83xx/km83xx.c int fixed_sdram(void) · line 224

Quoted 3 lines
board/keymile/km83xx/km83xx.c +0 -0
 	msize = CONFIG_SYS_DDR_SIZE << 20;
 	disable_addr_trans();

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#2 lore raw

PATCH 1/1 powerpc/83xx: fix sdram initialization for keymile boards

Hi Heiko,

Quoted 35 lines · Heiko Schocher
Quoted 25 lines · Holger Brunck

From: Andreas Huber <[email protected]>

commit b11f53f3 (keymile: Fix Coding style issues for keymile boards) introduces a bug according the SDRAM initialization for all km83xx boards.

im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
was replaced with
out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); and this is wrong, because this overwrites the intial value CONFIG_SYS_DDR_SDRAM_CFG.

---
 board/keymile/km83xx/km83xx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
board/keymile/km83xx/km83xx.c +0 -0
index 17560c8..c0238c8 100644

board/keymile/km83xx/km83xx.c int fixed_sdram(void) · line 221

Quoted 6 lines
board/keymile/km83xx/km83xx.c +2 -1
@@ -217,7 +217,8 @@ int fixed_sdram(void)
 	out_be32(&im->ddr.sdram_interval, CONFIG_SYS_DDR_INTERVAL);
 	out_be32(&im->ddr.sdram_clk_cntl, CONFIG_SYS_DDR_CLK_CNTL);
 	udelay(200);
-	out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
+	out_be32(&im->ddr.sdram_cfg,
+		SDRAM_CFG_MEM_EN | CONFIG_SYS_DDR_SDRAM_CFG);

Wouldn't a

Quoted 4 lines

setbits_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);

be better?

yes this works too and is slightly nicer, I will send an updated version.

Thanks!

Best regards
Holger

#3 lore raw

PATCH 1/1 powerpc/83xx: fix sdram initialization for keymile boards

Hello Holger,

Quoted 37 lines · Holger Brunck

Hi Heiko,

Quoted 34 lines · Heiko Schocher
Quoted 25 lines · Holger Brunck

From: Andreas Huber <[email protected]>

commit b11f53f3 (keymile: Fix Coding style issues for keymile boards) introduces a bug according the SDRAM initialization for all km83xx boards.

im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
was replaced with
out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); and this is wrong, because this overwrites the intial value CONFIG_SYS_DDR_SDRAM_CFG.

---
 board/keymile/km83xx/km83xx.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
board/keymile/km83xx/km83xx.c +0 -0
index 17560c8..c0238c8 100644

board/keymile/km83xx/km83xx.c int fixed_sdram(void) · line 221

Quoted 6 lines
board/keymile/km83xx/km83xx.c +2 -1
@@ -217,7 +217,8 @@ int fixed_sdram(void)
 	out_be32(&im->ddr.sdram_interval, CONFIG_SYS_DDR_INTERVAL);
 	out_be32(&im->ddr.sdram_clk_cntl, CONFIG_SYS_DDR_CLK_CNTL);
 	udelay(200);
-	out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
+	out_be32(&im->ddr.sdram_cfg,
+		SDRAM_CFG_MEM_EN | CONFIG_SYS_DDR_SDRAM_CFG);

Wouldn't a

Quoted 6 lines
Quoted 4 lines

setbits_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);

be better?

yes this works too and is slightly nicer, I will send an updated version.

Ok, thanks! Please fell free to add my

to it!

bye,
Heiko

Signature · 2 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
#4 lore raw

PATCH v2 1/1 powerpc/83xx: fix sdram initialization for keymile boards

In reply to Holger Brunck

From: Andreas Huber <[email protected]>

commit b11f53f3 (keymile: Fix Coding style issues for keymile boards) introduces a bug according the SDRAM initialization for all km83xx boards.

im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
was replaced with
out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); and this is wrong, because this overwrites the intial value CONFIG_SYS_DDR_SDRAM_CFG.

---
 board/keymile/km83xx/km83xx.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
board/keymile/km83xx/km83xx.c +1 -1
index 17560c8..16ae2e4 100644
@@ -217,7 +217,7 @@ int fixed_sdram(void)
 	out_be32(&im->ddr.sdram_interval, CONFIG_SYS_DDR_INTERVAL);
 	out_be32(&im->ddr.sdram_clk_cntl, CONFIG_SYS_DDR_CLK_CNTL);
 	udelay(200);
-	out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
+	setbits_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN);
 
 	msize = CONFIG_SYS_DDR_SIZE << 20;
 	disable_addr_trans();
Signature · 1 line
1.7.1
#5 lore raw

PATCH v2 1/1 powerpc/83xx: fix sdram initialization for keymile boards

Quoted 12 lines · On Thu, 10 Nov 2011 15:52:43 +0100 Holger Brunck <[email protected]>…

From: Andreas Huber <[email protected]>

commit b11f53f3 (keymile: Fix Coding style issues for keymile boards) introduces a bug according the SDRAM initialization for all km83xx boards.

im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
was replaced with
out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); and this is wrong, because this overwrites the intial value CONFIG_SYS_DDR_SDRAM_CFG.

Quoted 5 lines

---

good catch.

Kim

#6 lore raw

PATCH v2 1/1 powerpc/83xx: fix sdram initialization for keymile boards

Quoted 21 lines · On Thu, 10 Nov 2011 10:36:18 -0600 Kim Phillips <[email protected]>…
Quoted 12 lines · On Thu, 10 Nov 2011 15:52:43 +0100 Holger Brunck <[email protected]>…

From: Andreas Huber <[email protected]>

commit b11f53f3 (keymile: Fix Coding style issues for keymile boards) introduces a bug according the SDRAM initialization for all km83xx boards.

im->ddr.sdram_cfg |= SDRAM_CFG_MEM_EN;
was replaced with
out_be32(&im->ddr.sdram_cfg, SDRAM_CFG_MEM_EN); and this is wrong, because this overwrites the intial value CONFIG_SYS_DDR_SDRAM_CFG.

Quoted 5 lines

---

Quoted 3 lines

good catch.

Just noticed this can go through 83xx, so I've applied it to mpc83xx/master.

Kim