Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev/ic Print the part number for DDR3 modules.
details: https://anonhg.NetBSD.org/src/rev/11e63704470d
branches: trunk
changeset: 788758:11e63704470d
user: soren <soren%NetBSD.org@localhost>
date: Fri Jul 19 01:02:49 2013 +0000
description:
Print the part number for DDR3 modules.
Also closes PR kern/44665.
diffstat:
sys/dev/ic/spdmem.c | 62 ++++++++++++++++++++++++++++++++++---------------
sys/dev/ic/spdmemvar.h | 8 ++++-
2 files changed, 49 insertions(+), 21 deletions(-)
diffs (182 lines):
diff -r 8ee28fae5048 -r 11e63704470d sys/dev/ic/spdmem.c
--- a/sys/dev/ic/spdmem.c Thu Jul 18 22:58:35 2013 +0000
+++ b/sys/dev/ic/spdmem.c Fri Jul 19 01:02:49 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem.c,v 1.7 2012/10/27 17:18:22 chs Exp $ */
+/* $NetBSD: spdmem.c,v 1.8 2013/07/19 01:02:49 soren Exp $ */
/*
* Copyright (c) 2007 Nicolas Joly
@@ -35,7 +35,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.7 2012/10/27 17:18:22 chs Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.8 2013/07/19 01:02:49 soren Exp $");
#include <sys/param.h>
#include <sys/device.h>
@@ -259,19 +259,6 @@
for (i = 3; i < spd_len; i++)
((uint8_t *)s)[i] = (sc->sc_read)(sc, i);
-#ifdef DEBUG
- for (i = 0; i < spd_len; i += 16) {
- unsigned int j, k;
- aprint_debug("\n");
- aprint_debug_dev(self, "0x%02x:", i);
- k = (spd_len > i + 16) ? spd_len : i + 16;
- for (j = i; j < k; j++)
- aprint_debug(" %02x", ((uint8_t *)s)[j]);
- }
- aprint_debug("\n");
- aprint_debug_dev(self, "");
-#endif
-
/*
* Setup our sysctl subtree, hw.spdmemN
*/
@@ -336,9 +323,6 @@
}
}
- aprint_naive("\n");
- aprint_normal("\n");
- aprint_normal_dev(self, "%s", type);
strlcpy(sc->sc_type, type, SPDMEM_TYPE_MAXLEN);
if (node != NULL)
sysctl_createv(&sc->sc_sysctl_log, 0, NULL, NULL,
@@ -349,7 +333,9 @@
CTL_HW, node->sysctl_num, CTL_CREATE, CTL_EOL);
if (IS_RAMBUS_TYPE) {
- aprint_normal(", SPD Revision %s", rambus_rev);
+ aprint_naive("\n");
+ aprint_normal("\n");
+ aprint_normal_dev(self, "%s, SPD Revision %s", type, rambus_rev);
dimm_size = 1 << (s->sm_rdr.rdr_rows + s->sm_rdr.rdr_cols - 13);
if (dimm_size >= 1024)
aprint_normal(", %dGB\n", dimm_size / 1024);
@@ -384,6 +370,16 @@
decode_fbdimm(node, self, s);
break;
}
+
+ /* Dump SPD */
+ for (i = 0; i < spd_len; i += 16) {
+ unsigned int j, k;
+ aprint_debug_dev(self, "0x%02x:", i);
+ k = (spd_len > (i + 16)) ? i + 16 : spd_len;
+ for (j = i; j < k; j++)
+ aprint_debug(" %02x", ((uint8_t *)s)[j]);
+ aprint_debug("\n");
+ }
}
int
@@ -487,6 +483,10 @@
static void
decode_edofpm(const struct sysctlnode *node, device_t self, struct spdmem *s) {
+ aprint_naive("\n");
+ aprint_normal("\n");
+ aprint_normal_dev(self, "%s", spdmem_basic_types[s->sm_type]);
+
aprint_normal("\n");
aprint_verbose_dev(self,
"%d rows, %d cols, %d banks, %dns tRAC, %dns tCAC\n",
@@ -496,6 +496,10 @@
static void
decode_rom(const struct sysctlnode *node, device_t self, struct spdmem *s) {
+ aprint_naive("\n");
+ aprint_normal("\n");
+ aprint_normal_dev(self, "%s", spdmem_basic_types[s->sm_type]);
+
aprint_normal("\n");
aprint_verbose_dev(self, "%d rows, %d cols, %d banks\n",
s->sm_rom.rom_rows, s->sm_rom.rom_cols, s->sm_rom.rom_banks);
@@ -506,6 +510,10 @@
int spd_len) {
int dimm_size, cycle_time, bits, tAA, i, speed, freq;
+ aprint_naive("\n");
+ aprint_normal("\n");
+ aprint_normal_dev(self, "%s", spdmem_basic_types[s->sm_type]);
+
aprint_normal("%s, %s, ",
(s->sm_sdr.sdr_mod_attrs & SPDMEM_SDR_MASK_REG)?
" (registered)":"",
@@ -566,6 +574,10 @@
decode_ddr(const struct sysctlnode *node, device_t self, struct spdmem *s) {
int dimm_size, cycle_time, bits, tAA, i;
+ aprint_naive("\n");
+ aprint_normal("\n");
+ aprint_normal_dev(self, "%s", spdmem_basic_types[s->sm_type]);
+
aprint_normal("%s, %s, ",
(s->sm_ddr.ddr_mod_attrs & SPDMEM_DDR_MASK_REG)?
" (registered)":"",
@@ -610,6 +622,10 @@
decode_ddr2(const struct sysctlnode *node, device_t self, struct spdmem *s) {
int dimm_size, cycle_time, bits, tAA, i;
+ aprint_naive("\n");
+ aprint_normal("\n");
+ aprint_normal_dev(self, "%s", spdmem_basic_types[s->sm_type]);
+
aprint_normal("%s, %s, ",
(s->sm_ddr2.ddr2_mod_attrs & SPDMEM_DDR2_MASK_REG)?
" (registered)":"",
@@ -654,6 +670,10 @@
decode_ddr3(const struct sysctlnode *node, device_t self, struct spdmem *s) {
int dimm_size, cycle_time, bits;
+ aprint_naive("\n");
+ aprint_normal(": %18s\n", s->sm_ddr3.ddr3_part);
+ aprint_normal_dev(self, "%s", spdmem_basic_types[s->sm_type]);
+
if (s->sm_ddr3.ddr3_mod_type ==
SPDMEM_DDR3_TYPE_MINI_RDIMM ||
s->sm_ddr3.ddr3_mod_type == SPDMEM_DDR3_TYPE_RDIMM)
@@ -705,6 +725,10 @@
decode_fbdimm(const struct sysctlnode *node, device_t self, struct spdmem *s) {
int dimm_size, cycle_time, bits;
+ aprint_naive("\n");
+ aprint_normal("\n");
+ aprint_normal_dev(self, "%s", spdmem_basic_types[s->sm_type]);
+
/*
* FB-DIMM module size calculation is very much like DDR3
*/
diff -r 8ee28fae5048 -r 11e63704470d sys/dev/ic/spdmemvar.h
--- a/sys/dev/ic/spdmemvar.h Thu Jul 18 22:58:35 2013 +0000
+++ b/sys/dev/ic/spdmemvar.h Fri Jul 19 01:02:49 2013 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmemvar.h,v 1.2 2011/08/01 03:49:52 pgoyette Exp $ */
+/* $NetBSD: spdmemvar.h,v 1.3 2013/07/19 01:02:49 soren Exp $ */
/*
* Copyright (c) 2007 Paul Goyette
@@ -478,6 +478,11 @@
uint8_t ddr3_mfg_week;
uint8_t ddr3_serial[4];
uint16_t ddr3_crc;
+ uint8_t ddr3_part[18];
+ uint8_t ddr3_rev[2];
+ uint8_t ddr3_dram_mfgID_lsb;
+ uint8_t ddr3_dram_mfgID_msb;
+ uint8_t ddr3_vendor[26];
} __packed;
struct spdmem {
@@ -494,7 +499,6 @@
struct spdmem_rom u1_rom;
struct spdmem_ddr3 u1_ddr3;
} sm_u1;
- uint8_t sm_extension[128];
} __packed;
#define sm_fbd sm_u1.u1_fbd
#define sm_fpm sm_u1.u1_fpm
Home |
Main Index |
Thread Index |
Old Index