Morgan Jang has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37233 )
Change subject: src/mainboard/ocp/monolake: Create SMBIOS type 16 for Monolake platform ......................................................................
src/mainboard/ocp/monolake: Create SMBIOS type 16 for Monolake platform
Create SMBIOS type 16 for Monolake platform, but the memory ECC setting can`t be enabled by the FSP, so it`s hardcoded to MEMORY_ARRAY_ECC_SINGLE_BIT.
Change-Id: Ie057742112f14447b226d432417d9301d4aea958 Signed-off-by: Morgan Jang Morgan_Jang@wiwynn.com --- M src/mainboard/ocp/monolake/mainboard.c 1 file changed, 41 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/33/37233/1
diff --git a/src/mainboard/ocp/monolake/mainboard.c b/src/mainboard/ocp/monolake/mainboard.c index dffd19f..3a11b55 100644 --- a/src/mainboard/ocp/monolake/mainboard.c +++ b/src/mainboard/ocp/monolake/mainboard.c @@ -30,6 +30,8 @@ #define VPD_LEN 10 /* Default countdown is 15 minutes. */ #define DEFAULT_COUNTDOWN 9000 +#define MAX_IMC 1 +#define MAX_DIMM_SIZE_GB (32UL << 20)
static void init_frb2_wdt(void) { @@ -60,6 +62,41 @@ } }
+#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, "Create SMBIOS type 16\n"); + + 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; + return len; +} +#endif + /* * mainboard_enable is executed as first thing after enumerate_buses(). * This is the earliest point to add customization. @@ -76,6 +113,10 @@ clear_ipmi_flags(&rsp); system_reset(); } + +#if CONFIG(GENERATE_SMBIOS_TABLES) + dev->ops->get_smbios_data = write_smbios_type16; +#endif }
struct chip_operations mainboard_ops = {