Debian Codegraph @

src/mainboard/starlabs/byte_adl/cfr.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <boot/coreboot_tables.h>
4 #include <console/cfr.h>
5 #include <drivers/option/cfr_frontend.h>
6 #include <intelblocks/cfr.h>
7 #include <variants.h>
8
9 static const struct sm_object gna = SM_DECLARE_BOOL({
10 .opt_name = "gna",
11 .ui_name = "Gaussian & Neural Accelerator",
12 .ui_helptext = "Enable or Disable the Gaussian & Neural Accelerator",
13 .default_value = false,
14 });
15
16 static const struct sm_object power_profile = SM_DECLARE_ENUM({
17 .opt_name = "power_profile",
18 .ui_name = "Power Profile",
19 .ui_helptext = "Select whether to maximize performance, battery life or both.",
20 .default_value = 1,
21 .values = (const struct sm_enum_value[]) {
22 { "Power Saver", PP_POWER_SAVER },
23 { "Balanced", PP_BALANCED },
24 { "Performance", PP_PERFORMANCE },
25 SM_ENUM_VALUE_END },
26 });
27
28 static const struct sm_object vtd = SM_DECLARE_BOOL({
29 .opt_name = "vtd",
30 .ui_name = "VT-d",
31 .ui_helptext = "Enable or disable Intel VT-d (virtualization)",
32 .default_value = true,
33 });
34
35 static const struct sm_object bluetooth_rtd3 = SM_DECLARE_BOOL({
36 .opt_name = "bluetooth_rtd3",
37 .ui_name = "Bluetooth Runtime-D3",
38 .ui_helptext = "Enable or disable Bluetooth power optimization.\n"
39 "Recommended to disable when booting Windows.",
40 .default_value = true,
41 });
42
43 static const struct sm_object s0ix_enable = SM_DECLARE_BOOL({
44 .opt_name = "s0ix_enable",
45 .ui_name = "Modern Standby (S0ix)",
46 .ui_helptext = "Enabled: Use S0ix for device sleep.\n"
47 "Disabled: Use ACPI S3 for device sleep.\n"
48 "Requires Intel ME to be enabled.\n"
49 "Recommended: Enabled when booting Windows, disabled otherwise.",
50 .default_value = false,
51 });
52
53 static struct sm_obj_form performance = {
54 .ui_name = "Performance",
55 .obj_list = (const struct sm_object *[]) {
56 &bluetooth_rtd3,
57 &power_profile,
58 NULL
59 },
60 };
61
62 static struct sm_obj_form processor = {
63 .ui_name = "Processor",
64 .obj_list = (const struct sm_object *[]) {
65 &me_state,
66 &me_state_counter,
67 &s0ix_enable,
68 &vtd,
69 NULL
70 },
71 };
72
73 static struct sm_obj_form power = {
74 .ui_name = "Power",
75 .obj_list = (const struct sm_object *[]) {
76 &power_on_after_fail_bool,
77 NULL
78 },
79 };
80
81 static struct sm_obj_form devices = {
82 .ui_name = "Devices",
83 .obj_list = (const struct sm_object *[]) {
84 &gna,
85 NULL
86 },
87 };
88
89 static struct sm_obj_form pci = {
90 .ui_name = "PCI",
91 .obj_list = (const struct sm_object *[]) {
92 &pciexp_clk_pm,
93 &pciexp_aspm,
94 &pciexp_l1ss,
95 NULL
96 },
97 };
98
99 static struct sm_obj_form coreboot = {
100 .ui_name = "coreboot",
101 .obj_list = (const struct sm_object *[]) {
102 &debug_level,
103 NULL
104 },
105 };
106
107 static struct sm_obj_form *sm_root[] = {
108 &performance,
109 &processor,
110 &power,
111 &devices,
112 &pci,
113 &coreboot,
114 NULL
115 };
116
117 void mb_cfr_setup_menu(struct lb_cfr *cfr_root)
118 {
119 cfr_write_setup_menu(cfr_root, sm_root);
120 }