diff --git a/src/ec/starlabs/merlin/cfr.h b/src/ec/starlabs/merlin/cfr.h new file mode 100644 index 0000000000..b56e7d2e52 --- /dev/null +++ b/src/ec/starlabs/merlin/cfr.h @@ -0,0 +1,114 @@ +/* SPDX-License-Identifier: GPL-2.0-only */ + +/* + * CFR enums and structs which are used to control EC settings. + */ + +#include +#include "ec.h" + +/* + * Keyboard Backlight Timeout + */ +static const struct sm_object kbl_timeout = SM_DECLARE_ENUM({ + .opt_name = "kbl_timeout", + .ui_name = "Keyboard Backlight Timeout", + .ui_helptext = "Set the amount of time before the keyboard backlight turns off" + " when un-used", + .default_value = 0, + .values = (struct sm_enum_value[]) { + { "30 seconds", 0 }, + { "1 minute", 1 }, + { "3 minutes", 2 }, + { "5 minutes", 3 }, + { "Never", 4 }, + SM_ENUM_VALUE_END }, +}); + + +/* + * Function-Control Swap + */ +static const struct sm_object fn_ctrl_swap = SM_DECLARE_BOOL({ + .opt_name = "fn_ctrl_swap", + .ui_name = "Fn Ctrl Reverse", + .ui_helptext = "Swap the functions of the [Fn] and [Ctrl] keys", + .default_value = false, +}); + +/* + * Maximum Battery Charge Level + */ +static const struct sm_object max_charge = SM_DECLARE_ENUM({ + .opt_name = "max_charge", + .ui_name = "Maximum Charge Level", + .ui_helptext = "Set the maximum level the battery will charge to.", + .default_value = 0, + .values = (const struct sm_enum_value[]) { + { "100%", 0 }, + { "80%", 1 }, + { "60%", 2 }, + SM_ENUM_VALUE_END }, +}); + +/* + * Fan Mode + */ +static const struct sm_object fan_mode = SM_DECLARE_ENUM({ + .opt_name = "fan_mode", + .ui_name = "Fan Mode", + .ui_helptext = "Adjust the fan curve to prioritize performance or noise levels.", + .default_value = 0, + .values = (const struct sm_enum_value[]) { + { "Normal", 0 }, + { "Aggressive", 1 }, + { "Quiet", 2 }, + { "Disabled", 3 }, + SM_ENUM_VALUE_END }, +}); + +/* + * Charging Speed + */ +static const struct sm_object charging_speed = SM_DECLARE_ENUM({ + .opt_name = "charging_speed", + .ui_name = "Charging Speed", + .ui_helptext = "Set the maximum speed to charge the battery. Charging faster" + " will increase heat and battery wear.", + .default_value = 1, + .values = (const struct sm_enum_value[]) { + { "1.0C", 0 }, + { "0.5C", 1 }, + { "0.2C", 2 }, + SM_ENUM_VALUE_END }, +}); + +/* + * Lid Switch + */ +static const struct sm_object lid_switch = SM_DECLARE_ENUM({ + .opt_name = "lid_switch", + .ui_name = "Lid Switch", + .ui_helptext = "Configure what opening or closing the lid will do.", + .default_value = 0, + .values = (const struct sm_enum_value[]) { + { "Normal", 0 }, + { "Sleep Only", 1 }, + { "Disabled", 2 }, + SM_ENUM_VALUE_END }, +}); + +/* + * Power LED Brightness + */ +static const struct sm_object power_led = SM_DECLARE_ENUM({ + .opt_name = "power_led", + .ui_name = "Power LED Brightness", + .ui_helptext = "Control the maximum brightness of the power LED", + .default_value = 0, + .values = (const struct sm_enum_value[]) { + { "Normal", 0 }, + { "Reduced", 1 }, + SM_ENUM_VALUE_END, + }, +}); diff --git a/src/mainboard/starlabs/lite/cfr.c b/src/mainboard/starlabs/lite/cfr.c index e0d22e6b69..251f55c339 100644 --- a/src/mainboard/starlabs/lite/cfr.c +++ b/src/mainboard/starlabs/lite/cfr.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -54,28 +55,6 @@ static const struct sm_object fast_charge = SM_DECLARE_BOOL({ }); #endif -static const struct sm_object fn_ctrl_swap = SM_DECLARE_BOOL({ - .opt_name = "fn_ctrl_swap", - .ui_name = "Fn Ctrl Reverse", - .ui_helptext = "Swap the functions of the [Fn] and [Ctrl] keys", - .default_value = false, -}); - -static const struct sm_object kbl_timeout = SM_DECLARE_ENUM({ - .opt_name = "kbl_timeout", - .ui_name = "Keyboard Backlight Timeout", - .ui_helptext = "Set the amount of time before the keyboard backlight turns off" - " when un-used", - .default_value = 0, - .values = (struct sm_enum_value[]) { - { "30 seconds", 0 }, - { "1 minute", 1 }, - { "3 minutes", 2 }, - { "5 minutes", 3 }, - { "Never", 4 }, - SM_ENUM_VALUE_END }, -}); - static const struct sm_object power_on_after_fail = SM_DECLARE_BOOL({ .opt_name = "power_on_after_fail", .ui_name = "Power on after failure", diff --git a/src/mainboard/starlabs/starbook/cfr.c b/src/mainboard/starlabs/starbook/cfr.c index bf0e4b0bcf..1e08ba1c12 100644 --- a/src/mainboard/starlabs/starbook/cfr.c +++ b/src/mainboard/starlabs/starbook/cfr.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -27,21 +28,6 @@ static const struct sm_object card_reader = SM_DECLARE_BOOL({ .default_value = true, }); -#if CONFIG(EC_STARLABS_CHARGING_SPEED) -static const struct sm_object charging_speed = SM_DECLARE_ENUM({ - .opt_name = "charging_speed", - .ui_name = "Charging Speed", - .ui_helptext = "Set the maximum speed to charge the battery. Charging faster" - " will increase heat and battery wear.", - .default_value = 1, - .values = (const struct sm_enum_value[]) { - { "1.0C", 0 }, - { "0.5C", 1 }, - { "0.2C", 2 }, - SM_ENUM_VALUE_END }, -}); -#endif - static const struct sm_object debug_level = SM_DECLARE_ENUM({ .opt_name = "debug_level", .ui_name = "Debug Level", @@ -60,19 +46,6 @@ static const struct sm_object debug_level = SM_DECLARE_ENUM({ SM_ENUM_VALUE_END }, }); -static const struct sm_object fan_mode = SM_DECLARE_ENUM({ - .opt_name = "fan_mode", - .ui_name = "Fan Mode", - .ui_helptext = "Adjust the fan curve to prioritize performance or noise levels.", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "Normal", 0 }, - { "Aggressive", 1 }, - { "Quiet", 2 }, - { "Disabled", 3 }, - SM_ENUM_VALUE_END }, -}); - #if CONFIG(BOARD_STARLABS_STARBOOK_ADL) || CONFIG(BOARD_STARLABS_STARBOOK_RPL) static const struct sm_object fingerprint_reader = SM_DECLARE_BOOL({ .opt_name = "fingerprint_reader", @@ -82,13 +55,6 @@ static const struct sm_object fingerprint_reader = SM_DECLARE_BOOL({ }); #endif -static const struct sm_object fn_ctrl_swap = SM_DECLARE_BOOL({ - .opt_name = "fn_ctrl_swap", - .ui_name = "Fn Ctrl Reverse", - .ui_helptext = "Swap the functions of the [Fn] and [Ctrl] keys", - .default_value = false, -}); - #if CONFIG(SOC_INTEL_TIGERLAKE) || CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_RAPTORLAKE) static const struct sm_object gna = SM_DECLARE_BOOL({ .opt_name = "gna", @@ -107,47 +73,6 @@ static const struct sm_object hyper_threading = SM_DECLARE_BOOL({ }); #endif -static const struct sm_object kbl_timeout = SM_DECLARE_ENUM({ - .opt_name = "kbl_timeout", - .ui_name = "Keyboard Backlight Timeout", - .ui_helptext = "Set the amount of time before the keyboard backlight turns off" - " when un-used", - .default_value = 0, - .values = (struct sm_enum_value[]) { - { "30 seconds", 0 }, - { "1 minute", 1 }, - { "3 minutes", 2 }, - { "5 minutes", 3 }, - { "Never", 4 }, - SM_ENUM_VALUE_END }, -}); - -#if CONFIG(EC_STARLABS_LID_SWITCH) -static const struct sm_object lid_switch = SM_DECLARE_ENUM({ - .opt_name = "lid_switch", - .ui_name = "Lid Switch", - .ui_helptext = "Configure what opening or closing the lid will do.", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "Normal", 0 }, - { "Sleep Only", 1 }, - { "Disabled", 2 }, - SM_ENUM_VALUE_END }, -}); -#endif - -static const struct sm_object max_charge = SM_DECLARE_ENUM({ - .opt_name = "max_charge", - .ui_name = "Maximum Charge Level", - .ui_helptext = "Set the maximum level the battery will charge to.", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "100%", 0 }, - { "80%", 1 }, - { "60%", 2 }, - SM_ENUM_VALUE_END }, -}); - static const struct sm_object me_state = SM_DECLARE_ENUM({ .opt_name = "me_state", .ui_name = "Intel Management Engine", diff --git a/src/mainboard/starlabs/starfighter/cfr.c b/src/mainboard/starlabs/starfighter/cfr.c index f310f86a64..7e040cce31 100644 --- a/src/mainboard/starlabs/starfighter/cfr.c +++ b/src/mainboard/starlabs/starfighter/cfr.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -20,21 +21,6 @@ static const struct sm_object boot_option = SM_DECLARE_ENUM({ SM_ENUM_VALUE_END }, }); -#if CONFIG(EC_STARLABS_CHARGING_SPEED) -static const struct sm_object charging_speed = SM_DECLARE_ENUM({ - .opt_name = "charging_speed", - .ui_name = "Charging Speed", - .ui_helptext = "Set the maximum speed to charge the battery. Charging faster" - " will increase heat and battery wear.", - .default_value = 1, - .values = (const struct sm_enum_value[]) { - { "1.0C", 0 }, - { "0.5C", 1 }, - { "0.2C", 2 }, - SM_ENUM_VALUE_END }, -}); -#endif - static const struct sm_object debug_level = SM_DECLARE_ENUM({ .opt_name = "debug_level", .ui_name = "Debug Level", @@ -53,26 +39,6 @@ static const struct sm_object debug_level = SM_DECLARE_ENUM({ SM_ENUM_VALUE_END }, }); -static const struct sm_object fan_mode = SM_DECLARE_ENUM({ - .opt_name = "fan_mode", - .ui_name = "Fan Mode", - .ui_helptext = "Adjust the fan curve to prioritize performance or noise levels.", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "Normal", 0 }, - { "Aggressive", 1 }, - { "Quiet", 2 }, - { "Disabled", 3 }, - SM_ENUM_VALUE_END }, -}); - -static const struct sm_object fn_ctrl_swap = SM_DECLARE_BOOL({ - .opt_name = "fn_ctrl_swap", - .ui_name = "Fn Ctrl Reverse", - .ui_helptext = "Swap the functions of the [Fn] and [Ctrl] keys", - .default_value = false, -}); - #if CONFIG(SOC_INTEL_TIGERLAKE) || CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_RAPTORLAKE) static const struct sm_object gna = SM_DECLARE_BOOL({ .opt_name = "gna", @@ -89,47 +55,6 @@ static const struct sm_object hyper_threading = SM_DECLARE_BOOL({ .default_value = true, }); -static const struct sm_object kbl_timeout = SM_DECLARE_ENUM({ - .opt_name = "kbl_timeout", - .ui_name = "Keyboard Backlight Timeout", - .ui_helptext = "Set the amount of time before the keyboard backlight turns off" - " when un-used", - .default_value = 0, - .values = (struct sm_enum_value[]) { - { "30 seconds", 0 }, - { "1 minute", 1 }, - { "3 minutes", 2 }, - { "5 minutes", 3 }, - { "Never", 4 }, - SM_ENUM_VALUE_END }, -}); - -#if CONFIG(EC_STARLABS_LID_SWITCH) -static const struct sm_object lid_switch = SM_DECLARE_ENUM({ - .opt_name = "lid_switch", - .ui_name = "Lid Switch", - .ui_helptext = "Configure what opening or closing the lid will do.", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "Normal", 0 }, - { "Sleep Only", 1 }, - { "Disabled", 2 }, - SM_ENUM_VALUE_END }, -}); -#endif - -static const struct sm_object max_charge = SM_DECLARE_ENUM({ - .opt_name = "max_charge", - .ui_name = "Maximum Charge Level", - .ui_helptext = "Set the maximum level the battery will charge to.", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "100%", 0 }, - { "80%", 1 }, - { "60%", 2 }, - SM_ENUM_VALUE_END }, -}); - static const struct sm_object me_state = SM_DECLARE_ENUM({ .opt_name = "me_state", .ui_name = "Intel Management Engine", diff --git a/src/mainboard/starlabs/starlite_adl/cfr.c b/src/mainboard/starlabs/starlite_adl/cfr.c index a8e44fa11c..a00a7a7f4a 100644 --- a/src/mainboard/starlabs/starlite_adl/cfr.c +++ b/src/mainboard/starlabs/starlite_adl/cfr.c @@ -3,6 +3,7 @@ #include #include #include +#include #include #include #include @@ -27,21 +28,6 @@ static const struct sm_object boot_option = SM_DECLARE_ENUM({ SM_ENUM_VALUE_END }, }); -#if CONFIG(EC_STARLABS_CHARGING_SPEED) -static const struct sm_object charging_speed = SM_DECLARE_ENUM({ - .opt_name = "charging_speed", - .ui_name = "Charging Speed", - .ui_helptext = "Set the maximum speed to charge the battery. Charging faster" - " will increase heat and battery wear.", - .default_value = 1, - .values = (const struct sm_enum_value[]) { - { "1.0C", 0 }, - { "0.5C", 1 }, - { "0.2C", 2 }, - SM_ENUM_VALUE_END }, -}); -#endif - static const struct sm_object debug_level = SM_DECLARE_ENUM({ .opt_name = "debug_level", .ui_name = "Debug Level", @@ -69,32 +55,6 @@ static const struct sm_object gna = SM_DECLARE_BOOL({ }); #endif -#if CONFIG(EC_STARLABS_LID_SWITCH) -static const struct sm_object lid_switch = SM_DECLARE_ENUM({ - .opt_name = "lid_switch", - .ui_name = "Lid Switch", - .ui_helptext = "Configure what opening or closing the lid will do.", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "Normal", 0 }, - { "Sleep Only", 1 }, - { "Disabled", 2 }, - SM_ENUM_VALUE_END }, -}); -#endif - -static const struct sm_object max_charge = SM_DECLARE_ENUM({ - .opt_name = "max_charge", - .ui_name = "Maximum Charge Level", - .ui_helptext = "Set the maximum level the battery will charge to.", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "100%", 0 }, - { "80%", 1 }, - { "60%", 2 }, - SM_ENUM_VALUE_END }, -}); - static const struct sm_object me_state = SM_DECLARE_ENUM({ .opt_name = "me_state", .ui_name = "Intel Management Engine", @@ -194,18 +154,6 @@ static const struct sm_object pciexp_l1ss = SM_DECLARE_ENUM({ }); #endif -static const struct sm_object power_led = SM_DECLARE_ENUM({ - .opt_name = "power_led", - .ui_name = "Power LED Brightness", - .ui_helptext = "Control the maximum brightness of the power LED", - .default_value = 0, - .values = (const struct sm_enum_value[]) { - { "Normal", 0 }, - { "Reduced", 1 }, - SM_ENUM_VALUE_END, - }, -}); - static const struct sm_object reboot_counter = SM_DECLARE_NUMBER({ .opt_name = "reboot_counter", .ui_name = "Reboot Counter",