From e41f595310d6e74ba8ca67c87abfa2fed790428f Mon Sep 17 00:00:00 2001 From: Tim Chu Date: Mon, 2 Nov 2020 21:33:52 -0800 Subject: arch/x86/smbios: Update memory_array_handle for SMBIOS type 19 Update memory array handle for SMBIOS type 19. TEST=Execute "dmidecode -t 19" to check if memory array handle is correct. Signed-off-by: Tim Chu Change-Id: I49078b870bac3c6162913b91651ec09632800f1f Reviewed-on: https://review.coreboot.org/c/coreboot/+/47156 Tested-by: build bot (Jenkins) Reviewed-by: Jonathan Zhang Reviewed-by: Angel Pons --- src/arch/x86/smbios.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/arch/x86') diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 19b6f5d989..dc676cf141 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -1068,7 +1068,7 @@ static int smbios_write_type17(unsigned long *current, int *handle, int type16) return totallen; } -static int smbios_write_type19(unsigned long *current, int *handle) +static int smbios_write_type19(unsigned long *current, int *handle, int type16) { struct smbios_type19 *t = (struct smbios_type19 *)*current; int len = sizeof(struct smbios_type19); @@ -1084,6 +1084,7 @@ static int smbios_write_type19(unsigned long *current, int *handle) t->type = SMBIOS_MEMORY_ARRAY_MAPPED_ADDRESS; t->length = len - 2; t->handle = *handle; + t->memory_array_handle = type16; for (i = 0; i < meminfo->dimm_cnt && i < ARRAY_SIZE(meminfo->dimm); i++) { if (meminfo->dimm[i].dimm_size > 0) { @@ -1335,7 +1336,7 @@ unsigned long smbios_write_tables(unsigned long current) const int type16 = handle; update_max(len, max_struct_size, smbios_write_type16(¤t, &handle)); update_max(len, max_struct_size, smbios_write_type17(¤t, &handle, type16)); - update_max(len, max_struct_size, smbios_write_type19(¤t, &handle)); + update_max(len, max_struct_size, smbios_write_type19(¤t, &handle, type16)); update_max(len, max_struct_size, smbios_write_type32(¤t, handle++)); update_max(len, max_struct_size, smbios_walk_device_tree(all_devices, -- cgit v1.2.3