public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
* [U-Boot] [PATCH 8/8] powerpc/85xx: Add memory test feature for mpc85xx.
@ 2010-07-28 23:25 sun york-R58495
  2010-07-29 21:28 ` Wolfgang Denk
  0 siblings, 1 reply; 12+ messages in thread
From: sun york-R58495 @ 2010-07-28 23:25 UTC (permalink / raw)
  To: u-boot

Wolfgang,

As Timur pointed out, the post framework doesn't work for us. After U-boot relocate itself to RAM, we have only 2GB memory to test. The best place is before relocation. Many other boards do that. Following your idea of reusing code, I can only reuse the test pattern generator. I am open to suggestions.

York Sun
----- Original Message -----
From:"Wolfgang Denk" <wd@denx.de>
To:"York Sun" <yorksun@freescale.com>
Cc:"Timur Tabi" <timur.tabi@gmail.com>, "Kumar Gala" <galak@kernel.crashing.org>, "u-boot at lists.denx.de" <u-boot@lists.denx.de>
Sent:7/28/2010 4:50 PM
Subject:Re: [U-Boot] [PATCH 8/8] powerpc/85xx: Add memory test feature for mpc85xx.


Dear York Sun,

In message <1280351179.8571.63.camel@oslab-l1> you wrote:
> 
> > We already have too many different implementations of a memory test in
> > U-Boot, and I will not accept adding yet another one.
> > 
> I can reuse your testing code but have to move the desired code out of
> memory.c file to avoid the need for CONFIG_POST and
> CONFIG_SYS_POST_MEMORY. I also add a progress indicator. My testing

NAK, and NAK.

Please integrate your code into the existing POST framework instead,
as a number of other boards already did.

A progress indicator may be a nice little toy, but how does it
integrate into the POST framework?

> target is 2GB at a time, up to physically memory size which is easily
> over 8GB. Without progress indicator, it feels hung when it is actually
> running.

Yes, memory testing takes time. In the context of a power-on self
test (and this is what you are doing, right?) we should take care to
fit it into the existing framework, though.

> Please take a look at the patch below.

Instead of integrating your needs into an existing framework you
invent yet another one. I don't want to have this, sorry.

Best regards,

Wolfgang Denk

-- 
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
How can you tell when sour cream goes bad?

^ permalink raw reply	[flat|nested] 12+ messages in thread
* [U-Boot] [PATCH 1/8] powerpc/8xxx: Enabled hwconfig for memory interleaving
@ 2010-07-14 15:14 Kumar Gala
  2010-07-14 15:14 ` [U-Boot] [PATCH 2/8] powerpc/8xxx: Fix bug in memctrl interleaving & bank interleaving on cs0~cs4 Kumar Gala
  0 siblings, 1 reply; 12+ messages in thread
From: Kumar Gala @ 2010-07-14 15:14 UTC (permalink / raw)
  To: u-boot

Replace environmental variables memctl_intlv_ctl and ba_intlv_ctl with
hwconfig parameters. The syntax is

    setenv hwconfig "fsl_ddr:ctlr_intlv=<mode>,bank_intlv=<mode>"

The mode values for memory controller interleaving are
    cacheline
    page
    bank
    superbank

The mode values for bank interleaving are
    cs0_cs1
    cs2_cs3
    cs0_cs1_and_cs2_cs3
    cs0_cs1_cs2_cs3

Signed-off-by: York Sun <yorksun@freescale.com>
---
 arch/powerpc/cpu/mpc8xxx/ddr/options.c |   40 ++++++++++++++++++++------------
 doc/README.fsl-ddr                     |   25 +++++++++++--------
 2 files changed, 39 insertions(+), 26 deletions(-)

diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/options.c b/arch/powerpc/cpu/mpc8xxx/ddr/options.c
index 46731c8..11281b7 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/options.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/options.c
@@ -8,6 +8,7 @@
  */
 
 #include <common.h>
+#include <hwconfig.h>
 #include <asm/fsl_ddr_sdram.h>
 
 #include "ddr.h"
@@ -23,7 +24,6 @@ unsigned int populate_memctl_options(int all_DIMMs_registered,
 			unsigned int ctrl_num)
 {
 	unsigned int i;
-	const char *p;
 
 	/* Chip select options. */
 
@@ -221,7 +221,7 @@ unsigned int populate_memctl_options(int all_DIMMs_registered,
 	 * should be a subset of the requested configuration.
 	 */
 #if (CONFIG_NUM_DDR_CONTROLLERS > 1)
-	if ((p = getenv("memctl_intlv_ctl")) != NULL) {
+	if (hwconfig_sub("fsl_ddr", "ctlr_intlv")) {
 		if (pdimm[0].n_ranks == 0) {
 			printf("There is no rank on CS0. Because only rank on "
 				"CS0 and ranks chip-select interleaved with CS0"
@@ -230,37 +230,47 @@ unsigned int populate_memctl_options(int all_DIMMs_registered,
 			popts->memctl_interleaving = 0;
 		} else {
 			popts->memctl_interleaving = 1;
-			if (strcmp(p, "cacheline") == 0)
+			/* test null first. if CONFIG_HWCONFIG is not defined
+			 * hwconfig_arg_cmp returns non-zero */
+			if (hwconfig_subarg_cmp("fsl_ddr", "ctlr_intlv", "null")) {
+				popts->memctl_interleaving = 0;
+				debug("memory controller interleaving disabled.\n");
+			} else if (hwconfig_subarg_cmp("fsl_ddr", "ctlr_intlv", "cacheline"))
 				popts->memctl_interleaving_mode =
 					FSL_DDR_CACHE_LINE_INTERLEAVING;
-			else if (strcmp(p, "page") == 0)
+			else if (hwconfig_subarg_cmp("fsl_ddr", "ctlr_intlv", "page"))
 				popts->memctl_interleaving_mode =
 					FSL_DDR_PAGE_INTERLEAVING;
-			else if (strcmp(p, "bank") == 0)
+			else if (hwconfig_subarg_cmp("fsl_ddr", "ctlr_intlv", "bank"))
 				popts->memctl_interleaving_mode =
 					FSL_DDR_BANK_INTERLEAVING;
-			else if (strcmp(p, "superbank") == 0)
+			else if (hwconfig_subarg_cmp("fsl_ddr", "ctlr_intlv", "superbank"))
 				popts->memctl_interleaving_mode =
 					FSL_DDR_SUPERBANK_INTERLEAVING;
-			else
-				popts->memctl_interleaving_mode =
-						simple_strtoul(p, NULL, 0);
+			else {
+				popts->memctl_interleaving = 0;
+				printf("hwconfig has unrecognized parameter for ctlr_intlv.\n");
+			}
 		}
 	}
 #endif
 
-	if( ((p = getenv("ba_intlv_ctl")) != NULL) &&
+	if ((hwconfig_sub("fsl_ddr", "bank_intlv")) &&
 		(CONFIG_CHIP_SELECTS_PER_CTRL > 1)) {
-		if (strcmp(p, "cs0_cs1") == 0)
+		/* test null first. if CONFIG_HWCONFIG is not defined,
+		 * hwconfig_arg_cmp returns non-zero */
+		if (hwconfig_subarg_cmp("fsl_ddr", "bank_intlv", "null"))
+			printf("bank interleaving disabled.\n");
+		else if (hwconfig_subarg_cmp("fsl_ddr", "bank_intlv", "cs0_cs1"))
 			popts->ba_intlv_ctl = FSL_DDR_CS0_CS1;
-		else if (strcmp(p, "cs2_cs3") == 0)
+		else if (hwconfig_subarg_cmp("fsl_ddr", "bank_intlv", "cs2_cs3"))
 			popts->ba_intlv_ctl = FSL_DDR_CS2_CS3;
-		else if (strcmp(p, "cs0_cs1_and_cs2_cs3") == 0)
+		else if (hwconfig_subarg_cmp("fsl_ddr", "bank_intlv", "cs0_cs1_and_cs2_cs3"))
 			popts->ba_intlv_ctl = FSL_DDR_CS0_CS1_AND_CS2_CS3;
-		else if (strcmp(p, "cs0_cs1_cs2_cs3") == 0)
+		else if (hwconfig_subarg_cmp("fsl_ddr", "bank_intlv", "cs0_cs1_cs2_cs3"))
 			popts->ba_intlv_ctl = FSL_DDR_CS0_CS1_CS2_CS3;
 		else
-			popts->ba_intlv_ctl = simple_strtoul(p, NULL, 0);
+			printf("hwconfig has unrecognized parameter for ba_intlv_ctl.\n");
 
 		switch (popts->ba_intlv_ctl & FSL_DDR_CS0_CS1_CS2_CS3) {
 		case FSL_DDR_CS0_CS1_CS2_CS3:
diff --git a/doc/README.fsl-ddr b/doc/README.fsl-ddr
index 9c2224f..6e4f6e9 100644
--- a/doc/README.fsl-ddr
+++ b/doc/README.fsl-ddr
@@ -32,38 +32,41 @@ The ways to configure the ddr interleaving mode
 1. In board header file(e.g.MPC8572DS.h), add default interleaving setting
    under "CONFIG_EXTRA_ENV_SETTINGS", like:
 	#define CONFIG_EXTRA_ENV_SETTINGS				\
-	 "memctl_intlv_ctl=2\0"						\
+	 "hwconfig=fsl_ddr:ctlr_intlv=bank"			\
 	 ......
 
 2. Run u-boot "setenv" command to configure the memory interleaving mode.
    Either numerical or string value is accepted.
 
   # disable memory controller interleaving
-  setenv memctl_intlv_ctl
+  setenv hwconfig "fsl_ddr:ctlr_intlv=null"
 
   # cacheline interleaving
-  setenv memctl_intlv_ctl 0 or setenv memctl_intlv_ctl cacheline
+  setenv hwconfig "fsl_ddr:ctlr_intlv=cacheline"
 
   # page interleaving
-  setenv memctl_intlv_ctl 1 or setenv memctl_intlv_ctl page
+  setenv hwconfig "fsl_ddr:ctlr_intlv=page"
 
   # bank interleaving
-  setenv memctl_intlv_ctl 2 or setenv memctl_intlv_ctl bank
+  setenv hwconfig "fsl_ddr:ctlr_intlv=bank"
 
   # superbank
-  setenv memctl_intlv_ctl 3 or setenv memctl_intlv_ctl superbank
+  setenv hwconfig "fsl_ddr:ctlr_intlv=superbank"
 
   # disable bank (chip-select) interleaving
-  setenv ba_intlv_ctl
+  setenv hwconfig "fsl_ddr:bank_intlv=null"
 
   # bank(chip-select) interleaving cs0+cs1
-  setenv ba_intlv_ctl 0x40 or setenv ba_intlv_ctl cs0_cs1
+  setenv hwconfig "fsl_ddr:bank_intlv=cs0_cs1"
 
   # bank(chip-select) interleaving cs2+cs3
-  setenv ba_intlv_ctl 0x20 or setenv ba_intlv_ctl cs2_cs3
+  setenv hwconfig "fsl_ddr:bank_intlv=cs2_cs3"
 
   # bank(chip-select) interleaving (cs0+cs1) and (cs2+cs3)  (2x2)
-  setenv ba_intlv_ctl 0x60 or setenv ba_intlv_ctl cs0_cs1_and_cs2_cs3
+  setenv hwconfig "fsl_ddr:bank_intlv=cs0_cs1_and_cs2_cs3"
 
   # bank(chip-select) interleaving (cs0+cs1+cs2+cs3) (4x1)
-  setenv ba_intlv_ctl 0x04 or setenv ba_intlv_ctl cs0_cs1_cs2_cs3
+  setenv hwconfig "fsl_ddr:bank_intlv=cs0_cs1_cs2_cs3"
+
+  The above memory controller interleaving and bank interleaving can be mixed. The syntax is
+  setenv hwconfig "fsl_ddr:ctlr_intlv=cacheline,bank_intlv=cs0_cs1"
-- 
1.6.0.6

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

end of thread, other threads:[~2010-07-31 17:11 UTC | newest]

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-07-28 23:25 [U-Boot] [PATCH 8/8] powerpc/85xx: Add memory test feature for mpc85xx sun york-R58495
2010-07-29 21:28 ` Wolfgang Denk
2010-07-30 21:20   ` [U-Boot] help on POST York Sun
2010-07-30 21:29     ` Wolfgang Denk
2010-07-30 21:34       ` York Sun
2010-07-31 17:11         ` Wolfgang Denk
  -- strict thread matches above, loose matches on Subject: below --
2010-07-14 15:14 [U-Boot] [PATCH 1/8] powerpc/8xxx: Enabled hwconfig for memory interleaving Kumar Gala
2010-07-14 15:14 ` [U-Boot] [PATCH 2/8] powerpc/8xxx: Fix bug in memctrl interleaving & bank interleaving on cs0~cs4 Kumar Gala
2010-07-14 15:14   ` [U-Boot] [PATCH 3/8] powerpc/8xxx: Enable quad-rank DIMMs Kumar Gala
2010-07-14 15:14     ` [U-Boot] [PATCH 4/8] powerpc/8xxx: Enabled address hashing for 85xx Kumar Gala
2010-07-14 15:14       ` [U-Boot] [PATCH 5/8] powerpc/8xxx: Enable DDR3 RDIMM support Kumar Gala
2010-07-14 15:15         ` [U-Boot] [PATCH 6/8] powerpc/8xxx: Improvement to DDR parameters Kumar Gala
2010-07-14 15:15           ` [U-Boot] [PATCH 7/8] powerpc/p2020ds: Integrated with P2020DS DDR change and enabled hwconfig Kumar Gala
2010-07-14 15:15             ` [U-Boot] [PATCH 8/8] powerpc/85xx: Add memory test feature for mpc85xx Kumar Gala
2010-07-14 20:16               ` Wolfgang Denk
2010-07-14 22:13                 ` Timur Tabi
2010-07-15  9:07                   ` Wolfgang Denk
2010-07-28 21:06                     ` York Sun
2010-07-28 21:50                       ` Wolfgang Denk

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