Skip to contentSkip to conversation

Disable unused chip-select for DDR controller interleaving

PATCH New York Sun 2 participants 5 messages Oct 13, 2010 PowerPC

lore
Share & tools
lore

York Sun

author
#0 lore raw

PATCH 1/1 Disable unused chip-select for DDR controller interleaving

When DDR controller interleaving is eabled and less than all bank (chip-select) interleaving is seletected, the unused chip-select should be disabled.

---
 arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c |   13 ++++++++++---
 1 files changed, 10 insertions(+), 3 deletions(-)
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c +10 -3
index e82082e..e981262 100644
@@ -1184,6 +1184,7 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,
 	unsigned int sr_it;
 	unsigned int zq_en;
 	unsigned int wrlvl_en;
+	int cs_en = 1;
 
 	memset(ddr, 0, sizeof(fsl_ddr_cfg_regs_t));
 
@@ -1250,16 +1251,20 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,
 			 * and each controller uses rank interleaving within
 			 * itself. Therefore the starting and ending address
 			 * on each controller is twice the amount present on
-			 * each controller.
+			 * each controller.When
 			 */
 			unsigned long long ctlr_density = 0;
 			switch (popts->ba_intlv_ctl & FSL_DDR_CS0_CS1_CS2_CS3) {
 			case FSL_DDR_CS0_CS1:
 			case FSL_DDR_CS0_CS1_AND_CS2_CS3:
 				ctlr_density = dimm_params[0].rank_density * 2;
+				if (i > 1)
+					cs_en = 0;
 				break;
 			case FSL_DDR_CS2_CS3:
 				ctlr_density = dimm_params[0].rank_density;
+				if (i > 0)
+					cs_en = 0;
 				break;
 			case FSL_DDR_CS0_CS1_CS2_CS3:
 				/*
@@ -1379,8 +1384,10 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,
 			);
 
 		debug("FSLDDR: cs[%d]_bnds = 0x%08x\n", i, ddr->cs[i].bnds);
-		set_csn_config(dimm_number, i, ddr, popts, dimm_params);
-		set_csn_config_2(i, ddr);
+		if (cs_en) {
+			set_csn_config(dimm_number, i, ddr, popts, dimm_params);
+			set_csn_config_2(i, ddr);
+		}
 	}
 
 	set_ddr_eor(ddr, popts);
Signature · 1 line
1.7.0.4
#1 lore raw

PATCH 1/1 Disable unused chip-select for DDR controller interleaving

Dear York Sun,

Quoted 2 lines · In message <[email protected]> you wrote:

When DDR controller interleaving is eabled and less than all bank (chip-select) interleaving is seletected, the unused chip-select should be disabled.

...

arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c compute_fsl_memctl_config_regs(const memctl_options_t *popts, · line 1255

Quoted 7 lines
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c +1 -1
@@ -1250,16 +1251,20 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,
 			 * and each controller uses rank interleaving within
 			 * itself. Therefore the starting and ending address
 			 * on each controller is twice the amount present on
-			 * each controller.
+			 * each controller.When
 			 */

Seems you wanted to add some comment here, but then forgot it?

arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c compute_fsl_memctl_config_regs(const memctl_options_t *popts, · line 1390

Quoted 10 lines
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c +4 -2
@@ -1379,8 +1384,10 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,
 			);
 
 		debug("FSLDDR: cs[%d]_bnds = 0x%08x\n", i, ddr->cs[i].bnds);
-		set_csn_config(dimm_number, i, ddr, popts, dimm_params);
-		set_csn_config_2(i, ddr);
+		if (cs_en) {
+			set_csn_config(dimm_number, i, ddr, popts, dimm_params);
+			set_csn_config_2(i, ddr);
+		}

Would it not be helpful to inform the user that we disabled a memory bank? Eventually this wa snot intentional...

Best regards,

Wolfgang Denk

Signature · 5 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
Knowledge, sir, should be free to all!
	-- Harry Mudd, "I, Mudd", stardate 4513.3
author
#2 lore raw

PATCH 1/1 Disable unused chip-select for DDR controller interleaving

Quoted 7 lines · Wolfgang Denk

Dear York Sun,

Quoted 2 lines · In message <[email protected]> you wrote:

When DDR controller interleaving is eabled and less than all bank (chip-select) interleaving is seletected, the unused chip-select should be disabled.

...

Quoted 9 lines

arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c compute_fsl_memctl_config_regs(const memctl_options_t *popts, · line 1255

Quoted 7 lines
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c +1 -1
@@ -1250,16 +1251,20 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,
 			 * and each controller uses rank interleaving within
 			 * itself. Therefore the starting and ending address
 			 * on each controller is twice the amount present on
-			 * each controller.
+			 * each controller.When
 			 */

Seems you wanted to add some comment here, but then forgot it?

Oop. Nice catch. I didn't know how I missed this.

Quoted 4 lines
Quoted 4 lines
(quoted diff) +0 -0
@@ -1379,8 +1384,10 @@ compute_fsl_memctl_config_regs(const memctl_options_t *popts,
 			);
 
Quoted 10 lines

arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c compute_fsl_memctl_config_regs(const memctl_options_t *popts, · line 1390

Quoted 7 lines
arch/powerpc/cpu/mpc8xxx/ddr/ctrl_regs.c +4 -2
 		debug("FSLDDR: cs[%d]_bnds = 0x%08x\n", i, ddr->cs[i].bnds);
-		set_csn_config(dimm_number, i, ddr, popts, dimm_params);
-		set_csn_config_2(i, ddr);
+		if (cs_en) {
+			set_csn_config(dimm_number, i, ddr, popts, dimm_params);
+			set_csn_config_2(i, ddr);
+		}

Would it not be helpful to inform the user that we disabled a memory bank? Eventually this wa snot intentional...

I can add a message but maybe not necessary. The only case the CS left disable is the incomplete interleaving. For example the controller interleaving is enabled, but the bank interleaving is disabled or less than all populated CS are interleaving. In these cases, the unused CSs (or maybe CS'es, my bad English) are not accessible, even enabled. This patch doesn't change the hardware behavior, but to disable those unused CS to avoid confusion.

York

#3 lore raw

PATCH 1/1 Disable unused chip-select for DDR controller interleaving

Dear York Sun,

Quoted 11 lines · In message <1286988197.5737.6.camel@oslab-l1> you wrote:
Quoted 3 lines

Would it not be helpful to inform the user that we disabled a memory bank? Eventually this wa snot intentional...

I can add a message but maybe not necessary. The only case the CS left disable is the incomplete interleaving. For example the controller interleaving is enabled, but the bank interleaving is disabled or less than all populated CS are interleaving. In these cases, the unused CSs (or maybe CS'es, my bad English) are not accessible, even enabled. This patch doesn't change the hardware behavior, but to disable those unused CS to avoid confusion.

I understand this. But I think the conditions that cause such behaviour are pretty unusual, and most probably not something that is actually intended by the end user - for example, he might have installed an incompatible DIMM or such. It would be nice if he was made aware that somthing unusual is going on, so he can double-check his configuration.

Best regards,

Wolfgang Denk

Signature · 4 lines
DENX Software Engineering GmbH,     MD: Wolfgang Denk & Detlev Zundel
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: (+49)-8142-66989-10 Fax: (+49)-8142-66989-80 Email: wd at denx.de
2000 pounds of chinese soup                               = 1 Won Ton
author
#4 lore raw

PATCH 1/1 Disable unused chip-select for DDR controller interleaving

Quoted 15 lines · Wolfgang Denk

Dear York Sun,

Quoted 11 lines · In message <1286988197.5737.6.camel@oslab-l1> you wrote:
Quoted 3 lines

Would it not be helpful to inform the user that we disabled a memory bank? Eventually this wa snot intentional...

I can add a message but maybe not necessary. The only case the CS left disable is the incomplete interleaving. For example the controller interleaving is enabled, but the bank interleaving is disabled or less than all populated CS are interleaving. In these cases, the unused CSs (or maybe CS'es, my bad English) are not accessible, even enabled. This patch doesn't change the hardware behavior, but to disable those unused CS to avoid confusion.

Quoted 7 lines

I understand this. But I think the conditions that cause such behaviour are pretty unusual, and most probably not something that is actually intended by the end user - for example, he might have installed an incompatible DIMM or such. It would be nice if he was made aware that somthing unusual is going on, so he can double-check his configuration.

Points taken. I will add a message for this case.

Thanks.

York