Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-8]: src/sys/dev/ic Pull up following revision(s) (requested by ms...



details:   https://anonhg.NetBSD.org/src/rev/17fa6ac81702
branches:  netbsd-8
changeset: 851146:17fa6ac81702
user:      martin <martin%NetBSD.org@localhost>
date:      Wed Nov 22 14:33:23 2017 +0000

description:
Pull up following revision(s) (requested by msaitoh in ticket #369):
        sys/dev/ic/spdmem.c: revision 1.25
        sys/dev/ic/spdmem.c: revision 1.26
        sys/dev/ic/spdmem.c: revision 1.27
        sys/dev/ic/spdmem.c: revision 1.28
  A part number field of DDR3 and DDR4 is not NUL terminated. All unused chars
are filled by 0x20. Print it correctly.
Before:
spdmem0 at iic0 addr 0x50: 8KTF51264AZ-1G6E1 E1M^@,DPAFEQZ021
spdmem1 at iic0 addr 0x51: ACR256X64D3U1333C9BA^AM^X
spdmem2 at iic0 addr 0x52: KP223C-ELD        BA^BM-~
After:
spdmem0 at iic0 addr 0x50: 8KTF51264AZ-1G6E1
spdmem1 at iic0 addr 0x51: ACR256X64D3U1333C9
spdmem2 at iic0 addr 0x52: KP223C-ELD
dedup
simplify previous.
  Print "ECC" or "no ECC" for DDR4.

diffstat:

 sys/dev/ic/spdmem.c |  23 +++++++++++++++++------
 1 files changed, 17 insertions(+), 6 deletions(-)

diffs (60 lines):

diff -r 1e5209ba8c88 -r 17fa6ac81702 sys/dev/ic/spdmem.c
--- a/sys/dev/ic/spdmem.c       Wed Nov 22 14:30:23 2017 +0000
+++ b/sys/dev/ic/spdmem.c       Wed Nov 22 14:33:23 2017 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: spdmem.c,v 1.24 2017/01/18 06:02:50 msaitoh Exp $ */
+/* $NetBSD: spdmem.c,v 1.24.6.1 2017/11/22 14:33:23 martin Exp $ */
 
 /*
  * Copyright (c) 2007 Nicolas Joly
@@ -35,7 +35,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.24 2017/01/18 06:02:50 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.24.6.1 2017/11/22 14:33:23 martin Exp $");
 
 #include <sys/param.h>
 #include <sys/device.h>
@@ -748,12 +748,21 @@
 }
 
 static void
+print_part(const char *part, size_t pnsize)
+{
+       const char *p = memchr(part, ' ', pnsize);
+       if (p == NULL)
+               p = part + pnsize;
+       aprint_normal(": %.*s\n", (int)(p - part), part);
+}
+
+static void
 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);
+       print_part(s->sm_ddr3.ddr3_part, sizeof(s->sm_ddr3.ddr3_part));
        aprint_normal_dev(self, "%s", spdmem_basic_types[s->sm_type]);
 
        if (s->sm_ddr3.ddr3_mod_type ==
@@ -864,13 +873,15 @@
        int tAA_clocks, tRCD_clocks,tRP_clocks, tRAS_clocks;
 
        aprint_naive("\n");
-       aprint_normal(": %20s\n", s->sm_ddr4.ddr4_part_number);
+       print_part(s->sm_ddr4.ddr4_part_number,
+           sizeof(s->sm_ddr4.ddr4_part_number));
        aprint_normal_dev(self, "%s", spdmem_basic_types[s->sm_type]);
        if (s->sm_ddr4.ddr4_mod_type < __arraycount(spdmem_ddr4_module_types))
                aprint_normal(" (%s)", 
                    spdmem_ddr4_module_types[s->sm_ddr4.ddr4_mod_type]);
-       aprint_normal(", %stemp-sensor, ",
-               (s->sm_ddr4.ddr4_has_therm_sensor)?"":"no ");
+       aprint_normal(", %sECC, %stemp-sensor, ",
+               (s->sm_ddr4.ddr4_bus_width_extension) ? "" : "no ",
+               (s->sm_ddr4.ddr4_has_therm_sensor) ? "" : "no ");
 
        /*
         * DDR4 size calculation from JEDEC spec



Home | Main Index | Thread Index | Old Index