[coreboot-gerrit] Change in coreboot[master]: intel/wifi: Add WGDS ACPI method for Geo Aware SAR

Pratikkumar V Prajapati (Code Review) gerrit at coreboot.org
Fri Aug 18 20:56:02 CEST 2017


Pratikkumar V Prajapati has uploaded this change for review. ( https://review.coreboot.org/21098


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

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.

Change-Id: I4f602e3f95ff3545db6cc6e428beb9a36abd9296
Signed-off-by: Pratik Prajapati <pratikkumar.v.prajapati at intel.com>
---
M src/drivers/intel/wifi/chip.h
M src/drivers/intel/wifi/wifi.c
M src/include/sar.h
3 files changed, 115 insertions(+), 0 deletions(-)



  git pull ssh://review.coreboot.org:29418/coreboot refs/changes/98/21098/1

diff --git a/src/drivers/intel/wifi/chip.h b/src/drivers/intel/wifi/chip.h
index 0871874..61aad04 100644
--- a/src/drivers/intel/wifi/chip.h
+++ b/src/drivers/intel/wifi/chip.h
@@ -22,12 +22,18 @@
 /* EWRD Spec Revision */
 #define EWRD_REVISION 0x0
 
+/* WGDS Spec Revision */
+#define WGDS_REVISION 0x0
+
 /* WRDS Domain type */
 #define WRDS_DOMAIN_TYPE_WIFI 0x7
 
 /* 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 */
 };
diff --git a/src/drivers/intel/wifi/wifi.c b/src/drivers/intel/wifi/wifi.c
index 77918e4..080e31b 100644
--- a/src/drivers/intel/wifi/wifi.c
+++ b/src/drivers/intel/wifi/wifi.c
@@ -75,6 +75,37 @@
 {
 	int i, j, package_size;
 	struct wifi_sar_limits sar_limits;
+	struct wifi_sar_delta_table_t wifi_sar_delta_table = {
+		/* FCC group */
+		.group[0] = {
+			.power_max_2400mhz = 0x01,
+			.power_chain_a_2400mhz = 0x02,
+			.power_chain_b_2400mhz = 0x03,
+			.power_max_52000mhz = 0x04,
+			.power_chain_a_5200mhz = 0x05,
+			.power_chain_b_5200mhz = 0x06,
+		},
+
+		/* Europe and Japan Group */
+		.group[1] = {
+			.power_max_2400mhz = 0x07,
+			.power_chain_a_2400mhz = 0x08,
+			.power_chain_b_2400mhz = 0x09,
+			.power_max_52000mhz = 0x0a,
+			.power_chain_a_5200mhz = 0x0b,
+			.power_chain_b_5200mhz = 0x0c,
+		},
+
+		/* Rest-of-the-world Group */
+		.group[2] = {
+			.power_max_2400mhz = 0x0d,
+			.power_chain_a_2400mhz = 0x0e,
+			.power_chain_b_2400mhz = 0x0f,
+			.power_max_52000mhz = 0x10,
+			.power_chain_a_5200mhz = 0x11,
+			.power_chain_b_5200mhz = 0x12,
+		},
+	};
 
 	/* Retrieve the sar limits data */
 	if (get_wifi_sar_limits(&sar_limits) < 0) {
@@ -135,6 +166,65 @@
 			acpigen_write_byte(sar_limits.sar_limit[i][j]);
 	acpigen_pop_len();
 	acpigen_pop_len();
+
+	/*
+	 * Group 1 = FCC
+	 * Group 2 = Europe and Japan
+	 * Group 3 = Rest of the World
+	 *
+	 * 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
+	 *  }
+	 * })
+	 */
+
+
+	acpigen_write_name("WGDS");
+	acpigen_write_package(2);
+	acpigen_write_dword(WGDS_REVISION);
+	/*
+	 * Emit 'Domain Type' +
+	 * Group specific delta of power ( 6 bytes * NUM_WGDS_SAR_GROUPS )
+	 */
+	package_size = 1 + 6 * NUM_WGDS_SAR_GROUPS;
+	acpigen_write_package(package_size);
+	acpigen_write_dword(WGDS_DOMAIN_TYPE_WIFI);
+	for (i = 0; i < NUM_WGDS_SAR_GROUPS; i++) {
+		acpigen_write_byte(
+			wifi_sar_delta_table.group[i].power_max_2400mhz);
+		acpigen_write_byte(
+			wifi_sar_delta_table.group[i].power_chain_a_2400mhz);
+		acpigen_write_byte(
+			wifi_sar_delta_table.group[i].power_chain_b_2400mhz);
+		acpigen_write_byte(
+			wifi_sar_delta_table.group[i].power_max_52000mhz);
+		acpigen_write_byte(
+			wifi_sar_delta_table.group[i].power_chain_a_5200mhz);
+		acpigen_write_byte(
+			wifi_sar_delta_table.group[i].power_chain_b_5200mhz);
+	}
+	acpigen_pop_len();
+	acpigen_pop_len();
 }
 
 static void intel_wifi_fill_ssdt(struct device *dev)
@@ -193,6 +283,7 @@
 
 	printk(BIOS_INFO, "%s.%s: %s %s\n", path, acpi_device_name(dev),
 	       dev->chip_ops ? dev->chip_ops->name : "", dev_path(dev));
+
 }
 
 static const char *intel_wifi_acpi_name(struct device *dev)
diff --git a/src/include/sar.h b/src/include/sar.h
index 4653dd3..74b0d25 100644
--- a/src/include/sar.h
+++ b/src/include/sar.h
@@ -19,6 +19,7 @@
 
 #define NUM_SAR_LIMITS 4
 #define BYTES_PER_SAR_LIMIT 10
+#define NUM_WGDS_SAR_GROUPS 3
 
 /* Wifi SAR limit table structure */
 struct wifi_sar_limits {
@@ -26,6 +27,23 @@
 	uint8_t sar_limit[NUM_SAR_LIMITS][BYTES_PER_SAR_LIMIT];
 };
 
+struct wifi_sar_delta_table_t {
+	/*
+	 * 3 Groups are defined for delta
+	 * Group 1 = FCC
+	 * Group 2 = Europe and Japan
+	 * Group 3 = Rest of the World
+	 */
+	struct group{
+		uint8_t power_max_2400mhz;
+		uint8_t power_chain_a_2400mhz;
+		uint8_t power_chain_b_2400mhz;
+		uint8_t power_max_52000mhz;
+		uint8_t power_chain_a_5200mhz;
+		uint8_t power_chain_b_5200mhz;
+	} group[NUM_WGDS_SAR_GROUPS];
+};
+
 /*
  * Retrieve the SAR limits data from VPD and decode it.
  * sar_limits:	Pointer to wifi_sar_limits where the resulted data is stored

-- 
To view, visit https://review.coreboot.org/21098
To unsubscribe, visit https://review.coreboot.org/settings

Gerrit-Project: coreboot
Gerrit-Branch: master
Gerrit-MessageType: newchange
Gerrit-Change-Id: I4f602e3f95ff3545db6cc6e428beb9a36abd9296
Gerrit-Change-Number: 21098
Gerrit-PatchSet: 1
Gerrit-Owner: Pratikkumar V Prajapati <pratikkumar.v.prajapati at intel.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.coreboot.org/pipermail/coreboot-gerrit/attachments/20170818/dbdd2e14/attachment.html>


More information about the coreboot-gerrit mailing list