Robbie Zhang (robbie.zhang@intel.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/17959
-gerrit
commit 581c28271a0eb7608d2a41c4ec5e6cda1f85e378 Author: Robbie Zhang robbie.zhang@intel.com Date: Fri Dec 23 12:20:47 2016 -0800
intel/wifi: Create ACPI objects for wifi SAR configuration
To support intel wifi SAR configuration, it is required coreboot to publish two ACPI objects (WRDS and EWRD) to supply SAR limit data sets. VPD is to supply the raw SAR limit data.
BUG=chrome-os-partner:60821 TEST=Build and boot lars and reef
Change-Id: I6be345735292d0ca46f2f7e7ea61924990d338a8 Signed-off-by: Robbie Zhang robbie.zhang@intel.com --- src/drivers/intel/wifi/Kconfig | 21 +++++++++++++++++ src/drivers/intel/wifi/wifi.c | 53 ++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 74 insertions(+)
diff --git a/src/drivers/intel/wifi/Kconfig b/src/drivers/intel/wifi/Kconfig index 330de6c..10d09fe 100644 --- a/src/drivers/intel/wifi/Kconfig +++ b/src/drivers/intel/wifi/Kconfig @@ -5,3 +5,24 @@ config DRIVERS_INTEL_WIFI help When enabled, add identifiers in ACPI and SMBIOS tables to make OS drivers work with certain Intel PCI-e WiFi chipsets. + +config USE_SAR + bool + default n + help + Enable it when wifi driver uses SAR configuration feature. + VPD entry "wifi_sar" is required to support it. + +config SAR_ENABLE + bool + default n + +config DSAR_ENABLE + bool + default n + +config DSAR_SET_NUM + hex "Number of SAR sets when D-SAR is enabled" + default 0x3 + help + There can be up to 3 optional SAR table sets diff --git a/src/drivers/intel/wifi/wifi.c b/src/drivers/intel/wifi/wifi.c index 789d0d5..3ac9d00 100644 --- a/src/drivers/intel/wifi/wifi.c +++ b/src/drivers/intel/wifi/wifi.c @@ -20,6 +20,7 @@ #include <device/device.h> #include <device/pci.h> #include <device/pci_ids.h> +#include <sar.h> #include <smbios.h> #include <string.h> #include <wrdd.h> @@ -105,6 +106,58 @@ static void intel_wifi_fill_ssdt(struct device *dev) acpigen_pop_len(); }
+ /* Fill Wifi SAR related structures */ + if (IS_ENABLED(CONFIG_USE_SAR)) { + int i; + const struct wifi_sar_limit_t *sar_t = wifi_sar_limits(); + + /* + * Name ("WRDS", Package () { + * Revision, + * Package () { + * Domain Type, // 0x7:WiFi + * WiFi SAR BIOS, // BIOS SAR Enable/disable + * SAR Table Set // Set#1 of SAR Table (10 bytes) + * } + * }) + */ + acpigen_write_name("WRDS"); + acpigen_write_package(2); + acpigen_write_dword(WRDS_REVISION); + acpigen_write_package(2); + acpigen_write_dword(WRDS_DOMAIN_TYPE_WIFI); + acpigen_write_dword(CONFIG_SAR_ENABLE); + for (i = 0; i < BYTES_OF_SAR_SET; i++) + acpigen_write_byte(*(&sar_t->sar_limit[0] + i)); + acpigen_pop_len(); + acpigen_pop_len(); + + /* + * Name ("EWRD", Package () { + * Revision, + * Package () { + * Domain Type, // 0x7:WiFi + * Dynamic SAR Enable, // Dynamic SAR Enable/disable + * Extended SAR sets, // Number of optional SAR table sets + * SAR Table Set, // Set#2 of SAR Table (10 bytes) + * SAR Table Set, // Set#3 of SAR Table (10 bytes) + * SAR Table Set // Set#4 of SAR Table (10 bytes) + * } + * }) + */ + acpigen_write_name("EWRD"); + acpigen_write_package(2); + acpigen_write_dword(EWRD_REVISION); + acpigen_write_package(2); + acpigen_write_dword(EWRD_DOMAIN_TYPE_WIFI); + acpigen_write_dword(CONFIG_DSAR_ENABLE); + acpigen_write_dword(CONFIG_DSAR_SET_NUM); + for (i = 0; i < BYTES_OF_SAR_SET * 3; i++) + acpigen_write_byte(*(&sar_t->sar_limit[10] + i)); + acpigen_pop_len(); + acpigen_pop_len(); + } + acpigen_pop_len(); /* Device */ acpigen_pop_len(); /* Scope */