Debian Codegraph @

src/mainboard/google/octopus/variants/fleex/variant.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-only */
2
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>
8
9 #define MIN_LTE_SKU 4
10 #define FLEEX_MAX_SKU 0x20
11
12 static bool is_lte_sku(void)
13 {
14 uint32_t sku_id = google_chromeec_get_board_sku();
15
16 /* Only Fleex has LTE sku */
17 if (sku_id <= FLEEX_MAX_SKU)
18 return (sku_id >= MIN_LTE_SKU);
19
20 return false;
21 }
22
23 void variant_smi_sleep(u8 slp_typ)
24 {
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();
31 }
32
33 const char *get_wifi_sar_cbfs_filename(void)
34 {
35 if (!is_lte_sku())
36 return "wifi_sar-fleex.hex";
37
38 return WIFI_SAR_CBFS_DEFAULT_FILENAME;
39 }
40
41 void variant_update_devtree(struct device *dev)
42 {
43 struct soc_intel_apollolake_config *cfg = NULL;
44
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;
49 }