Angel Pons has submitted this change. ( https://review.coreboot.org/c/coreboot/+/37233 )
Change subject: mb/ocp/monolake: Create SMBIOS type 16 for Monolake platform ......................................................................
mb/ocp/monolake: Create SMBIOS type 16 for Monolake platform
TEST=Use "dmidecode -t 16" in Linux to check if SMBIOS type 16 exists
Change-Id: Ie057742112f14447b226d432417d9301d4aea958 Signed-off-by: Morgan Jang Morgan_Jang@wiwynn.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/37233 Reviewed-by: Angel Pons th3fanbus@gmail.com Tested-by: build bot (Jenkins) no-reply@coreboot.org --- M src/mainboard/ocp/monolake/mainboard.c 1 file changed, 45 insertions(+), 1 deletion(-)
Approvals: build bot (Jenkins): Verified Angel Pons: Looks good to me, approved
diff --git a/src/mainboard/ocp/monolake/mainboard.c b/src/mainboard/ocp/monolake/mainboard.c index 9a1c995..5f3408e 100644 --- a/src/mainboard/ocp/monolake/mainboard.c +++ b/src/mainboard/ocp/monolake/mainboard.c @@ -31,8 +31,9 @@ /* Default countdown is 15 minutes. */ #define DEFAULT_COUNTDOWN 9000 #define FRU_DEVICE_ID 0 - static struct fru_info_str fru_strings; +#define MAX_IMC 1 +#define MAX_DIMM_SIZE_GB (32 * MiB)
static void init_frb2_wdt(void) { @@ -63,6 +64,44 @@ } }
+#if CONFIG(GENERATE_SMBIOS_TABLES) +static int write_smbios_type16(struct device *dev, int *handle, unsigned long *current) +{ + struct smbios_type16 *t = (struct smbios_type16 *)*current; + u32 maximum_capacity; + int len = sizeof(struct smbios_type16); + + printk(BIOS_INFO, "Creating SMBIOS tables type 16 (note, ECC information is hard-coded) ..."); + + memset(t, 0, sizeof(struct smbios_type16)); + t->type = SMBIOS_PHYS_MEMORY_ARRAY; + t->location = MEMORY_ARRAY_LOCATION_SYSTEM_BOARD; + t->use = MEMORY_ARRAY_USE_SYSTEM; + /* The ECC setting can`t be confirmed in FSP, so hardcode it. */ + t->memory_error_correction = MEMORY_ARRAY_ECC_SINGLE_BIT; + t->memory_error_information_handle = 0xFFFE; + t->number_of_memory_devices = CONFIG_DIMM_MAX / MAX_IMC; + + maximum_capacity = (u32)(CONFIG_DIMM_MAX * MAX_DIMM_SIZE_GB); + if (maximum_capacity >= 0x80000000) { + t->maximum_capacity = 0x80000000; + t->extended_maximum_capacity = maximum_capacity << 10; + } else { + t->maximum_capacity = (u32)maximum_capacity; + t->extended_maximum_capacity = 0; + } + + *current += len; + t->handle = *handle; + *handle += 1; + t->length = len - 2; + + printk(BIOS_INFO, "done\n"); + + return len; +} +#endif + /* * mainboard_enable is executed as first thing after enumerate_buses(). * This is the earliest point to add customization. @@ -79,7 +118,12 @@ clear_ipmi_flags(&rsp); system_reset(); } + read_fru_areas(BMC_KCS_BASE, FRU_DEVICE_ID, 0, &fru_strings); + +#if (CONFIG(GENERATE_SMBIOS_TABLES)) + dev->ops->get_smbios_data = write_smbios_type16; +#endif }
struct chip_operations mainboard_ops = {