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 #include <soc/pm.h>
9 #include <soc/iomap.h>
10 #include <soc/nvs.h>
11 #include "onboard.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 /* gpi_sts is GPIO 47:32 */
34 void mainboard_smi_gpi(u32 gpi_sts)
35 {
36 }
37 
38 void mainboard_smi_sleep(u8 slp_typ)
39 {
40  /* Disable USB charging if required */
41  switch (slp_typ) {
42  case ACPI_S3:
44 
45  /* Enable DCP mode */
46  if (CONFIG(BOARD_GOOGLE_TIDUS)) {
48  }
49  break;
50  case ACPI_S5:
52  break;
53  }
54 }
55 
57 {
58  switch (apmc) {
60  break;
62  break;
63  }
64  return 0;
65 }
#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 __weak mainboard_smi_gpi(u32 gpi_sts)
Definition: smihandler.c:208
int __weak mainboard_io_trap_handler(int smif)
Definition: smihandler.c:206
@ CONFIG
Definition: dsi_common.h:201
@ LED_BLINK
Definition: onboard.h:39
@ LED_OFF
Definition: onboard.h:37
void set_power_led(int state)
Definition: led.c:6
#define GPIO_USB_CTL_1
Definition: onboard.h:32
@ 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_DEBUG
BIOS_DEBUG - Verbose output.
Definition: loglevel.h:128
struct global_nvs * gnvs
void set_gpio(int gpio_num, int value)
Definition: gpio.c:125
uint32_t u32
Definition: stdint.h:51
uint8_t u8
Definition: stdint.h:45
u8 smif
Definition: nvs.h:11