Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13837
-gerrit
commit b0551785046f1a27272138f6a5b22308d9e57abc
Author: Huang, Huki <huki.huang(a)intel.com>
Date: Thu Jan 21 10:17:06 2016 +0800
Chromeos: Modify wifi_regulatory_domain to use "region" key in VPD
In ChromeOS VPD spec the right name is "region".
Signed-off-by: Hannah Williams <hannah.williams(a)intel.com>
Reviewed-on: https://chromium-review.googlesource.com/322851
Reviewed-by: Hung-Te Lin <hungte(a)chromium.org>
Reviewed-by: mukesh agrawal <quiche(a)chromium.org>
(cherry picked from commit 21ea0663e7f3ffe3aaea6b6ce0e1216fcd9ca23e)
BUG=chrome-os-partner:50516
BRANCH=glados
TEST=build and boot on chell
Change-Id: I4ba9a9c65af3732fa263030640495ab5bea91d1f
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
Original-Commit-Id: 848f18e731eb11dd3037d12607d7364f95e64e34
Original-Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Original-Change-Id: Ib96036f9cd76449f170af5c3dd6ef6e8e91ded94
Original-Reviewed-on: https://chromium-review.googlesource.com/329293
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/vendorcode/google/chromeos/cros_vpd.h | 2 +-
src/vendorcode/google/chromeos/wrdd.c | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/vendorcode/google/chromeos/cros_vpd.h b/src/vendorcode/google/chromeos/cros_vpd.h
index ca9c320..96ca8af 100644
--- a/src/vendorcode/google/chromeos/cros_vpd.h
+++ b/src/vendorcode/google/chromeos/cros_vpd.h
@@ -7,7 +7,7 @@
#ifndef __CROS_VPD_H__
#define __CROS_VPD_H__
-#define CROS_VPD_WIFI_DOMAINKEY "regions"
+#define CROS_VPD_REGION_NAME "region"
/*
* Reads VPD string value by key.
diff --git a/src/vendorcode/google/chromeos/wrdd.c b/src/vendorcode/google/chromeos/wrdd.c
index ab27cc0..ad80992 100644
--- a/src/vendorcode/google/chromeos/wrdd.c
+++ b/src/vendorcode/google/chromeos/wrdd.c
@@ -26,6 +26,7 @@
* The first part is the ISO 3166-1 alpha-2 code of the country;
* The second part is a string of up to three alphanumeric characters
*/
+#define VARIANT_SEPARATOR '.'
struct wrdd_code_value_pair {
const char *code;
u16 value;
@@ -50,21 +51,27 @@ uint16_t wifi_regulatory_domain(void)
.value = WRDD_REGULATORY_DOMAIN_INDONESIA
}
};
- const char *wrdd_domain_key = CROS_VPD_WIFI_DOMAINKEY;
+ const char *wrdd_domain_key = CROS_VPD_REGION_NAME;
int i;
struct wrdd_code_value_pair *p;
/* wrdd_domain_value is ISO 3166-2 */
char wrdd_domain_code[7];
+ char *separator;
/* If not found for any reason fall backto the default value */
if (!cros_vpd_gets(wrdd_domain_key, wrdd_domain_code,
- sizeof(wrdd_domain_code))) {
+ ARRAY_SIZE(wrdd_domain_code))) {
printk(BIOS_DEBUG,
"Error: Could not locate '%s' in VPD\n", wrdd_domain_key);
return WRDD_DEFAULT_REGULATORY_DOMAIN;
}
printk(BIOS_DEBUG, "Found '%s'='%s' in VPD\n",
wrdd_domain_key, wrdd_domain_code);
+ separator = memchr(wrdd_domain_code, VARIANT_SEPARATOR,
+ ARRAY_SIZE(wrdd_domain_code));
+ if (separator) {
+ *separator = '\0';
+ }
for (i = 0; i < ARRAY_SIZE(wrdd_table); i++) {
p = &wrdd_table[i];
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13838
-gerrit
commit bb5c57e5ce0847b241a1be85059972ba354a70af
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Thu Feb 25 08:44:06 2016 -0800
intel/wifi: Add WRDD ACPI method
Add an ACPI file containing a generic WRDD method that is used
by Intel wireless kernel drivers to determine the country code
to be used for regulatory domain configuration of the wireless
radios.
This requires an NVS variable called 'CID1' to provide an
ISO-3166-2 alpha-2 country code or it will just return 0 instead.
This is implemented as a bare method because this needs to be
included directly into the wifi device that is defined by the
mainboard as it may have board-specific settings like _PRW that
need to be provided as well.
BUG=chrome-os-partner:50516
BRANCH=glados
TEST=boot on chell with 'region'='us' in VPD and see that it is
properly read out by calling WRDD method on the WiFi device.
Change-Id: I27a5e27f65d05ff62a0e79a87a32c1ef0c5d0ef3
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
Original-Commit-Id: 2da0cf76ca3cc5e3dfbc4a0859733523de780cf5
Original-Change-Id: I9d83c3938cceafc77ef8747a5c47f586ee84437e
Original-Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/329294
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/drivers/intel/wifi/acpi/wrdd.asl | 37 ++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/src/drivers/intel/wifi/acpi/wrdd.asl b/src/drivers/intel/wifi/acpi/wrdd.asl
new file mode 100644
index 0000000..6f071ad
--- /dev/null
+++ b/src/drivers/intel/wifi/acpi/wrdd.asl
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Google Inc.
+ * Copyright (C) 2016 Intel Corporation
+ *
+ * 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
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/*
+ * This method is used by the Intel wireless kernel drivers to determine
+ * the proper country code for regulatory domain configuration.
+ *
+ * It requires an NVS field called CID1 to be present that provides the
+ * ISO-3166-2 alpha-2 country code.
+ */
+Method (WRDD, 0, Serialized)
+{
+ Name (WRDX, Package () {
+ 0, /* Revision */
+ Package () {
+ 0x00000007, /* Domain Type, 0x7:WiFi */
+ 0x00000000, /* No Default Country Identifier */
+ }
+ })
+
+ /* Replace Country Identifier with value from NVS */
+ Store (\CID1, Index (DeRefOf (Index (WRDX, 1)), 1))
+ Return (WRDX)
+}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13840
-gerrit
commit a5c5d2184b11b5f20cc273c74975847249764293
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Thu Feb 25 08:49:00 2016 -0800
mainboard/skylake: Include WRDD method in WIFI ACPI device
Include the code to add the WRDD method to the existing
WiFi Device in the mainboard ACPI code.
BUG=chrome-os-partner:50516
BRANCH=glados
TEST=boot on chell with 'region'='us' in VPD and see that it is
properly read out by calling WRDD method on the WiFi device.
Compile for the other platforms that are modified.
Change-Id: Ibcff7585744071ba9018d0ba50e274e63365b150
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
Original-Commit-Id: b74bb553415f7ce224ddcb0c2c5ae509b8fed516
Original-Change-Id: Ieb24e0e64974ee3686d14a234e148f5d07fc8b12
Original-Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/329296
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/mainboard/google/chell/acpi/mainboard.asl | 2 ++
src/mainboard/google/glados/acpi/mainboard.asl | 2 ++
src/mainboard/google/lars/acpi/mainboard.asl | 2 ++
src/mainboard/intel/kunimitsu/acpi/mainboard.asl | 2 ++
4 files changed, 8 insertions(+)
diff --git a/src/mainboard/google/chell/acpi/mainboard.asl b/src/mainboard/google/chell/acpi/mainboard.asl
index 0714582..a7c7bfe 100644
--- a/src/mainboard/google/chell/acpi/mainboard.asl
+++ b/src/mainboard/google/chell/acpi/mainboard.asl
@@ -64,6 +64,8 @@ Scope (\_SB.PCI0.RP01)
Name (_ADR, 0x00000000)
Name (_DDN, "Wireless LAN")
Name (_PRW, Package () { GPE_WLAN_WAKE, 3 })
+
+ #include <drivers/intel/wifi/acpi/wrdd.asl>
}
}
diff --git a/src/mainboard/google/glados/acpi/mainboard.asl b/src/mainboard/google/glados/acpi/mainboard.asl
index 1b37329..3fbe332 100644
--- a/src/mainboard/google/glados/acpi/mainboard.asl
+++ b/src/mainboard/google/glados/acpi/mainboard.asl
@@ -63,6 +63,8 @@ Scope (\_SB.PCI0.RP01)
Name (_ADR, 0x00000000)
Name (_DDN, "Wireless LAN")
Name (_PRW, Package () { GPE_WLAN_WAKE, 3 })
+
+ #include <drivers/intel/wifi/acpi/wrdd.asl>
}
}
diff --git a/src/mainboard/google/lars/acpi/mainboard.asl b/src/mainboard/google/lars/acpi/mainboard.asl
index e8397a1..d6299a5 100644
--- a/src/mainboard/google/lars/acpi/mainboard.asl
+++ b/src/mainboard/google/lars/acpi/mainboard.asl
@@ -104,6 +104,8 @@ Scope (\_SB.PCI0.RP01)
Name (_ADR, 0x00000000)
Name (_DDN, "Wireless LAN")
Name (_PRW, Package () { GPE_WLAN_WAKE, 3 })
+
+ #include <drivers/intel/wifi/acpi/wrdd.asl>
}
}
diff --git a/src/mainboard/intel/kunimitsu/acpi/mainboard.asl b/src/mainboard/intel/kunimitsu/acpi/mainboard.asl
index 8692c58..f44e362 100644
--- a/src/mainboard/intel/kunimitsu/acpi/mainboard.asl
+++ b/src/mainboard/intel/kunimitsu/acpi/mainboard.asl
@@ -108,6 +108,8 @@ Scope (\_SB.PCI0.RP01)
Name (_ADR, 0x00000000)
Name (_DDN, "Wireless LAN")
Name (_PRW, Package () { GPE_WLAN_WAKE, 3 })
+
+ #include <drivers/intel/wifi/acpi/wrdd.asl>
}
}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13838
-gerrit
commit b36ac74af0243558e8e22890006c675b8e930d95
Author: Duncan Laurie <dlaurie(a)chromium.org>
Date: Thu Feb 25 08:44:06 2016 -0800
intel/wifi: Add WRDD ACPI method
Add an ACPI file containing a generic WRDD method that is used
by Intel wireless kernel drivers to determine the country code
to be used for regulatory domain configuration of the wireless
radios.
This requires an NVS variable called 'CID1' to provide an
ISO-3166-2 alpha-2 country code or it will just return 0 instead.
This is implemented as a bare method because this needs to be
included directly into the wifi device that is defined by the
mainboard as it may have board-specific settings like _PRW that
need to be provided as well.
BUG=chrome-os-partner:50516
BRANCH=glados
TEST=boot on chell with 'region'='us' in VPD and see that it is
properly read out by calling WRDD method on the WiFi device.
Change-Id: I27a5e27f65d05ff62a0e79a87a32c1ef0c5d0ef3
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
Original-Commit-Id: 2da0cf76ca3cc5e3dfbc4a0859733523de780cf5
Original-Change-Id: I9d83c3938cceafc77ef8747a5c47f586ee84437e
Original-Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Original-Reviewed-on: https://chromium-review.googlesource.com/329294
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/drivers/intel/wifi/acpi/wrdd.asl | 37 ++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+)
diff --git a/src/drivers/intel/wifi/acpi/wrdd.asl b/src/drivers/intel/wifi/acpi/wrdd.asl
new file mode 100644
index 0000000..6f071ad
--- /dev/null
+++ b/src/drivers/intel/wifi/acpi/wrdd.asl
@@ -0,0 +1,37 @@
+/*
+ * This file is part of the coreboot project.
+ *
+ * Copyright (C) 2016 Google Inc.
+ * Copyright (C) 2016 Intel Corporation
+ *
+ * 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
+ * the Free Software Foundation; version 2 of the License.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ */
+
+/*
+ * This method is used by the Intel wireless kernel drivers to determine
+ * the proper country code for regulatory domain configuration.
+ *
+ * It requires an NVS field called CID1 to be present that provides the
+ * ISO-3166-2 alpha-2 country code.
+ */
+Method (WRDD, 0, Serialized)
+{
+ Name (WRDX, Package () {
+ 0, /* Revision */
+ Package () {
+ 0x00000007, /* Domain Type, 0x7:WiFi */
+ 0x00000000, /* No Default Country Identifier */
+ }
+ })
+
+ /* Replace Country Identifier with value from NVS */
+ Store (\CID1, Index (DeRefOf (Index (WRDX, 1)), 1))
+ Return (WRDX)
+}
Patrick Georgi (pgeorgi(a)google.com) just uploaded a new patch set to gerrit, which you can find at https://review.coreboot.org/13837
-gerrit
commit eae6de757e5d5e0e899bfdb59d273a544037df06
Author: Huang, Huki <huki.huang(a)intel.com>
Date: Thu Jan 21 10:17:06 2016 +0800
Chromeos: Modify wifi_regulatory_domain to use "region" key in VPD
In ChromeOS VPD spec the right name is "region".
Signed-off-by: Hannah Williams <hannah.williams(a)intel.com>
Reviewed-on: https://chromium-review.googlesource.com/322851
Reviewed-by: Hung-Te Lin <hungte(a)chromium.org>
Reviewed-by: mukesh agrawal <quiche(a)chromium.org>
(cherry picked from commit 21ea0663e7f3ffe3aaea6b6ce0e1216fcd9ca23e)
BUG=chrome-os-partner:50516
BRANCH=glados
TEST=build and boot on chell
Change-Id: I4ba9a9c65af3732fa263030640495ab5bea91d1f
Signed-off-by: Patrick Georgi <pgeorgi(a)google.com>
Original-Commit-Id: 848f18e731eb11dd3037d12607d7364f95e64e34
Original-Signed-off-by: Duncan Laurie <dlaurie(a)chromium.org>
Original-Change-Id: Ib96036f9cd76449f170af5c3dd6ef6e8e91ded94
Original-Reviewed-on: https://chromium-review.googlesource.com/329293
Original-Reviewed-by: Aaron Durbin <adurbin(a)chromium.org>
---
src/vendorcode/google/chromeos/cros_vpd.h | 2 +-
src/vendorcode/google/chromeos/wrdd.c | 11 +++++++++--
2 files changed, 10 insertions(+), 3 deletions(-)
diff --git a/src/vendorcode/google/chromeos/cros_vpd.h b/src/vendorcode/google/chromeos/cros_vpd.h
index ca9c320..96ca8af 100644
--- a/src/vendorcode/google/chromeos/cros_vpd.h
+++ b/src/vendorcode/google/chromeos/cros_vpd.h
@@ -7,7 +7,7 @@
#ifndef __CROS_VPD_H__
#define __CROS_VPD_H__
-#define CROS_VPD_WIFI_DOMAINKEY "regions"
+#define CROS_VPD_REGION_NAME "region"
/*
* Reads VPD string value by key.
diff --git a/src/vendorcode/google/chromeos/wrdd.c b/src/vendorcode/google/chromeos/wrdd.c
index ab27cc0..ad80992 100644
--- a/src/vendorcode/google/chromeos/wrdd.c
+++ b/src/vendorcode/google/chromeos/wrdd.c
@@ -26,6 +26,7 @@
* The first part is the ISO 3166-1 alpha-2 code of the country;
* The second part is a string of up to three alphanumeric characters
*/
+#define VARIANT_SEPARATOR '.'
struct wrdd_code_value_pair {
const char *code;
u16 value;
@@ -50,21 +51,27 @@ uint16_t wifi_regulatory_domain(void)
.value = WRDD_REGULATORY_DOMAIN_INDONESIA
}
};
- const char *wrdd_domain_key = CROS_VPD_WIFI_DOMAINKEY;
+ const char *wrdd_domain_key = CROS_VPD_REGION_NAME;
int i;
struct wrdd_code_value_pair *p;
/* wrdd_domain_value is ISO 3166-2 */
char wrdd_domain_code[7];
+ char *separator;
/* If not found for any reason fall backto the default value */
if (!cros_vpd_gets(wrdd_domain_key, wrdd_domain_code,
- sizeof(wrdd_domain_code))) {
+ ARRAY_SIZE(wrdd_domain_code))) {
printk(BIOS_DEBUG,
"Error: Could not locate '%s' in VPD\n", wrdd_domain_key);
return WRDD_DEFAULT_REGULATORY_DOMAIN;
}
printk(BIOS_DEBUG, "Found '%s'='%s' in VPD\n",
wrdd_domain_key, wrdd_domain_code);
+ separator = memchr(wrdd_domain_code, VARIANT_SEPARATOR,
+ ARRAY_SIZE(wrdd_domain_code));
+ if (separator) {
+ *separator = '\0';
+ }
for (i = 0; i < ARRAY_SIZE(wrdd_table); i++) {
p = &wrdd_table[i];