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>
9 
10 /* Include EC functions */
12 #include "ec.h"
13 
14 void mainboard_smi_sleep(u8 slp_typ)
15 {
16  /* Tell the EC to Enable USB power for S3 if requested */
17  if (gnvs->s3u0 != 0 || gnvs->s3u1 != 0)
19 
20  /* Disable wake on USB, LAN & RTC */
21  /* Enable Wake from Keyboard */
22  if ((slp_typ == 4) || (slp_typ == 5)) {
23  printk(BIOS_DEBUG, "Disabling wake on RTC\n");
25  }
26 }
27 
29 {
30  switch (apmc) {
32  /* Clear all pending events and enable SCI */
34  break;
35 
37  /* Clear all pending events and tell the EC that ACPI is disabled */
39  break;
40  }
41  return 0;
42 }
#define printk(level,...)
Definition: stdlib.h:16
void __weak mainboard_smi_sleep(u8 slp_typ)
Definition: smihandler.c:210
int __weak mainboard_smi_apmc(u8 data)
Definition: smihandler.c:209
void ec_write_cmd(u8 cmd)
Definition: ec.c:79
u8 ec_mem_read(u8 addr)
Definition: ec.c:94
void ec_mem_write(u8 addr, u8 data)
Definition: ec.c:101
#define EC_PSW_IKB
Definition: ec.h:125
#define EC_CMD_ENABLE_ACPI_MODE
Definition: ec.h:179
#define EC_CMD_DISABLE_ACPI_MODE
Definition: ec.h:180
#define EC_PSW_USB
Definition: ec.h:129
#define EC_EC_PSW
Definition: ec.h:124
#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
struct global_nvs * gnvs
uint8_t u8
Definition: stdint.h:45
u8 s3u0
Definition: nvs.h:34
u8 s3u1
Definition: nvs.h:35