sar: Fix semantics of `get_wifi_sar_cbfs_filename()`
[coreboot.git] / src / mainboard / google / octopus / variants / fleex / variant.c
blob63908e2f6897d23732f17d4d16d917e89dfc9fc5
1 /* SPDX-License-Identifier: GPL-2.0-only */
3 #include <acpi/acpi.h>
4 #include <baseboard/variants.h>
5 #include <ec/google/chromeec/ec.h>
6 #include <sar.h>
7 #include <soc/intel/apollolake/chip.h>
9 #define MIN_LTE_SKU 4
10 #define FLEEX_MAX_SKU 0x20
12 static bool is_lte_sku(void)
14 uint32_t sku_id = google_chromeec_get_board_sku();
16 /* Only Fleex has LTE sku */
17 if (sku_id <= FLEEX_MAX_SKU)
18 return (sku_id >= MIN_LTE_SKU);
20 return false;
23 void variant_smi_sleep(u8 slp_typ)
25 /* Currently use cases here all target to S5 therefore we do early return
26 * here for saving one transaction to the EC for getting SKU ID. */
27 if (slp_typ != ACPI_S5)
28 return;
29 if (is_lte_sku())
30 power_off_lte_module();
33 const char *get_wifi_sar_cbfs_filename(void)
35 if (!is_lte_sku())
36 return "wifi_sar-fleex.hex";
38 return WIFI_SAR_CBFS_DEFAULT_FILENAME;
41 void variant_update_devtree(struct device *dev)
43 struct soc_intel_apollolake_config *cfg = NULL;
45 cfg = (struct soc_intel_apollolake_config *)dev->chip_info;
46 // Force disable_xhci_lfps_pm to update if it is LTE sku
47 if (cfg != NULL && is_lte_sku())
48 cfg->disable_xhci_lfps_pm = 1;