From d842e94d35de386cd27fcb3bfca9dd05767c2c77 Mon Sep 17 00:00:00 2001 From: Sean Rhodes Date: Wed, 9 Oct 2024 20:38:27 +0100 Subject: soc/intel/*: Add debug prints for misaligned FSP and driver settings Print a warning when the FSP UPD for CNVi Audio Offload is enabled without the corresponding USB ACPI driver being enabled. Throw an error when the USB ACPI driver is enabled without the corresponding UPD being enabled. Change-Id: I449c43998dd379dc68a33db47a2fe51cfe5cda2f Signed-off-by: Sean Rhodes Reviewed-on: https://review.coreboot.org/c/coreboot/+/84716 Tested-by: build bot (Jenkins) Reviewed-by: Martin L Roth --- src/soc/intel/tigerlake/fsp_params.c | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) (limited to 'src/soc/intel/tigerlake') diff --git a/src/soc/intel/tigerlake/fsp_params.c b/src/soc/intel/tigerlake/fsp_params.c index fa5a549e7e..9706ac6d62 100644 --- a/src/soc/intel/tigerlake/fsp_params.c +++ b/src/soc/intel/tigerlake/fsp_params.c @@ -7,6 +7,7 @@ #include #include #include +#include #include #include #include @@ -493,6 +494,24 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd) params->PchLanEnable = is_devfn_enabled(PCH_DEVFN_GBE); /* CNVi */ + struct device *port = NULL; + struct drivers_usb_acpi_config *usb_cfg; + bool usb_audio_offload = false; + + /* Search through the devicetree for matching USB devices */ + while ((port = dev_find_path(port, DEVICE_PATH_USB)) != NULL) { + /* Skip ports that are not enabled or not of USB type */ + if (!port->enabled || port->path.type != DEVICE_PATH_USB) + continue; + + usb_cfg = port->chip_info; + if (usb_cfg && usb_cfg->cnvi_bt_audio_offload) { + usb_audio_offload = true; + break; + } + + } + params->CnviMode = is_devfn_enabled(PCH_DEVFN_CNVI_WIFI); params->CnviBtCore = config->CnviBtCore; params->CnviBtAudioOffload = config->CnviBtAudioOffload; @@ -506,6 +525,13 @@ void platform_fsp_silicon_init_params_cb(FSPS_UPD *supd) params->CnviBtCore = 0; params->CnviBtAudioOffload = 0; } + if (params->CnviBtAudioOffload && !usb_audio_offload) { + printk(BIOS_WARNING, "CNVi BT Audio offload enabled but not in USB driver.\n"); + } + if (!params->CnviBtAudioOffload && usb_audio_offload) { + printk(BIOS_ERR, "USB BT Audio offload enabled but CNVi BT offload disabled\n"); + usb_cfg->cnvi_bt_audio_offload = 0; + } /* VMD */ params->VmdEnable = is_devfn_enabled(SA_DEVFN_VMD); -- cgit v1.2.3