coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
variant.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <bootstate.h>
4 #include <acpi/acpi.h>
5 #include <baseboard/variants.h>
6 #include <delay.h>
8 #include <fw_config.h>
9 #include <gpio.h>
10 #include <sar.h>
11 
12 const char *get_wifi_sar_cbfs_filename(void)
13 {
14  if (fw_config_probe(FW_CONFIG(TABLETMODE, TABLETMODE_ENABLED)))
15  return "wifi_sar-drawcia.hex";
16 
18 }
19 
20 const char *mainboard_vbt_filename(void)
21 {
22  if (fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_1A_HDMI)) ||
23  fw_config_probe(FW_CONFIG(DB_PORTS, DB_PORTS_1A_HDMI_LTE)))
24  return "vbt_drawman.bin";
25 
26  return "vbt.bin";
27 }
28 
29 static void power_off_lte_module(void)
30 {
31  gpio_output(GPP_H0, 0);
32  gpio_output(GPP_H17, 0);
33  mdelay(20);
34  gpio_output(GPP_A10, 0);
35 }
36 
37 void variant_smi_sleep(u8 slp_typ)
38 {
39  /*
40  * Once the FW_CONFIG is provisioned, power off LTE module only under
41  * the situation where it is stuffed.
42  */
43  if (slp_typ == ACPI_S5)
45 }
#define GPP_H17
#define GPP_H0
#define GPP_A10
void mdelay(unsigned int msecs)
Definition: delay.c:2
#define FW_CONFIG(__field, __option)
Definition: fw_config.h:28
const char * get_wifi_sar_cbfs_filename(void)
Definition: variant.c:5
const char * mainboard_vbt_filename(void)
Definition: variant.c:9
void variant_smi_sleep(u8 slp_typ)
Definition: variant.c:15
static void power_off_lte_module(void)
Definition: variant.c:29
@ ACPI_S5
Definition: acpi.h:1385
void gpio_output(gpio_t gpio, int value)
Definition: gpio.c:194
bool fw_config_probe(const struct fw_config *match)
Definition: fw_config.c:62
#define WIFI_SAR_CBFS_DEFAULT_FILENAME
Definition: sar.h:87
uint8_t u8
Definition: stdint.h:45