diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/mainboard/google/brya/Kconfig | 1 | ||||
-rw-r--r-- | src/mainboard/google/brya/variants/riven/overridetree.cb | 4 | ||||
-rw-r--r-- | src/mainboard/google/brya/variants/riven/variant.c | 22 |
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) { |