From 28fa33ccbce042d09daf64efa2097b67570ad4af Mon Sep 17 00:00:00 2001 From: Elyes HAOUAS Date: Fri, 25 Jan 2019 13:46:43 +0100 Subject: [PATCH] arch/x86/smbios(type4): Write processor_upgrade field Change-Id: I1bf5ac6c411720d349df8fd706015c6835758cd0 Signed-off-by: Elyes HAOUAS Reviewed-on: https://review.coreboot.org/c/coreboot/+/29529 Reviewed-by: Nico Huber Tested-by: build bot (Jenkins) --- src/arch/x86/smbios.c | 24 +++++++++++++++++++++++- 1 file changed, 23 insertions(+), 1 deletion(-) diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 8cb59df6a3..c01892ad2f 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -472,6 +472,28 @@ const char *__weak smbios_system_sku(void) return ""; } +static int get_socket_type(void) +{ + if (CONFIG(CPU_INTEL_SLOT_1)) + return 0x08; + if (CONFIG(CPU_INTEL_SOCKET_MPGA604)) + return 0x13; + if (CONFIG(CPU_INTEL_SOCKET_LGA775)) + return 0x15; + if (CONFIG(CPU_AMD_SOCKET_AM2R2)) + return 0x17; + if (CONFIG(CPU_AMD_SOCKET_F_1207)) + return 0x18; + if (CONFIG(CPU_AMD_SOCKET_G34_NON_AGESA)) + return 0x1a; + if (CONFIG(CPU_AMD_SOCKET_AM3)) + return 0x1b; + if (CONFIG(CPU_AMD_SOCKET_C32_NON_AGESA)) + return 0x1c; + + return 0x02; /* Unknown */ +} + static int smbios_write_type1(unsigned long *current, int handle) { struct smbios_type1 *t = (struct smbios_type1 *)*current; @@ -574,7 +596,7 @@ static int smbios_write_type4(unsigned long *current, int handle) t->l1_cache_handle = 0xffff; t->l2_cache_handle = 0xffff; t->l3_cache_handle = 0xffff; - t->processor_upgrade = 1; + t->processor_upgrade = get_socket_type(); len = t->length + smbios_string_table_len(t->eos); *current += len; return len;