Poornima Tom has uploaded this change for review. ( https://review.coreboot.org/c/coreboot/+/81834?usp=email )
Change subject: Wifi: Support 320Mhz Bandwidth Enablement per MCC ......................................................................
Wifi: Support 320Mhz Bandwidth Enablement per MCC
Add support for the configuration of 320MHz Bandwidth per MCC based on countries, as per the connectivity document: 559910_Intel_Connectivity_Platforms_BIOS_Guidelines_Rev8_2.pdf
BUG=b:333804562 BRANCH=None TEST=To test on Rex
Change-Id: Ie76794825f1a0104d199c078aa4ffc714aa95b17
Change-Id: Ic47d599bbf22c9c74dddf8b6551f9c7c308b7ad6 Signed-off-by: Poornima Tom poornima.tom@intel.com --- M src/drivers/wifi/generic/acpi.c M src/include/sar.h M src/vendorcode/google/chromeos/sar.c 3 files changed, 48 insertions(+), 2 deletions(-)
git pull ssh://review.coreboot.org:29418/coreboot refs/changes/34/81834/1
diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c index 9e2936d..32ae45f 100644 --- a/src/drivers/wifi/generic/acpi.c +++ b/src/drivers/wifi/generic/acpi.c @@ -461,6 +461,35 @@ acpigen_write_package_end(); }
+static void sar_emit_wbem(struct wbem_profile *wbem) +{ + if (wbem == NULL) + return; + + /* + * Name (WBEM, Package() { + * { + * Revision, + * Package() + * { + * DomainType, // 0x7:WiFi + * WiFi320MHzPerMcc // Enablement of Wifi 320Mhz Bandwidth per MCC + * } + * }) + */ + + acpigen_write_name("WBEM"); + acpigen_write_package(2); + acpigen_write_dword(wbem->revision); + acpigen_write_package(4); + acpigen_write_dword(DOMAIN_TYPE_WIFI); + acpigen_write_dword(wbem->WiFi320MHzPerMcc); + + acpigen_write_package_end(); + acpigen_write_package_end(); +} + + static void emit_sar_acpi_structures(const struct device *dev, struct dsm_profile *dsm) { union wifi_sar_limits sar_limits = {{NULL, NULL, NULL, NULL, NULL} }; @@ -483,6 +512,7 @@ sar_emit_wgds(sar_limits.wgds); sar_emit_ppag(sar_limits.ppag); sar_emit_wtas(sar_limits.wtas); + sar_emit_wbem(sar_limits.wbem);
/* copy the dsm data to be later used for creating _DSM function */ if (sar_limits.dsm != NULL) diff --git a/src/include/sar.h b/src/include/sar.h index 8d712de..c14fba3 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 5 +#define MAX_PROFILE_COUNT 6 #define MAX_SAR_REVISION 2 #define REVISION_SIZE 1 #define SAR_REV0_CHAINS_COUNT 2 @@ -59,6 +59,11 @@ uint32_t unii_4; };
+struct wbem_profile { + uint8_t revision; + uint32_t WiFi320MHzPerMcc; +} __packed; + struct sar_header { char marker[SAR_STR_PREFIX_SIZE]; uint8_t version; @@ -73,6 +78,7 @@ struct gain_profile *ppag; struct avg_profile *wtas; struct dsm_profile *dsm; + struct wbem_profile *wbem; }; void *profile[MAX_PROFILE_COUNT]; }; diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c index c42bf65..b5057c7 100644 --- a/src/vendorcode/google/chromeos/sar.c +++ b/src/vendorcode/google/chromeos/sar.c @@ -94,6 +94,13 @@ return sizeof(struct dsm_profile); }
+static int wbem_table_size(const struct wbem_profile *wbem) +{ + if (wbem == NULL) + return 0; + return sizeof(struct wbem_profile); +} + static bool valid_legacy_length(size_t bin_len) { if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE) @@ -145,6 +152,7 @@ expected_sar_bin_size += gain_table_size(sar_limits->ppag); expected_sar_bin_size += sar_avg_table_size(sar_limits->wtas); expected_sar_bin_size += dsm_table_size(sar_limits->dsm); + expected_sar_bin_size += wbem_table_size(sar_limits->wbem);
if (sar_bin_size != expected_sar_bin_size) { printk(BIOS_ERR, "Invalid SAR size, expected: %zu, obtained: %zu\n", @@ -210,13 +218,13 @@ * [PPAG_REVISION,MODE,CHAINS_COUNT,SUBBANDS_COUNT<PPAG_DATA>] * [WTAS_REVISION, WTAS_DATA] * [DSM_RETURN_VALUES] + * [WBEM_REVISION, WBEM_DATA] * * The configuration data will always have the revision added in the file for each of the * block, based on the revision number and validity, size of the specific block will be * calculated. * * [WGDS_DATA] = [GROUP#0][GROUP#1][GROUP#2] - * * [GROUP#<i>] = * Supported by Revision 0, 1 and 2 * [2.4Ghz - Max Allowed][2.4Ghz - Chain A Offset][2.4Ghz - Chain B Offset] @@ -249,6 +257,8 @@ * [Enable/disable the TAS feature] * [Number of blocked countries that are not approved by the OEM to support this feature] * [deny_list_entry_<1-16>: ISO country code to block] + * [WBEM_DATA] = + * [Enable or disable 320MHZ Bandwidth for Japan, SouthKorea] */ int get_wifi_sar_limits(union wifi_sar_limits *sar_limits) {