From 3f535d3a0dcf17fadb98f52450ab79e693446040 Mon Sep 17 00:00:00 2001 From: Jeremy Compostella Date: Mon, 28 Oct 2024 16:32:55 -0700 Subject: drivers/wifi: Support Bluetooth BiQuad Bypass Filter This feature provides ability to identify non-LTE platform and disable BiQuad Bypass filter logic in hardware for Bluetooth usecases reducing device power consumption. The implementation follows document 559910 Intel Connectivity Platforms BIOS Guideline revision 9.2 specification. BUG=b:346600091 TEST=BBFB method is added to the bluetooth companion device and return the data supplied by the SAR binary blob Change-Id: Iebe95815c944d045f4cf686abcd1874a8a45e213 Signed-off-by: Jeremy Compostella Reviewed-on: https://review.coreboot.org/c/coreboot/+/84942 Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik Reviewed-by: Elyes Haouas Reviewed-by: Kapil Porwal --- src/drivers/wifi/generic/acpi.c | 36 ++++++++++++++++++++++++++++++++++++ 1 file changed, 36 insertions(+) (limited to 'src/drivers') diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c index 0a5bee728f..4be43ffe43 100644 --- a/src/drivers/wifi/generic/acpi.c +++ b/src/drivers/wifi/generic/acpi.c @@ -701,6 +701,41 @@ static void sar_emit_bpag(const struct bpag_profile *bpag) acpigen_write_package_end(); } +static void sar_emit_bbfb(const struct bbfb_profile *bbfb) +{ + if (bbfb == NULL) + return; + + /* + * Name ("BBFB", Package () { + * Revision, + * Package () { + * Domain Type, // 0x12:Bluetooth + * By Pass Enabled // Enable ByPass + * } + * }) + */ + if (bbfb->revision != BBFB_REVISION) { + printk(BIOS_ERR, "Unsupported BBFB table revision: %d\n", + bbfb->revision); + return; + } + + acpigen_write_name("BBFB"); + acpigen_write_package(2); + acpigen_write_dword(bbfb->revision); + + /* + * Emit 'Domain Type' + 'Enable ByPass' + */ + acpigen_write_package(2); + acpigen_write_dword(DOMAIN_TYPE_BLUETOOTH); + acpigen_write_dword(bbfb->enable_quad_filter_bypass); + + acpigen_write_package_end(); + acpigen_write_package_end(); +} + static void emit_wifi_sar_acpi_structures(const struct device *dev, union wifi_sar_limits *sar_limits) { @@ -834,6 +869,7 @@ static void wifi_ssdt_write_properties(const struct device *dev, const char *sco acpigen_write_scope(path); sar_emit_brds(sar_limits.bsar); sar_emit_bpag(sar_limits.bpag); + sar_emit_bbfb(sar_limits.bbfb); acpigen_write_scope_end(); } else { printk(BIOS_ERR, "Failed to get %s Bluetooth companion ACPI path\n", -- cgit v1.2.3