summaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorMark Kettenis <kettenis@cvs.openbsd.org>2019-12-21 12:33:04 +0000
committerMark Kettenis <kettenis@cvs.openbsd.org>2019-12-21 12:33:04 +0000
commit3a0c705d9da46d8a64799f227c61bc81e7047540 (patch)
tree37742da51b2619cb2bc7e58477c7c9bcff435b9c /sys
parentddddbc8242b8521b332d736eb6797dd909080833 (diff)
Fix DDR4 DIMM size calculation.
ok claudio@
Diffstat (limited to 'sys')
-rw-r--r--sys/dev/spdmem.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/dev/spdmem.c b/sys/dev/spdmem.c
index f4699e6e515..56691be5fdf 100644
--- a/sys/dev/spdmem.c
+++ b/sys/dev/spdmem.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: spdmem.c,v 1.6 2019/12/17 08:01:36 claudio Exp $ */
+/* $OpenBSD: spdmem.c,v 1.7 2019/12/21 12:33:03 kettenis Exp $ */
/* $NetBSD: spdmem.c,v 1.3 2007/09/20 23:09:59 xtraeme Exp $ */
/*
@@ -770,8 +770,8 @@ spdmem_ddr4_decode(struct spdmem_softc *sc, struct spdmem *s)
SPDMEM_DDR4_PACK_TYPE_DIE_COUNT_MASK;
}
- dimm_size = datawidth - (chipwidth + 2);
- dimm_size = ddr4_chipsize[chipsize] * (1 << dimm_size) *
+ dimm_size = (datawidth + 3) - (chipwidth + 2);
+ dimm_size = (ddr4_chipsize[chipsize] / 8) * (1 << dimm_size) *
(physbanks + 1) * (diecount + 1);
if (dimm_size < 1024)