Debian Codegraph @

src/soc/intel/common/block/include/intelblocks/cfr.h

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
3 /*
4 * CFR enums and structs which are used to control various Intel common block settings.
5 */
6
7 #ifndef SOC_INTEL_CMN_CFR_H
8 #define SOC_INTEL_CMN_CFR_H
9
10 #include <drivers/option/cfr_frontend.h>
11 #include <intelblocks/pcie_rp.h>
12 #include <intelblocks/pmclib.h>
13
14 /* Intel ME State */
15 static const struct sm_object me_state = SM_DECLARE_ENUM({
16 .opt_name = "me_state",
17 .ui_name = "Intel Management Engine",
18 .ui_helptext = "Enable or disable the Intel Management Engine",
19 .default_value = CONFIG(CSE_DEFAULT_CFR_OPTION_STATE_DISABLED),
20 .values = (const struct sm_enum_value[]) {
21 { "Disabled", 1 },
22 { "Enabled", 0 },
23 SM_ENUM_VALUE_END },
24 });
25
26 /* Intel ME State Counter */
27 static const struct sm_object me_state_counter = SM_DECLARE_NUMBER({
28 .opt_name = "me_state_counter",
29 .ui_name = "ME State Counter",
30 .flags = CFR_OPTFLAG_SUPPRESS,
31 .default_value = 0,
32 });
33
34 /*
35 * Power state after power loss
36 * Use this option or the one below, but not both
37 */
38 static const struct sm_object power_on_after_fail = SM_DECLARE_ENUM({
39 .opt_name = "power_on_after_fail",
40 .ui_name = "Restore AC power after loss",
41 .ui_helptext = "Specify what to do when power is re-applied after a power loss.",
42 .default_value = CONFIG_MAINBOARD_POWER_FAILURE_STATE,
43 .values = (const struct sm_enum_value[]) {
44 { "Power off (S5)", MAINBOARD_POWER_STATE_OFF },
45 { "Power on (S0)", MAINBOARD_POWER_STATE_ON },
46 { "Previous state", MAINBOARD_POWER_STATE_PREVIOUS },
47 SM_ENUM_VALUE_END },
48 });
49
50 /*
51 * Automatic power-on toggle
52 * Use this option or the one above, but not both
53 */
54 static const struct sm_object power_on_after_fail_bool = SM_DECLARE_BOOL({
55 .opt_name = "power_on_after_fail",
56 .ui_name = "Power on after failure",
57 .ui_helptext = "Automatically turn on after a power failure",
58 .default_value = CONFIG_MAINBOARD_POWER_FAILURE_STATE,
59 });
60
61 /* PCIe PCH RP ASPM */
62 static const struct sm_object pciexp_aspm = SM_DECLARE_ENUM({
63 .opt_name = "pciexp_aspm",
64 .ui_name = "PCIe PCH RP ASPM",
65 .ui_helptext = "Controls the Active State Power Management for PCIe devices."
66 " Enabling this feature can reduce power consumption of"
67 " PCIe-connected devices during idle times.",
68 .default_value = ASPM_AUTO,
69 .values = (const struct sm_enum_value[]) {
70 { "Disabled", ASPM_DISABLE },
71 { "L0s", ASPM_L0S },
72 { "L1", ASPM_L1 },
73 { "L0sL1", ASPM_L0S_L1 },
74 { "Auto", ASPM_AUTO },
75 SM_ENUM_VALUE_END },
76 });
77
78 /* PCIe CPU RP ASPM */
79 static const struct sm_object pciexp_aspm_cpu = SM_DECLARE_ENUM({
80 .opt_name = "pciexp_aspm_cpu",
81 .ui_name = "PCIe CPU RP ASPM",
82 .ui_helptext = "Controls the Active State Power Management for PCIe devices."
83 " Enabling this feature can reduce power consumption of"
84 " PCIe-connected devices during idle times.",
85 .default_value = ASPM_L0S_L1,
86 .values = (const struct sm_enum_value[]) {
87 { "Disabled", ASPM_DISABLE },
88 { "L0s", ASPM_L0S },
89 { "L1", ASPM_L1 },
90 { "L0sL1", ASPM_L0S_L1 },
91 SM_ENUM_VALUE_END },
92 });
93
94 /* PCIe Clock PM */
95 static const struct sm_object pciexp_clk_pm = SM_DECLARE_BOOL({
96 .opt_name = "pciexp_clk_pm",
97 .ui_name = "PCIe Clock Power Management",
98 .ui_helptext = "Enables or disables power management for the PCIe clock. When"
99 " enabled, it reduces power consumption during idle states."
100 " This can help lower overall energy use but may impact"
101 " performance in power-sensitive tasks.",
102 .default_value = true,
103 });
104
105 /* PCIe L1 Substates */
106 static const struct sm_object pciexp_l1ss = SM_DECLARE_ENUM({
107 .opt_name = "pciexp_l1ss",
108 .ui_name = "PCIe L1 Substates",
109 .ui_helptext = "Controls deeper power-saving states for PCIe devices."
110 " Enabling this feature allows supported devices to achieve"
111 " lower power states at the cost of slightly increased"
112 " latency when exiting these states.",
113 .default_value = L1_SS_L1_2,
114 .values = (const struct sm_enum_value[]) {
115 { "Disabled", L1_SS_DISABLED },
116 { "L1.1", L1_SS_L1_1 },
117 { "L1.2", L1_SS_L1_2 },
118 SM_ENUM_VALUE_END },
119 });
120
121 /* PCIe PCH Root Port Speed */
122 static const struct sm_object pciexp_speed = SM_DECLARE_ENUM({
123 .opt_name = "pciexp_speed",
124 .ui_name = "PCIe PCH Root Port Speed",
125 .ui_helptext = "Sets the maximum port speed for PCIe devices attached to PCH root ports.",
126 .default_value = SPEED_AUTO,
127 .values = (const struct sm_enum_value[]) {
128 { "Auto", SPEED_AUTO },
129 { "Gen1", SPEED_GEN1 },
130 { "Gen2", SPEED_GEN2 },
131 { "Gen3", SPEED_GEN3 },
132 { "Gen4", SPEED_GEN4 },
133 SM_ENUM_VALUE_END },
134 });
135
136 #endif /* SOC_INTEL_CMN_CFR_H */