summaryrefslogtreecommitdiff
path: root/src/mainboard/ocp
diff options
context:
space:
mode:
authorJohnny Lin <johnny_lin@wiwynn.com>2020-09-28 22:44:48 +0800
committerAngel Pons <th3fanbus@gmail.com>2020-10-08 12:09:36 +0000
commit1d2866829615bb9d027a91c0f301b8e9a1b50c6e (patch)
treebf606cd0d2fb899010336ac961d70be63d87a4cb /src/mainboard/ocp
parent7581352759ed3553f42b5356aaaa9759ec1c43b9 (diff)
mb/ocp/deltalake: Override smbios_fill_dimm_locator for type 17
Override smbios_fill_dimm_locator for type 17 Locator and Bank Locator. Also remove CONFIG(GENERATE_SMBIOS_TABLES) compile option because SMBIOS is always enabled and it makes the code cleaner. One sample type 17 table displayed as below: Handle 0x0010, DMI type 17, 40 bytes Memory Device ... Locator: DIMM F0 Bank Locator: _Node0_Channel5_Dimm0 Tested=On OCP Delta Lake, the Locator and Bank Locator strings are expected. Change-Id: I84531f9ee8bc76d9529aa983bc13e64f40c93138 Signed-off-by: Johnny Lin <johnny_lin@wiwynn.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/45799 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src/mainboard/ocp')
-rw-r--r--src/mainboard/ocp/deltalake/ramstage.c15
1 files changed, 11 insertions, 4 deletions
diff --git a/src/mainboard/ocp/deltalake/ramstage.c b/src/mainboard/ocp/deltalake/ramstage.c
index e00f1c391e..c03ad68b31 100644
--- a/src/mainboard/ocp/deltalake/ramstage.c
+++ b/src/mainboard/ocp/deltalake/ramstage.c
@@ -128,7 +128,6 @@ static void dl_oem_smbios_strings(struct device *dev, struct smbios_type11 *t)
}
}
-#if CONFIG(GENERATE_SMBIOS_TABLES)
static int create_smbios_type9(int *handle, unsigned long *current)
{
int index;
@@ -234,7 +233,17 @@ static int mainboard_smbios_data(struct device *dev, int *handle, unsigned long
return len;
}
-#endif
+
+void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios_type17 *t)
+{
+ char buf[40];
+
+ snprintf(buf, sizeof(buf), "DIMM %c0", 'A' + dimm->channel_num);
+ t->device_locator = smbios_add_string(t->eos, buf);
+
+ snprintf(buf, sizeof(buf), "_Node0_Channel%d_Dimm0", dimm->channel_num);
+ t->bank_locator = smbios_add_string(t->eos, buf);
+}
unsigned int smbios_processor_family(struct cpuid_result res)
{
@@ -251,9 +260,7 @@ static void mainboard_enable(struct device *dev)
{
dev->ops->get_smbios_strings = dl_oem_smbios_strings,
read_fru_areas(CONFIG_BMC_KCS_BASE, CONFIG_FRU_DEVICE_ID, 0, &fru_strings);
-#if (CONFIG(GENERATE_SMBIOS_TABLES))
dev->ops->get_smbios_data = mainboard_smbios_data;
-#endif
}
void mainboard_silicon_init_params(FSPS_UPD *params)