coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
me_common.c File Reference
#include <device/mmio.h>
#include <device/device.h>
#include <device/pci.h>
#include <device/pci_ops.h>
#include <console/console.h>
#include <device/pci_ids.h>
#include <device/pci_def.h>
#include <string.h>
#include <delay.h>
#include <halt.h>
#include <timer.h>
#include "me.h"
#include "pch.h"
#include <vendorcode/google/chromeos/chromeos.h>
Include dependency graph for me_common.c:

Go to the source code of this file.

Functions

const char *const me_get_bios_path_string (int path)
 
static void mei_dump (void *ptr, int dword, int offset, const char *type)
 
void mei_read_dword_ptr (void *ptr, int offset)
 
void mei_write_dword_ptr (void *ptr, int offset)
 
void read_host_csr (struct mei_csr *csr)
 
void write_host_csr (struct mei_csr *csr)
 
void read_me_csr (struct mei_csr *csr)
 
void write_cb (u32 dword)
 
u32 read_cb (void)
 
static int mei_wait_for_me_ready (void)
 
static void mei_reset (void)
 
static int mei_send_msg (struct mei_header *mei, struct mkhi_header *mkhi, void *req_data)
 
static int mei_recv_msg (struct mkhi_header *mkhi, void *rsp_data, int rsp_bytes)
 
int mei_sendrecv (struct mei_header *mei, struct mkhi_header *mkhi, void *req_data, void *rsp_data, int rsp_bytes)
 
int intel_mei_setup (struct device *dev)
 
int intel_me_extend_valid (struct device *dev)
 
void intel_me_hide (struct device *dev)
 
bool enter_soft_temp_disable (void)
 
void enter_soft_temp_disable_wait (void)
 
void exit_soft_temp_disable (struct device *dev)
 
void exit_soft_temp_disable_wait (struct device *dev)
 

Variables

static const char *const me_bios_path_values []
 
static u32mei_base_address
 

Function Documentation

◆ enter_soft_temp_disable()

bool enter_soft_temp_disable ( void  )

◆ enter_soft_temp_disable_wait()

void enter_soft_temp_disable_wait ( void  )

Definition at line 439 of file me_common.c.

References mdelay().

Here is the call graph for this function:

◆ exit_soft_temp_disable()

void exit_soft_temp_disable ( struct device dev)

Definition at line 454 of file me_common.c.

References PCI_ME_H_GS, and pci_write_config32().

Here is the call graph for this function:

◆ exit_soft_temp_disable_wait()

void exit_soft_temp_disable_wait ( struct device dev)

Wait for fw_init_complete. Check every 50 ms, give up after 20 sec. This is what vendor BIOS does. Usually it takes 1.5 seconds or so.

Definition at line 460 of file me_common.c.

References BIOS_ERR, BIOS_NOTICE, me_hfs::fw_init_complete, mdelay(), ME_ENABLE_TIMEOUT, PCI_ME_HFS, pci_read_config32(), printk, me_hfs::raw, stopwatch_duration_msecs(), stopwatch_expired(), and stopwatch_init_msecs_expire().

Here is the call graph for this function:

◆ intel_me_extend_valid()

int intel_me_extend_valid ( struct device dev)

◆ intel_me_hide()

void intel_me_hide ( struct device dev)

Definition at line 405 of file me_common.c.

References device::enabled, and pch_enable().

Here is the call graph for this function:

◆ intel_mei_setup()

◆ me_get_bios_path_string()

const char* const me_get_bios_path_string ( int  path)

Definition at line 30 of file me_common.c.

References me_bios_path_values.

◆ mei_dump()

static void mei_dump ( void ptr,
int  dword,
int  offset,
const char *  type 
)
static

◆ mei_read_dword_ptr()

void mei_read_dword_ptr ( void ptr,
int  offset 
)

Definition at line 75 of file me_common.c.

References mei_base_address, mei_dump(), memcpy(), offset, and read32().

Referenced by mei_recv_msg(), read_host_csr(), and read_me_csr().

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

◆ mei_recv_msg()

static int mei_recv_msg ( struct mkhi_header mkhi,
void rsp_data,
int  rsp_bytes 
)
static

◆ mei_reset()

static void mei_reset ( void  )
static

Definition at line 135 of file me_common.c.

References mei_csr::interrupt_generate, mei_wait_for_me_ready(), read_host_csr(), mei_csr::ready, mei_csr::reset, and write_host_csr().

Referenced by mei_send_msg().

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

◆ mei_send_msg()

static int mei_send_msg ( struct mei_header mei,
struct mkhi_header mkhi,
void req_data 
)
static

Definition at line 159 of file me_common.c.

References BIOS_DEBUG, BIOS_ERR, mei_csr::buffer_depth, mei_csr::buffer_write_ptr, mei_csr::interrupt_generate, mei_header::length, MEI_H_CB_WW, mei_reset(), mei_wait_for_me_ready(), mei_write_dword_ptr(), printk, read_host_csr(), write_cb(), and write_host_csr().

Referenced by mei_sendrecv().

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

◆ mei_sendrecv()

int mei_sendrecv ( struct mei_header mei,
struct mkhi_header mkhi,
void req_data,
void rsp_data,
int  rsp_bytes 
)

Definition at line 306 of file me_common.c.

References mei_recv_msg(), and mei_send_msg().

Referenced by enter_soft_temp_disable(), me7_mkhi_end_of_post(), me8_mkhi_end_of_post(), and mkhi_get_fwcaps().

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

◆ mei_wait_for_me_ready()

static int mei_wait_for_me_ready ( void  )
static

Definition at line 119 of file me_common.c.

References BIOS_ERR, ME_DELAY, ME_RETRY, printk, read_me_csr(), mei_csr::ready, and udelay().

Referenced by mei_recv_msg(), mei_reset(), and mei_send_msg().

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

◆ mei_write_dword_ptr()

void mei_write_dword_ptr ( void ptr,
int  offset 
)

Definition at line 82 of file me_common.c.

References mei_base_address, mei_dump(), memcpy(), offset, and write32().

Referenced by mei_send_msg(), and write_host_csr().

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

◆ read_cb()

u32 read_cb ( void  )

Definition at line 111 of file me_common.c.

References mei_base_address, mei_dump(), MEI_ME_CB_RW, NULL, and read32().

Referenced by mei_recv_msg().

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

◆ read_host_csr()

void read_host_csr ( struct mei_csr csr)

Definition at line 90 of file me_common.c.

References MEI_H_CSR, and mei_read_dword_ptr().

Referenced by intel_mei_setup(), mei_recv_msg(), mei_reset(), and mei_send_msg().

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

◆ read_me_csr()

void read_me_csr ( struct mei_csr csr)

Definition at line 100 of file me_common.c.

References MEI_ME_CSR_HA, and mei_read_dword_ptr().

Referenced by mei_recv_msg(), and mei_wait_for_me_ready().

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

◆ write_cb()

void write_cb ( u32  dword)

Definition at line 105 of file me_common.c.

References mei_base_address, mei_dump(), MEI_H_CB_WW, NULL, and write32().

Referenced by mei_send_msg().

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

◆ write_host_csr()

void write_host_csr ( struct mei_csr csr)

Definition at line 95 of file me_common.c.

References MEI_H_CSR, and mei_write_dword_ptr().

Referenced by intel_mei_setup(), mei_recv_msg(), mei_reset(), and mei_send_msg().

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

Variable Documentation

◆ me_bios_path_values

const char* const me_bios_path_values[]
static
Initial value:
= {
[ME_NORMAL_BIOS_PATH] = "Normal",
[ME_S3WAKE_BIOS_PATH] = "S3 Wake",
[ME_ERROR_BIOS_PATH] = "Error",
[ME_RECOVERY_BIOS_PATH] = "Recovery",
[ME_DISABLE_BIOS_PATH] = "Disable",
[ME_FIRMWARE_UPDATE_BIOS_PATH] = "Firmware Update",
}
@ ME_ERROR_BIOS_PATH
Definition: me.h:313
@ ME_RECOVERY_BIOS_PATH
Definition: me.h:314
@ ME_DISABLE_BIOS_PATH
Definition: me.h:315
@ ME_FIRMWARE_UPDATE_BIOS_PATH
Definition: me.h:316
@ ME_S3WAKE_BIOS_PATH
Definition: me.h:312
@ ME_NORMAL_BIOS_PATH
Definition: me.h:311

Definition at line 21 of file me_common.c.

Referenced by me_get_bios_path_string().

◆ mei_base_address

u32* mei_base_address
static