coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
ec.c File Reference
#include <acpi/acpi.h>
#include <console/console.h>
#include <cpu/x86/smm.h>
#include <ec/acpi/ec.h>
#include <mainboard/ec.h>
#include <timer.h>
Include dependency graph for ec.c:

Go to the source code of this file.

Macros

#define EC_STATUS   0x50
 
#define EC_RUNNING   (1 << 1)
 
#define EC_DEVICE_CONTROL_1   0x80
 
#define EC_DEVICE_CONTROL_1_PROGAS_ON   (1 << 0)
 
#define EC_DEVICE_CONTROL_1_BOOMER_ON   (1 << 1)
 
#define EC_DEVICE_CONTROL_1_BT_RF_ON   (1 << 2)
 
#define EC_DEVICE_CONTROL_1_TP_ON   (1 << 3)
 
#define EC_DEVICE_CONTROL_1_LAN2_RST   (1 << 6)
 
#define EC_DEVICE_CONTROL_2   0x81
 
#define EC_DEVICE_CONTROL_2_LAN_1_ON   (1 << 0)
 
#define EC_DEVICE_CONTROL_2_LAN_2_ON   (1 << 1)
 
#define EC_DEVICE_CONTROL_2_WLAN_ON   (1 << 2)
 
#define EC_DEVICE_CONTROL_2_USB_ON   (1 << 3)
 
#define EC_DEVICE_CONTROL_2_IDE1_ON   (1 << 4)
 
#define EC_DEVICE_CONTROL_2_IDE2_ON   (1 << 5)
 
#define EC_DEVICE_CONTROL_2_COM1_ON   (1 << 6)
 
#define EC_DEVICE_CONTROL_2_MPI_ON   (1 << 7)
 
#define RUNNING_TIMEOUT_MS   3333
 

Functions

static bool ec_running (void)
 
void ec_enable_devices (bool enable_usb)
 
void mainboard_smi_sleep (const uint8_t slp_typ)
 

Macro Definition Documentation

◆ EC_DEVICE_CONTROL_1

#define EC_DEVICE_CONTROL_1   0x80

Definition at line 12 of file ec.c.

◆ EC_DEVICE_CONTROL_1_BOOMER_ON

#define EC_DEVICE_CONTROL_1_BOOMER_ON   (1 << 1)

Definition at line 14 of file ec.c.

◆ EC_DEVICE_CONTROL_1_BT_RF_ON

#define EC_DEVICE_CONTROL_1_BT_RF_ON   (1 << 2)

Definition at line 15 of file ec.c.

◆ EC_DEVICE_CONTROL_1_LAN2_RST

#define EC_DEVICE_CONTROL_1_LAN2_RST   (1 << 6)

Definition at line 17 of file ec.c.

◆ EC_DEVICE_CONTROL_1_PROGAS_ON

#define EC_DEVICE_CONTROL_1_PROGAS_ON   (1 << 0)

Definition at line 13 of file ec.c.

◆ EC_DEVICE_CONTROL_1_TP_ON

#define EC_DEVICE_CONTROL_1_TP_ON   (1 << 3)

Definition at line 16 of file ec.c.

◆ EC_DEVICE_CONTROL_2

#define EC_DEVICE_CONTROL_2   0x81

Definition at line 18 of file ec.c.

◆ EC_DEVICE_CONTROL_2_COM1_ON

#define EC_DEVICE_CONTROL_2_COM1_ON   (1 << 6)

Definition at line 25 of file ec.c.

◆ EC_DEVICE_CONTROL_2_IDE1_ON

#define EC_DEVICE_CONTROL_2_IDE1_ON   (1 << 4)

Definition at line 23 of file ec.c.

◆ EC_DEVICE_CONTROL_2_IDE2_ON

#define EC_DEVICE_CONTROL_2_IDE2_ON   (1 << 5)

Definition at line 24 of file ec.c.

◆ EC_DEVICE_CONTROL_2_LAN_1_ON

#define EC_DEVICE_CONTROL_2_LAN_1_ON   (1 << 0)

Definition at line 19 of file ec.c.

◆ EC_DEVICE_CONTROL_2_LAN_2_ON

#define EC_DEVICE_CONTROL_2_LAN_2_ON   (1 << 1)

Definition at line 20 of file ec.c.

◆ EC_DEVICE_CONTROL_2_MPI_ON

#define EC_DEVICE_CONTROL_2_MPI_ON   (1 << 7)

Definition at line 26 of file ec.c.

◆ EC_DEVICE_CONTROL_2_USB_ON

#define EC_DEVICE_CONTROL_2_USB_ON   (1 << 3)

Definition at line 22 of file ec.c.

◆ EC_DEVICE_CONTROL_2_WLAN_ON

#define EC_DEVICE_CONTROL_2_WLAN_ON   (1 << 2)

Definition at line 21 of file ec.c.

◆ EC_RUNNING

#define EC_RUNNING   (1 << 1)

Definition at line 11 of file ec.c.

◆ EC_STATUS

#define EC_STATUS   0x50

Definition at line 10 of file ec.c.

◆ RUNNING_TIMEOUT_MS

#define RUNNING_TIMEOUT_MS   3333

Definition at line 28 of file ec.c.

Function Documentation

◆ ec_enable_devices()

void ec_enable_devices ( bool  enable_usb)

Definition at line 46 of file ec.c.

References BIOS_INFO, EC_DEVICE_CONTROL_1, EC_DEVICE_CONTROL_1_BOOMER_ON, EC_DEVICE_CONTROL_1_BT_RF_ON, EC_DEVICE_CONTROL_2, EC_DEVICE_CONTROL_2_MPI_ON, EC_DEVICE_CONTROL_2_USB_ON, EC_DEVICE_CONTROL_2_WLAN_ON, ec_read(), ec_running(), ec_write(), and printk.

Referenced by mainboard_dev_init().

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

◆ ec_running()

static bool ec_running ( void  )
static

Definition at line 30 of file ec.c.

References BIOS_WARNING, ec_read(), EC_RUNNING, ec_status(), EC_STATUS, printk, RUNNING_TIMEOUT_MS, stopwatch_expired(), and stopwatch_init_msecs_expire().

Referenced by ec_enable_devices(), and mainboard_smi_sleep().

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

◆ mainboard_smi_sleep()

void mainboard_smi_sleep ( const uint8_t  slp_typ)