mb/starlabs/starbook: Simplify CFR options
Move declaration of all CFR objects to a header file, so they don't need to be guarded. Simplify the enablement of CFR options by creating board-level Kconfig options as needed. TEST=build/boot starbook MTL, TGL, ADL-N. Change-Id: I43dfa6795708e9975b938ce1359629f6b9c4f1cf Signed-off-by: Matt DeVillier <matt.devillier@gmail.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/87088 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Sean Rhodes <sean@starlabs.systems>
This commit is contained in:
parent
7e706dc027
commit
aa9f0881b3
3 changed files with 229 additions and 211 deletions
|
|
@ -244,4 +244,24 @@ config VARIANT_DIR
|
|||
default "adl_n" if BOARD_STARLABS_STARBOOK_ADL_N
|
||||
default "mtl" if BOARD_STARLABS_STARBOOK_MTL
|
||||
|
||||
config BOARD_HAS_FPR
|
||||
bool
|
||||
default y if BOARD_STARLABS_STARBOOK_ADL || BOARD_STARLABS_STARBOOK_RPL
|
||||
default n
|
||||
|
||||
config BOARD_HAS_GNA
|
||||
bool
|
||||
default y if SOC_INTEL_TIGERLAKE || SOC_INTEL_ALDERLAKE || SOC_INTEL_RAPTORLAKE || SOC_INTEL_METEORLAKE
|
||||
default n
|
||||
|
||||
config BOARD_SUPPORTS_HT
|
||||
bool
|
||||
default n if SOC_INTEL_ALDERLAKE_PCH_N
|
||||
default y
|
||||
|
||||
config BOARD_SUPPORTS_HOTPLUG
|
||||
bool
|
||||
default y if BOARD_STARLABS_STARBOOK_ADL
|
||||
default n
|
||||
|
||||
endif
|
||||
|
|
|
|||
|
|
@ -5,215 +5,9 @@
|
|||
#include <drivers/option/cfr_frontend.h>
|
||||
#include <ec/starlabs/merlin/cfr.h>
|
||||
#include <inttypes.h>
|
||||
#include <intelblocks/pcie_rp.h>
|
||||
#include <string.h>
|
||||
#include <types.h>
|
||||
#include <variants.h>
|
||||
|
||||
static const struct sm_object boot_option = SM_DECLARE_ENUM({
|
||||
.opt_name = "boot_option",
|
||||
.ui_name = "Boot Option",
|
||||
.ui_helptext = "Change the boot device in the event of a failed boot",
|
||||
.default_value = 0,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Fallback", 0 },
|
||||
{ "Normal", 1 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object card_reader = SM_DECLARE_BOOL({
|
||||
.opt_name = "card_reader",
|
||||
.ui_name = "Card Reader",
|
||||
.ui_helptext = "Enable or disable the built-in card reader",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object debug_level = SM_DECLARE_ENUM({
|
||||
.opt_name = "debug_level",
|
||||
.ui_name = "Debug Level",
|
||||
.ui_helptext = "Set the verbosity of the debug output.",
|
||||
.default_value = 0,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Emergency", 0 },
|
||||
{ "Alert", 1 },
|
||||
{ "Critical", 2 },
|
||||
{ "Error", 3 },
|
||||
{ "Warning", 4 },
|
||||
{ "Notice", 5 },
|
||||
{ "Info", 6 },
|
||||
{ "Debug", 7 },
|
||||
{ "Spew", 8 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
#if CONFIG(BOARD_STARLABS_STARBOOK_ADL) || CONFIG(BOARD_STARLABS_STARBOOK_RPL)
|
||||
static const struct sm_object fingerprint_reader = SM_DECLARE_BOOL({
|
||||
.opt_name = "fingerprint_reader",
|
||||
.ui_name = "Fingerprint Reader",
|
||||
.ui_helptext = "Enable or disable the built-in fingerprint reader",
|
||||
.default_value = true,
|
||||
});
|
||||
#endif
|
||||
|
||||
#if CONFIG(SOC_INTEL_TIGERLAKE) || CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_RAPTORLAKE) || CONFIG(SOC_INTEL_METEORLAKE)
|
||||
static const struct sm_object gna = SM_DECLARE_BOOL({
|
||||
.opt_name = "gna",
|
||||
.ui_name = "Gaussian & Neural Accelerator",
|
||||
.ui_helptext = "Enable or Disable the Gaussian & Neural Accelerator",
|
||||
.default_value = false,
|
||||
});
|
||||
#endif
|
||||
|
||||
#if !CONFIG(SOC_INTEL_ALDERLAKE_PCH_N)
|
||||
static const struct sm_object hyper_threading = SM_DECLARE_BOOL({
|
||||
.opt_name = "hyper_threading",
|
||||
.ui_name = "Hyper-Threading",
|
||||
.ui_helptext = "Enable or disable Hyper-Threading",
|
||||
.default_value = true,
|
||||
});
|
||||
#endif
|
||||
|
||||
static const struct sm_object me_state = SM_DECLARE_ENUM({
|
||||
.opt_name = "me_state",
|
||||
.ui_name = "Intel Management Engine",
|
||||
.ui_helptext = "Enable or disable the Intel Management Engine",
|
||||
.default_value = 1,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Disabled", 1 },
|
||||
{ "Enabled", 0 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object me_state_counter = SM_DECLARE_NUMBER({
|
||||
.opt_name = "me_state_counter",
|
||||
.ui_name = "ME State Counter",
|
||||
.flags = CFR_OPTFLAG_SUPPRESS,
|
||||
.default_value = 0,
|
||||
});
|
||||
|
||||
static const struct sm_object power_on_after_fail = SM_DECLARE_BOOL({
|
||||
.opt_name = "power_on_after_fail",
|
||||
.ui_name = "Power on after failure",
|
||||
.ui_helptext = "Automatically turn on after a power failure",
|
||||
.default_value = false,
|
||||
});
|
||||
|
||||
static const struct sm_object power_profile = SM_DECLARE_ENUM({
|
||||
.opt_name = "power_profile",
|
||||
.ui_name = "Power Profile",
|
||||
.ui_helptext = "Select whether to maximize performance, battery life or both.",
|
||||
.default_value = 1,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Power Saver", PP_POWER_SAVER },
|
||||
{ "Balanced", PP_BALANCED },
|
||||
{ "Performance", PP_PERFORMANCE },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object microphone = SM_DECLARE_BOOL({
|
||||
.opt_name = "microphone",
|
||||
.ui_name = "Microphone",
|
||||
.ui_helptext = "Enable or disable the built-in microphone",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
#if CONFIG(BOARD_STARLABS_STARBOOK_ADL)
|
||||
static const struct sm_object pci_hot_plug = SM_DECLARE_BOOL({
|
||||
.opt_name = "pci_hot_plug",
|
||||
.ui_name = "Third-Party SSD Support",
|
||||
.ui_helptext = "Enables PCI Hot Plug, which slows down the SSD initialization. It"
|
||||
" is required for certain third-party SSDs to be detected.",
|
||||
.default_value = false,
|
||||
});
|
||||
#endif
|
||||
|
||||
#if CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_METEORLAKE)
|
||||
static const struct sm_object pciexp_aspm = SM_DECLARE_ENUM({
|
||||
.opt_name = "pciexp_aspm",
|
||||
.ui_name = "PCI ASPM",
|
||||
.ui_helptext = "Controls the Active State Power Management for PCI devices."
|
||||
" Enabling this feature can reduce power consumption of"
|
||||
" PCI-connected devices during idle times.",
|
||||
.default_value = ASPM_L0S_L1,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Disabled", ASPM_DISABLE },
|
||||
{ "L0s", ASPM_L0S },
|
||||
{ "L1", ASPM_L1 },
|
||||
{ "L0sL1", ASPM_L0S_L1 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object pciexp_clk_pm = SM_DECLARE_BOOL({
|
||||
.opt_name = "pciexp_clk_pm",
|
||||
.ui_name = "PCI Clock Power Management",
|
||||
.ui_helptext = "Enables or disables power management for the PCI clock. When"
|
||||
" enabled, it reduces power consumption during idle states."
|
||||
" This can help lower overall energy use but may impact"
|
||||
" performance in power-sensitive tasks.",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object pciexp_l1ss = SM_DECLARE_ENUM({
|
||||
.opt_name = "pciexp_l1ss",
|
||||
.ui_name = "PCI L1 Substates",
|
||||
.ui_helptext = "Controls deeper power-saving states for PCI devices."
|
||||
" Enabling this feature allows supported devices to achieve"
|
||||
" lower power states at the cost of slightly increased"
|
||||
" latency when exiting these states.",
|
||||
.default_value = L1_SS_L1_2,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Disabled", L1_SS_DISABLED },
|
||||
{ "L1.1", L1_SS_L1_1 },
|
||||
{ "L1.2", L1_SS_L1_2 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
#endif
|
||||
|
||||
static const struct sm_object reboot_counter = SM_DECLARE_NUMBER({
|
||||
.opt_name = "reboot_counter",
|
||||
.ui_name = "Reboot Counter",
|
||||
.flags = CFR_OPTFLAG_SUPPRESS,
|
||||
.default_value = 0,
|
||||
});
|
||||
|
||||
#if CONFIG(DRIVERS_INTEL_USB4_RETIMER)
|
||||
static const struct sm_object thunderbolt = SM_DECLARE_BOOL({
|
||||
.opt_name = "thunderbolt",
|
||||
.ui_name = "Thunderbolt",
|
||||
.ui_helptext = "Enable or disable Thunderbolt support",
|
||||
.default_value = true,
|
||||
});
|
||||
#endif
|
||||
|
||||
#if CONFIG(SOC_INTEL_METEORLAKE)
|
||||
static const struct sm_object vpu = SM_DECLARE_BOOL({
|
||||
.opt_name = "vpu",
|
||||
.ui_name = "VPU",
|
||||
.ui_helptext = "Enable or disable VPU",
|
||||
.default_value = true,
|
||||
});
|
||||
#endif
|
||||
|
||||
static const struct sm_object webcam = SM_DECLARE_BOOL({
|
||||
.opt_name = "webcam",
|
||||
.ui_name = "Webcam",
|
||||
.ui_helptext = "Enable or disable the built-in webcam",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object wireless = SM_DECLARE_BOOL({
|
||||
.opt_name = "wireless",
|
||||
.ui_name = "Wireless",
|
||||
.ui_helptext = "Enable or disable the built-in wireless card",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object vtd = SM_DECLARE_BOOL({
|
||||
.opt_name = "vtd",
|
||||
.ui_name = "VT-d",
|
||||
.ui_helptext = "Enable or disable Intel VT-d (virtualization)",
|
||||
.default_value = true,
|
||||
});
|
||||
#include "cfr.h"
|
||||
|
||||
static struct sm_obj_form performance = {
|
||||
.ui_name = "Performance",
|
||||
|
|
@ -229,7 +23,7 @@ static struct sm_obj_form processor = {
|
|||
.obj_list = (const struct sm_object *[]) {
|
||||
&me_state,
|
||||
&me_state_counter,
|
||||
#if !CONFIG(SOC_INTEL_ALDERLAKE_PCH_N)
|
||||
#if CONFIG(BOARD_SUPPORTS_HT)
|
||||
&hyper_threading,
|
||||
#endif
|
||||
&vtd,
|
||||
|
|
@ -262,10 +56,10 @@ static struct sm_obj_form devices = {
|
|||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&card_reader,
|
||||
#if CONFIG(BOARD_STARLABS_STARBOOK_ADL) || CONFIG(BOARD_STARLABS_STARBOOK_RPL)
|
||||
#if CONFIG(BOARD_HAS_FPR)
|
||||
&fingerprint_reader,
|
||||
#endif
|
||||
#if CONFIG(SOC_INTEL_TIGERLAKE) || CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_RAPTORLAKE) || CONFIG(SOC_INTEL_METEORLAKE)
|
||||
#if CONFIG(BOARD_HAS_GNA)
|
||||
&gna,
|
||||
#endif
|
||||
#if CONFIG(EC_STARLABS_LID_SWITCH)
|
||||
|
|
@ -290,7 +84,7 @@ static struct sm_obj_form pci = {
|
|||
#if CONFIG(BOARD_STARLABS_STARBOOK_ADL)
|
||||
&pci_hot_plug,
|
||||
#endif
|
||||
#if CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_METEORLAKE)
|
||||
#if CONFIG(SOC_INTEL_COMMON_BLOCK_ASPM)
|
||||
&pciexp_clk_pm,
|
||||
&pciexp_aspm,
|
||||
&pciexp_l1ss,
|
||||
|
|
|
|||
204
src/mainboard/starlabs/starbook/cfr.h
Normal file
204
src/mainboard/starlabs/starbook/cfr.h
Normal file
|
|
@ -0,0 +1,204 @@
|
|||
/* SPDX-License-Identifier: GPL-2.0-only */
|
||||
|
||||
|
||||
#ifndef _STARBOOK_CFR_H_
|
||||
#define _STARBOOK_CFR_H_
|
||||
|
||||
#include <drivers/option/cfr_frontend.h>
|
||||
#include <intelblocks/pcie_rp.h>
|
||||
#include <variants.h>
|
||||
|
||||
static const struct sm_object boot_option = SM_DECLARE_ENUM({
|
||||
.opt_name = "boot_option",
|
||||
.ui_name = "Boot Option",
|
||||
.ui_helptext = "Change the boot device in the event of a failed boot",
|
||||
.default_value = 0,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Fallback", 0 },
|
||||
{ "Normal", 1 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object card_reader = SM_DECLARE_BOOL({
|
||||
.opt_name = "card_reader",
|
||||
.ui_name = "Card Reader",
|
||||
.ui_helptext = "Enable or disable the built-in card reader",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object debug_level = SM_DECLARE_ENUM({
|
||||
.opt_name = "debug_level",
|
||||
.ui_name = "Debug Level",
|
||||
.ui_helptext = "Set the verbosity of the debug output.",
|
||||
.default_value = 0,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Emergency", 0 },
|
||||
{ "Alert", 1 },
|
||||
{ "Critical", 2 },
|
||||
{ "Error", 3 },
|
||||
{ "Warning", 4 },
|
||||
{ "Notice", 5 },
|
||||
{ "Info", 6 },
|
||||
{ "Debug", 7 },
|
||||
{ "Spew", 8 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object fingerprint_reader = SM_DECLARE_BOOL({
|
||||
.opt_name = "fingerprint_reader",
|
||||
.ui_name = "Fingerprint Reader",
|
||||
.ui_helptext = "Enable or disable the built-in fingerprint reader",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object gna = SM_DECLARE_BOOL({
|
||||
.opt_name = "gna",
|
||||
.ui_name = "Gaussian & Neural Accelerator",
|
||||
.ui_helptext = "Enable or Disable the Gaussian & Neural Accelerator",
|
||||
.default_value = false,
|
||||
});
|
||||
|
||||
static const struct sm_object hyper_threading = SM_DECLARE_BOOL({
|
||||
.opt_name = "hyper_threading",
|
||||
.ui_name = "Hyper-Threading",
|
||||
.ui_helptext = "Enable or disable Hyper-Threading",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object me_state = SM_DECLARE_ENUM({
|
||||
.opt_name = "me_state",
|
||||
.ui_name = "Intel Management Engine",
|
||||
.ui_helptext = "Enable or disable the Intel Management Engine",
|
||||
.default_value = 1,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Disabled", 1 },
|
||||
{ "Enabled", 0 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object me_state_counter = SM_DECLARE_NUMBER({
|
||||
.opt_name = "me_state_counter",
|
||||
.ui_name = "ME State Counter",
|
||||
.flags = CFR_OPTFLAG_SUPPRESS,
|
||||
.default_value = 0,
|
||||
});
|
||||
|
||||
static const struct sm_object power_on_after_fail = SM_DECLARE_BOOL({
|
||||
.opt_name = "power_on_after_fail",
|
||||
.ui_name = "Power on after failure",
|
||||
.ui_helptext = "Automatically turn on after a power failure",
|
||||
.default_value = false,
|
||||
});
|
||||
|
||||
static const struct sm_object power_profile = SM_DECLARE_ENUM({
|
||||
.opt_name = "power_profile",
|
||||
.ui_name = "Power Profile",
|
||||
.ui_helptext = "Select whether to maximize performance, battery life or both.",
|
||||
.default_value = 1,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Power Saver", PP_POWER_SAVER },
|
||||
{ "Balanced", PP_BALANCED },
|
||||
{ "Performance", PP_PERFORMANCE },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object microphone = SM_DECLARE_BOOL({
|
||||
.opt_name = "microphone",
|
||||
.ui_name = "Microphone",
|
||||
.ui_helptext = "Enable or disable the built-in microphone",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object pci_hot_plug = SM_DECLARE_BOOL({
|
||||
.opt_name = "pci_hot_plug",
|
||||
.ui_name = "Third-Party SSD Support",
|
||||
.ui_helptext = "Enables PCI Hot Plug, which slows down the SSD initialization. It"
|
||||
" is required for certain third-party SSDs to be detected.",
|
||||
.default_value = false,
|
||||
});
|
||||
|
||||
static const struct sm_object pciexp_aspm = SM_DECLARE_ENUM({
|
||||
.opt_name = "pciexp_aspm",
|
||||
.ui_name = "PCI ASPM",
|
||||
.ui_helptext = "Controls the Active State Power Management for PCI devices."
|
||||
" Enabling this feature can reduce power consumption of"
|
||||
" PCI-connected devices during idle times.",
|
||||
.default_value = ASPM_L0S_L1,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Disabled", ASPM_DISABLE },
|
||||
{ "L0s", ASPM_L0S },
|
||||
{ "L1", ASPM_L1 },
|
||||
{ "L0sL1", ASPM_L0S_L1 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object pciexp_clk_pm = SM_DECLARE_BOOL({
|
||||
.opt_name = "pciexp_clk_pm",
|
||||
.ui_name = "PCI Clock Power Management",
|
||||
.ui_helptext = "Enables or disables power management for the PCI clock. When"
|
||||
" enabled, it reduces power consumption during idle states."
|
||||
" This can help lower overall energy use but may impact"
|
||||
" performance in power-sensitive tasks.",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object pciexp_l1ss = SM_DECLARE_ENUM({
|
||||
.opt_name = "pciexp_l1ss",
|
||||
.ui_name = "PCI L1 Substates",
|
||||
.ui_helptext = "Controls deeper power-saving states for PCI devices."
|
||||
" Enabling this feature allows supported devices to achieve"
|
||||
" lower power states at the cost of slightly increased"
|
||||
" latency when exiting these states.",
|
||||
.default_value = L1_SS_L1_2,
|
||||
.values = (const struct sm_enum_value[]) {
|
||||
{ "Disabled", L1_SS_DISABLED },
|
||||
{ "L1.1", L1_SS_L1_1 },
|
||||
{ "L1.2", L1_SS_L1_2 },
|
||||
SM_ENUM_VALUE_END },
|
||||
});
|
||||
|
||||
static const struct sm_object reboot_counter = SM_DECLARE_NUMBER({
|
||||
.opt_name = "reboot_counter",
|
||||
.ui_name = "Reboot Counter",
|
||||
.flags = CFR_OPTFLAG_SUPPRESS,
|
||||
.default_value = 0,
|
||||
});
|
||||
|
||||
|
||||
static const struct sm_object thunderbolt = SM_DECLARE_BOOL({
|
||||
.opt_name = "thunderbolt",
|
||||
.ui_name = "Thunderbolt",
|
||||
.ui_helptext = "Enable or disable Thunderbolt support",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
|
||||
static const struct sm_object vpu = SM_DECLARE_BOOL({
|
||||
.opt_name = "vpu",
|
||||
.ui_name = "VPU",
|
||||
.ui_helptext = "Enable or disable VPU",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object webcam = SM_DECLARE_BOOL({
|
||||
.opt_name = "webcam",
|
||||
.ui_name = "Webcam",
|
||||
.ui_helptext = "Enable or disable the built-in webcam",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object wireless = SM_DECLARE_BOOL({
|
||||
.opt_name = "wireless",
|
||||
.ui_name = "Wireless",
|
||||
.ui_helptext = "Enable or disable the built-in wireless card",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object vtd = SM_DECLARE_BOOL({
|
||||
.opt_name = "vtd",
|
||||
.ui_name = "VT-d",
|
||||
.ui_helptext = "Enable or disable Intel VT-d (virtualization)",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
#endif /* _STARBOOK_CFR_H_ */
|
||||
Loading…
Add table
Add a link
Reference in a new issue