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 <acpi/acpi.h>
4 #include <console/console.h>
5 #include <cpu/x86/smm.h>
6 
7 #include "commands.h"
8 #include "ec.h"
9 #include "smm.h"
10 
11 void wilco_ec_smi_sleep(int slp_type)
12 {
13  switch (slp_type) {
14  case ACPI_S3:
17  WAKE_ON);
19  break;
20  case ACPI_S5:
22  break;
23  }
24 }
25 
26 void wilco_ec_smi_apmc(int apmc)
27 {
28  switch (apmc) {
31  break;
34  break;
35  }
36 }
37 
39 {
40  struct ec_pm_event_state pm;
41 
42  if (!wilco_ec_get_pm(&pm, true)) {
44  "EC SMI: %02x_%02x-%02x_%02x_%02x_%02x_%02x_%02x-%02x",
45  pm.event[0], pm.event[1],
46  pm.state[0], pm.state[1], pm.state[2],
47  pm.state[3], pm.state[4], pm.state[5], pm.hotkey);
48  }
49 }
int wilco_ec_get_pm(struct ec_pm_event_state *pm, bool clear)
wilco_ec_get_pm
Definition: commands.c:107
int wilco_ec_change_wake(uint8_t source, enum ec_wake_change change)
wilco_ec_change_wake_source
Definition: commands.c:156
void wilco_ec_slp_en(void)
wilco_ec_slp_en
Definition: commands.c:131
void wilco_ec_power_off(enum ec_power_off_reason reason)
wilco_ec_power_off
Definition: commands.c:139
@ WAKE_ON
Definition: commands.h:289
@ EC_ACPI_WAKE_PWRB
Definition: commands.h:303
@ EC_ACPI_WAKE_LID
Definition: commands.h:304
@ EC_SWOFF_ACPI
Definition: commands.h:164
@ KB_ACPI
Definition: commands.h:26
@ KB_SAVE
Definition: commands.h:18
@ ACPI_OFF
Definition: commands.h:53
@ ACPI_ON
Definition: commands.h:54
#define printk(level,...)
Definition: stdlib.h:16
static int wilco_ec_send(uint8_t command, uint8_t param)
wilco_ec_send
Definition: ec.h:45
static int wilco_ec_send_noargs(uint8_t command)
wilco_ec_send_noargs
Definition: ec.h:60
void wilco_ec_smi_espi(void)
wilco_ec_smi_espi
Definition: smihandler.c:38
void wilco_ec_smi_sleep(int slp_type)
wilco_ec_smi_sleep
Definition: smihandler.c:11
void wilco_ec_smi_apmc(int apmc)
wilco_ec_smi_apmc
Definition: smihandler.c:26
@ ACPI_S5
Definition: acpi.h:1385
@ ACPI_S3
Definition: acpi.h:1383
#define APM_CNT_ACPI_DISABLE
Definition: smm.h:21
#define APM_CNT_ACPI_ENABLE
Definition: smm.h:22
#define BIOS_INFO
BIOS_INFO - Expected events.
Definition: loglevel.h:113
uint8_t event[2]
Definition: commands.h:247
uint8_t state[6]
Definition: commands.h:248
uint8_t hotkey
Definition: commands.h:249