intel/wifi: Add WGDS ACPI method for Geo Aware SAR

To comply with all relevant bodies throughout the world, SAR settings
take into account the lowest common denominator Tx power settings. This
setup may lead to non-optimal performance when the user location is in a
country that may allow higher power setting. The purpose of Wireless Geo
Delta Settings (WGDS) is to provide offset settings for FCC, Europe,
Japan and Rest of the world. These offsets would be added (by Intel wifi
driver) to the base SAR Tx Power as defined in WRDS and EWRD

BUG=b:65155728
BRANCH=none
TEST=WGDS ACPI table gets created as expected.

Change-Id: I4f602e3f95ff3545db6cc6e428beb9a36abd9296
Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati@intel.com>
Reviewed-on: https://review.coreboot.org/21098
Tested-by: build bot (Jenkins) <no-reply@coreboot.org>
Reviewed-by: Aaron Durbin <adurbin@chromium.org>
This commit is contained in:
Pratik Prajapati
2017-08-11 14:06:57 -07:00
committed by Patrick Georgi
parent 8919ac726b
commit 7fd1e4b9b1
6 changed files with 191 additions and 28 deletions

View File

@@ -11,7 +11,9 @@ config USE_SAR
default n
help
Enable it when wifi driver uses SAR configuration feature.
VPD entry "wifi_sar" is required to support it.
VPD entry "wifi_sar" is read to get SAR settings, if its
not found driver may look into CBFS for default settigs.
WIFI_SAR_CBFS is option to enable CBFS lookup.
config SAR_ENABLE
bool
@@ -23,6 +25,26 @@ config DSAR_ENABLE
default n
depends on USE_SAR
config GEO_SAR_ENABLE
bool
default n
depends on USE_SAR
config WIFI_SAR_CBFS
bool
default n
depends on USE_SAR
help
wifi driver would look for "wifi_sar" vpd key and load SAR settings from
it, if the vpd key is not found then the driver tries to look for sar
settings from CBFS with file name wifi_sar_defaults.hex.
So OEM/ODM can override wifi sar with VPD.
config WIFI_SAR_CBFS_FILEPATH
string "The cbfs file which has WIFI SAR defaults"
depends on WIFI_SAR_CBFS
default "src/mainboard/$(MAINBOARDDIR)/wifi_sar_defaults.hex"
config DSAR_SET_NUM
hex "Number of SAR sets when D-SAR is enabled"
default 0x3

View File

@@ -12,3 +12,7 @@
#
ramstage-$(CONFIG_DRIVERS_INTEL_WIFI) += wifi.c
cbfs-files-$(CONFIG_WIFI_SAR_CBFS) += wifi_sar_defaults.hex
wifi_sar_defaults.hex-file := $(call strip_quotes,$(CONFIG_WIFI_SAR_CBFS_FILEPATH))
wifi_sar_defaults.hex-type := raw

View File

@@ -28,6 +28,9 @@
/* EWRD Domain type */
#define EWRD_DOMAIN_TYPE_WIFI 0x7
/* WGDS Domain type */
#define WGDS_DOMAIN_TYPE_WIFI 0x7
struct drivers_intel_wifi_config {
unsigned wake; /* Wake pin for ACPI _PRW */
};

View File

@@ -2,6 +2,7 @@
* This file is part of the coreboot project.
*
* Copyright (C) 2014 Vladimir Serbinenko
* Copyright (C) 2018 Intel Corp.
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -75,6 +76,7 @@ static void emit_sar_acpi_structures(void)
{
int i, j, package_size;
struct wifi_sar_limits sar_limits;
struct wifi_sar_delta_table *wgds;
/* Retrieve the sar limits data */
if (get_wifi_sar_limits(&sar_limits) < 0) {
@@ -135,6 +137,59 @@ static void emit_sar_acpi_structures(void)
acpigen_write_byte(sar_limits.sar_limit[i][j]);
acpigen_pop_len();
acpigen_pop_len();
if (!IS_ENABLED(CONFIG_GEO_SAR_ENABLE))
return;
/*
* Name ("WGDS", Package() {
* Revision,
* Package() {
* DomainType, // 0x7:WiFi
* WgdsWiFiSarDeltaGroup1PowerMax1, // Group 1 FCC 2400 Max
* WgdsWiFiSarDeltaGroup1PowerChainA1, // Group 1 FCC 2400 A Offset
* WgdsWiFiSarDeltaGroup1PowerChainB1, // Group 1 FCC 2400 B Offset
* WgdsWiFiSarDeltaGroup1PowerMax2, // Group 1 FCC 5200 Max
* WgdsWiFiSarDeltaGroup1PowerChainA2, // Group 1 FCC 5200 A Offset
* WgdsWiFiSarDeltaGroup1PowerChainB2, // Group 1 FCC 5200 B Offset
* WgdsWiFiSarDeltaGroup2PowerMax1, // Group 2 EC Jap 2400 Max
* WgdsWiFiSarDeltaGroup2PowerChainA1, // Group 2 EC Jap 2400 A Offset
* WgdsWiFiSarDeltaGroup2PowerChainB1, // Group 2 EC Jap 2400 B Offset
* WgdsWiFiSarDeltaGroup2PowerMax2, // Group 2 EC Jap 5200 Max
* WgdsWiFiSarDeltaGroup2PowerChainA2, // Group 2 EC Jap 5200 A Offset
* WgdsWiFiSarDeltaGroup2PowerChainB2, // Group 2 EC Jap 5200 B Offset
* WgdsWiFiSarDeltaGroup3PowerMax1, // Group 3 ROW 2400 Max
* WgdsWiFiSarDeltaGroup3PowerChainA1, // Group 3 ROW 2400 A Offset
* WgdsWiFiSarDeltaGroup3PowerChainB1, // Group 3 ROW 2400 B Offset
* WgdsWiFiSarDeltaGroup3PowerMax2, // Group 3 ROW 5200 Max
* WgdsWiFiSarDeltaGroup3PowerChainA2, // Group 3 ROW 5200 A Offset
* WgdsWiFiSarDeltaGroup3PowerChainB2, // Group 3 ROW 5200 B Offset
* }
* })
*/
wgds = &sar_limits.wgds;
acpigen_write_name("WGDS");
acpigen_write_package(2);
acpigen_write_dword(wgds->version);
/* Emit 'Domain Type' +
* Group specific delta of power ( 6 bytes * NUM_WGDS_SAR_GROUPS )
*/
package_size = sizeof(sar_limits.wgds.group) + 1;
acpigen_write_package(package_size);
acpigen_write_dword(WGDS_DOMAIN_TYPE_WIFI);
for (i = 0; i < SAR_NUM_WGDS_GROUPS; i++) {
acpigen_write_byte(wgds->group[i].power_max_2400mhz);
acpigen_write_byte(wgds->group[i].power_chain_a_2400mhz);
acpigen_write_byte(wgds->group[i].power_chain_b_2400mhz);
acpigen_write_byte(wgds->group[i].power_max_5200mhz);
acpigen_write_byte(wgds->group[i].power_chain_a_5200mhz);
acpigen_write_byte(wgds->group[i].power_chain_b_5200mhz);
}
acpigen_pop_len();
acpigen_pop_len();
}
static void intel_wifi_fill_ssdt(struct device *dev)