diff options
Diffstat (limited to 'lib')
-rw-r--r-- | lib/Kconfig | 16 | ||||
-rw-r--r-- | lib/smbios.c | 46 |
2 files changed, 13 insertions, 49 deletions
diff --git a/lib/Kconfig b/lib/Kconfig index fdc35a9232..7673d2e4e0 100644 --- a/lib/Kconfig +++ b/lib/Kconfig @@ -661,22 +661,6 @@ config GENERATE_SMBIOS_TABLE See also SMBIOS_SYSINFO which allows SMBIOS values to be provided in the devicetree. -config SMBIOS_MANUFACTURER - string "SMBIOS Manufacturer" - depends on GENERATE_SMBIOS_TABLE - default SYS_VENDOR - help - The board manufacturer to store in SMBIOS structures. - Change this to override the default one (CONFIG_SYS_VENDOR). - -config SMBIOS_PRODUCT_NAME - string "SMBIOS Product Name" - depends on GENERATE_SMBIOS_TABLE - default SYS_BOARD - help - The product name to store in SMBIOS structures. - Change this to override the default one (CONFIG_SYS_BOARD). - endmenu config ASN1_COMPILER diff --git a/lib/smbios.c b/lib/smbios.c index a52a9d5b30..485a812c77 100644 --- a/lib/smbios.c +++ b/lib/smbios.c @@ -65,43 +65,28 @@ static int smbios_add_string(char *start, const char *str) } /** - * smbios_add_prop_default() - Add a property from the device tree or default + * smbios_add_prop() - Add a property from the device tree * * @start: string area start address * @node: node containing the information to write (ofnode_null() if none) * @prop: property to write - * @def: default string if the node has no such property * @return 0 if not found, else SMBIOS string number (1 or more) */ -static int smbios_add_prop_default(char *start, ofnode node, const char *prop, - const char *def) +static int smbios_add_prop(char *start, ofnode node, const char *prop) { - const char *str = NULL; - if (IS_ENABLED(CONFIG_OF_CONTROL)) + if (IS_ENABLED(CONFIG_OF_CONTROL)) { + const char *str; + str = ofnode_read_string(node, prop); - if (str) - return smbios_add_string(start, str); - else if (def) - return smbios_add_string(start, def); + if (str) + return smbios_add_string(start, str); + } return 0; } /** - * smbios_add_prop() - Add a property from the device tree - * - * @start: string area start address - * @node: node containing the information to write (ofnode_null() if none) - * @prop: property to write - * @return 0 if not found, else SMBIOS string number (1 or more) - */ -static int smbios_add_prop(char *start, ofnode node, const char *prop) -{ - return smbios_add_prop_default(start, node, prop, NULL); -} - -/** * smbios_string_table_len() - compute the string area size * * This computes the size of the string area including the string terminator. @@ -169,10 +154,8 @@ static int smbios_write_type1(ulong *current, int handle, ofnode node) t = map_sysmem(*current, len); memset(t, 0, sizeof(struct smbios_type1)); fill_smbios_header(t, SMBIOS_SYSTEM_INFORMATION, len, handle); - t->manufacturer = smbios_add_prop_default(t->eos, node, "manufacturer", - CONFIG_SMBIOS_MANUFACTURER); - t->product_name = smbios_add_prop_default(t->eos, node, "product", - CONFIG_SMBIOS_PRODUCT_NAME); + t->manufacturer = smbios_add_prop(t->eos, node, "manufacturer"); + t->product_name = smbios_add_prop(t->eos, node, "product"); t->version = smbios_add_prop(t->eos, node, "version"); if (serial_str) { t->serial_number = smbios_add_string(t->eos, serial_str); @@ -198,10 +181,8 @@ static int smbios_write_type2(ulong *current, int handle, ofnode node) t = map_sysmem(*current, len); memset(t, 0, sizeof(struct smbios_type2)); fill_smbios_header(t, SMBIOS_BOARD_INFORMATION, len, handle); - t->manufacturer = smbios_add_prop_default(t->eos, node, "manufacturer", - CONFIG_SMBIOS_MANUFACTURER); - t->product_name = smbios_add_prop_default(t->eos, node, "product", - CONFIG_SMBIOS_PRODUCT_NAME); + t->manufacturer = smbios_add_prop(t->eos, node, "manufacturer"); + t->product_name = smbios_add_prop(t->eos, node, "product"); t->asset_tag_number = smbios_add_prop(t->eos, node, "asset-tag"); t->feature_flags = SMBIOS_BOARD_FEATURE_HOSTING; t->board_type = SMBIOS_BOARD_MOTHERBOARD; @@ -221,8 +202,7 @@ static int smbios_write_type3(ulong *current, int handle, ofnode node) t = map_sysmem(*current, len); memset(t, 0, sizeof(struct smbios_type3)); fill_smbios_header(t, SMBIOS_SYSTEM_ENCLOSURE, len, handle); - t->manufacturer = smbios_add_prop_default(t->eos, node, "manufacturer", - CONFIG_SMBIOS_MANUFACTURER); + t->manufacturer = smbios_add_prop(t->eos, node, "manufacturer"); t->chassis_type = SMBIOS_ENCLOSURE_DESKTOP; t->bootup_state = SMBIOS_STATE_SAFE; t->power_supply_state = SMBIOS_STATE_SAFE; |