diff options
author | David Milosevic <David.Milosevic@9elements.com> | 2022-10-20 16:47:48 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2022-11-17 17:52:18 +0000 |
commit | 0f5b87cf95992ffddb9bc9bd08ee4d6af046bd92 (patch) | |
tree | 2fcbd353b4a322e4c93cf9858a65f0e28d4838dd | |
parent | 6be82a4cd8231a496ebe2e7cf6605150cb22e1f4 (diff) |
mb/prodrive/atlas: add unique DIMM locators in smbios type17
This patch adds unique device-locators, bank-locators and
asset-tags to the smbios type17 tables by making use of a
DIMMs controller-ID. This way we avoid name clashes when,
for example, two DIMMs share the same channel-ID and DIMM-ID
but have a distinct controller-ID.
Signed-off-by: David Milosevic <David.Milosevic@9elements.com>
Change-Id: I8aef79faa43f2475485f581c675ee152e580f678
Reviewed-on: https://review.coreboot.org/c/coreboot/+/68632
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Lean Sheng Tan <sheng.tan@9elements.com>
-rw-r--r-- | src/mainboard/prodrive/atlas/mainboard.c | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/src/mainboard/prodrive/atlas/mainboard.c b/src/mainboard/prodrive/atlas/mainboard.c index 59c7cb7c3b..227e30a3c4 100644 --- a/src/mainboard/prodrive/atlas/mainboard.c +++ b/src/mainboard/prodrive/atlas/mainboard.c @@ -5,9 +5,37 @@ #include <stdint.h> #include <gpio.h> #include <arch/io.h> +#include <string.h> +#include <smbios.h> #include "gpio.h" +void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios_type17 *t) +{ + const u8 mc = dimm->ctrlr_num; + const u8 ch = dimm->channel_num; + const u8 mm = dimm->dimm_num; + + char dev_loc[40] = { "\x00" }; + snprintf(dev_loc, sizeof(dev_loc), "SO-DIMM %c%u", 'A' + mc, mm); + t->device_locator = smbios_add_string(t->eos, dev_loc); + + char bnk_loc[40] = { "\x00" }; + snprintf(bnk_loc, sizeof(bnk_loc), "BANK-%u-%u-%u", mc, ch, mm); + t->bank_locator = smbios_add_string(t->eos, bnk_loc); +} + +void smbios_fill_dimm_asset_tag(const struct dimm_info *dimm, struct smbios_type17 *t) +{ + const u8 mc = dimm->ctrlr_num; + const u8 ch = dimm->channel_num; + const u8 mm = dimm->dimm_num; + + char tag[40] = { "\x00" }; + snprintf(tag, sizeof(tag), "MC-%u-CH-%u-DIMM-%u", mc, ch, mm); + t->asset_tag = smbios_add_string(t->eos, tag); +} + static uint8_t get_hsid(void) { const gpio_t hsid_gpios[] = { |