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

Go to the source code of this file.

Functions

static void mei_dump (void *ptr, int dword, int offset, const char *type)
 
static void mei_read_dword_ptr (void *ptr, int offset)
 
static void mei_write_dword_ptr (void *ptr, int offset)
 
static void pci_read_dword_ptr (struct device *dev, void *ptr, int offset)
 
static void read_host_csr (struct mei_csr *csr)
 
static void write_host_csr (struct mei_csr *csr)
 
static void read_me_csr (struct mei_csr *csr)
 
static void write_cb (u32 dword)
 
static 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 mei_header *mei, struct mkhi_header *mkhi, void *rsp_data, int rsp_bytes)
 
static int mei_sendrecv (struct mei_header *mei, struct mkhi_header *mkhi, void *req_data, void *rsp_data, int rsp_bytes)
 
static me_bios_path intel_me_path (struct device *dev)
 
static int intel_mei_setup (struct device *dev)
 
static int intel_me_extend_valid (struct device *dev)
 
static void intel_me_hide (struct device *dev)
 
static void intel_me_init (struct device *dev)
 

Variables

static const char *me_bios_path_values[] __unused
 
static u32mei_base_address
 
static struct device_operations device_ops
 
static const unsigned short pci_device_ids []
 
static const struct pci_driver intel_me __pci_driver
 

Function Documentation

◆ intel_me_extend_valid()

static int intel_me_extend_valid ( struct device dev)
static

◆ intel_me_hide()

static void intel_me_hide ( struct device dev)
static

Definition at line 463 of file me.c.

References device::enabled, and pch_enable().

Here is the call graph for this function:

◆ intel_me_init()

static void intel_me_init ( struct device dev)
static

Definition at line 470 of file me.c.

◆ intel_me_path()

◆ intel_mei_setup()

◆ mei_dump()

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

◆ mei_read_dword_ptr()

static void mei_read_dword_ptr ( void ptr,
int  offset 
)
inlinestatic

Definition at line 76 of file me.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 mei_header mei,
struct mkhi_header mkhi,
void rsp_data,
int  rsp_bytes 
)
static

◆ mei_reset()

static void mei_reset ( void  )
static

Definition at line 146 of file me.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 170 of file me.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()

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

Definition at line 315 of file me.c.

References mei_recv_msg(), and mei_send_msg().

Referenced by mkhi_get_fw_version(), 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 130 of file me.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()

static void mei_write_dword_ptr ( void ptr,
int  offset 
)
inlinestatic

Definition at line 83 of file me.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:

◆ pci_read_dword_ptr()

static void pci_read_dword_ptr ( struct device dev,
void ptr,
int  offset 
)
inlinestatic

Definition at line 92 of file me.c.

References mei_dump(), memcpy(), offset, and pci_read_config32().

Referenced by intel_me_extend_valid(), and intel_me_path().

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

◆ read_cb()

static u32 read_cb ( void  )
inlinestatic

Definition at line 122 of file me.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()

static void read_host_csr ( struct mei_csr csr)
inlinestatic

Definition at line 101 of file me.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()

static void read_me_csr ( struct mei_csr csr)
inlinestatic

Definition at line 111 of file me.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()

static void write_cb ( u32  dword)
inlinestatic

Definition at line 116 of file me.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()

static void write_host_csr ( struct mei_csr csr)
inlinestatic

Definition at line 106 of file me.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

◆ __pci_driver

const struct pci_driver intel_me __pci_driver
static
Initial value:
= {
.ops = &device_ops,
.vendor = PCI_VID_INTEL,
.devices = pci_device_ids
}
#define PCI_VID_INTEL
Definition: pci_ids.h:2157
static struct device_operations device_ops
Definition: me.c:510
static const unsigned short pci_device_ids[]
Definition: me.c:518

Definition at line 518 of file me.c.

◆ __unused

const char* me_bios_path_values [] __unused
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 27 of file me.c.

◆ device_ops

struct device_operations device_ops
static
Initial value:
= {
.read_resources = pci_dev_read_resources,
.set_resources = pci_dev_set_resources,
.enable_resources = pci_dev_enable_resources,
.init = intel_me_init,
.ops_pci = &pci_dev_ops_pci,
}
void pci_dev_enable_resources(struct device *dev)
Definition: pci_device.c:721
void pci_dev_read_resources(struct device *dev)
Definition: pci_device.c:534
struct pci_operations pci_dev_ops_pci
Default device operation for PCI devices.
Definition: pci_device.c:911
void pci_dev_set_resources(struct device *dev)
Definition: pci_device.c:691
static void intel_me_init(struct device *dev)
Definition: me.c:470

Definition at line 470 of file me.c.

◆ mei_base_address

u32* mei_base_address
static

Definition at line 37 of file me.c.

Referenced by intel_mei_setup(), mei_read_dword_ptr(), mei_write_dword_ptr(), read_cb(), and write_cb().

◆ pci_device_ids

const unsigned short pci_device_ids[]
static
Initial value:
= {
0x1c3a,
0
}
#define PCI_DID_INTEL_IBEXPEAK_HECI1
Definition: pci_ids.h:2814

Definition at line 518 of file me.c.