From c6493d3b809af8ed5e55c48209d3dbe1a91f32b7 Mon Sep 17 00:00:00 2001 From: David Wu Date: Thu, 12 Sep 2024 19:24:00 +0800 Subject: 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 Reviewed-on: https://review.coreboot.org/c/coreboot/+/84339 Reviewed-by: Eric Lai Tested-by: build bot (Jenkins) Reviewed-by: Subrata Banik --- .../google/brya/variants/riven/overridetree.cb | 4 ++++ src/mainboard/google/brya/variants/riven/variant.c | 22 ++++++++++++++++++++++ 2 files changed, 26 insertions(+) (limited to 'src/mainboard/google/brya/variants') 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 #include +#include +#include +#include + +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) { -- cgit v1.2.3