Martin Roth has submitted this change. ( https://review.coreboot.org/c/coreboot/+/35319 )
Change subject: mb/ocp/monolake: Implement bank/locator scheme ......................................................................
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 anpetrov@fb.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/35319 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: David Hendricks david.hendricks@gmail.com Reviewed-by: Patrick Rudolph siro@das-labor.org --- M src/mainboard/ocp/monolake/mainboard.c 1 file changed, 16 insertions(+), 0 deletions(-)
Approvals: build bot (Jenkins): Verified David Hendricks: Looks good to me, approved Patrick Rudolph: Looks good to me, approved
diff --git a/src/mainboard/ocp/monolake/mainboard.c b/src/mainboard/ocp/monolake/mainboard.c index 9755b06..010e064 100644 --- a/src/mainboard/ocp/monolake/mainboard.c +++ b/src/mainboard/ocp/monolake/mainboard.c @@ -17,6 +17,8 @@ #include <device/device.h> #include <pc80/mc146818rtc.h> #include <cf9_reset.h> +#include <smbios.h> +#include <string.h> #include "ipmi.h"
/* @@ -39,3 +41,17 @@ 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); +}