diff options
author | Jeremy Compostella <jeremy.compostella@intel.com> | 2024-10-29 14:17:48 -0700 |
---|---|---|
committer | Jérémy Compostella <jeremy.compostella@intel.com> | 2024-11-27 21:28:22 +0000 |
commit | 386b5a9ddfab9c0a2855c4a9f90e9d5ecd0483b0 (patch) | |
tree | 881db3cdfc7af261d7463d589d4bbbb24ed0fc82 /src | |
parent | 6e941f99dad04e6476059082ee6129f4788c1491 (diff) |
drivers/wifi: Support Bluetooth Dual Mac Mode
This feature provides ability to set the Bluetooth Dual Mac Mode
setting.
The implementation follows document 559910 Intel Connectivity
Platforms BIOS Guideline revision 9.2 specification.
BUG=b:346600091
TEST=BDMM method is added to the bluetooth companion device and
return the data supplied by the SAR binary blob
Change-Id: Iebe95815c944d045f4cf686abcd1874a8a45e240
Signed-off-by: Jeremy Compostella <jeremy.compostella@intel.com>
Reviewed-on: https://review.coreboot.org/c/coreboot/+/84946
Reviewed-by: Subrata Banik <subratabanik@google.com>
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Kapil Porwal <kapilporwal@google.com>
Diffstat (limited to 'src')
-rw-r--r-- | src/drivers/wifi/generic/acpi.c | 36 | ||||
-rw-r--r-- | src/include/sar.h | 9 | ||||
-rw-r--r-- | src/vendorcode/google/chromeos/sar.c | 9 |
3 files changed, 53 insertions, 1 deletions
diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c index 4a95b690b4..3cd55e36fe 100644 --- a/src/drivers/wifi/generic/acpi.c +++ b/src/drivers/wifi/generic/acpi.c @@ -841,6 +841,41 @@ static void sar_emit_bucs(const struct bucs_profile *bucs) acpigen_write_package_end(); } +static void sar_emit_bdmm(const struct bdmm_profile *bdmm) +{ + if (bdmm == NULL) + return; + + /* + * Name ("BDMM", Package () { + * Revision, + * Package () { + * Domain Type, // 0x12:Bluetooth + * Dual Mac Enable + * } + * }) + */ + if (bdmm->revision != BDMM_REVISION) { + printk(BIOS_ERR, "Unsupported BDMM table revision: %d\n", + bdmm->revision); + return; + } + + acpigen_write_name("BDMM"); + acpigen_write_package(2); + acpigen_write_dword(bdmm->revision); + + /* + * Emit 'Domain Type' + 'Dual Mac Enable' + */ + acpigen_write_package(2); + acpigen_write_dword(DOMAIN_TYPE_BLUETOOTH); + acpigen_write_dword(bdmm->dual_mac_enable); + + 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) { @@ -978,6 +1013,7 @@ static void wifi_ssdt_write_properties(const struct device *dev, const char *sco sar_emit_bdcm(sar_limits.bdcm); sar_emit_bbsm(sar_limits.bbsm); sar_emit_bucs(sar_limits.bucs); + sar_emit_bdmm(sar_limits.bdmm); 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 433b91107a..4643b24f86 100644 --- a/src/include/sar.h +++ b/src/include/sar.h @@ -9,7 +9,7 @@ #define MAX_DENYLIST_ENTRY 16 #define MAX_DSAR_SET_COUNT 3 #define MAX_GEO_OFFSET_REVISION 3 -#define MAX_PROFILE_COUNT 12 +#define MAX_PROFILE_COUNT 13 #define MAX_SAR_REVISION 2 #define BSAR_REVISION 1 #define WBEM_REVISION 0 @@ -18,6 +18,7 @@ #define BDCM_REVISION 1 #define BBSM_REVISION 1 #define BUCS_REVISION 1 +#define BDMM_REVISION 1 #define REVISION_SIZE 1 #define SAR_REV0_CHAINS_COUNT 2 #define SAR_REV0_SUBBANDS_COUNT 5 @@ -111,6 +112,11 @@ struct bucs_profile { uint32_t uhb_country_selection; } __packed; +struct bdmm_profile { + uint8_t revision; + uint8_t dual_mac_enable; +} __packed; + struct sar_header { char marker[SAR_STR_PREFIX_SIZE]; uint8_t version; @@ -132,6 +138,7 @@ union wifi_sar_limits { struct bdcm_profile *bdcm; struct bbsm_profile *bbsm; struct bucs_profile *bucs; + struct bdmm_profile *bdmm; }; void *profile[MAX_PROFILE_COUNT]; }; diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c index 8e54942a4f..dd43c977df 100644 --- a/src/vendorcode/google/chromeos/sar.c +++ b/src/vendorcode/google/chromeos/sar.c @@ -150,6 +150,14 @@ static size_t bucs_table_size(const struct bucs_profile *bucs) return sizeof(struct bucs_profile); } +static size_t bdmm_table_size(const struct bdmm_profile *bdmm) +{ + if (bdmm == NULL) + return 0; + + return sizeof(struct bdmm_profile); +} + static bool valid_legacy_length(size_t bin_len) { if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE) @@ -208,6 +216,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t expected_sar_bin_size += bdcm_table_size(sar_limits->bdcm); expected_sar_bin_size += bbsm_table_size(sar_limits->bbsm); expected_sar_bin_size += bucs_table_size(sar_limits->bucs); + expected_sar_bin_size += bdmm_table_size(sar_limits->bdmm); if (sar_bin_size != expected_sar_bin_size) { printk(BIOS_ERR, "Invalid SAR size, expected: %zu, obtained: %zu\n", |