Patrick Georgi has submitted this change. ( https://review.coreboot.org/c/coreboot/+/42139 )
Change subject: SMBIOS: Remove Kconfig SYSTEM_ENCLOSURE_TYPE ......................................................................
SMBIOS: Remove Kconfig SYSTEM_ENCLOSURE_TYPE
This gets rid of the magic numbers in Kconfig.
Change-Id: Ibee033b6c99e3131bb323f0d86d306dcd82f9b45 Signed-off-by: Kyösti Mälkki kyosti.malkki@gmail.com Reviewed-on: https://review.coreboot.org/c/coreboot/+/42139 Tested-by: build bot (Jenkins) no-reply@coreboot.org Reviewed-by: Angel Pons th3fanbus@gmail.com Reviewed-by: HAOUAS Elyes ehaouas@noos.fr --- M src/Kconfig M src/arch/x86/smbios.c 2 files changed, 16 insertions(+), 15 deletions(-)
Approvals: build bot (Jenkins): Verified HAOUAS Elyes: Looks good to me, approved Angel Pons: Looks good to me, approved
diff --git a/src/Kconfig b/src/Kconfig index b96d51f..63ecd0a 100644 --- a/src/Kconfig +++ b/src/Kconfig @@ -734,20 +734,6 @@ 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 0x1e if SYSTEM_TYPE_TABLET - default 0x1f if SYSTEM_TYPE_CONVERTIBLE - default 0x20 if SYSTEM_TYPE_DETACHABLE - default 0x03 - help - System Enclosure or Chassis Types as defined in SMBIOS specification. - The default value is SMBIOS_ENCLOSURE_DESKTOP (0x03) but laptop, - convertible, or tablet enclosure will be used if the appropriate - system type is selected. - endmenu
source "payloads/Kconfig" diff --git a/src/arch/x86/smbios.c b/src/arch/x86/smbios.c index 29d5d54..ee69408 100644 --- a/src/arch/x86/smbios.c +++ b/src/arch/x86/smbios.c @@ -479,9 +479,24 @@ return SMBIOS_BOARD_TYPE_UNKNOWN; }
+/* + * System Enclosure or Chassis Types as defined in SMBIOS specification. + * The default value is SMBIOS_ENCLOSURE_DESKTOP (0x03) but laptop, + * convertible, or tablet enclosure will be used if the appropriate + * system type is selected. + */ smbios_enclosure_type __weak smbios_mainboard_enclosure_type(void) { - return CONFIG_SMBIOS_ENCLOSURE_TYPE; + if (CONFIG(SYSTEM_TYPE_LAPTOP)) + return SMBIOS_ENCLOSURE_LAPTOP; + else if (CONFIG(SYSTEM_TYPE_TABLET)) + return SMBIOS_ENCLOSURE_TABLET; + else if (CONFIG(SYSTEM_TYPE_CONVERTIBLE)) + return SMBIOS_ENCLOSURE_CONVERTIBLE; + else if (CONFIG(SYSTEM_TYPE_DETACHABLE)) + return SMBIOS_ENCLOSURE_DETACHABLE; + else + return SMBIOS_ENCLOSURE_DESKTOP; }
const char *__weak smbios_system_serial_number(void)