18 #include <vendorcode/google/chromeos/chromeos.h>
42 if (!
CONFIG(DEBUG_INTEL_ME))
78 memcpy(ptr, &dword,
sizeof(dword));
85 memcpy(&dword, ptr,
sizeof(dword));
162 unsigned int ndata, n;
210 for (n = 0; n < ndata; ++n)
227 unsigned int ndata, n;
228 unsigned int expected;
232 expected = (rsp_bytes +
sizeof(mei_rsp) +
sizeof(mkhi_rsp)) >> 2;
249 printk(
BIOS_ERR,
"ME: timeout waiting for data: expected %u, available %u\n",
262 ndata = mei_rsp.
length >> 2;
266 if (ndata != (expected - 1)) {
268 ndata, (expected - 1));
278 "command %u ?= %u, is_response %u\n", mkhi->
group_id,
286 if (ndata != (rsp_bytes >> 2)) {
287 printk(
BIOS_ERR,
"ME: not enough room in response buffer: %u != %u\n",
288 ndata, rsp_bytes >> 2);
294 for (n = 0; n < ndata; ++n)
307 void *req_data,
void *rsp_data,
int rsp_bytes)
316 #ifdef __SIMPLE_DEVICE__
339 if (!res || res->
base == 0 || res->
size == 0) {
391 for (i = 0; i <
count; ++i) {
399 chromeos_set_me_hash(extend,
count);
424 .length =
sizeof(mkhi) +
sizeof(message),
430 if (
mei_sendrecv(&mei, &mkhi, &message, &resp,
sizeof(resp)) < 0
479 printk(
BIOS_ERR,
"ME: giving up on waiting for fw_init_complete\n");
static void write32(void *addr, uint32_t val)
static uint32_t read32(const void *addr)
void * memcpy(void *dest, const void *src, size_t n)
#define printk(level,...)
void mdelay(unsigned int msecs)
struct resource * probe_resource(const struct device *dev, unsigned int index)
See if a resource structure already exists for a given index.
static __always_inline void pci_write_config32(const struct device *dev, u16 reg, u32 val)
static __always_inline void pci_or_config16(const struct device *dev, u16 reg, u16 ormask)
static __always_inline u32 pci_read_config32(const struct device *dev, u16 reg)
static int stopwatch_expired(struct stopwatch *sw)
static long stopwatch_duration_msecs(struct stopwatch *sw)
static void stopwatch_init_msecs_expire(struct stopwatch *sw, long ms)
#define BIOS_DEBUG
BIOS_DEBUG - Verbose output.
#define BIOS_NOTICE
BIOS_NOTICE - Unexpected but relatively insignificant.
#define BIOS_ERR
BIOS_ERR - System in incomplete state.
#define BIOS_SPEW
BIOS_SPEW - Excessively verbose output.
#define BIOS_WARNING
BIOS_WARNING - Bad configuration.
static void mei_dump(void *ptr, int dword, int offset, const char *type)
int intel_mei_setup(struct device *dev)
void exit_soft_temp_disable(struct device *dev)
static int mei_wait_for_me_ready(void)
static int mei_send_msg(struct mei_header *mei, struct mkhi_header *mkhi, void *req_data)
const char *const me_get_bios_path_string(int path)
int intel_me_extend_valid(struct device *dev)
void write_host_csr(struct mei_csr *csr)
void intel_me_hide(struct device *dev)
void mei_read_dword_ptr(void *ptr, int offset)
static void mei_reset(void)
void read_host_csr(struct mei_csr *csr)
static int mei_recv_msg(struct mkhi_header *mkhi, void *rsp_data, int rsp_bytes)
bool enter_soft_temp_disable(void)
static u32 * mei_base_address
void mei_write_dword_ptr(void *ptr, int offset)
int mei_sendrecv(struct mei_header *mei, struct mkhi_header *mkhi, void *req_data, void *rsp_data, int rsp_bytes)
void exit_soft_temp_disable_wait(struct device *dev)
void enter_soft_temp_disable_wait(void)
static const char *const me_bios_path_values[]
void read_me_csr(struct mei_csr *csr)
#define PCI_COMMAND_MASTER
#define PCI_COMMAND_MEMORY
#define PCI_BASE_ADDRESS_0
#define MKHI_GROUP_ID_FWCAPS
#define PCI_ME_EXT_SHA256
@ ME_FIRMWARE_UPDATE_BIOS_PATH
bool is_mei_base_address_valid(void)
void update_mei_base_address(void)
#define MKHI_FWCAPS_SET_RULE
#define MKHI_DISABLE_RULE_ID
#define ME_ENABLE_TIMEOUT
void pch_enable(struct device *dev)
u32 extend_feature_present