coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smihandler.c File Reference
#include <arch/io.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
#include <ec/compal/ene932/ec.h>
#include <southbridge/amd/agesa/hudson/hudson.h>
#include <southbridge/amd/agesa/hudson/smi.h>
#include "ec.h"
Include dependency graph for smihandler.c:

Go to the source code of this file.

Macros

#define ACPI_PM1_CNT_SLEEP(state)   ((1 << 13) | (state & 0x7) << 10)
 

Enumerations

enum  sleep_states {
  S0 = 0 , S1 = 1 , S3 = 3 , S4 = 4 ,
  S5 = 5 , S0 = 0 , S1 = 1 , S3 = 3 ,
  S4 = 4 , S5 = 5 , S0 = 0 , S1 = 1 ,
  S3 = 3 , S4 = 4 , S5 = 5
}
 
enum  ec_smi_event {
  EC_SMI_EVENT_IDLE = 0x80 , EC_SMI_BATTERY_LOW = 0xb3 , EC_SMI_EVENT_IDLE = 0x80 , EC_SMI_BATTERY_LOW = 0xb3 ,
  EC_SMI_EVENT_IDLE = 0x80 , EC_SMI_BATTERY_LOW = 0xb3
}
 

Functions

static void ec_enter_apm_mode (void)
 
static void ec_enter_acpi_mode (void)
 
static uint8_t ec_get_smi_event (void)
 
static void ec_process_smi (uint8_t src)
 
static void handle_ec_smi (void)
 
static void handle_lid_smi (void)
 
int mainboard_smi_apmc (uint8_t data)
 
void mainboard_smi_gpi (uint32_t gpi_sts)
 

Macro Definition Documentation

◆ ACPI_PM1_CNT_SLEEP

#define ACPI_PM1_CNT_SLEEP (   state)    ((1 << 13) | (state & 0x7) << 10)

Definition at line 16 of file smihandler.c.

Enumeration Type Documentation

◆ ec_smi_event

Enumerator
EC_SMI_EVENT_IDLE 
EC_SMI_BATTERY_LOW 
EC_SMI_EVENT_IDLE 
EC_SMI_BATTERY_LOW 
EC_SMI_EVENT_IDLE 
EC_SMI_BATTERY_LOW 

Definition at line 26 of file smihandler.c.

◆ sleep_states

Enumerator
S0 
S1 
S3 
S4 
S5 
S0 
S1 
S3 
S4 
S5 
S0 
S1 
S3 
S4 
S5 

Definition at line 18 of file smihandler.c.

Function Documentation

◆ ec_enter_acpi_mode()

static void ec_enter_acpi_mode ( void  )
static

Definition at line 38 of file smihandler.c.

References ec_kbc_write_cmd(), and ec_kbc_write_ib().

Referenced by mainboard_smi_apmc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ec_enter_apm_mode()

static void ec_enter_apm_mode ( void  )
static

Definition at line 32 of file smihandler.c.

References ec_kbc_write_cmd(), and ec_kbc_write_ib().

Referenced by mainboard_smi_apmc().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ec_get_smi_event()

static uint8_t ec_get_smi_event ( void  )
static

Definition at line 44 of file smihandler.c.

References ec_kbc_read_ob(), and ec_kbc_write_cmd().

Referenced by handle_ec_smi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ec_process_smi()

static void ec_process_smi ( uint8_t  src)
static

Definition at line 50 of file smihandler.c.

References ACPI_PM1_CNT_BLK, ACPI_PM1_CNT_SLEEP, BIOS_DEBUG, EC_SMI_BATTERY_LOW, outl(), printk, and S5.

Referenced by handle_ec_smi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_ec_smi()

static void handle_ec_smi ( void  )
static

Definition at line 66 of file smihandler.c.

References ec_get_smi_event(), ec_process_smi(), and EC_SMI_EVENT_IDLE.

Referenced by mainboard_smi_gpi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ handle_lid_smi()

static void handle_lid_smi ( void  )
static

Definition at line 74 of file smihandler.c.

References ACPI_PM1_CNT_BLK, ACPI_PM1_CNT_SLEEP, outl(), and S4.

Referenced by mainboard_smi_gpi().

Here is the call graph for this function:
Here is the caller graph for this function:

◆ mainboard_smi_apmc()

int mainboard_smi_apmc ( uint8_t  data)

◆ mainboard_smi_gpi()

void mainboard_smi_gpi ( uint32_t  gpi_sts)

Definition at line 100 of file smihandler.c.

References EC_LID_GEVENT, EC_SMI_GEVENT, handle_ec_smi(), and handle_lid_smi().

Here is the call graph for this function: