summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorJeremy Compostella <jeremy.compostella@intel.com>2024-10-28 16:32:55 -0700
committerJérémy Compostella <jeremy.compostella@intel.com>2024-11-27 21:27:59 +0000
commit3f535d3a0dcf17fadb98f52450ab79e693446040 (patch)
tree4d5f6f04e301a7b5b09bad2bb5a075aa84c47fe9 /src
parent354cba21a41aa868b7b41804c2859f920d2e1b17 (diff)
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 <jeremy.compostella@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84942 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com> Reviewed-by: Elyes Haouas <ehaouas@noos.fr> Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Diffstat (limited to 'src')
-rw-r--r--src/drivers/wifi/generic/acpi.c36
-rw-r--r--src/include/sar.h9
-rw-r--r--src/vendorcode/google/chromeos/sar.c9
3 files changed, 53 insertions, 1 deletions
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",
diff --git a/src/include/sar.h b/src/include/sar.h
index b9c83c3a05..0609bd34ef 100644
--- a/src/include/sar.h
+++ b/src/include/sar.h
@@ -9,11 +9,12 @@
#define MAX_DENYLIST_ENTRY 16
#define MAX_DSAR_SET_COUNT 3
#define MAX_GEO_OFFSET_REVISION 3
-#define MAX_PROFILE_COUNT 8
+#define MAX_PROFILE_COUNT 9
#define MAX_SAR_REVISION 2
#define BSAR_REVISION 1
#define WBEM_REVISION 0
#define BPAG_REVISION 2
+#define BBFB_REVISION 1
#define REVISION_SIZE 1
#define SAR_REV0_CHAINS_COUNT 2
#define SAR_REV0_SUBBANDS_COUNT 5
@@ -87,6 +88,11 @@ struct bpag_profile {
uint32_t antenna_gain_country_enablement;
} __packed;
+struct bbfb_profile {
+ uint8_t revision;
+ uint8_t enable_quad_filter_bypass;
+} __packed;
+
struct sar_header {
char marker[SAR_STR_PREFIX_SIZE];
uint8_t version;
@@ -104,6 +110,7 @@ union wifi_sar_limits {
struct bsar_profile *bsar;
struct wbem_profile *wbem;
struct bpag_profile *bpag;
+ struct bbfb_profile *bbfb;
};
void *profile[MAX_PROFILE_COUNT];
};
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index dcf647398e..8d19f00222 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -118,6 +118,14 @@ static size_t bpag_table_size(const struct bpag_profile *bpag)
return sizeof(struct bpag_profile);
}
+static size_t bbfb_table_size(const struct bbfb_profile *bbfb)
+{
+ if (bbfb == NULL)
+ return 0;
+
+ return sizeof(struct bbfb_profile);
+}
+
static bool valid_legacy_length(size_t bin_len)
{
if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE)
@@ -172,6 +180,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t
expected_sar_bin_size += bsar_table_size(sar_limits->bsar);
expected_sar_bin_size += wbem_table_size(sar_limits->wbem);
expected_sar_bin_size += bpag_table_size(sar_limits->bpag);
+ expected_sar_bin_size += bbfb_table_size(sar_limits->bbfb);
if (sar_bin_size != expected_sar_bin_size) {
printk(BIOS_ERR, "Invalid SAR size, expected: %zu, obtained: %zu\n",