coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smihandler.c File Reference
#include <stdint.h>
#include <acpi/acpi_gnvs.h>
#include <arch/io.h>
#include <device/pci_ops.h>
#include <console/console.h>
#include <cpu/x86/cache.h>
#include <cpu/x86/smm.h>
#include <cpu/intel/em64t100_save_state.h>
#include <device/pci_def.h>
#include <elog.h>
#include <halt.h>
#include <spi-generic.h>
#include <smmstore.h>
#include <soc/iosf.h>
#include <soc/pci_devs.h>
#include <soc/pm.h>
#include <soc/nvs.h>
#include <soc/device_nvs.h>
Include dependency graph for smihandler.c:

Go to the source code of this file.

Macros

#define SCC_ACPI_MODE_DISABLE(name_)
 
#define LPSS_ACPI_MODE_DISABLE(name_)
 

Typedefs

typedef void(* smi_handler_t) (void)
 

Functions

int southbridge_io_trap_handler (int smif)
 
void southbridge_smi_set_eos (void)
 
static void busmaster_disable_on_bus (int bus)
 
static void southbridge_smi_sleep (void)
 
static em64t100_smm_state_save_area_t * smi_apmc_find_state_save (uint8_t cmd)
 
static void southbridge_smi_gsmi (void)
 
voidacpi_get_device_nvs (void)
 
static void soc_legacy (void)
 
static void southbridge_smi_store (void)
 
static void southbridge_smi_apmc (void)
 
static void southbridge_smi_pm1 (void)
 
static void southbridge_smi_gpe0 (void)
 
static void southbridge_smi_tco (void)
 
static void southbridge_smi_periodic (void)
 
void southbridge_smi_handler (void)
 

Variables

static const smi_handler_t southbridge_smi [32]
 

Macro Definition Documentation

◆ LPSS_ACPI_MODE_DISABLE

#define LPSS_ACPI_MODE_DISABLE (   name_)
Value:
do { if (dev_nvs->lpss_en[LPSS_NVS_ ## name_]) { \
reg32 = iosf_lpss_read(LPSS_ ## name_ ## _CTL); \
iosf_lpss_write(LPSS_ ## name_ ## _CTL, reg32); \
} } while (0)
uint32_t iosf_lpss_read(int reg)
Definition: iosf.c:111
#define LPSS_CTL_PCI_CFG_DIS
Definition: iosf.h:276
#define LPSS_CTL_ACPI_INT_EN
Definition: iosf.h:275

◆ SCC_ACPI_MODE_DISABLE

#define SCC_ACPI_MODE_DISABLE (   name_)
Value:
do { if (dev_nvs->scc_en[SCC_NVS_ ## name_]) { \
reg32 = iosf_scc_read(SCC_ ## name_ ## _CTL); \
iosf_scc_write(SCC_ ## name_ ## _CTL, reg32); \
} } while (0)
#define SCC_CTL_PCI_CFG_DIS
Definition: iosf.h:287
uint32_t iosf_scc_read(int reg)
Definition: iosf.c:141
#define SCC_CTL_ACPI_INT_EN
Definition: iosf.h:288

Typedef Documentation

◆ smi_handler_t

typedef void(* smi_handler_t) (void)

Definition at line 361 of file smihandler.c.

Function Documentation

◆ acpi_get_device_nvs()

void* acpi_get_device_nvs ( void  )

Definition at line 209 of file smihandler.c.

References ALIGN_UP, and gnvs.

Referenced by soc_legacy().

Here is the caller graph for this function:

◆ busmaster_disable_on_bus()

static void busmaster_disable_on_bus ( int  bus)
static

Definition at line 46 of file smihandler.c.

References PCI_COMMAND, PCI_COMMAND_MASTER, PCI_DEV, PCI_HEADER_TYPE, PCI_HEADER_TYPE_BRIDGE, PCI_HEADER_TYPE_CARDBUS, PCI_PRIMARY_BUS, pci_read_config16(), pci_read_config32(), pci_read_config8(), PCI_VENDOR_ID, pci_write_config16(), and val.

Referenced by southbridge_smi_sleep().

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

◆ smi_apmc_find_state_save()

static em64t100_smm_state_save_area_t* smi_apmc_find_state_save ( uint8_t  cmd)
static

Definition at line 158 of file smihandler.c.

References APM_CNT, NULL, and smm_get_save_state().

Referenced by southbridge_smi_gsmi(), and southbridge_smi_store().

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

◆ soc_legacy()

static void soc_legacy ( void  )
static

Definition at line 220 of file smihandler.c.

References acpi_get_device_nvs(), I2C1, I2C2, I2C3, I2C4, I2C5, I2C6, I2C7, iosf_port58_read(), iosf_port58_write(), device_nvs::lpe_en, LPE_PCICFGCTR1, LPE_PCICFGCTR1_ACPI_INT_EN, LPE_PCICFGCTR1_PCI_CFG_DIS, LPSS_ACPI_MODE_DISABLE, SCC_ACPI_MODE_DISABLE, and SD.

Referenced by southbridge_smi_apmc().

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

◆ southbridge_io_trap_handler()

int southbridge_io_trap_handler ( int  smif)

Definition at line 23 of file smihandler.c.

References BIOS_DEBUG, gnvs, printk, and global_nvs::smif.

◆ southbridge_smi_apmc()

◆ southbridge_smi_gpe0()

static void southbridge_smi_gpe0 ( void  )
static

Definition at line 329 of file smihandler.c.

References clear_gpe_status().

Here is the call graph for this function:

◆ southbridge_smi_gsmi()

static void southbridge_smi_gsmi ( void  )
static

Definition at line 189 of file smihandler.c.

References APM_CNT_ELOG_GSMI, gsmi_exec(), and smi_apmc_find_state_save().

Referenced by southbridge_smi_apmc().

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

◆ southbridge_smi_handler()

void southbridge_smi_handler ( void  )

Definition at line 398 of file smihandler.c.

References ARRAY_SIZE, BIOS_DEBUG, clear_alt_status(), clear_smi_status(), mainboard_smi_gpi(), NULL, printk, and southbridge_smi.

Here is the call graph for this function:

◆ southbridge_smi_periodic()

static void southbridge_smi_periodic ( void  )
static

Definition at line 348 of file smihandler.c.

References BIOS_DEBUG, get_pmbase(), inl(), PERIODIC_EN, printk, and SMI_EN.

Here is the call graph for this function:

◆ southbridge_smi_pm1()

static void southbridge_smi_pm1 ( void  )
static

Definition at line 316 of file smihandler.c.

References clear_pm1_status(), disable_pm1_control(), elog_gsmi_add_event(), ELOG_TYPE_POWER_BUTTON, enable_pm1_control(), PWRBTN_STS, SLP_EN, SLP_TYP_S5, and SLP_TYP_SHIFT.

Here is the call graph for this function:

◆ southbridge_smi_set_eos()

void southbridge_smi_set_eos ( void  )

Definition at line 41 of file smihandler.c.

References enable_smi(), and EOS.

Referenced by smi_set_eos().

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

◆ southbridge_smi_sleep()

◆ southbridge_smi_store()

static void southbridge_smi_store ( void  )
static

Definition at line 269 of file smihandler.c.

References APM_CNT_SMMSTORE, smi_apmc_find_state_save(), and smmstore_exec().

Referenced by southbridge_smi_apmc().

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

◆ southbridge_smi_tco()

static void southbridge_smi_tco ( void  )
static

Definition at line 334 of file smihandler.c.

References BIOS_DEBUG, clear_tco_status(), printk, and TCO_TIMEOUT.

Here is the call graph for this function:

Variable Documentation

◆ southbridge_smi

const smi_handler_t southbridge_smi[32]
static

Definition at line 363 of file smihandler.c.