public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 1/2] am33xx,ddr3: fix ddr3 sdram configuration
@ 2015-12-02 14:27 Samuel Egli
  2015-12-02 14:27 ` [U-Boot] [PATCH 2/2] siemens,am33x: remove ddr3 delay workaround Samuel Egli
  2015-12-14 20:19 ` [U-Boot] [U-Boot, 1/2] am33xx, ddr3: fix ddr3 sdram configuration Tom Rini
  0 siblings, 2 replies; 4+ messages in thread
From: Samuel Egli @ 2015-12-02 14:27 UTC (permalink / raw)
  To: u-boot

This patch fixes the DDR3 initialization procedure in
order to comply with DDR3 standard. A 500 us delay is specified
between the DDR3 reset and clock enable signal. Until now,
this delay was not respected. Some DDR3 chips don't bother
but the bigger the RAM becomes the more likely it seems that
this delay is needed. We observed that DRAM > 256 MB from
the manufacturer Samsung have an issue when the specification
is not respected.

Changes:

1) Add a 1 ms wait for L3 timeout error trigger

2) Don't delay DDR3 initialization
Bit 31 of emif_sdram_ref_ctrl shouldn't be set because his
suppresses the initialization of DDR3

Signed-off-by: Samuel Egli <samuel.egli@siemens.com>
Reviewed-by: James Doublesin <doublesin@ti.com>
Cc: Tom Rini <trini@konsulko.com>
Cc: Felipe Balbi <balbi@ti.com>
Cc: Roger Meier <r.meier@siemens.com>
Cc: Heiko Schocher <hs@denx.de>
---
 arch/arm/cpu/armv7/am33xx/ddr.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/arch/arm/cpu/armv7/am33xx/ddr.c b/arch/arm/cpu/armv7/am33xx/ddr.c
index b3fb0c4..888cf1f 100644
--- a/arch/arm/cpu/armv7/am33xx/ddr.c
+++ b/arch/arm/cpu/armv7/am33xx/ddr.c
@@ -164,6 +164,13 @@ void config_sdram(const struct emif_regs *regs, int nr)
 		writel(regs->zq_config, &emif_reg[nr]->emif_zq_config);
 		writel(regs->sdram_config, &cstat->secure_emif_sdram_config);
 		writel(regs->sdram_config, &emif_reg[nr]->emif_sdram_config);
+
+		/* Trigger initialization */
+		writel(0x00003100, &emif_reg[nr]->emif_sdram_ref_ctrl);
+		/* Wait 1ms because of L3 timeout error */
+		udelay(1000);
+
+		/* Write proper sdram_ref_cref_ctrl value */
 		writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl);
 		writel(regs->ref_ctrl, &emif_reg[nr]->emif_sdram_ref_ctrl_shdw);
 	}
@@ -292,7 +299,9 @@ void config_ddr_phy(const struct emif_regs *regs, int nr)
 		     EMIF_REG_INITREF_DIS_MASK);
 #endif
 	if (regs->zq_config)
-		writel(0x80003100, &emif_reg[nr]->emif_sdram_ref_ctrl);
+		/* Set time between rising edge of DDR_RESET to rising
+		 * edge of DDR_CKE to > 500us per memory spec. */
+		writel(0x00003100, &emif_reg[nr]->emif_sdram_ref_ctrl);
 
 	writel(regs->emif_ddr_phy_ctlr_1,
 		&emif_reg[nr]->emif_ddr_phy_ctrl_1);
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [PATCH 2/2] siemens,am33x: remove ddr3 delay workaround
  2015-12-02 14:27 [U-Boot] [PATCH 1/2] am33xx,ddr3: fix ddr3 sdram configuration Samuel Egli
@ 2015-12-02 14:27 ` Samuel Egli
  2015-12-14 20:20   ` [U-Boot] [U-Boot, 2/2] siemens, am33x: " Tom Rini
  2015-12-14 20:19 ` [U-Boot] [U-Boot, 1/2] am33xx, ddr3: fix ddr3 sdram configuration Tom Rini
  1 sibling, 1 reply; 4+ messages in thread
From: Samuel Egli @ 2015-12-02 14:27 UTC (permalink / raw)
  To: u-boot

Signed-off-by: Samuel Egli <samuel.egli@siemens.com>
Cc: Roger Meier <r.meier@siemens.com>
Cc: Heiko Schocher <hs@denx.de>
---
 board/siemens/draco/board.c | 5 -----
 1 file changed, 5 deletions(-)

diff --git a/board/siemens/draco/board.c b/board/siemens/draco/board.c
index 4882314..988c12a 100644
--- a/board/siemens/draco/board.c
+++ b/board/siemens/draco/board.c
@@ -196,11 +196,6 @@ struct ctrl_ioregs draco_ddr3_ioregs = {
 
 	config_ddr(DDR_PLL_FREQ, &draco_ddr3_ioregs, &draco_ddr3_data,
 		   &draco_ddr3_cmd_ctrl_data, &draco_ddr3_emif_reg_data, 0);
-
-	/* For Samsung 2Gbit RAM we need this delay otherwise config fails after
-	 * soft reset.
-	 */
-	udelay(2000);
 }
 
 static void spl_siemens_board_init(void)
-- 
2.1.4

^ permalink raw reply related	[flat|nested] 4+ messages in thread

* [U-Boot] [U-Boot, 1/2] am33xx, ddr3: fix ddr3 sdram configuration
  2015-12-02 14:27 [U-Boot] [PATCH 1/2] am33xx,ddr3: fix ddr3 sdram configuration Samuel Egli
  2015-12-02 14:27 ` [U-Boot] [PATCH 2/2] siemens,am33x: remove ddr3 delay workaround Samuel Egli
@ 2015-12-14 20:19 ` Tom Rini
  1 sibling, 0 replies; 4+ messages in thread
From: Tom Rini @ 2015-12-14 20:19 UTC (permalink / raw)
  To: u-boot

On Wed, Dec 02, 2015 at 03:27:56PM +0100, Egli, Samuel wrote:

> This patch fixes the DDR3 initialization procedure in
> order to comply with DDR3 standard. A 500 us delay is specified
> between the DDR3 reset and clock enable signal. Until now,
> this delay was not respected. Some DDR3 chips don't bother
> but the bigger the RAM becomes the more likely it seems that
> this delay is needed. We observed that DRAM > 256 MB from
> the manufacturer Samsung have an issue when the specification
> is not respected.
> 
> Changes:
> 
> 1) Add a 1 ms wait for L3 timeout error trigger
> 
> 2) Don't delay DDR3 initialization
> Bit 31 of emif_sdram_ref_ctrl shouldn't be set because his
> suppresses the initialization of DDR3
> 
> Signed-off-by: Samuel Egli <samuel.egli@siemens.com>
> Reviewed-by: James Doublesin <doublesin@ti.com>
> Cc: Tom Rini <trini@konsulko.com>
> Cc: Felipe Balbi <balbi@ti.com>
> Cc: Roger Meier <r.meier@siemens.com>
> Cc: Heiko Schocher <hs@denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151214/65304c74/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

* [U-Boot] [U-Boot, 2/2] siemens, am33x: remove ddr3 delay workaround
  2015-12-02 14:27 ` [U-Boot] [PATCH 2/2] siemens,am33x: remove ddr3 delay workaround Samuel Egli
@ 2015-12-14 20:20   ` Tom Rini
  0 siblings, 0 replies; 4+ messages in thread
From: Tom Rini @ 2015-12-14 20:20 UTC (permalink / raw)
  To: u-boot

On Wed, Dec 02, 2015 at 03:27:57PM +0100, Egli, Samuel wrote:

> Signed-off-by: Samuel Egli <samuel.egli@siemens.com>
> Cc: Roger Meier <r.meier@siemens.com>
> Cc: Heiko Schocher <hs@denx.de>

Applied to u-boot/master, thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 836 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20151214/b85646c6/attachment.sig>

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2015-12-14 20:20 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-12-02 14:27 [U-Boot] [PATCH 1/2] am33xx,ddr3: fix ddr3 sdram configuration Samuel Egli
2015-12-02 14:27 ` [U-Boot] [PATCH 2/2] siemens,am33x: remove ddr3 delay workaround Samuel Egli
2015-12-14 20:20   ` [U-Boot] [U-Boot, 2/2] siemens, am33x: " Tom Rini
2015-12-14 20:19 ` [U-Boot] [U-Boot, 1/2] am33xx, ddr3: fix ddr3 sdram configuration Tom Rini

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox