coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
sch5545_ec.c File Reference
#include <cbfs.h>
#include <cf9_reset.h>
#include <option.h>
#include <cpu/x86/msr.h>
#include <console/console.h>
#include <cpu/intel/model_206ax/model_206ax.h>
#include <southbridge/intel/common/gpio.h>
#include <superio/smsc/sch5545/sch5545.h>
#include <superio/smsc/sch5545/sch5545_emi.h>
#include <baseboard/sch5545_ec.h>
#include <variant/sch5545_ec_tables.h>
Include dependency graph for sch5545_ec.c:

Go to the source code of this file.

Macros

#define GPIO_CHASSIS_ID0   1
 
#define GPIO_CHASSIS_ID1   17
 
#define GPIO_CHASSIS_ID2   37
 
#define GPIO_FRONT_PANEL_CHASSIS_DET_L   70
 

Functions

static uint8_t send_mbox_msg_with_int (uint8_t mbox_message)
 
static uint8_t send_mbox_msg_simple (uint8_t mbox_message)
 
static void ec_check_mbox_and_int_status (uint8_t int_src, uint8_t mbox_msg)
 
static uint8_t ec_read_write_reg (uint8_t ldn, uint16_t reg, uint8_t *value, uint8_t rw_bit)
 
uint16_t sch5545_get_ec_fw_version (void)
 
void sch5545_update_ec_firmware (uint16_t ec_version)
 
void sch5545_ec_hwm_early_init (void)
 
static uint8_t get_sku_tdp_config (void)
 
static uint8_t get_chassis_type (void)
 
static void ec_hwm_init_late (const ec_chassis_tdp_t *ec_hwm_sequence, size_t size)
 
static void prepare_for_hwm_ec_sequence (uint8_t write_only, uint8_t *value)
 
void sch5545_ec_hwm_init (void *unused)
 

Variables

static const struct ec_val_reg ec_hwm_init_seq []
 

Macro Definition Documentation

◆ GPIO_CHASSIS_ID0

#define GPIO_CHASSIS_ID0   1

Definition at line 16 of file sch5545_ec.c.

◆ GPIO_CHASSIS_ID1

#define GPIO_CHASSIS_ID1   17

Definition at line 17 of file sch5545_ec.c.

◆ GPIO_CHASSIS_ID2

#define GPIO_CHASSIS_ID2   37

Definition at line 18 of file sch5545_ec.c.

◆ GPIO_FRONT_PANEL_CHASSIS_DET_L

#define GPIO_FRONT_PANEL_CHASSIS_DET_L   70

Definition at line 19 of file sch5545_ec.c.

Function Documentation

◆ ec_check_mbox_and_int_status()

static void ec_check_mbox_and_int_status ( uint8_t  int_src,
uint8_t  mbox_msg 
)
static

Definition at line 138 of file sch5545_ec.c.

References BIOS_SPEW, printk, sch5545_emi_ec2h_mbox_read(), sch5545_emi_get_int_src_low(), sch5545_emi_set_int_src_low(), and val.

Referenced by sch5545_ec_hwm_early_init(), and sch5545_ec_hwm_init().

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

◆ ec_hwm_init_late()

static void ec_hwm_init_late ( const ec_chassis_tdp_t ec_hwm_sequence,
size_t  size 
)
static

Definition at line 331 of file sch5545_ec.c.

References EC_HWM_LDN, ec_read_write_reg(), get_sku_tdp_config(), ec_val_reg::reg, TDP_COMMON, val, ec_val_reg_tdp::val, and WRITE_OP.

Referenced by sch5545_ec_hwm_init().

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

◆ ec_read_write_reg()

static uint8_t ec_read_write_reg ( uint8_t  ldn,
uint16_t  reg,
uint8_t value,
uint8_t  rw_bit 
)
static

◆ get_chassis_type()

static uint8_t get_chassis_type ( void  )
static

Definition at line 299 of file sch5545_ec.c.

References BIOS_DEBUG, get_gpio(), GPIO_CHASSIS_ID0, GPIO_CHASSIS_ID1, GPIO_CHASSIS_ID2, GPIO_FRONT_PANEL_CHASSIS_DET_L, and printk.

Referenced by sch5545_ec_hwm_init().

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

◆ get_sku_tdp_config()

static uint8_t get_sku_tdp_config ( void  )
static

Definition at line 280 of file sch5545_ec.c.

References msr_struct::lo, MSR_PKG_POWER_SKU, MSR_PKG_POWER_SKU_UNIT, and rdmsr().

Referenced by ec_hwm_init_late().

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

◆ prepare_for_hwm_ec_sequence()

static void prepare_for_hwm_ec_sequence ( uint8_t  write_only,
uint8_t value 
)
static

Definition at line 346 of file sch5545_ec.c.

References EC_HWM_LDN, ec_read_write_reg(), NULL, READ_OP, ec_val_reg::reg, val, value, and WRITE_OP.

Referenced by sch5545_ec_hwm_init().

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

◆ sch5545_ec_hwm_early_init()

void sch5545_ec_hwm_early_init ( void  )

Definition at line 259 of file sch5545_ec.c.

References ARRAY_SIZE, BIOS_DEBUG, ec_check_mbox_and_int_status(), ec_hwm_init_seq, EC_HWM_LDN, ec_read_write_reg(), printk, READ_OP, ec_val_reg::reg, val, ec_val_reg::val, and WRITE_OP.

Referenced by mainboard_early_init().

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

◆ sch5545_ec_hwm_init()

◆ sch5545_get_ec_fw_version()

uint16_t sch5545_get_ec_fw_version ( void  )

Definition at line 182 of file sch5545_ec.c.

References EC_HWM_LDN, ec_read_write_reg(), READ_OP, and val.

Referenced by mainboard_early_init(), and sch5545_update_ec_firmware().

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

◆ sch5545_update_ec_firmware()

void sch5545_update_ec_firmware ( uint16_t  ec_version)

Definition at line 199 of file sch5545_ec.c.

References BIOS_ERR, BIOS_INFO, BIOS_WARNING, cbfs_map(), full_reset(), printk, sch5545_emi_ec_write32_bulk(), sch5545_get_ec_fw_version(), and send_mbox_msg_simple().

Referenced by mainboard_early_init().

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

◆ send_mbox_msg_simple()

static uint8_t send_mbox_msg_simple ( uint8_t  mbox_message)
static

Definition at line 120 of file sch5545_ec.c.

References sch5545_emi_ec2h_mbox_read(), sch5545_emi_get_int_src_low(), and sch5545_emi_h2ec_mbox_write().

Referenced by sch5545_update_ec_firmware().

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

◆ send_mbox_msg_with_int()

static uint8_t send_mbox_msg_with_int ( uint8_t  mbox_message)
static

Definition at line 98 of file sch5545_ec.c.

References sch5545_emi_ec2h_mbox_read(), sch5545_emi_get_int_src_low(), sch5545_emi_h2ec_mbox_write(), and sch5545_emi_set_int_src_low().

Referenced by ec_read_write_reg().

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

Variable Documentation

◆ ec_hwm_init_seq

const struct ec_val_reg ec_hwm_init_seq[]
static

Definition at line 1 of file sch5545_ec.c.

Referenced by sch5545_ec_hwm_early_init().