summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJincheng Li <jincheng.li@intel.com>2023-09-15 14:39:29 +0800
committerDavid Hendricks <david.hendricks@gmail.com>2024-07-22 22:30:47 +0000
commit9b2d995bdbef8fd5df5d04ed80f7fb96382e968a (patch)
treef39ca5485e09a290ae0c2fcc4009916058c26405
parentaa6865291a7ddfae4c67fcfc55ebd0c13a376807 (diff)
lib/smbios: Create SMBIOS type 4 entry
One smbios type 4 should be provided for each CPU instance. Create SMBIOS type 4 entry according to socket number, with a default value of 1. TEST=Boot on intel/archercity CRB No changes in boot log and 'dmidecode' result under centos Change-Id: Ia47fb7c458f9e89ae63ca64c0d6678b55c9d9d37 Signed-off-by: Jincheng Li <jincheng.li@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/83331 Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
-rw-r--r--src/include/smbios.h2
-rw-r--r--src/lib/Kconfig4
-rw-r--r--src/lib/smbios.c16
-rw-r--r--src/soc/intel/xeon_sp/util.c5
4 files changed, 24 insertions, 3 deletions
diff --git a/src/include/smbios.h b/src/include/smbios.h
index 8ef37d8c84..b5b9e7a83f 100644
--- a/src/include/smbios.h
+++ b/src/include/smbios.h
@@ -74,6 +74,8 @@ void smbios_cpu_get_core_counts(u16 *core_count, u16 *thread_count);
unsigned int smbios_cpu_get_max_speed_mhz(void);
unsigned int smbios_cpu_get_current_speed_mhz(void);
unsigned int smbios_cpu_get_voltage(void);
+unsigned int smbios_get_max_sockets(void);
+unsigned int smbios_soc_get_max_sockets(void);
const char *smbios_mainboard_manufacturer(void);
const char *smbios_mainboard_product_name(void);
diff --git a/src/lib/Kconfig b/src/lib/Kconfig
index e896704e39..2c1a93cff1 100644
--- a/src/lib/Kconfig
+++ b/src/lib/Kconfig
@@ -49,6 +49,10 @@ config DIMM_MAX
It is multiplication of number of channel to number of DIMMs per
channel
+config MAX_SOCKET
+ int
+ default 1
+
config DIMM_SPD_SIZE
int
default 256
diff --git a/src/lib/smbios.c b/src/lib/smbios.c
index ca71e3b053..58caf8c6d8 100644
--- a/src/lib/smbios.c
+++ b/src/lib/smbios.c
@@ -443,6 +443,14 @@ unsigned int __weak smbios_cpu_get_voltage(void)
return 0; /* Unknown */
}
+unsigned int smbios_get_max_sockets(void)
+{
+ if (CONFIG_MAX_SOCKET == 1)
+ return 1;
+ else
+ return smbios_soc_get_max_sockets();
+}
+
static int smbios_write_type1(unsigned long *current, int handle)
{
struct smbios_type1 *t = smbios_carve_table(*current, SMBIOS_SYSTEM_INFORMATION,
@@ -1233,9 +1241,11 @@ unsigned long smbios_write_tables(unsigned long current)
handle++;
update_max(len, max_struct_size, smbios_write_type3(&current, handle++));
- struct smbios_type4 *type4 = (struct smbios_type4 *)current;
- update_max(len, max_struct_size, smbios_write_type4(&current, handle++));
- len += smbios_write_type7_cache_parameters(&current, &handle, &max_struct_size, type4);
+ for (unsigned int s = 0; s < smbios_get_max_sockets(); s++) {
+ struct smbios_type4 *type4 = (struct smbios_type4 *)current;
+ update_max(len, max_struct_size, smbios_write_type4(&current, handle++));
+ len += smbios_write_type7_cache_parameters(&current, &handle, &max_struct_size, type4);
+ }
update_max(len, max_struct_size, smbios_write_type11(&current, &handle));
if (CONFIG(ELOG))
update_max(len, max_struct_size,
diff --git a/src/soc/intel/xeon_sp/util.c b/src/soc/intel/xeon_sp/util.c
index 4dbe7a4cd7..bf07ee74f3 100644
--- a/src/soc/intel/xeon_sp/util.c
+++ b/src/soc/intel/xeon_sp/util.c
@@ -90,6 +90,11 @@ unsigned int soc_get_num_cpus(void)
return get_iio_uds()->SystemStatus.numCpus;
}
+unsigned int smbios_soc_get_max_sockets(void)
+{
+ return soc_get_num_cpus();
+}
+
union p2sb_bdf soc_get_hpet_bdf(void)
{
if (CONFIG(SOC_INTEL_COMMON_IBL_BASE)) {