Attention is currently required from: Jincheng Li.
Hello Jincheng Li,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/83331?usp=email
to review the following change.
Change subject: lib/smbios: Create SMBIOS type 4 entry ......................................................................
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 --- M src/include/smbios.h M src/lib/smbios.c 2 files changed, 11 insertions(+), 3 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/31/83331/1
diff --git a/src/include/smbios.h b/src/include/smbios.h index 8ef37d8..ec776b1 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -74,6 +74,7 @@ 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_socket(void);
const char *smbios_mainboard_manufacturer(void); const char *smbios_mainboard_product_name(void); diff --git a/src/lib/smbios.c b/src/lib/smbios.c index ca71e3b..76d999f 100644 --- a/src/lib/smbios.c +++ b/src/lib/smbios.c @@ -443,6 +443,11 @@ return 0; /* Unknown */ }
+unsigned int __weak smbios_get_max_socket(void) +{ + return 1; +} + static int smbios_write_type1(unsigned long *current, int handle) { struct smbios_type1 *t = smbios_carve_table(*current, SMBIOS_SYSTEM_INFORMATION, @@ -1233,9 +1238,11 @@ handle++; update_max(len, max_struct_size, smbios_write_type3(¤t, handle++));
- struct smbios_type4 *type4 = (struct smbios_type4 *)current; - update_max(len, max_struct_size, smbios_write_type4(¤t, handle++)); - len += smbios_write_type7_cache_parameters(¤t, &handle, &max_struct_size, type4); + for (unsigned int s = 0; s < smbios_get_max_socket(); s++) { + struct smbios_type4 *type4 = (struct smbios_type4 *)current; + update_max(len, max_struct_size, smbios_write_type4(¤t, handle++)); + len += smbios_write_type7_cache_parameters(¤t, &handle, &max_struct_size, type4); + } update_max(len, max_struct_size, smbios_write_type11(¤t, &handle)); if (CONFIG(ELOG)) update_max(len, max_struct_size,