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>
This commit is contained in:
Patrick Rudolph 2023-07-20 08:59:03 +02:00 committed by Felix Held
parent 2f872e9675
commit 5ca756fb19
2 changed files with 28 additions and 0 deletions

View File

@ -11,6 +11,21 @@ void mainboard_silicon_init_params(FSPS_UPD *params)
gpio_configure_pads(gpio_table, ARRAY_SIZE(gpio_table)); 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) static void finalize_boot(void *unused)
{ {
printk(BIOS_DEBUG, "FM_BIOS_POST_CMPLT_N cleared.\n"); printk(BIOS_DEBUG, "FM_BIOS_POST_CMPLT_N cleared.\n");

View File

@ -2,6 +2,7 @@
#include <console/console.h> #include <console/console.h>
#include <soc/romstage.h> #include <soc/romstage.h>
#include <soc/ddr.h>
#include <defs_cxl.h> #include <defs_cxl.h>
#include <hob_iiouds.h> #include <hob_iiouds.h>
@ -347,3 +348,15 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
sktbmp[3] = BIT(1) | BIT(4); sktbmp[3] = BIT(1) | BIT(4);
mainboard_config_iio(mupd); 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;
}