Debian Codegraph @

src/mainboard/google/dedede/variants/boten/variant.c

raw symbols SCIP
1 /* SPDX-License-Identifier: GPL-2.0-or-later */
2
3 #include <acpi/acpi.h>
4 #include <acpi/acpigen.h>
5 #include <baseboard/variants.h>
6 #include <delay.h>
7 #include <ec/google/chromeec/ec.h>
8 #include <gpio.h>
9 #include <sar.h>
10
11 enum {
12 SKU_ID_BOTEN_MIN = 0x60000,
13 SKU_ID_BOTEN_MAX = 0x6ffff,
14 SKU_ID_BOTENFLEX_MIN = 0x90000,
15 SKU_ID_BOTENFLEX_MAX = 0x9ffff,
16 SKU_ID_BOOKEM_MIN = 0x290000,
17 SKU_ID_BOOKEM_MAX = 0x29ffff,
18 };
19
20 static void power_off_lte_module(void)
21 {
22 gpio_output(GPP_H17, 0);
23 mdelay(10);
24 gpio_output(GPP_A10, 0);
25 }
26
27 void variant_smi_sleep(u8 slp_typ)
28 {
29 /*
30 * Once the FW_CONFIG is provisioned, power off LTE module only under
31 * the situation where it is stuffed.
32 */
33 if (slp_typ == ACPI_S5)
34 power_off_lte_module();
35 }
36
37 const char *get_wifi_sar_cbfs_filename(void)
38 {
39 uint32_t sku_id = google_chromeec_get_board_sku();
40
41 if (sku_id >= SKU_ID_BOTEN_MIN && sku_id <= SKU_ID_BOTEN_MAX)
42 return "wifi_sar-boten.hex";
43 if (sku_id >= SKU_ID_BOTENFLEX_MIN && sku_id <= SKU_ID_BOTENFLEX_MAX)
44 return "wifi_sar-botenflex.hex";
45 if (sku_id >= SKU_ID_BOOKEM_MIN && sku_id <= SKU_ID_BOOKEM_MAX)
46 return "wifi_sar-bookem.hex";
47
48 return WIFI_SAR_CBFS_DEFAULT_FILENAME;
49 }
50
51 void variant_generate_s0ix_hook(enum s0ix_entry entry)
52 {
53 if (entry == S0IX_ENTRY)
54 acpigen_soc_clear_tx_gpio(GPP_D13);
55 else if (entry == S0IX_EXIT)
56 acpigen_soc_set_tx_gpio(GPP_D13);
57 }