aboutsummaryrefslogtreecommitdiff
path: root/src/vendorcode/google
diff options
context:
space:
mode:
authorSugnan Prabhu S <sugnan.prabhu.s@intel.com>2021-08-31 07:11:35 +0530
committerTim Wawrzynczak <twawrzynczak@chromium.org>2021-09-02 22:54:35 +0000
commitd1fc832c527699265c7d04517010cc4b0ea6aabd (patch)
tree74deb12c6e985c6502b5d038a3f8f3fde0fbee21 /src/vendorcode/google
parentfcb4f2d77e4d0c09bf8e433d724ef0ea272df815 (diff)
wifi: Add support for per-platform antenna gain
Add support for the PPAG 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 PPAG related configuration values and verified that the SSDT has the PPAG ACPI table. Change-Id: Ie8d25113feeeb4a4242cfd7d72a5091d2d5fb389 Signed-off-by: Sugnan Prabhu S <sugnan.prabhu.s@intel.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/57060 Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Tim Wawrzynczak <twawrzynczak@chromium.org>
Diffstat (limited to 'src/vendorcode/google')
-rw-r--r--src/vendorcode/google/chromeos/sar.c27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/vendorcode/google/chromeos/sar.c b/src/vendorcode/google/chromeos/sar.c
index d6cb021412..5c16f7606b 100644
--- a/src/vendorcode/google/chromeos/sar.c
+++ b/src/vendorcode/google/chromeos/sar.c
@@ -68,6 +68,14 @@ static int wgds_table_size(const struct geo_profile *geo)
return sizeof(struct geo_profile) + (geo->chains_count * geo->bands_count);
}
+static int gain_table_size(const struct gain_profile *gain)
+{
+ if (gain == NULL)
+ return 0;
+
+ return sizeof(struct gain_profile) + (gain->chains_count * gain->bands_count);
+}
+
static bool valid_legacy_length(size_t bin_len)
{
if (bin_len == LEGACY_SAR_WGDS_BIN_SIZE)
@@ -116,6 +124,7 @@ static int fill_wifi_sar_limits(union wifi_sar_limits *sar_limits, const uint8_t
expected_sar_bin_size = header_size;
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);
if (sar_bin_size != expected_sar_bin_size) {
printk(BIOS_ERR, "ERROR: Invalid SAR size, expected: %ld, obtained: %ld\n",
@@ -178,6 +187,7 @@ static int fill_wifi_sar_limits_legacy(union wifi_sar_limits *sar_limits,
* Offsets
* [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>]
*
* 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
@@ -195,6 +205,23 @@ static int fill_wifi_sar_limits_legacy(union wifi_sar_limits *sar_limits,
* [GROUP#0] is for FCC
* [GROUP#1] is for Europe/Japan
* [GROUP#2] is for ROW
+ *
+ * [PPAG_DATA] = [ANT_gain Table Chain A] [ANT_gain Table Chain A]
+ *
+ * [ANT_gain Table] =
+ * Supported by Revision 0, 1 and 2
+ * [Antenna gain used for 2400MHz frequency]
+ * [Antenna gain used for 5150-5350MHz frequency]
+ * [Antenna gain used for 5350-5470MHz frequency]
+ * [Antenna gain used for 5470-5725MHz frequency]
+ * [Antenna gain used for 5725-5945MHz frequency]
+ * Supported by Revision 1 and 2
+ * [Antenna gain used for 5945-6165MHz frequency]
+ * [Antenna gain used for 6165-6405MHz frequency]
+ * [Antenna gain used for 6405-6525MHz frequency]
+ * [Antenna gain used for 6525-6705MHz frequency]
+ * [Antenna gain used for 6705-6865MHz frequency]
+ * [Antenna gain used for 6865-7105MHz frequency]
*/
int get_wifi_sar_limits(union wifi_sar_limits *sar_limits)
{