arch/x86/smbios: Update SMBIOS type 17 asset tag

Add SMBIOS type 17 asset tag. Use dimm locator as default value.

Tested=Execute "dmidecode -t 17" to check asset tag field is correct.

Signed-off-by: Tim Chu <Tim.Chu@quantatw.com>
Change-Id: I323e6b4cf6b11ede253d5a2a4bfc976a3f432b05
Reviewed-on: https://review.coreboot.org/c/coreboot/+/48886
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Jonathan Zhang <jonzhang@fb.com>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
This commit is contained in:
Tim Chu 2020-12-23 19:15:21 -08:00 committed by Patrick Georgi
parent 0185d6d760
commit 31b4209201
3 changed files with 12 additions and 0 deletions

View File

@ -283,6 +283,7 @@ static int create_smbios_type17_for_dimm(struct dimm_info *dimm,
smbios_fill_dimm_manufacturer_from_id(dimm->mod_id, t);
smbios_fill_dimm_serial_number(dimm, t);
smbios_fill_dimm_asset_tag(dimm, t);
smbios_fill_dimm_locator(dimm, t);
/* put '\0' in the end of data */

View File

@ -18,6 +18,15 @@ __weak void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios
t->bank_locator = smbios_add_string(t->eos, locator);
}
__weak void smbios_fill_dimm_asset_tag(const struct dimm_info *dimm, struct smbios_type17 *t)
{
char buf[40];
snprintf(buf, sizeof(buf), "Channel-%d-DIMM-%d-AssetTag",
dimm->channel_num, dimm->dimm_num);
t->asset_tag = smbios_add_string(t->eos, buf);
}
__weak const char *smbios_mainboard_bios_version(void)
{
return NULL;

View File

@ -958,6 +958,8 @@ struct smbios_type127 {
void smbios_fill_dimm_manufacturer_from_id(uint16_t mod_id,
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,
struct smbios_type17 *t);