Debian Codegraph @

src/mainboard/lenovo/m900_tiny/cfr.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 #include <boot/coreboot_tables.h>
4 #include <drivers/option/cfr_frontend.h>
5
6 struct sm_object wifi_slot_enable = SM_DECLARE_BOOL({
7 .flags = CFR_OPTFLAG_RUNTIME,
8 .opt_name = "wifi_slot_enable",
9 .ui_name = "Enable Wi-Fi card slot",
10 .ui_helptext = "Enable or disable detection of devices in the Wi-Fi card slot",
11 .default_value = true,
12 });
13
14 struct sm_object ssd_slot_enable = SM_DECLARE_BOOL({
15 .flags = CFR_OPTFLAG_RUNTIME,
16 .opt_name = "ssd_slot_enable",
17 .ui_name = "Enable SSD slot",
18 .ui_helptext = "Enable or disable detection of devices in the SSD slot",
19 .default_value = true,
20 });
21
22 struct sm_object hdd_slot_enable = SM_DECLARE_BOOL({
23 .flags = CFR_OPTFLAG_RUNTIME,
24 .opt_name = "hdd_slot_enable",
25 .ui_name = "Enable 2.5 inch disk slot",
26 .ui_helptext = "Enable or disable detection of devices in the 2.5 inch disk slot",
27 .default_value = true,
28 });
29
30 static struct sm_obj_form devices = {
31 .ui_name = "Devices",
32 .obj_list = (const struct sm_object *[]) {
33 &wifi_slot_enable,
34 &ssd_slot_enable,
35 &hdd_slot_enable,
36 NULL
37 },
38 };
39
40 struct sm_object ps2_enable = SM_DECLARE_BOOL({
41 .flags = CFR_OPTFLAG_RUNTIME,
42 .opt_name = "ps2_enable",
43 .ui_name = "PS/2 controller",
44 .ui_helptext = "Enable or disable the PS/2 controller",
45 .default_value = true,
46 });
47
48 struct sm_object power_on_after_fail = SM_DECLARE_ENUM({
49 .flags = CFR_OPTFLAG_RUNTIME,
50 .opt_name = "power_on_after_fail",
51 .ui_name = "Power state after fail",
52 .ui_helptext = "State of the platform after external power is restored",
53 .default_value = CONFIG_MAINBOARD_POWER_FAILURE_STATE,
54 .values = (const struct sm_enum_value[]) {
55 { "Off", 0 },
56 { "On", 1 },
57 { "Previous", 2 },
58 SM_ENUM_VALUE_END },
59 });
60
61 static struct sm_obj_form superio = {
62 .ui_name = "Super I/O",
63 .obj_list = (const struct sm_object *[]) {
64 &ps2_enable,
65 &power_on_after_fail,
66 NULL
67 },
68 };
69
70 static struct sm_obj_form *sm_root[] = {
71 &devices,
72 &superio,
73 NULL
74 };
75
76 void mb_cfr_setup_menu(struct lb_cfr *cfr_root)
77 {
78 cfr_write_setup_menu(cfr_root, sm_root);
79 }