smbios: Add option to select the enclosure type
This allows for a mainboard to change the value from its Kconfig. The default value is still SMBIOS_ENCLOSURE_DESKTOP (0x03) or SMBIOS_ENCLOSURE_LAPTOP (0x09) if SYSTEM_TYPE_LAPTOP is set. Change-Id: I35bc913af69565531831746040a0afe0cabe1c58 Signed-off-by: Julien Viard de Galbert <jviarddegalbert@online.net> Reviewed-on: https://review.coreboot.org/23841 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Nico Huber <nico.h@gmx.de> Reviewed-by: Patrick Rudolph <siro@das-labor.org> Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net>
This commit is contained in:
parent
a3af8eb76b
commit
9d231a9fd3
10
src/Kconfig
10
src/Kconfig
|
@ -623,6 +623,16 @@ config MAINBOARD_SMBIOS_PRODUCT_NAME
|
|||
help
|
||||
Override the default Product name stored in SMBIOS structures.
|
||||
|
||||
config SMBIOS_ENCLOSURE_TYPE
|
||||
hex
|
||||
depends on GENERATE_SMBIOS_TABLES
|
||||
default 0x09 if SYSTEM_TYPE_LAPTOP
|
||||
default 0x03
|
||||
help
|
||||
System Enclosure or Chassis Types as defined in SMBIOS specification.
|
||||
The default value is SMBIOS_ENCLOSURE_DESKTOP (0x03) or
|
||||
SMBIOS_ENCLOSURE_LAPTOP (0x09) if SYSTEM_TYPE_LAPTOP is set.
|
||||
|
||||
endmenu
|
||||
|
||||
source "payloads/Kconfig"
|
||||
|
|
|
@ -454,10 +454,7 @@ static int smbios_write_type3(unsigned long *current, int handle)
|
|||
t->bootup_state = SMBIOS_STATE_SAFE;
|
||||
t->power_supply_state = SMBIOS_STATE_SAFE;
|
||||
t->thermal_state = SMBIOS_STATE_SAFE;
|
||||
if (IS_ENABLED(CONFIG_SYSTEM_TYPE_LAPTOP))
|
||||
t->_type = SMBIOS_ENCLOSURE_LAPTOP;
|
||||
else
|
||||
t->_type = SMBIOS_ENCLOSURE_DESKTOP;
|
||||
t->_type = CONFIG_SMBIOS_ENCLOSURE_TYPE;
|
||||
t->security_status = SMBIOS_STATE_SAFE;
|
||||
len = t->length + smbios_string_table_len(t->eos);
|
||||
*current += len;
|
||||
|
|
Loading…
Reference in New Issue