From 1d2866829615bb9d027a91c0f301b8e9a1b50c6e Mon Sep 17 00:00:00 2001 From: Johnny Lin Date: Mon, 28 Sep 2020 22:44:48 +0800 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/45799 Tested-by: build bot (Jenkins) Reviewed-by: Angel Pons --- src/mainboard/ocp/deltalake/ramstage.c | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) (limited to 'src/mainboard/ocp/deltalake/ramstage.c') 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) -- cgit v1.2.3