u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Kyle Moffett <Kyle.D.Moffett@boeing.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [RFC][PATCH 1/3] DDR2: Support new JEDEC DDR2 SPD 1.3 spec
Date: Mon, 30 Aug 2010 14:24:51 -0400	[thread overview]
Message-ID: <1283192693-7328-2-git-send-email-Kyle.D.Moffett@boeing.com> (raw)
In-Reply-To: <1283192693-7328-1-git-send-email-Kyle.D.Moffett@boeing.com>

The new DDR2 SPD spec is backwards-compatible with the old one, but
there are DIMMs which are being produced which have new SPD version
fields that fail to work with U-boot.

To make the code a bit more readable, we add some human-readable
SPD_DIMM_TYPE_* constants.

Signed-off-by: Kyle Moffett <Kyle.D.Moffett@boeing.com>
---
 common/ddr_spd.c                   |    4 ++--
 cpu/mpc8xxx/ddr/ddr2_dimm_params.c |   30 ++++++++++++++++++++++--------
 2 files changed, 24 insertions(+), 10 deletions(-)

diff --git a/common/ddr_spd.c b/common/ddr_spd.c
index c058e4f..f7a482e 100644
--- a/common/ddr_spd.c
+++ b/common/ddr_spd.c
@@ -18,9 +18,9 @@ spd_check(const u8 *buf, u8 spd_rev, u8 spd_cksum)
 
 	/*
 	 * Check SPD revision supported
-	 * Rev 1.2 or less supported by this code
+	 * Rev 1.3 or less supported by this code
 	 */
-	if (spd_rev > 0x12) {
+	if (spd_rev > 0x13) {
 		printf("SPD revision %02X not supported by this code\n",
 		       spd_rev);
 		return 1;
diff --git a/cpu/mpc8xxx/ddr/ddr2_dimm_params.c b/cpu/mpc8xxx/ddr/ddr2_dimm_params.c
index d9d0fa7..2d40a60 100644
--- a/cpu/mpc8xxx/ddr/ddr2_dimm_params.c
+++ b/cpu/mpc8xxx/ddr/ddr2_dimm_params.c
@@ -9,6 +9,17 @@
 #include <common.h>
 #include <asm/fsl_ddr_sdram.h>
 
+/* These are all the types defined by the JEDEC DDR2 SPD 1.3 spec */
+#define SPD_DIMM_TYPE_UNDEFINED		0x00
+#define SPD_DIMM_TYPE_RDIMM		0x01
+#define SPD_DIMM_TYPE_UDIMM		0x02
+#define SPD_DIMM_TYPE_SO_DIMM		0x04
+#define SPD_DIMM_TYPE_72B_SO_CDIMM	0x06
+#define SPD_DIMM_TYPE_72B_SO_RDIMM	0x07
+#define SPD_DIMM_TYPE_MICRO_DIMM	0x08
+#define SPD_DIMM_TYPE_MINI_RDIMM	0x10
+#define SPD_DIMM_TYPE_MINI_UDIMM	0x20
+
 #include "ddr.h"
 /*
  * Calculate the Density of each Physical Rank.
@@ -250,20 +261,23 @@ ddr_compute_dimm_parameters(const ddr2_spd_eeprom_t *spd,
 	pdimm->primary_sdram_width = spd->primw;
 	pdimm->ec_sdram_width = spd->ecw;
 
-	/* FIXME: what about registered SO-DIMM? */
+	/* These are all the types defined by the JEDEC DDR2 SPD 1.3 spec */
 	switch (spd->dimm_type) {
-	case 0x01:	/* RDIMM */
-	case 0x10:	/* Mini-RDIMM */
-		pdimm->registered_dimm = 1; /* register buffered */
+	case SPD_DIMM_TYPE_RDIMM:
+	case SPD_DIMM_TYPE_72B_SO_RDIMM:
+	case SPD_DIMM_TYPE_MINI_RDIMM:
+		/* Registered/buffered DIMMs */
+		pdimm->registered_dimm = 1;
 		break;
 
-	case 0x02:	/* UDIMM */
-	case 0x04:	/* SO-DIMM */
-	case 0x08:	/* Micro-DIMM */
-	case 0x20:	/* Mini-UDIMM */
+	case SPD_DIMM_TYPE_UDIMM:
+	case SPD_DIMM_TYPE_SO_DIMM:
+	case SPD_DIMM_TYPE_MICRO_DIMM:
+	case SPD_DIMM_TYPE_MINI_UDIMM:
 		pdimm->registered_dimm = 0;	/* unbuffered */
 		break;
 
+	case SPD_DIMM_TYPE_72B_SO_CDIMM:
 	default:
 		printf("unknown dimm_type 0x%02X\n", spd->dimm_type);
 		return 1;
-- 
1.7.1

  reply	other threads:[~2010-08-30 18:24 UTC|newest]

Thread overview: 19+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2010-08-30 18:24 [U-Boot] [RFC] Board support patches for the eXMeritus HWW-1U-1A devices Kyle Moffett
2010-08-30 18:24 ` Kyle Moffett [this message]
2010-09-03  3:06   ` [U-Boot] [RFC][PATCH 1/3] DDR2: Support new JEDEC DDR2 SPD 1.3 spec Peter Tyser
2010-09-03  5:10     ` Kyle Moffett
2010-08-30 18:24 ` [U-Boot] [RFC][PATCH 2/3] e1000: Intel 82571EB: Don't wait for MNG cycle on unmanaged chips Kyle Moffett
2010-09-13  4:18   ` Ben Warren
2010-09-13  4:24     ` Kyle Moffett
2010-09-13  4:28       ` Ben Warren
2010-08-30 18:24 ` [U-Boot] [RFC][PATCH 3/3] Add board support for the eXMeritus HWW-1U-1A devices Kyle Moffett
2010-09-03  4:00   ` Peter Tyser
2010-09-03  5:50     ` Kyle Moffett
2010-09-07 22:09       ` Peter Tyser
2010-09-07 22:50         ` [U-Boot] [RFC][PATCH 3/3] Add board support for the eXMeritusHWW-1U-1A devices Moffett, Kyle D
2010-09-08  3:43           ` Peter Tyser
2010-09-07 21:21     ` [U-Boot] [RFC][PATCH 3/3] Add board support for the eXMeritus HWW-1U-1A devices Moffett, Kyle D
2010-09-07 21:40       ` Peter Tyser
2010-09-07 21:59         ` Wolfgang Denk
2010-09-07 22:21         ` [U-Boot] [RFC][PATCH 3/3] Add board support for the eXMeritusHWW-1U-1A devices Moffett, Kyle D
  -- strict thread matches above, loose matches on Subject: below --
2010-08-13 16:27 [U-Boot] [RFC] Board support patches for the eXMeritus HWW-1U-1A devices Kyle Moffett
2010-08-13 16:27 ` [U-Boot] [RFC][PATCH 1/3] DDR2: Support new JEDEC DDR2 SPD 1.3 spec Kyle Moffett

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1283192693-7328-2-git-send-email-Kyle.D.Moffett@boeing.com \
    --to=kyle.d.moffett@boeing.com \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).