smbios: handle DIMM of 32G or more

According to SMBIOS Reference Specification (1)
section 7.18.5 Memory Device — Extended Size

When the size cannot be represented in the size field, it must be set to
0x7fff and the real size stored in the extended_size field.

1: https://www.dmtf.org/sites/default/files/standards/documents/DSP0134_3.1.1.pdf

Change-Id: Idc559454c16ccd685aaaed0d60f1af69b634ea2e
Signed-off-by: Julien Viard de Galbert <jviarddegalbert@online.net>
Reviewed-on: https://review.coreboot.org/23396
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
Julien Viard de Galbert 2018-01-24 11:04:46 +01:00 committed by Martin Roth
parent efea957ed6
commit 9989171401
1 changed files with 6 additions and 1 deletions

View File

@ -207,7 +207,12 @@ static int create_smbios_type17_for_dimm(struct dimm_info *dimm,
t->clock_speed = dimm->ddr_frequency;
t->speed = dimm->ddr_frequency;
t->type = SMBIOS_MEMORY_DEVICE;
t->size = dimm->dimm_size;
if (dimm->dimm_size < 0x7fff) {
t->size = dimm->dimm_size;
} else {
t->size = 0x7fff;
t->extended_size = dimm->dimm_size & 0x7fffffff;
}
t->data_width = 8 * (1 << (dimm->bus_width & 0x7));
t->total_width = t->data_width + 8 * ((dimm->bus_width & 0x18) >> 3);