From b18946a557b43f77904287187534d496c4b165a2 Mon Sep 17 00:00:00 2001 From: Andrey Petrov Date: Tue, 10 Sep 2019 11:27:52 -0700 Subject: [PATCH] mb/ocp/monolake: Implement bank/locator scheme Implement Locator and Bank fields (as reported by dmidecode) to match vendor BIOS. TEST=on OCP monolake, run dmidecode tool and see that "Locator" field matches expectation. Change-Id: Ia271ff1e596ba469cf42e23d8390401c27670a27 Signed-off-by: Andrey Petrov Reviewed-on: https://review.coreboot.org/c/coreboot/+/35319 Tested-by: build bot (Jenkins) Reviewed-by: David Hendricks Reviewed-by: Patrick Rudolph --- src/mainboard/ocp/monolake/mainboard.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/src/mainboard/ocp/monolake/mainboard.c b/src/mainboard/ocp/monolake/mainboard.c index 9755b06983..010e064c35 100644 --- a/src/mainboard/ocp/monolake/mainboard.c +++ b/src/mainboard/ocp/monolake/mainboard.c @@ -17,6 +17,8 @@ #include #include #include +#include +#include #include "ipmi.h" /* @@ -39,3 +41,17 @@ static void mainboard_enable(struct device *dev) struct chip_operations mainboard_ops = { .enable_dev = mainboard_enable, }; + +void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios_type17 *t) +{ + + char locator[64] = {0}; + + snprintf(locator, sizeof(locator), "DIMM_%c%u", 'A' + dimm->channel_num, + dimm->dimm_num); + t->device_locator = smbios_add_string(t->eos, locator); + + snprintf(locator, sizeof(locator), "_Node0_Channel%d_Dimm%d", dimm->channel_num, + dimm->dimm_num); + t->bank_locator = smbios_add_string(t->eos, locator); +}