diff mbox

[U-Boot,1/4] powerpc/mpc8xxx: fix recognition of DIMMs with ECC and Address Parity

Message ID 1300395492-21155-1-git-send-email-galak@kernel.crashing.org
State Accepted
Commit 08b3f7599f7bdf7e96cf46ecb9eecffc92b323d2
Delegated to: Kumar Gala
Headers show

Commit Message

Kumar Gala March 17, 2011, 8:58 p.m. UTC
From: York Sun <yorksun@freescale.com>

To recognize DIMMs with ECC capability by testing ECC bit only. Not to be
confused by Address Parity bit.

Signed-off-by: York Sun <yorksun@freescale.com>
Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
---
 .../cpu/mpc8xxx/ddr/lc_common_dimm_params.c        |    3 ++-
 arch/powerpc/include/asm/fsl_ddr_dimm_params.h     |    4 ++++
 2 files changed, 6 insertions(+), 1 deletions(-)

Comments

Kumar Gala March 23, 2011, 5:22 a.m. UTC | #1
On Mar 17, 2011, at 3:58 PM, Kumar Gala wrote:

> From: York Sun <yorksun@freescale.com>
> 
> To recognize DIMMs with ECC capability by testing ECC bit only. Not to be
> confused by Address Parity bit.
> 
> Signed-off-by: York Sun <yorksun@freescale.com>
> Signed-off-by: Kumar Gala <galak@kernel.crashing.org>
> ---
> .../cpu/mpc8xxx/ddr/lc_common_dimm_params.c        |    3 ++-
> arch/powerpc/include/asm/fsl_ddr_dimm_params.h     |    4 ++++
> 2 files changed, 6 insertions(+), 1 deletions(-)

applied

- k
diff mbox

Patch

diff --git a/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c b/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
index a58e5a9..8b31ec0 100644
--- a/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
+++ b/arch/powerpc/cpu/mpc8xxx/ddr/lc_common_dimm_params.c
@@ -367,7 +367,8 @@  compute_lowest_common_dimm_parameters(const dimm_params_t *dimm_params,
 	/* Determine if all DIMMs ECC capable. */
 	temp1 = 1;
 	for (i = 0; i < number_of_dimms; i++) {
-		if (dimm_params[i].n_ranks && dimm_params[i].edc_config != 2) {
+		if (dimm_params[i].n_ranks &&
+			!(dimm_params[i].edc_config & EDC_ECC)) {
 			temp1 = 0;
 			break;
 		}
diff --git a/arch/powerpc/include/asm/fsl_ddr_dimm_params.h b/arch/powerpc/include/asm/fsl_ddr_dimm_params.h
index be82602..982b809 100644
--- a/arch/powerpc/include/asm/fsl_ddr_dimm_params.h
+++ b/arch/powerpc/include/asm/fsl_ddr_dimm_params.h
@@ -9,6 +9,10 @@ 
 #ifndef DDR2_DIMM_PARAMS_H
 #define DDR2_DIMM_PARAMS_H
 
+#define EDC_DATA_PARITY	1
+#define EDC_ECC		2
+#define EDC_AC_PARITY	4
+
 /* Parameters for a DDR2 dimm computed from the SPD */
 typedef struct dimm_params_s {