From b935d5b05831d238967f9abd03f3d233682e5d41 Mon Sep 17 00:00:00 2001 From: Angel Pons Date: Wed, 18 Feb 2026 21:27:24 +0100 Subject: [PATCH] soc/intel/cannonlake: Replace CFR enums with booleans Boolean options are intended to represent generic "Enable"/"Disable" options, but without enum options' extra bloat in the CFR structures. Change-Id: I4be1ac4644c461fd64766e27383e479ff518a889 Signed-off-by: Angel Pons Reviewed-on: https://review.coreboot.org/c/coreboot/+/91350 Reviewed-by: Matt DeVillier Tested-by: build bot (Jenkins) --- src/soc/intel/cannonlake/include/soc/cfr.h | 40 ++++++---------------- 1 file changed, 10 insertions(+), 30 deletions(-) diff --git a/src/soc/intel/cannonlake/include/soc/cfr.h b/src/soc/intel/cannonlake/include/soc/cfr.h index d177d2db83..80ddd18b2e 100644 --- a/src/soc/intel/cannonlake/include/soc/cfr.h +++ b/src/soc/intel/cannonlake/include/soc/cfr.h @@ -11,27 +11,19 @@ #include /* FSP hyperthreading */ -static const struct sm_object hyper_threading = SM_DECLARE_ENUM({ +static const struct sm_object hyper_threading = SM_DECLARE_BOOL({ .opt_name = "hyper_threading", .ui_name = "Hyper-Threading", .ui_helptext = "Enable or disable Hyper-Threading", .default_value = CONFIG(FSP_HYPERTHREADING), - .values = (const struct sm_enum_value[]) { - { "Disabled", 0 }, - { "Enabled", 1 }, - SM_ENUM_VALUE_END }, }); /* IGD Enabled */ -static const struct sm_object igd_enabled = SM_DECLARE_ENUM({ +static const struct sm_object igd_enabled = SM_DECLARE_BOOL({ .opt_name = "igd_enabled", .ui_name = "Enable the Intel iGPU", .ui_helptext = "Enable or disable the Intel iGPU", .default_value = !CONFIG(SOC_INTEL_DISABLE_IGD), - .values = (const struct sm_enum_value[]) { - { "Disabled", 0 }, - { "Enabled", 1 }, - SM_ENUM_VALUE_END }, }); /* IGD Aperture Size */ @@ -45,7 +37,7 @@ static const struct sm_object igd_aperture = SM_DECLARE_ENUM({ { "256 MB", IGD_AP_SZ_256MB }, { "512 MB", IGD_AP_SZ_512MB }, SM_ENUM_VALUE_END }, -}, WITH_DEP_VALUES(&igd_enabled, 1)); +}, WITH_DEP_VALUES(&igd_enabled, true)); /* IGD DVMT pre-allocated memory */ static const struct sm_object igd_dvmt = SM_DECLARE_ENUM({ @@ -59,42 +51,30 @@ static const struct sm_object igd_dvmt = SM_DECLARE_ENUM({ { "96 MB", IGD_SM_96MB }, { "128 MB", IGD_SM_128MB }, SM_ENUM_VALUE_END }, -}, WITH_DEP_VALUES(&igd_enabled, 1)); +}, WITH_DEP_VALUES(&igd_enabled, true)); /* Legacy 8254 Timer */ -static const struct sm_object legacy_8254_timer = SM_DECLARE_ENUM({ +static const struct sm_object legacy_8254_timer = SM_DECLARE_BOOL({ .opt_name = "legacy_8254_timer", .ui_name = "Legacy 8254 Timer", .ui_helptext = "Enable the legacy 8254 timer by disabling clock gating.", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "Disabled", 0 }, - { "Enabled", 1 }, - SM_ENUM_VALUE_END }, + .default_value = false, }); /* S0ix Enable */ -static const struct sm_object s0ix_enable = SM_DECLARE_ENUM({ +static const struct sm_object s0ix_enable = SM_DECLARE_BOOL({ .opt_name = "s0ix_enable", .ui_name = "Modern Standby (S0ix)", .ui_helptext = "Enabled: use Modern Standby / S0ix. Disabled: use ACPI S3 sleep", - .default_value = 1, - .values = (const struct sm_enum_value[]) { - { "Disabled", 0 }, - { "Enabled", 1 }, - SM_ENUM_VALUE_END }, + .default_value = true, }); /* VT-d */ -static const struct sm_object vtd = SM_DECLARE_ENUM({ +static const struct sm_object vtd = SM_DECLARE_BOOL({ .opt_name = "vtd", .ui_name = "VT-d", .ui_helptext = "Enable or disable Intel VT-d (virtualization)", - .default_value = 1, - .values = (const struct sm_enum_value[]) { - { "Disabled", 0 }, - { "Enabled", 1 }, - SM_ENUM_VALUE_END }, + .default_value = true, }); #endif /* CANNONLAKE_CFR_H */