aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSugnan Prabhu S <sugnan.prabhu.s@intel.com>2021-08-31 07:19:30 +0530
committerTim Wawrzynczak <twawrzynczak@chromium.org>2021-09-02 22:55:00 +0000
commitcc50770cd0eeab0794264f2e6bccdfa7c117f2b9 (patch)
tree3ea6a55912fc299a472a8d7c3f0cd19d7708209c
parentd1fc832c527699265c7d04517010cc4b0ea6aabd (diff)
wifi: Add support for wifi time average SAR config
Add support for the WTAS ACPI BIOS configuration table as per the connectivity document: 559910_Intel_Connectivity_Platforms_BIOS_Guidelines_Rev6_4.pdf BUG=b:193665559 TEST=Generated SAR file with the WTAS related configuration values and verified that the SSDT has the WTAS ACPI table. Change-Id: I42cf3cba7974e6db0e05de30846ef103a15fd584 Signed-off-by: Sugnan Prabhu S <sugnan.prabhu.s@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57061 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
-rw-r--r--src/drivers/wifi/generic/acpi.c53
-rw-r--r--src/include/sar.h11
-rw-r--r--src/vendorcode/google/chromeos/sar.c15
3 files changed, 78 insertions, 1 deletions
diff --git a/src/drivers/wifi/generic/acpi.c b/src/drivers/wifi/generic/acpi.c
index ed5b632216..5636abca68 100644
--- a/src/drivers/wifi/generic/acpi.c
+++ b/src/drivers/wifi/generic/acpi.c
@@ -267,6 +267,58 @@ static void sar_emit_ppag(struct gain_profile *ppag)
acpigen_write_package_end();
}
+static void sar_emit_wtas(struct avg_profile *wtas)
+{
+ int i;
+ size_t package_size;
+
+ if (wtas == NULL)
+ return;
+
+ /*
+ * Name (WTAS, Package() {
+ * {
+ * Revision,
+ * Package()
+ * {
+ * DomainType, // 0x7:WiFi
+ * WifiTASSelection, // Enable/Disable the TAS feature
+ * WifiTASListEntries, // No. of blocked countries not approved by OEM to
+ * BlockedListEntry1, support this feature
+ * BlockedListEntry2,
+ * BlockedListEntry3,
+ * BlockedListEntry4,
+ * BlockedListEntry5,
+ * BlockedListEntry6,
+ * BlockedListEntry7,
+ * BlockedListEntry8,
+ * BlockedListEntry9,
+ * BlockedListEntry10,
+ * BlockedListEntry11,
+ * BlockedListEntry12,
+ * BlockedListEntry13,
+ * BlockedListEntry14,
+ * BlockedListEntry15,
+ * BlockedListEntry16,
+ * }
+ * })
+ */
+ package_size = 1 + 1 + 1 + MAX_DENYLIST_ENTRY;
+
+ acpigen_write_name("WTAS");
+ acpigen_write_package(2);
+ acpigen_write_dword(wtas->revision);
+ acpigen_write_package(package_size);
+ acpigen_write_dword(DOMAIN_TYPE_WIFI);
+ acpigen_write_dword(wtas->tas_selection);
+ acpigen_write_dword(wtas->tas_list_size);
+ for (i = 0; i < MAX_DENYLIST_ENTRY; i++)
+ acpigen_write_byte(wtas->deny_list_entry[i]);
+
+ acpigen_write_package_end();
+ acpigen_write_package_end();
+}
+
static void emit_sar_acpi_structures(const struct device *dev)
{
union wifi_sar_limits sar_limits;
@@ -288,6 +340,7 @@ static void emit_sar_acpi_structures(const struct device *dev)
sar_emit_ewrd(sar_limits.sar);
sar_emit_wgds(sar_limits.wgds);
sar_emit_ppag(sar_limits.ppag);
+ sar_emit_wtas(sar_limits.wtas);
free(sar_limits.sar);
}
diff --git a/src/include/sar.h b/src/include/sar.h
index e8a1b287b5..f4ee0c5ac3 100644
--- a/src/include/sar.h
+++ b/src/include/sar.h
@@ -5,9 +5,10 @@
#include <stdint.h>
#define MAX_ANT_GAINS_REVISION 2
+#define MAX_DENYLIST_ENTRY 16
#define MAX_DSAR_SET_COUNT 3
#define MAX_GEO_OFFSET_REVISION 3
-#define MAX_PROFILE_COUNT 3
+#define MAX_PROFILE_COUNT 4
#define MAX_SAR_REVISION 2
#define REVISION_SIZE 1
#define SAR_REV0_CHAINS_COUNT 2
@@ -39,6 +40,13 @@ struct gain_profile {
uint8_t ppag_table[0];
} __packed;
+struct avg_profile {
+ uint8_t revision;
+ uint8_t tas_selection;
+ uint8_t tas_list_size;
+ uint8_t deny_list_entry[MAX_DENYLIST_ENTRY];
+} __packed;
+
struct sar_header {
char marker[SAR_STR_PREFIX_SIZE];
uint8_t version;
@@ -51,6 +59,7 @@ union wifi_sar_limits {
struct sar_profile *sar;
struct geo_profile *wgds;
struct gain_profile *ppag;
+ struct avg_profile *wtas;
};
void *profile[MAX_PROFILE_COUNT];
};
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index 5c16f7606b..7b84d1ad55 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -76,6 +76,14 @@ static int gain_table_size(const struct gain_profile *gain)
return sizeof(struct gain_profile) + (gain->chains_count * gain->bands_count);
}
+static int sar_avg_table_size(const struct avg_profile *sar_avg)
+{
+ if (sar_avg == NULL)
+ return 0;
+
+ return sizeof(struct avg_profile);
+}
+
static bool valid_legacy_length(size_t bin_len)
{
if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE)
@@ -125,6 +133,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t
expected_sar_bin_size += sar_table_size(sar_limits->sar);
expected_sar_bin_size += wgds_table_size(sar_limits->wgds);
expected_sar_bin_size += gain_table_size(sar_limits->ppag);
+ expected_sar_bin_size += sar_avg_table_size(sar_limits->wtas);
if (sar_bin_size != expected_sar_bin_size) {
printk(BIOS_ERR, "ERROR: Invalid SAR size, expected: %ld, obtained: %ld\n",
@@ -188,6 +197,7 @@ static int fill_wifi_sar_limits_legacy(union wifi_sar_limits *sar_limits,
* [SAR_REVISION,DSAR_SET_COUNT,CHAINS_COUNT,SUBBANDS_COUNT <WRDD>[EWRD]]
* [WGDS_REVISION,CHAINS_COUNT,SUBBANDS_COUNT<WGDS_DATA>]
* [PPAG_REVISION,MODE,CHAINS_COUNT,SUBBANDS_COUNT<PPAG_DATA>]
+ * [WTAS_REVISION, WTAS_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
@@ -222,6 +232,11 @@ static int fill_wifi_sar_limits_legacy(union wifi_sar_limits *sar_limits,
* [Antenna gain used for 6525-6705MHz frequency]
* [Antenna gain used for 6705-6865MHz frequency]
* [Antenna gain used for 6865-7105MHz frequency]
+ *
+ * [WTAS_DATA] =
+ * [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]
*/
int get_wifi_sar_limits(union wifi_sar_limits *sar_limits)
{