arch/x86/smbios: Replace SMBIOS type4 processor upgrade fields

values by macros

Macro definitions are from DMTF System Management BIOS (SMBIOS)
Reference Specification (DSP0134) Chapter 7.5.5.

Change-Id: Ifed1d773b0b349f878648b8172fd770a397e9686
Signed-off-by: Li, Jincheng <jincheng.li@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/71633
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Elyes Haouas <ehaouas@noos.fr>
Reviewed-by: Marc Jones <marc@marcjonesconsulting.com>
Reviewed-by: Martin L Roth <gaumless@gmail.com>
This commit is contained in:
Li, Jincheng 2023-01-03 15:43:40 +08:00 committed by Martin L Roth
parent 060df17f1d
commit aa990125b8
2 changed files with 82 additions and 6 deletions

View File

@ -401,17 +401,17 @@ static int smbios_write_type0(unsigned long *current, int handle)
static int get_socket_type(void)
{
if (CONFIG(CPU_INTEL_SLOT_1))
return 0x08;
return PROCESSOR_UPGRADE_SLOT_1;
if (CONFIG(CPU_INTEL_SOCKET_MPGA604))
return 0x13;
return PROCESSOR_UPGRADE_SOCKET_MPGA604;
if (CONFIG(CPU_INTEL_SOCKET_LGA775))
return 0x15;
return PROCESSOR_UPGRADE_SOCKET_LGA775;
if (CONFIG(XEON_SP_COMMON_BASE))
return 0x36;
return PROCESSOR_UPGRADE_SOCKET_LGA3647_1;
if (CONFIG(SOC_INTEL_ALDERLAKE))
return 0x40;
return PROCESSOR_UPGRADE_SOCKET_LGA1700;
return 0x02; /* Unknown */
return PROCESSOR_UPGRADE_UNKNOWN;
}
unsigned int __weak smbios_processor_external_clock(void)

View File

@ -486,6 +486,82 @@ struct smbios_type4 {
#define SMBIOS_PROCESSOR_STATUS_POPULATED (1 << 6)
#define SMBIOS_PROCESSOR_STATUS_CPU_ENABLED (1 << 0)
/* enum for socket type */
enum smbios_processor_upgrade_field {
PROCESSOR_UPGRADE_OTHER = 0x01,
PROCESSOR_UPGRADE_UNKNOWN = 0x02,
PROCESSOR_UPGRADE_DAUGHTER_BOARD = 0x03,
PROCESSOR_UPGRADE_ZIF_SOCKET = 0x04,
PROCESSOR_UPGRADE_REPLACEABLE_PIGGY_BACK = 0x05,
PROCESSOR_UPGRADE_NONE = 0x06,
PROCESSOR_UPGRADE_LIF_SOCKET = 0x07,
PROCESSOR_UPGRADE_SLOT_1 = 0x08,
PROCESSOR_UPGRADE_SLOT_2 = 0x09,
PROCESSOR_UPGRADE_370_PIN_SOCKET = 0x0a,
PROCESSOR_UPGRADE_SLOT_A = 0x0b,
PROCESSOR_UPGRADE_SLOT_M = 0x0c,
PROCESSOR_UPGRADE_SOCKET_423 = 0x0d,
PROCESSOR_UPGRADE_SOCKET_A = 0x0e,
PROCESSOR_UPGRADE_SOCKET_478 = 0x0f,
PROCESSOR_UPGRADE_SOCKET_754 = 0x10,
PROCESSOR_UPGRADE_SOCKET_940 = 0x11,
PROCESSOR_UPGRADE_SOCKET_939 = 0x12,
PROCESSOR_UPGRADE_SOCKET_MPGA604 = 0x13,
PROCESSOR_UPGRADE_SOCKET_LGA771 = 0x14,
PROCESSOR_UPGRADE_SOCKET_LGA775 = 0x15,
PROCESSOR_UPGRADE_SOCKET_S1 = 0x16,
PROCESSOR_UPGRADE_SOCKET_AM2 = 0x17,
PROCESSOR_UPGRADE_SOCKET_F = 0x18,
PROCESSOR_UPGRADE_SOCKET_LGA1366 = 0x19,
PROCESSOR_UPGRADE_SOCKET_G34 = 0x1a,
PROCESSOR_UPGRADE_SOCKET_AM3 = 0x1b,
PROCESSOR_UPGRADE_SOCKET_C32 = 0x1c,
PROCESSOR_UPGRADE_SOCKET_LGA1156 = 0x1d,
PROCESSOR_UPGRADE_SOCKET_LGA1567 = 0x1e,
PROCESSOR_UPGRADE_SOCKET_PGA988A = 0x1f,
PROCESSOR_UPGRADE_SOCKET_BGA1288 = 0x20,
PROCESSOR_UPGRADE_SOCKET_RPGA988B = 0x21,
PROCESSOR_UPGRADE_SOCKET_BGA1023 = 0x22,
PROCESSOR_UPGRADE_SOCKET_BGA1224 = 0x23,
PROCESSOR_UPGRADE_SOCKET_LGA1155 = 0x24,
PROCESSOR_UPGRADE_SOCKET_LGA1356 = 0x25,
PROCESSOR_UPGRADE_SOCKET_LGA2011 = 0x26,
PROCESSOR_UPGRADE_SOCKET_FS1 = 0x27,
PROCESSOR_UPGRADE_SOCKET_FS2 = 0x28,
PROCESSOR_UPGRADE_SOCKET_FM1 = 0x29,
PROCESSOR_UPGRADE_SOCKET_FM2 = 0x2a,
PROCESSOR_UPGRADE_SOCKET_LGA2011_3 = 0x2b,
PROCESSOR_UPGRADE_SOCKET_LGA1356_3 = 0x2c,
PROCESSOR_UPGRADE_SOCKET_LGA1150 = 0x2d,
PROCESSOR_UPGRADE_SOCKET_BGA1168 = 0x2e,
PROCESSOR_UPGRADE_SOCKET_BGA1234 = 0x2f,
PROCESSOR_UPGRADE_SOCKET_BGA1364 = 0x30,
PROCESSOR_UPGRADE_SOCKET_AM4 = 0x31,
PROCESSOR_UPGRADE_SOCKET_LGA1151 = 0x32,
PROCESSOR_UPGRADE_SOCKET_BGA1356 = 0x33,
PROCESSOR_UPGRADE_SOCKET_BGA1440 = 0x34,
PROCESSOR_UPGRADE_SOCKET_BGA1515 = 0x35,
PROCESSOR_UPGRADE_SOCKET_LGA3647_1 = 0x36,
PROCESSOR_UPGRADE_SOCKET_SP3 = 0x37,
PROCESSOR_UPGRADE_SOCKET_SP3R2 = 0x38,
PROCESSOR_UPGRADE_SOCKET_LGA2066 = 0x39,
PROCESSOR_UPGRADE_SOCKET_BGA1392 = 0x3a,
PROCESSOR_UPGRADE_SOCKET_BGA1510 = 0x3b,
PROCESSOR_UPGRADE_SOCKET_BGA1528 = 0x3c,
PROCESSOR_UPGRADE_SOCKET_LGA4189 = 0x3d,
PROCESSOR_UPGRADE_SOCKET_LGA1200 = 0x3e,
PROCESSOR_UPGRADE_SOCKET_LGA4677 = 0x3f,
PROCESSOR_UPGRADE_SOCKET_LGA1700 = 0x40,
PROCESSOR_UPGRADE_SOCKET_BGA1744 = 0x41,
PROCESSOR_UPGRADE_SOCKET_BGA1781 = 0x42,
PROCESSOR_UPGRADE_SOCKET_BGA1211 = 0x43,
PROCESSOR_UPGRADE_SOCKET_BGA2422 = 0x44,
PROCESSOR_UPGRADE_SOCKET_LGA1211 = 0x45,
PROCESSOR_UPGRADE_SOCKET_LGA2422 = 0x46,
PROCESSOR_UPGRADE_SOCKET_LGA5773 = 0x47,
PROCESSOR_UPGRADE_SOCKET_BGA5773 = 0x48,
};
/* defines for processor family */
#define SMBIOS_PROCESSOR_FAMILY_OTHER 0x01
#define SMBIOS_PROCESSOR_FAMILY_UNKNOWN 0x02