Skip to contentSkip to conversation

Add bank configuration to FSL spd_sdram.c

PATCH Superseded Jerry Van Baren 4 participants 6 messages Mar 13, 2009 – Mar 14, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Add bank configuration to FSL spd_sdram.c

The routine assumed 4 bank SDRAMs, enhance to configure for 4 or 8 bank SDRAMs.

---

I haven't made much headway on adapting the cpu/mpc8xxxx/ddr routines to the 83xx (8360). It has some 85xx (86xx) assumptions in that needs to be pulled out.

Meanwhile, the cpu/mpc83xx/spd_sdram.c routine /almost/ worked for me. It turns out my DIMM stick has 8 banks which was being ignored (hard-coded for 4 banks). The enhancement below fixed that for me.

It would be Really Good to get this verified and in the pending release.

Best regards,
gvb

 cpu/mpc83xx/spd_sdram.c |    8 +++++---
 1 files changed, 5 insertions(+), 3 deletions(-)
cpu/mpc83xx/spd_sdram.c +5 -3
index df116aa..df1ccae 100644
@@ -220,7 +220,8 @@ long int spd_sdram()
 	ddr->cs_config[0] = ( 1 << 31
 			    | (odt_rd_cfg << 20)
 			    | (odt_wr_cfg << 16)
-			    | (spd.nrow_addr - 12) << 8
+			    | ((spd.nbanks == 8 ? 1 : 0) << 14)
+			    | ((spd.nrow_addr - 12) << 8)
 			    | (spd.ncol_addr - 8) );
 	debug("\n");
 	debug("cs0_bnds = 0x%08x\n",ddr->csbnds[0].csbnds);
@@ -232,8 +233,9 @@ long int spd_sdram()
 		ddr->cs_config[1] = ( 1<<31
 				    | (odt_rd_cfg << 20)
 				    | (odt_wr_cfg << 16)
-				    | (spd.nrow_addr-12) << 8
-				    | (spd.ncol_addr-8) );
+				    | ((spd.nbanks == 8 ? 1 : 0) << 14)
+				    | ((spd.nrow_addr - 12) << 8)
+				    | (spd.ncol_addr - 8) );
 		debug("cs1_bnds = 0x%08x\n",ddr->csbnds[1].csbnds);
 		debug("cs1_config = 0x%08x\n",ddr->cs_config[1]);
 	}
Signature · 1 line
1.5.6.5
#1 lore raw

PATCH 1/1 Add bank configuration to FSL spd_sdram.c

Quoted 10 lines

The routine assumed 4 bank SDRAMs, enhance to configure for 4 or 8 bank SDRAMs.

---

I haven't made much headway on adapting the cpu/mpc8xxxx/ddr routines to the 83xx (8360). It has some 85xx (86xx) assumptions in that needs to be pulled out.

Quoted 7 lines

Meanwhile, the cpu/mpc83xx/spd_sdram.c routine /almost/ worked for me. It turns out my DIMM stick has 8 banks which was being ignored (hard-coded for 4 banks). The enhancement below fixed that for me.

It would be Really Good to get this verified and in the pending release.

Could you also make the same change to #CS2# and #CS3?

Thanks, Dave

#2 lore raw

PATCH 1/1 Add bank configuration to FSL spd_sdram.c

Quoted 15 lines · Liu Dave-R63238 wrote:
Quoted 15 lines

The routine assumed 4 bank SDRAMs, enhance to configure for 4 or 8 bank SDRAMs.

---

I haven't made much headway on adapting the cpu/mpc8xxxx/ddr routines to the 83xx (8360). It has some 85xx (86xx) assumptions in that needs to be pulled out.

Meanwhile, the cpu/mpc83xx/spd_sdram.c routine /almost/ worked for me. It turns out my DIMM stick has 8 banks which was being ignored (hard-coded for 4 banks). The enhancement below fixed that for me.

Quoted 6 lines
Quoted 2 lines

It would be Really Good to get this verified and in the pending release.

Could you also make the same change to #CS2# and #CS3?

Thanks, Dave

AAARGH, will do.

Sorry,
gvb

#3 lore raw

PATCH v2 1/1 Add bank configuration to FSL spd_sdram.c

In reply to Jerry Van Baren

The routine assumed 4 bank SDRAMs, enhance to configure for 4 or 8 bank SDRAMs.

---

V2: Do both sets of chip selects. D'oh!

The cpu/mpc83xx/spd_sdram.c routine /almost/ worked for me. It turns out my DIMM stick has 8 banks which was being ignored (hard-coded for 4 banks). The enhancement below fixed that for me.

It would be Really Good to get this verified and in the pending release.

Best regards,
gvb

 cpu/mpc83xx/spd_sdram.c |   16 ++++++++++------
 1 files changed, 10 insertions(+), 6 deletions(-)
cpu/mpc83xx/spd_sdram.c +10 -6
index ecbc70c..0187ffb 100644
@@ -219,7 +219,8 @@ long int spd_sdram()
 	ddr->cs_config[0] = ( 1 << 31
 			    | (odt_rd_cfg << 20)
 			    | (odt_wr_cfg << 16)
-			    | (spd.nrow_addr - 12) << 8
+			    | ((spd.nbanks == 8 ? 1 : 0) << 14)
+			    | ((spd.nrow_addr - 12) << 8)
 			    | (spd.ncol_addr - 8) );
 	debug("\n");
 	debug("cs0_bnds = 0x%08x\n",ddr->csbnds[0].csbnds);
@@ -231,8 +232,9 @@ long int spd_sdram()
 		ddr->cs_config[1] = ( 1<<31
 				    | (odt_rd_cfg << 20)
 				    | (odt_wr_cfg << 16)
-				    | (spd.nrow_addr-12) << 8
-				    | (spd.ncol_addr-8) );
+				    | ((spd.nbanks == 8 ? 1 : 0) << 14)
+				    | ((spd.nrow_addr - 12) << 8)
+				    | (spd.ncol_addr - 8) );
 		debug("cs1_bnds = 0x%08x\n",ddr->csbnds[1].csbnds);
 		debug("cs1_config = 0x%08x\n",ddr->cs_config[1]);
 	}
@@ -242,7 +244,8 @@ long int spd_sdram()
 	ddr->cs_config[2] = ( 1 << 31
 			    | (odt_rd_cfg << 20)
 			    | (odt_wr_cfg << 16)
-			    | (spd.nrow_addr - 12) << 8
+			    | ((spd.nbanks == 8 ? 1 : 0) << 14)
+			    | ((spd.nrow_addr - 12) << 8)
 			    | (spd.ncol_addr - 8) );
 	debug("\n");
 	debug("cs2_bnds = 0x%08x\n",ddr->csbnds[2].csbnds);
@@ -254,8 +257,9 @@ long int spd_sdram()
 		ddr->cs_config[3] = ( 1<<31
 				    | (odt_rd_cfg << 20)
 				    | (odt_wr_cfg << 16)
-				    | (spd.nrow_addr-12) << 8
-				    | (spd.ncol_addr-8) );
+				    | ((spd.nbanks == 8 ? 1 : 0) << 14)
+				    | ((spd.nrow_addr - 12) << 8)
+				    | (spd.ncol_addr - 8) );
 		debug("cs3_bnds = 0x%08x\n",ddr->csbnds[3].csbnds);
 		debug("cs3_config = 0x%08x\n",ddr->cs_config[3]);
 	}
Signature · 1 line
1.5.6.5
#4 lore raw

PATCH v2 1/1 Add bank configuration to FSL spd_sdram.c

Quoted 9 lines

From: Jerry Van Baren [mailto:gvb.uboot at gmail.com]
Sent: Friday, March 13, 2009 11:40 PM
To: u-boot at lists.denx.de; Phillips Kim-R1AAHA; Liu Dave-R63238
Subject: [PATCH v2] Add bank configuration to FSL spd_sdram.c

The routine assumed 4 bank SDRAMs, enhance to configure for 4 or 8 bank SDRAMs.

Applied
#5 lore raw

PATCH v2 1/1 Add bank configuration to FSL spd_sdram.c

Quoted 11 lines · On Fri, 13 Mar 2009 18:59:20 -0600 "Liu Dave-R63238" <[email protected]>…
Quoted 9 lines

From: Jerry Van Baren [mailto:gvb.uboot at gmail.com]
Sent: Friday, March 13, 2009 11:40 PM
To: u-boot at lists.denx.de; Phillips Kim-R1AAHA; Liu Dave-R63238
Subject: [PATCH v2] Add bank configuration to FSL spd_sdram.c

The routine assumed 4 bank SDRAMs, enhance to configure for 4 or 8 bank SDRAMs.

applied.

Thanks both,

Kim