Johnny Lin has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/37443 )
Change subject: mb/ocp/monolake: Override SMBIOS data with IPMI read FRU data ......................................................................
mb/ocp/monolake: Override SMBIOS data with IPMI read FRU data
SMBIOS type 1 fields are updated by data read from FRU product info area, SMBIOS type 2 fields are updated by FRU board info area.
Tested on OCP Mono Lake.
Change-Id: I58cbe95055dea053b115e99f354f40d5902c6a35 --- M src/mainboard/ocp/monolake/Kconfig M src/mainboard/ocp/monolake/mainboard.c 2 files changed, 82 insertions(+), 0 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/43/37443/1
diff --git a/src/mainboard/ocp/monolake/Kconfig b/src/mainboard/ocp/monolake/Kconfig index 7d85bbb..bbc29a3 100644 --- a/src/mainboard/ocp/monolake/Kconfig +++ b/src/mainboard/ocp/monolake/Kconfig @@ -60,4 +60,6 @@ config IPMI_KCS_REGISTER_SPACING default 4
+config IPMI_FRU_SINGLE_RW_SZ + default 16 endif # BOARD_OCP_MONOLAKE diff --git a/src/mainboard/ocp/monolake/mainboard.c b/src/mainboard/ocp/monolake/mainboard.c old mode 100644 new mode 100755 index a75aae7..a843d0c --- a/src/mainboard/ocp/monolake/mainboard.c +++ b/src/mainboard/ocp/monolake/mainboard.c @@ -30,6 +30,9 @@ #define VPD_LEN 10 /* Default countdown is 15 minutes. */ #define DEFAULT_COUNTDOWN 9000 +#define FRU_DEVICE_ID 0 + +static struct fru_info_str fru_strings;
static void init_frb2_wdt(void) { @@ -76,6 +79,7 @@ clear_ipmi_flags(&rsp); system_reset(); } + read_fru_areas_data(BMC_KCS_BASE, FRU_DEVICE_ID, 0, &fru_strings); }
struct chip_operations mainboard_ops = { @@ -101,3 +105,79 @@ { ipmi_get_system_guid(BMC_KCS_BASE, uuid); } + +const char *smbios_system_manufacturer(void) +{ + if (fru_strings.prod_info.manufacturer != NULL) + return (const char *)fru_strings.prod_info.manufacturer; + else + return CONFIG_MAINBOARD_SMBIOS_MANUFACTURER; +} + +const char *smbios_system_product_name(void) +{ + char *prod_name_partnumber; + /* Mono Lake concatenates IPMI FRU Product Info product name + * and product part number. */ + if (fru_strings.prod_info.product_name != NULL) { + if (fru_strings.prod_info.product_partnumber != NULL) { + /* Append a space after product_name. */ + prod_name_partnumber = strconcat(fru_strings.prod_info.product_name, + " "); + if (!prod_name_partnumber) + return (const char *)fru_strings.prod_info.product_name; + return (const char *)strconcat(prod_name_partnumber, + fru_strings.prod_info.product_partnumber); + } else + return (const char *)fru_strings.prod_info.product_name; + } else + return CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME; +} + +const char *smbios_system_serial_number(void) +{ + if (fru_strings.prod_info.serial_number != NULL) + return (const char *)fru_strings.prod_info.serial_number; + else + return CONFIG_MAINBOARD_SERIAL_NUMBER; +} + +const char *smbios_system_version(void) +{ + if (fru_strings.prod_info.product_version != NULL) + return (const char *)fru_strings.prod_info.product_version; + else + return CONFIG_MAINBOARD_SERIAL_NUMBER; +} + +const char *smbios_mainboard_version(void) +{ + if (fru_strings.board_info.part_number != NULL) + return (const char *)fru_strings.board_info.part_number; + else + return CONFIG_MAINBOARD_VERSION; +} + +const char *smbios_mainboard_manufacturer(void) +{ + if (fru_strings.board_info.manufacturer != NULL) + return (const char *)fru_strings.board_info.manufacturer; + else + return CONFIG_MAINBOARD_SMBIOS_MANUFACTURER; +} + +const char *smbios_mainboard_product_name(void) +{ + if (fru_strings.board_info.product_name != NULL) + return (const char *)fru_strings.board_info.product_name; + else + return CONFIG_MAINBOARD_SMBIOS_PRODUCT_NAME; +} + +const char *smbios_mainboard_serial_number(void) +{ + if (fru_strings.board_info.serial_number != NULL) + return (const char *)fru_strings.board_info.serial_number; + else + return CONFIG_MAINBOARD_SERIAL_NUMBER; +}