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>
This commit is contained in:
Andrey Petrov 2019-09-10 11:27:52 -07:00 committed by Martin Roth
parent 91f955e31f
commit b18946a557
1 changed files with 16 additions and 0 deletions

View File

@ -17,6 +17,8 @@
#include <device/device.h> #include <device/device.h>
#include <pc80/mc146818rtc.h> #include <pc80/mc146818rtc.h>
#include <cf9_reset.h> #include <cf9_reset.h>
#include <smbios.h>
#include <string.h>
#include "ipmi.h" #include "ipmi.h"
/* /*
@ -39,3 +41,17 @@ static void mainboard_enable(struct device *dev)
struct chip_operations mainboard_ops = { struct chip_operations mainboard_ops = {
.enable_dev = mainboard_enable, .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);
}