summaryrefslogtreecommitdiff
path: root/src/mainboard/google
diff options
context:
space:
mode:
authorDavid Wu <david_wu@quanta.corp-partner.google.com>2024-09-12 19:24:00 +0800
committerFelix Held <felix-coreboot@felixheld.de>2024-09-19 13:46:43 +0000
commitc6493d3b809af8ed5e55c48209d3dbe1a91f32b7 (patch)
tree2341d8938897b26489fdf600d9c5c39cb551bec6 /src/mainboard/google
parent9c51ca52a447217c394717fde2bc97f64afd6781 (diff)
mb/google/nissa/var/riven: enable WIFI SAR
According to the CL:chrome-internal:7651905, Riven will use the fw_config to separate SAR setting. CNVI + ID_0 --> wifi_sar_0.hex for WIFI6 PCIE + ID_1 --> wifi_sar_9.hex for WIFI7 BUG=b:366060274 TEST=build, enabled iwlwifi debug, and check dmesg as below. iwl_sar_fill_table Chain[0]: iwl_sar_fill_table Band[0] = 132 * .125dBm iwl_sar_fill_table Band[1] = 136 * .125dBm iwl_sar_fill_table Band[2] = 136 * .125dBm iwl_sar_fill_table Band[3] = 136 * .125dBm iwl_sar_fill_table Band[4] = 136 * .125dBm iwl_sar_fill_table Band[5] = 144 * .125dBm iwl_sar_fill_table Band[6] = 144 * .125dBm iwl_sar_fill_table Band[7] = 144 * .125dBm iwl_sar_fill_table Band[8] = 144 * .125dBm iwl_sar_fill_table Band[9] = 144 * .125dBm iwl_sar_fill_table Band[10] = 144 * .125dBm iwl_sar_fill_table Chain[1]: iwl_sar_fill_table Band[0] = 132 * .125dBm iwl_sar_fill_table Band[1] = 136 * .125dBm iwl_sar_fill_table Band[2] = 136 * .125dBm iwl_sar_fill_table Band[3] = 136 * .125dBm iwl_sar_fill_table Band[4] = 136 * .125dBm iwl_sar_fill_table Band[5] = 144 * .125dBm iwl_sar_fill_table Band[6] = 144 * .125dBm iwl_sar_fill_table Band[7] = 144 * .125dBm iwl_sar_fill_table Band[8] = 144 * .125dBm iwl_sar_fill_table Band[9] = 144 * .125dBm iwl_sar_fill_table Band[10] = 144 * .125dBm Cq-Depend: chrome-internal:7651905 Change-Id: I647d64a008991a7a20791b2c87ea6308af6bb82e Signed-off-by: David Wu <david_wu@quanta.corp-partner.google.com> Reviewed-on: https://review.coreboot.org/c/coreboot/+/84339 Reviewed-by: Eric Lai <ericllai@google.com> Tested-by: build bot (Jenkins) <no-reply@coreboot.org> Reviewed-by: Subrata Banik <subratabanik@google.com>
Diffstat (limited to 'src/mainboard/google')
-rw-r--r--src/mainboard/google/brya/Kconfig1
-rw-r--r--src/mainboard/google/brya/variants/riven/overridetree.cb4
-rw-r--r--src/mainboard/google/brya/variants/riven/variant.c22
3 files changed, 27 insertions, 0 deletions
diff --git a/src/mainboard/google/brya/Kconfig b/src/mainboard/google/brya/Kconfig
index 87d97b085f..5747e9e0b5 100644
--- a/src/mainboard/google/brya/Kconfig
+++ b/src/mainboard/google/brya/Kconfig
@@ -473,6 +473,7 @@ config BOARD_GOOGLE_REDRIX4ES
config BOARD_GOOGLE_RIVEN
select BOARD_GOOGLE_BASEBOARD_NISSA
+ select CHROMEOS_WIFI_SAR if CHROMEOS
select DRIVERS_GENERIC_GPIO_KEYS
select DRIVERS_INTEL_MIPI_CAMERA
select HAVE_WWAN_POWER_SEQUENCE
diff --git a/src/mainboard/google/brya/variants/riven/overridetree.cb b/src/mainboard/google/brya/variants/riven/overridetree.cb
index 6f33f48d2e..d565897e3d 100644
--- a/src/mainboard/google/brya/variants/riven/overridetree.cb
+++ b/src/mainboard/google/brya/variants/riven/overridetree.cb
@@ -8,6 +8,10 @@ fw_config
option STYLUS_ABSENT 0
option STYLUS_PRESENT 1
end
+ field WIFI_SAR_ID 4 6
+ option ID_0 0
+ option ID_1 1
+ end
field WIFI_TYPE 7
option WIFI_CNVI 0
option WIFI_PCIE 1
diff --git a/src/mainboard/google/brya/variants/riven/variant.c b/src/mainboard/google/brya/variants/riven/variant.c
index 15460ce24a..32c1f0aee1 100644
--- a/src/mainboard/google/brya/variants/riven/variant.c
+++ b/src/mainboard/google/brya/variants/riven/variant.c
@@ -2,6 +2,28 @@
#include <baseboard/variants.h>
#include <boardid.h>
+#include <fw_config.h>
+#include <sar.h>
+#include <stdio.h>
+
+const char *get_wifi_sar_cbfs_filename(void)
+{
+ uint64_t type = fw_config_get_field(FW_CONFIG_FIELD(WIFI_TYPE));
+ uint64_t sar_id = fw_config_get_field(FW_CONFIG_FIELD(WIFI_SAR_ID));
+ static char filename[20];
+
+ if (type == UNDEFINED_FW_CONFIG || sar_id == UNDEFINED_FW_CONFIG) {
+ printk(BIOS_WARNING, "fw_config unprovisioned, set sar filename to NULL\n");
+ return NULL;
+ }
+
+ printk(BIOS_INFO, "Use wifi_sar_%lld.hex.\n", type << 3 | sar_id);
+ if (snprintf(filename, sizeof(filename), "wifi_sar_%lld.hex", type << 3 | sar_id) < 0) {
+ printk(BIOS_ERR, "Error occurred with snprintf, set sar filename to NULL\n");
+ return NULL;
+ }
+ return filename;
+}
void variant_update_soc_chip_config(struct soc_intel_alderlake_config *config)
{