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>
6 #include <soc/iomap.h>
7 #include <soc/nvs.h>
8 #include <soc/pm.h>
10 #include "ec.h"
11 #include "gpio.h"
12 
14 {
15  switch (smif) {
16  case 0x99:
17  printk(BIOS_DEBUG, "Sample\n");
18  gnvs->smif = 0;
19  break;
20  default:
21  return 0;
22  }
23 
24  /* On success, the IO Trap Handler returns 0
25  * On failure, the IO Trap Handler returns a value != 0
26  *
27  * For now, we force the return value to 0 and log all traps to
28  * see what's going on.
29  */
30  return 1;
31 }
32 
33 void mainboard_smi_gpi_handler(const struct gpi_status *sts)
34 {
35  if (gpi_status_get(sts, EC_SMI_GPI))
37 }
38 
39 void mainboard_smi_sleep(u8 slp_typ)
40 {
41  if (CONFIG(EC_GOOGLE_CHROMEEC))
44 }
45 
47 {
48  if (CONFIG(EC_GOOGLE_CHROMEEC))
51  return 0;
52 }
#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
int __weak mainboard_io_trap_handler(int smif)
Definition: smihandler.c:206
@ CONFIG
Definition: dsi_common.h:201
void chromeec_smi_sleep(int slp_type, uint64_t s3_mask, uint64_t s5_mask)
Definition: smihandler.c:48
void chromeec_smi_process_events(void)
Definition: smihandler.c:29
void chromeec_smi_apmc(int apmc, uint64_t sci_mask, uint64_t smi_mask)
Definition: smihandler.c:89
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
#define MAINBOARD_EC_S5_WAKE_EVENTS
Definition: ec.h:32
#define MAINBOARD_EC_SCI_EVENTS
Definition: ec.h:12
#define MAINBOARD_EC_SMI_EVENTS
Definition: ec.h:28
#define EC_SMI_GPI
Definition: ec.h:10
#define MAINBOARD_EC_S3_WAKE_EVENTS
Definition: ec.h:37
void mainboard_smi_gpi_handler(const struct gpi_status *sts)
Definition: smihandler.c:16
struct global_nvs * gnvs
int gpi_status_get(const struct gpi_status *sts, gpio_t pad)
Definition: gpio.c:733
uint8_t u8
Definition: stdint.h:45
u8 smif
Definition: nvs.h:11