coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
smihandler.c File Reference
#include <types.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 <device/pci_def.h>
#include "i82801dx.h"
Include dependency graph for smihandler.c:

Go to the source code of this file.

Macros

#define DEBUG_SMI
 
#define SMRAM   0x90
 
#define D_OPEN   (1 << 6)
 
#define D_CLS   (1 << 5)
 
#define D_LCK   (1 << 4)
 
#define G_SMRANE   (1 << 3)
 
#define C_BASE_SEG   ((0 << 2) | (1 << 1) | (0 << 0))
 

Typedefs

typedef void(* smi_handler_t) (void)
 

Functions

static u16 reset_pm1_status (void)
 read and clear PM1_STS More...
 
static void dump_pm1_status (u16 pm1_sts)
 
static u32 reset_smi_status (void)
 read and clear SMI_STS More...
 
static void dump_smi_status (u32 smi_sts)
 
static u32 reset_gpe0_status (void)
 read and clear GPE0_STS More...
 
static void dump_gpe0_status (u32 gpe0_sts)
 
static u32 reset_tco_status (void)
 read and clear TCOx_STS More...
 
static void dump_tco_status (u32 tco_sts)
 
void southbridge_smi_set_eos (void)
 Set the EOS bit. More...
 
static void busmaster_disable_on_bus (int bus)
 
static void southbridge_smi_sleep (void)
 
static void southbridge_smi_apmc (void)
 
static void southbridge_smi_pm1 (void)
 
static void southbridge_smi_gpe0 (void)
 
static void southbridge_smi_gpi (void)
 
static void southbridge_smi_mc (void)
 
static void southbridge_smi_tco (void)
 
static void southbridge_smi_periodic (void)
 
void southbridge_smi_handler (void)
 Interrupt handler for SMI#. More...
 

Variables

u16 pmbase = PMBASE_ADDR
 
smi_handler_t southbridge_smi [32]
 

Macro Definition Documentation

◆ C_BASE_SEG

#define C_BASE_SEG   ((0 << 2) | (1 << 1) | (0 << 0))

Definition at line 20 of file smihandler.c.

◆ D_CLS

#define D_CLS   (1 << 5)

Definition at line 17 of file smihandler.c.

◆ D_LCK

#define D_LCK   (1 << 4)

Definition at line 18 of file smihandler.c.

◆ D_OPEN

#define D_OPEN   (1 << 6)

Definition at line 16 of file smihandler.c.

◆ DEBUG_SMI

#define DEBUG_SMI

Definition at line 12 of file smihandler.c.

◆ G_SMRANE

#define G_SMRANE   (1 << 3)

Definition at line 19 of file smihandler.c.

◆ SMRAM

#define SMRAM   0x90

Definition at line 15 of file smihandler.c.

Typedef Documentation

◆ smi_handler_t

typedef void(* smi_handler_t) (void)

Definition at line 418 of file smihandler.c.

Function Documentation

◆ busmaster_disable_on_bus()

static void busmaster_disable_on_bus ( int  bus)
static

Definition at line 187 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:

◆ dump_gpe0_status()

static void dump_gpe0_status ( u32  gpe0_sts)
static

Definition at line 114 of file smihandler.c.

References BIOS_DEBUG, and printk.

Referenced by southbridge_smi_gpe0().

Here is the caller graph for this function:

◆ dump_pm1_status()

static void dump_pm1_status ( u16  pm1_sts)
static

Definition at line 42 of file smihandler.c.

References BIOS_SPEW, inw(), PM1_EN, pmbase, and printk.

Referenced by southbridge_smi_pm1().

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

◆ dump_smi_status()

static void dump_smi_status ( u32  smi_sts)
static

Definition at line 73 of file smihandler.c.

References BIOS_DEBUG, and printk.

Referenced by southbridge_smi_handler().

Here is the caller graph for this function:

◆ dump_tco_status()

static void dump_tco_status ( u32  tco_sts)
static

Definition at line 156 of file smihandler.c.

References BIOS_DEBUG, and printk.

Referenced by southbridge_smi_tco().

Here is the caller graph for this function:

◆ reset_gpe0_status()

static u32 reset_gpe0_status ( void  )
static

read and clear GPE0_STS

Returns
GPE0_STS register

Definition at line 103 of file smihandler.c.

References GPE0_STS, inl(), outl(), and pmbase.

Referenced by southbridge_smi_gpe0().

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

◆ reset_pm1_status()

static u16 reset_pm1_status ( void  )
static

read and clear PM1_STS

Returns
PM1_STS register

Definition at line 31 of file smihandler.c.

References inw(), outw(), PM1_STS, and pmbase.

Referenced by southbridge_smi_pm1().

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

◆ reset_smi_status()

static u32 reset_smi_status ( void  )
static

read and clear SMI_STS

Returns
SMI_STS register

Definition at line 62 of file smihandler.c.

References inl(), outl(), pmbase, and SMI_STS.

Referenced by southbridge_smi_handler().

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

◆ reset_tco_status()

static u32 reset_tco_status ( void  )
static

read and clear TCOx_STS

Returns
TCOx_STS registers

Definition at line 142 of file smihandler.c.

References inl(), outl(), and pmbase.

Referenced by southbridge_smi_tco().

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

◆ southbridge_smi_apmc()

static void southbridge_smi_apmc ( void  )
static

Definition at line 295 of file smihandler.c.

References APM_CNT_ACPI_DISABLE, APM_CNT_ACPI_ENABLE, apm_get_apmc(), inl(), outl(), PM1_CNT, pmbase, and SCI_EN.

Here is the call graph for this function:

◆ southbridge_smi_gpe0()

static void southbridge_smi_gpe0 ( void  )
static

Definition at line 333 of file smihandler.c.

References dump_gpe0_status(), and reset_gpe0_status().

Here is the call graph for this function:

◆ southbridge_smi_gpi()

static void southbridge_smi_gpi ( void  )
static

Definition at line 341 of file smihandler.c.

References ALT_GP_SMI_EN, ALT_GP_SMI_STS, BIOS_DEBUG, inw(), mainboard_smi_gpi(), outl(), pmbase, and printk.

Here is the call graph for this function:

◆ southbridge_smi_handler()

void southbridge_smi_handler ( void  )

Interrupt handler for SMI#.

Definition at line 458 of file smihandler.c.

References BIOS_DEBUG, dump, dump_smi_status(), PCI_DEV, pci_read_config16(), pmbase, printk, reset_smi_status(), and southbridge_smi.

Here is the call graph for this function:

◆ southbridge_smi_mc()

static void southbridge_smi_mc ( void  )
static

Definition at line 355 of file smihandler.c.

References BIOS_DEBUG, inl(), MCSMI_EN, pmbase, printk, and SMI_EN.

Here is the call graph for this function:

◆ southbridge_smi_periodic()

static void southbridge_smi_periodic ( void  )
static

Definition at line 405 of file smihandler.c.

References BIOS_DEBUG, inl(), PERIODIC_EN, pmbase, 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 315 of file smihandler.c.

References dump_pm1_status(), outl(), PM1_CNT, pmbase, PWRBTN_STS, and reset_pm1_status().

Here is the call graph for this function:

◆ southbridge_smi_set_eos()

void southbridge_smi_set_eos ( void  )

Set the EOS bit.

Definition at line 178 of file smihandler.c.

References EOS, inb(), outb(), pmbase, and SMI_EN.

Here is the call graph for this function:

◆ southbridge_smi_sleep()

static void southbridge_smi_sleep ( void  )
static

◆ southbridge_smi_tco()

static void southbridge_smi_tco ( void  )
static

Definition at line 368 of file smihandler.c.

References BIOS_DEBUG, dump_tco_status(), PCI_DEV, pci_read_config16(), pci_write_config32(), printk, and reset_tco_status().

Here is the call graph for this function:

Variable Documentation

◆ pmbase

◆ southbridge_smi

smi_handler_t southbridge_smi[32]

Definition at line 420 of file smihandler.c.