coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
mec.c File Reference
#include <stddef.h>
#include <stdint.h>
#include <arch/io.h>
#include "mec.h"
Include dependency graph for mec.c:

Go to the source code of this file.

Macros

#define MEC_EMI_HOST_TO_EC(base)   ((base) + 0)
 
#define MEC_EMI_EC_TO_HOST(base)   ((base) + 1)
 
#define MEC_EMI_EC_ADDRESS_B0(base)   ((base) + 2)
 
#define MEC_EMI_EC_ADDRESS_B1(base)   ((base) + 3)
 
#define MEC_EMI_EC_DATA_B0(base)   ((base) + 4)
 
#define MEC_EMI_EC_DATA_B1(base)   ((base) + 5)
 
#define MEC_EMI_EC_DATA_B2(base)   ((base) + 6)
 
#define MEC_EMI_EC_DATA_B3(base)   ((base) + 7)
 

Enumerations

enum  mec_access_mode { ACCESS_TYPE_BYTE = 0x0 , ACCESS_TYPE_WORD = 0x1 , ACCESS_TYPE_LONG = 0x2 , ACCESS_TYPE_LONG_AUTO_INCREMENT = 0x3 }
 

Functions

static void mec_emi_write_address (uint16_t base, uint16_t offset, enum mec_access_mode access_mode)
 
uint8_t mec_io_bytes (enum mec_io_type type, uint16_t base, uint16_t offset, void *buffer, size_t size)
 

Macro Definition Documentation

◆ MEC_EMI_EC_ADDRESS_B0

#define MEC_EMI_EC_ADDRESS_B0 (   base)    ((base) + 2)

Definition at line 26 of file mec.c.

◆ MEC_EMI_EC_ADDRESS_B1

#define MEC_EMI_EC_ADDRESS_B1 (   base)    ((base) + 3)

Definition at line 27 of file mec.c.

◆ MEC_EMI_EC_DATA_B0

#define MEC_EMI_EC_DATA_B0 (   base)    ((base) + 4)

Definition at line 28 of file mec.c.

◆ MEC_EMI_EC_DATA_B1

#define MEC_EMI_EC_DATA_B1 (   base)    ((base) + 5)

Definition at line 29 of file mec.c.

◆ MEC_EMI_EC_DATA_B2

#define MEC_EMI_EC_DATA_B2 (   base)    ((base) + 6)

Definition at line 30 of file mec.c.

◆ MEC_EMI_EC_DATA_B3

#define MEC_EMI_EC_DATA_B3 (   base)    ((base) + 7)

Definition at line 31 of file mec.c.

◆ MEC_EMI_EC_TO_HOST

#define MEC_EMI_EC_TO_HOST (   base)    ((base) + 1)

Definition at line 25 of file mec.c.

◆ MEC_EMI_HOST_TO_EC

#define MEC_EMI_HOST_TO_EC (   base)    ((base) + 0)

Definition at line 24 of file mec.c.

Enumeration Type Documentation

◆ mec_access_mode

Enumerator
ACCESS_TYPE_BYTE 
ACCESS_TYPE_WORD 
ACCESS_TYPE_LONG 
ACCESS_TYPE_LONG_AUTO_INCREMENT 

Definition at line 9 of file mec.c.

Function Documentation

◆ mec_emi_write_address()

static void mec_emi_write_address ( uint16_t  base,
uint16_t  offset,
enum mec_access_mode  access_mode 
)
static

Definition at line 42 of file mec.c.

References base, MEC_EMI_EC_ADDRESS_B0, MEC_EMI_EC_ADDRESS_B1, offset, and outb().

Referenced by mec_io_bytes().

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

◆ mec_io_bytes()

uint8_t mec_io_bytes ( enum mec_io_type  type,
uint16_t  base,
uint16_t  offset,
void buffer,
size_t  size 
)

Definition at line 49 of file mec.c.

References ACCESS_TYPE_BYTE, ACCESS_TYPE_LONG_AUTO_INCREMENT, base, buf, buffer, checksum(), inb(), MEC_EMI_EC_DATA_B0, MEC_EMI_EC_DATA_B3, mec_emi_write_address(), MEC_IO_WRITE, offset, outb(), and type.

Referenced by read_bytes(), wilco_ec_transfer(), and write_bytes().

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