mb/starlabs/*: Separate WiFi and Bluetooth controls
Split the "wireless" option into "WiFi" and "Bluetooth" in CFR to allow more granular control. Test=Disable WiFi and Bluetooth in turn and make sure the devices are disabled independently. Change-Id: I3f617486c78a89a60a1e8c7c8ab7d157dc20bf2e Signed-off-by: Sean Rhodes <sean@starlabs.systems> Reviewed-on: https://review.coreboot.org/c/coreboot/+/89797 Reviewed-by: Matt DeVillier <matt.devillier@gmail.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
This commit is contained in:
parent
abf630c96b
commit
082ad480d9
21 changed files with 73 additions and 49 deletions
|
|
@ -40,8 +40,9 @@ static struct sm_obj_form power = {
|
|||
static struct sm_obj_form devices = {
|
||||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth,
|
||||
&gna,
|
||||
&wireless,
|
||||
&wifi,
|
||||
NULL
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -21,7 +21,7 @@ void devtree_update(void)
|
|||
struct soc_power_limits_config *soc_conf_8core =
|
||||
&cfg->power_limits_config[ADL_N_041_15W_CORE];
|
||||
|
||||
struct device *nic_dev = pcidev_on_root(0x14, 3);
|
||||
struct device *wifi_dev = pcidev_on_root(0x14, 3);
|
||||
struct device *gna_dev = pcidev_on_root(0x08, 0);
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
|
@ -55,11 +55,14 @@ void devtree_update(void)
|
|||
soc_conf_8core->tdp_pl1_override = (soc_conf_8core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_8core->tdp_pl2_override = (soc_conf_8core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
wifi_dev->enabled = 0;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0) {
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
nic_dev->enabled = 0;
|
||||
}
|
||||
|
||||
/* Enable/Disable GNA based on CMOS settings */
|
||||
if (get_uint_option("gna", 0) == 0)
|
||||
|
|
|
|||
|
|
@ -15,6 +15,13 @@ static const struct sm_object accelerometer = SM_DECLARE_BOOL({
|
|||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object bluetooth = SM_DECLARE_BOOL({
|
||||
.opt_name = "bluetooth",
|
||||
.ui_name = "Bluetooth",
|
||||
.ui_helptext = "Enable or disable the built-in Bluetooth",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
static const struct sm_object bluetooth_rtd3 = SM_DECLARE_BOOL({
|
||||
.opt_name = "bluetooth_rtd3",
|
||||
.ui_name = "Bluetooth Runtime-D3",
|
||||
|
|
@ -146,10 +153,10 @@ static const struct sm_object webcam = SM_DECLARE_BOOL({
|
|||
.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",
|
||||
static const struct sm_object wifi = SM_DECLARE_BOOL({
|
||||
.opt_name = "wifi",
|
||||
.ui_name = "WiFi",
|
||||
.ui_helptext = "Enable or disable the built-in WiFi",
|
||||
.default_value = true,
|
||||
});
|
||||
|
||||
|
|
|
|||
|
|
@ -45,10 +45,11 @@ static struct sm_obj_form keyboard = {
|
|||
static struct sm_obj_form devices = {
|
||||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth,
|
||||
&card_reader,
|
||||
µphone,
|
||||
&webcam,
|
||||
&wireless,
|
||||
&wifi,
|
||||
NULL
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ void devtree_update(void)
|
|||
struct soc_power_limits_config *soc_conf =
|
||||
&cfg->power_limits_config;
|
||||
|
||||
struct device *nic_dev = pcidev_on_root(0x0c, 0);
|
||||
struct device *wifi_dev = pcidev_on_root(0x0c, 0);
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
|
|
@ -52,9 +52,10 @@ void devtree_update(void)
|
|||
soc_conf->tdp_pl1_override = (soc_conf->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf->tdp_pl2_override = (soc_conf->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
/* Enable/Disable Wireless based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
nic_dev->enabled = 0;
|
||||
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
wifi_dev->enabled = 0;
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
cfg->usb2_port[CONFIG_WEBCAM_USB_PORT].enable = get_uint_option("webcam", 1);
|
||||
|
|
|
|||
|
|
@ -55,6 +55,7 @@ static struct sm_obj_form keyboard = {
|
|||
static struct sm_obj_form devices = {
|
||||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&bluetooth,
|
||||
&card_reader,
|
||||
#if CONFIG(BOARD_USES_FIXED_MODE_VBT)
|
||||
&display_native_res,
|
||||
|
|
@ -76,7 +77,7 @@ static struct sm_obj_form devices = {
|
|||
&vpu,
|
||||
#endif
|
||||
&webcam,
|
||||
&wireless,
|
||||
&wifi,
|
||||
NULL
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -57,7 +57,7 @@ void devtree_update(void)
|
|||
soc_conf_12core->tdp_pl2_override = (soc_conf_12core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||
const uint8_t vtd = get_uint_option("vtd", 1);
|
||||
mupd->FspmConfig.VtdDisable = !vtd;
|
||||
|
||||
/* Enable/Disable Wireless (RP05) based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
/* Enable/Disable WiFi (RP05) based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
mupd->FspmConfig.PcieRpEnableMask &= ~(1 << 4);
|
||||
|
||||
mupd->FspmConfig.DmiMaxLinkSpeed = 4;
|
||||
|
|
|
|||
|
|
@ -49,7 +49,7 @@ void devtree_update(void)
|
|||
soc_conf_4core->tdp_pl2_override = (soc_conf_4core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||
const uint8_t vtd = get_uint_option("vtd", 1);
|
||||
mupd->FspmConfig.VtdDisable = !vtd;
|
||||
|
||||
/* Enable/Disable Wireless (RP07) based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
/* Enable/Disable WiFi (RP07) based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
mupd->FspmConfig.PcieRpEnableMask &= ~(1 << 6);
|
||||
};
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ void devtree_update(void)
|
|||
|
||||
struct soc_power_limits_config *soc_conf = &cfg->power_limits_config;
|
||||
|
||||
struct device *nic_dev = pcidev_on_root(0x14, 3);
|
||||
struct device *wifi_dev = pcidev_on_root(0x14, 3);
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
|
|
@ -47,11 +47,13 @@ void devtree_update(void)
|
|||
soc_conf->tdp_pl1_override = (soc_conf->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf->tdp_pl2_override = (soc_conf->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
/* Enable/Disable Wireless based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0) {
|
||||
nic_dev->enabled = 0;
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
wifi_dev->enabled = 0;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
}
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
cfg->usb2_ports[CONFIG_CCD_PORT].enable = get_uint_option("webcam", 1);
|
||||
|
|
|
|||
|
|
@ -18,7 +18,7 @@ void devtree_update(void)
|
|||
|
||||
struct soc_power_limits_config *soc_conf = &cfg->power_limits_config;
|
||||
|
||||
struct device *nic_dev = pcidev_on_root(0x1c, 5);
|
||||
struct device *wifi_dev = pcidev_on_root(0x1c, 5);
|
||||
|
||||
uint8_t performance_scale = 100;
|
||||
|
||||
|
|
@ -47,11 +47,13 @@ void devtree_update(void)
|
|||
soc_conf->tdp_pl1_override = (soc_conf->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf->tdp_pl2_override = (soc_conf->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
/* Enable/Disable Wireless based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0) {
|
||||
nic_dev->enabled = 0;
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
wifi_dev->enabled = 0;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
}
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
cfg->usb2_ports[CONFIG_CCD_PORT].enable = get_uint_option("webcam", 1);
|
||||
|
|
|
|||
|
|
@ -50,7 +50,7 @@ void devtree_update(void)
|
|||
soc_conf_20core->tdp_pl2_override = (soc_conf_20core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||
const uint8_t vtd = get_uint_option("vtd", 1);
|
||||
mupd->FspmConfig.VtdDisable = !vtd;
|
||||
|
||||
/* Enable/Disable Wireless (RP09) based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
/* Enable/Disable WiFi (RP09) based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
mupd->FspmConfig.PcieRpEnableMask &= ~(1 << 8);
|
||||
|
||||
mupd->FspmConfig.PchHdaSubSystemIds = 0x70381e50;
|
||||
|
|
|
|||
|
|
@ -59,7 +59,7 @@ void devtree_update(void)
|
|||
soc_conf_12core->tdp_pl2_override = (soc_conf_12core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
|
|
|
|||
|
|
@ -32,8 +32,8 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||
const uint8_t vtd = get_uint_option("vtd", 1);
|
||||
mupd->FspmConfig.VtdDisable = !vtd;
|
||||
|
||||
/* Enable/Disable Wireless (RP05) based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
/* Enable/Disable WiFi (RP05) based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
mupd->FspmConfig.PcieRpEnableMask &= ~(1 << 4);
|
||||
|
||||
/* Enable/Disable Thunderbolt based on CMOS settings */
|
||||
|
|
|
|||
|
|
@ -22,7 +22,7 @@ void devtree_update(void)
|
|||
struct soc_power_limits_config *soc_conf_4core =
|
||||
&cfg->power_limits_config[POWER_LIMITS_U_4_CORE];
|
||||
|
||||
struct device *nic_dev = pcidev_on_root(0x14, 3);
|
||||
struct device *wifi_dev = pcidev_on_root(0x14, 3);
|
||||
struct device *tbt_pci_dev = pcidev_on_root(0x07, 0);
|
||||
struct device *tbt_dma_dev = pcidev_on_root(0x0d, 2);
|
||||
struct device *gna_dev = pcidev_on_root(0x08, 0);
|
||||
|
|
@ -59,11 +59,13 @@ void devtree_update(void)
|
|||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_4core->tdp_pl2_override = (soc_conf_4core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
/* Enable/Disable Wireless based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0) {
|
||||
nic_dev->enabled = 0;
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
wifi_dev->enabled = 0;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
}
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
cfg->usb2_ports[CONFIG_CCD_PORT].enable = get_uint_option("webcam", 1);
|
||||
|
|
|
|||
|
|
@ -60,7 +60,7 @@ void devtree_update(void)
|
|||
soc_conf_14core->tdp_pl2_override = (soc_conf_14core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
|
||||
/* Enable/Disable Webcam based on CMOS settings */
|
||||
|
|
|
|||
|
|
@ -127,7 +127,7 @@ void mainboard_memory_init_params(FSPM_UPD *mupd)
|
|||
mupd->FspmConfig.VtdDisable = !vtd;
|
||||
|
||||
/* Enable/Disable Wireless (RP05) based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0)
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
mupd->FspmConfig.PcieRpEnableMask &= ~(1 << 4);
|
||||
|
||||
/* Enable/Disable Thunderbolt based on CMOS settings */
|
||||
|
|
|
|||
|
|
@ -57,6 +57,7 @@ static struct sm_obj_form devices = {
|
|||
.ui_name = "Devices",
|
||||
.obj_list = (const struct sm_object *[]) {
|
||||
&accelerometer,
|
||||
&bluetooth,
|
||||
&card_reader,
|
||||
&display_native_res,
|
||||
#if CONFIG(SOC_INTEL_TIGERLAKE) || CONFIG(SOC_INTEL_ALDERLAKE) || CONFIG(SOC_INTEL_RAPTORLAKE)
|
||||
|
|
@ -68,7 +69,7 @@ static struct sm_obj_form devices = {
|
|||
µphone,
|
||||
&touchscreen,
|
||||
&webcam,
|
||||
&wireless,
|
||||
&wifi,
|
||||
NULL
|
||||
},
|
||||
};
|
||||
|
|
|
|||
|
|
@ -19,7 +19,7 @@ void devtree_update(void)
|
|||
struct soc_power_limits_config *soc_conf_4core =
|
||||
&cfg->power_limits_config[ADL_N_041_6W_CORE];
|
||||
|
||||
struct device *nic_dev = pcidev_on_root(0x14, 3);
|
||||
struct device *wifi_dev = pcidev_on_root(0x14, 3);
|
||||
struct device *touchscreen_dev = pcidev_on_root(0x15, 2);
|
||||
struct device *accelerometer_dev = pcidev_on_root(0x15, 0);
|
||||
struct device *gna_dev = pcidev_on_root(0x08, 0);
|
||||
|
|
@ -51,11 +51,14 @@ void devtree_update(void)
|
|||
soc_conf_4core->tdp_pl1_override = (soc_conf_4core->tdp_pl1_override * performance_scale) / 100;
|
||||
soc_conf_4core->tdp_pl2_override = (soc_conf_4core->tdp_pl2_override * performance_scale) / 100;
|
||||
|
||||
|
||||
/* Enable/Disable WiFi based on CMOS settings */
|
||||
if (get_uint_option("wifi", 1) == 0)
|
||||
wifi_dev->enabled = 0;
|
||||
|
||||
/* Enable/Disable Bluetooth based on CMOS settings */
|
||||
if (get_uint_option("wireless", 1) == 0) {
|
||||
if (get_uint_option("bluetooth", 1) == 0)
|
||||
cfg->usb2_ports[9].enable = 0;
|
||||
nic_dev->enabled = 0;
|
||||
}
|
||||
|
||||
/* Enable/Disable Webcam/Camera based on CMOS settings */
|
||||
if (get_uint_option("webcam", 1) == 0)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue