summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorPatrick Rudolph <patrick.rudolph@9elements.com>2020-07-27 15:37:43 +0200
committerAngel Pons <th3fanbus@gmail.com>2020-07-30 22:31:24 +0000
commit5e007808cd380fe934b1a3f0c42eb79cb03787d0 (patch)
treeefb2c027acb0d018b5922e0f246db467dc4847a8 /src/include
parent95c42c3b04b1e499d756d979ef0ce2c428d9c540 (diff)
downloadcoreboot-5e007808cd380fe934b1a3f0c42eb79cb03787d0.tar.xz
smbios: Fix type 17 for Windows 10
The `GetPhysicallyInstalledSystemMemory` API call, at least on Windows 10, returns an error if SMBIOS tables are invalid. Various tools use this API call and don't operate correctly if this fails. For example, the "Intel Processor Diagnostic Tool" program is affected. Windows then guesses the physical memory size by accumulating entries from the firmware-provided memory map, which results in a total memory size that is slightly lower than the actual installed memory capacity. To fix this issue, add the handle to a type 16 entry to all type 17 entries. Add new fields to struct memory_info and fill them in Intel common code. Use the introduced variables to fill type 16 in smbios.c and provide a handle to type 17 entries. Besides keeping the current behaviour on intel/soc/common platforms, the type 16 table is also emitted on platforms that don't explicitly fill it, by using the existing fields of struct memory_info. Tested on Windows 10: The GetPhysicallyInstalledSystemMemory API call doesn't return an error anymore and the installed memory is now being reported as 8192 MiB. Change-Id: Idc3a363cbc3d0654dafd4176c4f4af9005210f42 Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com> Signed-off-by: Angel Pons <th3fanbus@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/43969 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Marcello Sylvester Bauer <sylv@sylv.io> Reviewed-by: Christian Walter <christian.walter@9elements.com> Reviewed-by: Patrick Rudolph <siro@das-labor.org>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/memory_info.h9
1 files changed, 9 insertions, 0 deletions
diff --git a/src/include/memory_info.h b/src/include/memory_info.h
index a9891189d2..f4a200995c 100644
--- a/src/include/memory_info.h
+++ b/src/include/memory_info.h
@@ -5,6 +5,7 @@
#define _MEMORY_INFO_H_
#include <stdint.h>
+#include <stdbool.h>
#define DIMM_INFO_SERIAL_SIZE 4
#define DIMM_INFO_PART_NUMBER_SIZE 33
@@ -81,6 +82,14 @@ struct dimm_info {
} __packed;
struct memory_info {
+ /* controller specific */
+ bool ecc_capable;
+ /* Maximum capacity the DRAM controller/mainboard supports */
+ uint32_t max_capacity_mib;
+ /* Maximum number of DIMMs the DRAM controller/mainboard supports */
+ uint16_t number_of_devices;
+
+ /* active DIMM configuration */
uint8_t dimm_cnt;
struct dimm_info dimm[DIMM_INFO_TOTAL];
} __packed;