Module Name: src Committed By: msaitoh Date: Thu Dec 27 02:54:00 UTC 2018
Modified Files: src/sys/dev/ic: spdmem.c spdmemvar.h Log Message: Print rank on DDR4. To generate a diff of this commit: cvs rdiff -u -r1.29 -r1.30 src/sys/dev/ic/spdmem.c cvs rdiff -u -r1.13 -r1.14 src/sys/dev/ic/spdmemvar.h Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/sys/dev/ic/spdmem.c diff -u src/sys/dev/ic/spdmem.c:1.29 src/sys/dev/ic/spdmem.c:1.30 --- src/sys/dev/ic/spdmem.c:1.29 Wed Dec 26 10:24:20 2018 +++ src/sys/dev/ic/spdmem.c Thu Dec 27 02:54:00 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: spdmem.c,v 1.29 2018/12/26 10:24:20 msaitoh Exp $ */ +/* $NetBSD: spdmem.c,v 1.30 2018/12/27 02:54:00 msaitoh Exp $ */ /* * Copyright (c) 2007 Nicolas Joly @@ -35,7 +35,7 @@ */ #include <sys/cdefs.h> -__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.29 2018/12/26 10:24:20 msaitoh Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.30 2018/12/27 02:54:00 msaitoh Exp $"); #include <sys/param.h> #include <sys/device.h> @@ -869,7 +869,7 @@ decode_fbdimm(const struct sysctlnode *n static void decode_ddr4(const struct sysctlnode *node, device_t self, struct spdmem *s) { - int dimm_size, cycle_time; + int dimm_size, cycle_time, ranks; int tAA_clocks, tRCD_clocks,tRP_clocks, tRAS_clocks; aprint_naive("\n"); @@ -937,14 +937,17 @@ decode_ddr4(const struct sysctlnode *nod 1 << (s->sm_ddr4.ddr4_primary_bus_width + 3), TRUE, "PC4", 0); + ranks = s->sm_ddr4.ddr4_package_ranks + 1; aprint_verbose_dev(self, - "%d rows, %d cols, %d banks/group, %d bank groups, " - "%d.%03dns cycle time\n", + "%d rows, %d cols, %d ranks%s, %d banks/group, %d bank groups\n", s->sm_ddr4.ddr4_rows + 12, s->sm_ddr4.ddr4_cols + 9, + ranks, (ranks > 1) ? ((s->sm_ddr4.ddr4_rank_mix == 1) + ? " (asymmetric)" : " (symmetiric)") : "", 1 << (2 + s->sm_ddr4.ddr4_logbanks), - 1 << s->sm_ddr4.ddr4_bankgroups, - cycle_time / 1000, cycle_time % 1000); + 1 << s->sm_ddr4.ddr4_bankgroups); + aprint_verbose_dev(self, "%d.%03dns cycle time\n", + cycle_time / 1000, cycle_time % 1000); tAA_clocks = __DDR4_VALUE(tAAmin) * 1000 / cycle_time; tRCD_clocks = __DDR4_VALUE(tRCDmin) * 1000 / cycle_time; Index: src/sys/dev/ic/spdmemvar.h diff -u src/sys/dev/ic/spdmemvar.h:1.13 src/sys/dev/ic/spdmemvar.h:1.14 --- src/sys/dev/ic/spdmemvar.h:1.13 Wed Jan 18 06:02:50 2017 +++ src/sys/dev/ic/spdmemvar.h Thu Dec 27 02:54:00 2018 @@ -1,4 +1,4 @@ -/* $NetBSD: spdmemvar.h,v 1.13 2017/01/18 06:02:50 msaitoh Exp $ */ +/* $NetBSD: spdmemvar.h,v 1.14 2018/12/27 02:54:00 msaitoh Exp $ */ /* * Copyright (c) 2007 Paul Goyette @@ -768,7 +768,8 @@ struct spdmem_ddr4 { /* Dual Data Rat uint8_t ddr4_device_width:3, \ /* number of package ranks is field value plus 1 */ \ uint8_t ddr4_package_ranks:3, \ - uint8_t ddr4_unused9:2, \ + uint8_t ddr4_rank_mix:1, \ + uint8_t ddr4_unused9:1 \ ); SPD_BITFIELD( \ /* primary width is offset by 3, extension is offset by 2 */ \