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

Go to the source code of this file.

Macros

#define SYSTEM76_EC_BASE   0x0E00
 
#define SYSTEM76_EC_SIZE   256
 
#define REG_CMD   0
 
#define REG_RESULT   1
 
#define CMD_FINISHED   0
 
#define CMD_PRINT   4
 
#define CMD_PRINT_REG_FLAGS   2
 
#define CMD_PRINT_REG_LEN   3
 
#define CMD_PRINT_REG_DATA   4
 

Functions

static uint8_t system76_ec_read (uint8_t addr)
 
static void system76_ec_write (uint8_t addr, uint8_t data)
 
void system76_ec_init (void)
 
void system76_ec_flush (void)
 
void system76_ec_print (uint8_t byte)
 

Macro Definition Documentation

◆ CMD_FINISHED

#define CMD_FINISHED   0

Definition at line 16 of file system76_ec.c.

◆ CMD_PRINT

#define CMD_PRINT   4

Definition at line 19 of file system76_ec.c.

◆ CMD_PRINT_REG_DATA

#define CMD_PRINT_REG_DATA   4

Definition at line 22 of file system76_ec.c.

◆ CMD_PRINT_REG_FLAGS

#define CMD_PRINT_REG_FLAGS   2

Definition at line 20 of file system76_ec.c.

◆ CMD_PRINT_REG_LEN

#define CMD_PRINT_REG_LEN   3

Definition at line 21 of file system76_ec.c.

◆ REG_CMD

#define REG_CMD   0

Definition at line 12 of file system76_ec.c.

◆ REG_RESULT

#define REG_RESULT   1

Definition at line 13 of file system76_ec.c.

◆ SYSTEM76_EC_BASE

#define SYSTEM76_EC_BASE   0x0E00

Definition at line 9 of file system76_ec.c.

◆ SYSTEM76_EC_SIZE

#define SYSTEM76_EC_SIZE   256

Definition at line 10 of file system76_ec.c.

Function Documentation

◆ system76_ec_flush()

void system76_ec_flush ( void  )

Definition at line 41 of file system76_ec.c.

References CMD_FINISHED, CMD_PRINT, CMD_PRINT_REG_LEN, REG_CMD, system76_ec_read(), system76_ec_write(), and wait_us.

Referenced by system76_ec_print().

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

◆ system76_ec_init()

void system76_ec_init ( void  )

Definition at line 34 of file system76_ec.c.

References SYSTEM76_EC_SIZE, and system76_ec_write().

Here is the call graph for this function:

◆ system76_ec_print()

void system76_ec_print ( uint8_t  byte)

Definition at line 52 of file system76_ec.c.

References CMD_PRINT_REG_DATA, CMD_PRINT_REG_LEN, system76_ec_flush(), system76_ec_read(), SYSTEM76_EC_SIZE, and system76_ec_write().

Here is the call graph for this function:

◆ system76_ec_read()

static uint8_t system76_ec_read ( uint8_t  addr)
inlinestatic

Definition at line 24 of file system76_ec.c.

References addr, inb(), and SYSTEM76_EC_BASE.

Referenced by system76_ec_flush(), and system76_ec_print().

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

◆ system76_ec_write()

static void system76_ec_write ( uint8_t  addr,
uint8_t  data 
)
inlinestatic

Definition at line 29 of file system76_ec.c.

References addr, outb(), and SYSTEM76_EC_BASE.

Referenced by system76_ec_flush(), system76_ec_init(), and system76_ec_print().

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