| 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 accelerometer = SM_DECLARE_BOOL({ |
| 11 |
.opt_name = "accelerometer", |
| 12 |
.ui_name = "Accelerometer", |
| 13 |
.ui_helptext = "Enable or disable the built-in accelerometer", |
| 14 |
.default_value = true, |
| 15 |
}); |
| 16 |
|
| 17 |
#if CONFIG(SOC_INTEL_TIGERLAKE) || CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_RAPTORLAKE) |
| 18 |
static const struct sm_object gna = SM_DECLARE_BOOL({ |
| 19 |
.opt_name = "gna", |
| 20 |
.ui_name = "Gaussian & Neural Accelerator", |
| 21 |
.ui_helptext = "Enable or Disable the Gaussian & Neural Accelerator", |
| 22 |
.default_value = false, |
| 23 |
}); |
| 24 |
#endif |
| 25 |
|
| 26 |
static const struct sm_object memory_speed = SM_DECLARE_ENUM({ |
| 27 |
.opt_name = "memory_speed", |
| 28 |
.ui_name = "Memory Speed", |
| 29 |
.ui_helptext = "Configure the speed that the memory will run at. Higher speeds produce more heat and consume more power but provide higher performance.", |
| 30 |
.default_value = 1, |
| 31 |
.values = (const struct sm_enum_value[]) { |
| 32 |
{ "5500MT/s", 0 }, |
| 33 |
{ "6400MT/s", 1 }, |
| 34 |
{ "7500MT/s", 2 }, |
| 35 |
SM_ENUM_VALUE_END, |
| 36 |
} |
| 37 |
}); |
| 38 |
|
| 39 |
static const struct sm_object power_profile = SM_DECLARE_ENUM({ |
| 40 |
.opt_name = "power_profile", |
| 41 |
.ui_name = "Power Profile", |
| 42 |
.ui_helptext = "Select whether to maximize performance, battery life or both.", |
| 43 |
.default_value = 1, |
| 44 |
.values = (const struct sm_enum_value[]) { |
| 45 |
{ "Power Saver", PP_POWER_SAVER }, |
| 46 |
{ "Balanced", PP_BALANCED }, |
| 47 |
{ "Performance", PP_PERFORMANCE }, |
| 48 |
SM_ENUM_VALUE_END }, |
| 49 |
}); |
| 50 |
|
| 51 |
static const struct sm_object microphone = SM_DECLARE_BOOL({ |
| 52 |
.opt_name = "microphone", |
| 53 |
.ui_name = "Microphone", |
| 54 |
.ui_helptext = "Enable or disable the built-in microphone", |
| 55 |
.default_value = true, |
| 56 |
}); |
| 57 |
|
| 58 |
static const struct sm_object touchscreen = SM_DECLARE_BOOL({ |
| 59 |
.opt_name = "touchscreen", |
| 60 |
.ui_name = "Touchscreen", |
| 61 |
.ui_helptext = "Enable or disable the built-in touch-screen", |
| 62 |
.default_value = true, |
| 63 |
}); |
| 64 |
|
| 65 |
static const struct sm_object webcam = SM_DECLARE_BOOL({ |
| 66 |
.opt_name = "webcam", |
| 67 |
.ui_name = "Webcam", |
| 68 |
.ui_helptext = "Enable or disable the built-in webcam", |
| 69 |
.default_value = true, |
| 70 |
}); |
| 71 |
|
| 72 |
static const struct sm_object wireless = SM_DECLARE_BOOL({ |
| 73 |
.opt_name = "wireless", |
| 74 |
.ui_name = "Wireless", |
| 75 |
.ui_helptext = "Enable or disable the built-in wireless card", |
| 76 |
.default_value = true, |
| 77 |
}); |
| 78 |
|
| 79 |
static const struct sm_object vtd = SM_DECLARE_BOOL({ |
| 80 |
.opt_name = "vtd", |
| 81 |
.ui_name = "VT-d", |
| 82 |
.ui_helptext = "Enable or disable Intel VT-d (virtualization)", |
| 83 |
.default_value = true, |
| 84 |
}); |
| 85 |
|
| 86 |
static const struct sm_object bluetooth_rtd3 = SM_DECLARE_BOOL({ |
| 87 |
.opt_name = "bluetooth_rtd3", |
| 88 |
.ui_name = "Bluetooth Runtime-D3", |
| 89 |
.ui_helptext = "Enable or disable Bluetooth power optimization.\n" |
| 90 |
"Recommended to disable when booting Windows.", |
| 91 |
.default_value = true, |
| 92 |
}); |
| 93 |
|
| 94 |
static const struct sm_object display_native_res = SM_DECLARE_BOOL({ |
| 95 |
.opt_name = "display_native_res", |
| 96 |
.ui_name = "Display: Use Native Resolution", |
| 97 |
.ui_helptext = "Enabled: use the native panel resolution at boot.\n" |
| 98 |
"Disabled: use a fixed/scaled video mode at boot.", |
| 99 |
.default_value = false, |
| 100 |
}); |
| 101 |
|
| 102 |
static const struct sm_object s0ix_enable = SM_DECLARE_BOOL({ |
| 103 |
.opt_name = "s0ix_enable", |
| 104 |
.ui_name = "Modern Standby (S0ix)", |
| 105 |
.ui_helptext = "Enabled: Use S0ix for device sleep.\n" |
| 106 |
"Disabled: Use ACPI S3 for device sleep.\n" |
| 107 |
"Requires Intel ME to be enabled.\n" |
| 108 |
"Recommended: Enabled when booting Windows, disabled otherwise.", |
| 109 |
.default_value = false, |
| 110 |
}); |
| 111 |
|
| 112 |
static struct sm_obj_form performance = { |
| 113 |
.ui_name = "Performance", |
| 114 |
.obj_list = (const struct sm_object *[]) { |
| 115 |
&bluetooth_rtd3, |
| 116 |
&memory_speed, |
| 117 |
&power_profile, |
| 118 |
NULL |
| 119 |
}, |
| 120 |
}; |
| 121 |
|
| 122 |
static struct sm_obj_form processor = { |
| 123 |
.ui_name = "Processor", |
| 124 |
.obj_list = (const struct sm_object *[]) { |
| 125 |
&me_state, |
| 126 |
&me_state_counter, |
| 127 |
&s0ix_enable, |
| 128 |
&vtd, |
| 129 |
NULL |
| 130 |
}, |
| 131 |
}; |
| 132 |
|
| 133 |
static struct sm_obj_form power = { |
| 134 |
.ui_name = "Power", |
| 135 |
.obj_list = (const struct sm_object *[]) { |
| 136 |
&max_charge, |
| 137 |
#if CONFIG(EC_STARLABS_CHARGING_SPEED) |
| 138 |
&charging_speed, |
| 139 |
#endif |
| 140 |
&power_led, |
| 141 |
&power_on_after_fail_bool, |
| 142 |
NULL |
| 143 |
}, |
| 144 |
}; |
| 145 |
|
| 146 |
static struct sm_obj_form devices = { |
| 147 |
.ui_name = "Devices", |
| 148 |
.obj_list = (const struct sm_object *[]) { |
| 149 |
&accelerometer, |
| 150 |
&display_native_res, |
| 151 |
#if CONFIG(SOC_INTEL_TIGERLAKE) || CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_RAPTORLAKE) |
| 152 |
&gna, |
| 153 |
#endif |
| 154 |
#if CONFIG(EC_STARLABS_LID_SWITCH) |
| 155 |
&lid_switch, |
| 156 |
#endif |
| 157 |
µphone, |
| 158 |
&touchscreen, |
| 159 |
&webcam, |
| 160 |
&wireless, |
| 161 |
NULL |
| 162 |
}, |
| 163 |
}; |
| 164 |
|
| 165 |
static struct sm_obj_form pci = { |
| 166 |
.ui_name = "PCI", |
| 167 |
.obj_list = (const struct sm_object *[]) { |
| 168 |
#if CONFIG(SOC_INTEL_COMMON_BLOCK_ASPM) |
| 169 |
&pciexp_clk_pm, |
| 170 |
&pciexp_aspm, |
| 171 |
&pciexp_l1ss, |
| 172 |
#endif |
| 173 |
NULL |
| 174 |
}, |
| 175 |
}; |
| 176 |
|
| 177 |
static struct sm_obj_form coreboot = { |
| 178 |
.ui_name = "coreboot", |
| 179 |
.obj_list = (const struct sm_object *[]) { |
| 180 |
&debug_level, |
| 181 |
NULL |
| 182 |
}, |
| 183 |
}; |
| 184 |
|
| 185 |
static struct sm_obj_form *sm_root[] = { |
| 186 |
&performance, |
| 187 |
&processor, |
| 188 |
&power, |
| 189 |
&devices, |
| 190 |
&pci, |
| 191 |
&coreboot, |
| 192 |
NULL |
| 193 |
}; |
| 194 |
|
| 195 |
void mb_cfr_setup_menu(struct lb_cfr *cfr_root) |
| 196 |
{ |
| 197 |
cfr_write_setup_menu(cfr_root, sm_root); |
| 198 |
} |