diff options
author | Patrick Rudolph <patrick.rudolph@9elements.com> | 2023-07-20 08:59:03 +0200 |
---|---|---|
committer | Felix Held <felix-coreboot@felixheld.de> | 2023-07-25 13:26:32 +0000 |
commit | 5ca756fb1976636934cf488dd1dd85a58e528100 (patch) | |
tree | 039302be8845c392206877e62de8cddb146b6f09 /src | |
parent | 2f872e967567815ded97fe61bff3eb2af7935735 (diff) |
mb/ibm/sbp1: Improve SMBIOS type 17 entries
Add bank locator and slot existance to the mainboard code.
TEST: Verified on Linux that all slots show in dmidecode -t 17.
Change-Id: I4ced36e26368d3f99a7341cb55a8deb118b2d1a4
Signed-off-by: Patrick Rudolph <patrick.rudolph@9elements.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/76677
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Angel Pons <th3fanbus@gmail.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/mainboard/ibm/sbp1/ramstage.c | 15 | ||||
-rw-r--r-- | src/mainboard/ibm/sbp1/romstage.c | 13 |
2 files changed, 28 insertions, 0 deletions
diff --git a/src/mainboard/ibm/sbp1/ramstage.c b/src/mainboard/ibm/sbp1/ramstage.c index 63481aa123..78db8c9fc8 100644 --- a/src/mainboard/ibm/sbp1/ramstage.c +++ b/src/mainboard/ibm/sbp1/ramstage.c @@ -11,6 +11,21 @@ void mainboard_silicon_init_params(FSPS_UPD *params) gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); } +void smbios_fill_dimm_locator(const struct dimm_info *dimm, struct smbios_type17 *t) +{ + const u8 so = dimm->soc_num; + const u8 ch = dimm->channel_num; + const u8 mm = dimm->dimm_num; + + char dev_loc[10] = { "\x00" }; + snprintf(dev_loc, sizeof(dev_loc), "DIMM C%u%c%u", so, 'A' + ch, mm); + t->device_locator = smbios_add_string(t->eos, dev_loc); + + char bnk_loc[10] = { "\x00" }; + snprintf(bnk_loc, sizeof(bnk_loc), "BANK C%u%c%u", so, 'A' + ch, mm); + t->bank_locator = smbios_add_string(t->eos, bnk_loc); +} + static void finalize_boot(void *unused) { printk(BIOS_DEBUG, "FM_BIOS_POST_CMPLT_N cleared.\n"); diff --git a/src/mainboard/ibm/sbp1/romstage.c b/src/mainboard/ibm/sbp1/romstage.c index afb1cf5a19..5e29e3c5f0 100644 --- a/src/mainboard/ibm/sbp1/romstage.c +++ b/src/mainboard/ibm/sbp1/romstage.c @@ -2,6 +2,7 @@ #include <console/console.h> #include <soc/romstage.h> +#include <soc/ddr.h> #include <defs_cxl.h> #include <hob_iiouds.h> @@ -347,3 +348,15 @@ void mainboard_memory_init_params(FSPM_UPD *mupd) sktbmp[3] = BIT(1) | BIT(4); mainboard_config_iio(mupd); } + +bool mainboard_dimm_slot_exists(uint8_t socket, uint8_t channel, uint8_t dimm) +{ + if (socket >= CONFIG_MAX_SOCKET) + return false; + if (channel >= 8) + return false; + if (dimm >= 2) + return false; + + return true; +} |