coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smihandler.c
Go to the documentation of this file.
1 /* SPDX-License-Identifier: GPL-2.0-only */
2 
3 #include <console/console.h>
4 #include <cpu/x86/smm.h>
5 #include <soc/nvs.h>
7 #include <ec/acpi/ec.h>
8 
9 void mainboard_smi_gpi(u32 gpi_sts)
10 {
11  if (gpi_sts & (1 << 1)) {
12  printk(BIOS_DEBUG, "EC/SMI\n");
13  /* TODO */
14  }
15 }
16 
18 {
19  switch (apmc) {
21  send_ec_command(0x05); /* Set_SMI_Disable */
22  send_ec_command(0xaa); /* Set_ACPI_Enable */
23  break;
24 
26  send_ec_command(0x04); /* Set_SMI_Enable */
27  send_ec_command(0xab); /* Set_ACPI_Disable */
28  break;
29  }
30  return 0;
31 }
#define printk(level,...)
Definition: stdlib.h:16
int __weak mainboard_smi_apmc(u8 data)
Definition: smihandler.c:209
void __weak mainboard_smi_gpi(u32 gpi_sts)
Definition: smihandler.c:208
int send_ec_command(u8 command)
Definition: ec.c:13
#define APM_CNT_ACPI_DISABLE
Definition: smm.h:21
#define APM_CNT_ACPI_ENABLE
Definition: smm.h:22
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
uint32_t u32
Definition: stdint.h:51
uint8_t u8
Definition: stdint.h:45