Attention is currently required from: lichenchen.carl.
Hello lichenchen.carl,
I'd like you to do a code review. Please visit
https://review.coreboot.org/c/coreboot/+/75736?usp=email
to review the following change.
Change subject: src/arch/x86/smbios.c: Change smbios_fill_dimm_serial_number function to weak ......................................................................
src/arch/x86/smbios.c: Change smbios_fill_dimm_serial_number function to weak
Move smbios_fill_dimm_serial_number function from smbios.c to smbios_defaults.c with __weak.In order to allow ODM override this field.
Change-Id: Icc28a56a577f98a2974407175783e32a1e234f86 Signed-off-by: lichenchen.carl lichenchen.carl@bytedance.com Signed-off-by: Yiwei Tang tangyiwei.2022@bytedance.com --- M src/arch/x86/smbios.c M src/arch/x86/smbios_defaults.c M src/include/smbios.h 3 files changed, 12 insertions(+), 12 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/36/75736/1
diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 1ec0ad2..8a8b882 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -207,18 +207,6 @@ } }
-/* Encodes the SPD serial number into hex */ -static void smbios_fill_dimm_serial_number(const struct dimm_info *dimm, - struct smbios_type17 *t) -{ - char serial[9]; - - snprintf(serial, sizeof(serial), "%02hhx%02hhx%02hhx%02hhx", - dimm->serial[0], dimm->serial[1], dimm->serial[2], dimm->serial[3]); - - t->serial_number = smbios_add_string(t->eos, serial); -} - static int create_smbios_type17_for_dimm(struct dimm_info *dimm, unsigned long *current, int *handle, int type16_handle) diff --git a/src/arch/x86/smbios_defaults.c b/src/arch/x86/smbios_defaults.c index 8b62ebb..dc166b2 100644 --- a/src/arch/x86/smbios_defaults.c +++ b/src/arch/x86/smbios_defaults.c @@ -27,6 +27,16 @@ t->asset_tag = smbios_add_string(t->eos, buf); }
+__weak void smbios_fill_dimm_serial_number(const struct dimm_info *dimm, struct smbios_type17 *t) +{ + char serial[9]; + + snprintf(serial, sizeof(serial), "%02hhx%02hhx%02hhx%02hhx", + dimm->serial[0], dimm->serial[1], dimm->serial[2], dimm->serial[3]); + + t->serial_number = smbios_add_string(t->eos, serial); +} + __weak smbios_wakeup_type smbios_system_wakeup_type(void) { return SMBIOS_WAKEUP_TYPE_RESERVED; diff --git a/src/include/smbios.h b/src/include/smbios.h index 446652c..c42cabb 100644 --- a/src/include/smbios.h +++ b/src/include/smbios.h @@ -1212,6 +1212,8 @@
void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id, struct smbios_type17 *t); +void smbios_fill_dimm_serial_number(const struct dimm_info *dimm, + struct smbios_type17 *t); void smbios_fill_dimm_asset_tag(const struct dimm_info *dimm, struct smbios_type17 *t); void smbios_fill_dimm_locator(const struct dimm_info *dimm,