| 1 |
|
| 2 |
|
| 3 |
#include <boot/coreboot_tables.h> |
| 4 |
#include <console/cfr.h> |
| 5 |
#include <drivers/option/cfr_frontend.h> |
| 6 |
#include <ec/starlabs/merlin/cfr.h> |
| 7 |
#include <intelblocks/cfr.h> |
| 8 |
#include <variants.h> |
| 9 |
|
| 10 |
static const struct sm_object card_reader = SM_DECLARE_BOOL({ |
| 11 |
.opt_name = "card_reader", |
| 12 |
.ui_name = "Card Reader", |
| 13 |
.ui_helptext = "Enable or disable the built-in card reader", |
| 14 |
.default_value = true, |
| 15 |
}); |
| 16 |
|
| 17 |
#if CONFIG(EC_STARLABS_FAST_CHARGE) |
| 18 |
static const struct sm_object fast_charge = SM_DECLARE_BOOL({ |
| 19 |
.opt_name = "fast_charge", |
| 20 |
.ui_name = "Fast Charge", |
| 21 |
.ui_helptext = "Charge the battery faster at the cost of heat and battery wear.", |
| 22 |
.default_value = false, |
| 23 |
}); |
| 24 |
#endif |
| 25 |
|
| 26 |
static const struct sm_object power_profile = SM_DECLARE_ENUM({ |
| 27 |
.opt_name = "power_profile", |
| 28 |
.ui_name = "Power Profile", |
| 29 |
.ui_helptext = "Select whether to maximize performance, battery life or both.", |
| 30 |
.default_value = 1, |
| 31 |
.values = (const struct sm_enum_value[]) { |
| 32 |
{ "Power Saver", PP_POWER_SAVER }, |
| 33 |
{ "Balanced", PP_BALANCED }, |
| 34 |
{ "Performance", PP_PERFORMANCE }, |
| 35 |
SM_ENUM_VALUE_END }, |
| 36 |
}); |
| 37 |
|
| 38 |
static const struct sm_object microphone = SM_DECLARE_BOOL({ |
| 39 |
.opt_name = "microphone", |
| 40 |
.ui_name = "Microphone", |
| 41 |
.ui_helptext = "Enable or disable the built-in microphone", |
| 42 |
.default_value = true, |
| 43 |
}); |
| 44 |
|
| 45 |
static const struct sm_object webcam = SM_DECLARE_BOOL({ |
| 46 |
.opt_name = "webcam", |
| 47 |
.ui_name = "Webcam", |
| 48 |
.ui_helptext = "Enable or disable the built-in webcam", |
| 49 |
.default_value = true, |
| 50 |
}); |
| 51 |
|
| 52 |
static const struct sm_object wireless = SM_DECLARE_BOOL({ |
| 53 |
.opt_name = "wireless", |
| 54 |
.ui_name = "Wireless", |
| 55 |
.ui_helptext = "Enable or disable the built-in wireless card", |
| 56 |
.default_value = true, |
| 57 |
}); |
| 58 |
|
| 59 |
static const struct sm_object vtd = SM_DECLARE_BOOL({ |
| 60 |
.opt_name = "vtd", |
| 61 |
.ui_name = "VT-d", |
| 62 |
.ui_helptext = "Enable or disable Intel VT-d (virtualization)", |
| 63 |
.default_value = true, |
| 64 |
}); |
| 65 |
|
| 66 |
static const struct sm_object s0ix_enable = SM_DECLARE_BOOL({ |
| 67 |
.opt_name = "s0ix_enable", |
| 68 |
.ui_name = "Modern Standby (S0ix)", |
| 69 |
.ui_helptext = "Enabled: Use S0ix for device sleep.\n" |
| 70 |
"Disabled: Use ACPI S3 for device sleep.\n" |
| 71 |
"Requires Intel ME to be enabled.\n" |
| 72 |
"Recommended: Enabled when booting Windows, disabled otherwise.", |
| 73 |
.default_value = false, |
| 74 |
}); |
| 75 |
|
| 76 |
static struct sm_obj_form performance = { |
| 77 |
.ui_name = "Performance", |
| 78 |
.obj_list = (const struct sm_object *[]) { |
| 79 |
&power_profile, |
| 80 |
NULL |
| 81 |
}, |
| 82 |
}; |
| 83 |
|
| 84 |
static struct sm_obj_form processor = { |
| 85 |
.ui_name = "Processor", |
| 86 |
.obj_list = (const struct sm_object *[]) { |
| 87 |
&s0ix_enable, |
| 88 |
&vtd, |
| 89 |
NULL |
| 90 |
}, |
| 91 |
}; |
| 92 |
|
| 93 |
static struct sm_obj_form power = { |
| 94 |
.ui_name = "Power", |
| 95 |
.obj_list = (const struct sm_object *[]) { |
| 96 |
#if CONFIG(EC_STARLABS_FAST_CHARGE) |
| 97 |
&fast_charge, |
| 98 |
#endif |
| 99 |
&power_on_after_fail_bool, |
| 100 |
NULL |
| 101 |
}, |
| 102 |
}; |
| 103 |
|
| 104 |
static struct sm_obj_form keyboard = { |
| 105 |
.ui_name = "Keyboard", |
| 106 |
.obj_list = (const struct sm_object *[]) { |
| 107 |
&kbl_timeout, |
| 108 |
&fn_ctrl_swap, |
| 109 |
NULL |
| 110 |
}, |
| 111 |
}; |
| 112 |
|
| 113 |
static struct sm_obj_form devices = { |
| 114 |
.ui_name = "Devices", |
| 115 |
.obj_list = (const struct sm_object *[]) { |
| 116 |
&card_reader, |
| 117 |
µphone, |
| 118 |
&webcam, |
| 119 |
&wireless, |
| 120 |
NULL |
| 121 |
}, |
| 122 |
}; |
| 123 |
|
| 124 |
static struct sm_obj_form pci = { |
| 125 |
.ui_name = "PCI", |
| 126 |
.obj_list = (const struct sm_object *[]) { |
| 127 |
#if CONFIG(SOC_INTEL_ALDERLAKE) |
| 128 |
&pciexp_clk_pm, |
| 129 |
&pciexp_aspm, |
| 130 |
&pciexp_l1ss, |
| 131 |
#endif |
| 132 |
NULL |
| 133 |
}, |
| 134 |
}; |
| 135 |
|
| 136 |
static struct sm_obj_form coreboot = { |
| 137 |
.ui_name = "coreboot", |
| 138 |
.obj_list = (const struct sm_object *[]) { |
| 139 |
&debug_level, |
| 140 |
NULL |
| 141 |
}, |
| 142 |
}; |
| 143 |
|
| 144 |
static struct sm_obj_form *sm_root[] = { |
| 145 |
&performance, |
| 146 |
&processor, |
| 147 |
&power, |
| 148 |
&keyboard, |
| 149 |
&devices, |
| 150 |
&pci, |
| 151 |
&coreboot, |
| 152 |
NULL |
| 153 |
}; |
| 154 |
|
| 155 |
void mb_cfr_setup_menu(struct lb_cfr *cfr_root) |
| 156 |
{ |
| 157 |
cfr_write_setup_menu(cfr_root, sm_root); |
| 158 |
} |