Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files. =================================================================== RCS file: /ftp/cvs/cvsroot/src/sys/dev/ic/spdmem.c,v rcsdiff: /ftp/cvs/cvsroot/src/sys/dev/ic/spdmem.c,v: warning: Unknown phrases like `commitid ...;' are present. retrieving revision 1.23 retrieving revision 1.23.2.1 diff -u -p -r1.23 -r1.23.2.1 --- src/sys/dev/ic/spdmem.c 2017/01/11 21:44:50 1.23 +++ src/sys/dev/ic/spdmem.c 2017/04/21 16:53:46 1.23.2.1 @@ -1,4 +1,4 @@ -/* $NetBSD: spdmem.c,v 1.23 2017/01/11 21:44:50 maya Exp $ */ +/* $NetBSD: spdmem.c,v 1.23.2.1 2017/04/21 16:53:46 bouyer Exp $ */ /* * Copyright (c) 2007 Nicolas Joly @@ -35,7 +35,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.23 2017/01/11 21:44:50 maya Exp $"); +__KERNEL_RCSID(0, "$NetBSD: spdmem.c,v 1.23.2.1 2017/04/21 16:53:46 bouyer Exp $"); #include #include @@ -909,11 +909,15 @@ decode_ddr4(const struct sysctlnode *nod } } +/* + * Note that the ddr4_xxx_ftb fields are actually signed offsets from + * the corresponding mtb value, so we might have to subtract 256! + */ #define __DDR4_VALUE(field) ((s->sm_ddr4.ddr4_##field##_mtb * 125 + \ s->sm_ddr4.ddr4_##field##_ftb) - \ ((s->sm_ddr4.ddr4_##field##_ftb > 127)?256:0)) /* - * For now, the only value for mtb is 1 = 125ps, and ftp = 1ps + * For now, the only value for mtb is 0 = 125ps, and ftb = 1ps * so we don't need to figure out the time-base units - just * hard-code them for now. */ @@ -930,10 +934,6 @@ decode_ddr4(const struct sysctlnode *nod 1 << s->sm_ddr4.ddr4_bankgroups, cycle_time / 1000, cycle_time % 1000); -/* - * Note that the ddr4_xxx_ftb fields are actually signed offsets from - * the corresponding mtb value, so we might have to subtract 256! - */ tAA_clocks = __DDR4_VALUE(tAAmin) * 1000 / cycle_time; tRCD_clocks = __DDR4_VALUE(tRCDmin) * 1000 / cycle_time;