coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
uart.c File Reference
#include <device/mmio.h>
#include <boot/coreboot_tables.h>
#include <console/uart.h>
#include <drivers/uart/uart8250reg.h>
#include <stdint.h>
#include <soc/addressmap.h>
#include <soc/pll.h>
Include dependency graph for uart.c:

Go to the source code of this file.

Data Structures

struct  mtk_uart
 
struct  mtk_peri_globalcon
 

Functions

static void mtk_uart_tx_flush (void)
 
static int mtk_uart_tst_byte (void)
 
static void mtk_uart_init (void)
 
static void mtk_uart_tx_byte (unsigned char data)
 
static unsigned char mtk_uart_rx_byte (void)
 
void uart_init (unsigned int idx)
 
unsigned char uart_rx_byte (unsigned int idx)
 
void uart_tx_byte (unsigned int idx, unsigned char data)
 
void uart_tx_flush (unsigned int idx)
 
void uart_fill_lb (void *data)
 

Variables

struct mtk_uart __packed
 
static struct mtk_uart *const uart_ptr = (void *)UART0_BASE
 

Function Documentation

◆ mtk_uart_init()

static void mtk_uart_init ( void  )
static

◆ mtk_uart_rx_byte()

static unsigned char mtk_uart_rx_byte ( void  )
static

Definition at line 130 of file uart.c.

References mtk_uart_tst_byte(), mtk_uart::rbr, read8(), and uart_ptr.

Referenced by uart_rx_byte().

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

◆ mtk_uart_tst_byte()

static int mtk_uart_tst_byte ( void  )
static

Definition at line 137 of file uart.c.

References mtk_uart::lsr, read8(), UART8250_LSR_DR, and uart_ptr.

Referenced by mtk_uart_rx_byte().

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

◆ mtk_uart_tx_byte()

static void mtk_uart_tx_byte ( unsigned char  data)
static

Definition at line 117 of file uart.c.

References mtk_uart::lsr, read8(), mtk_uart::thr, UART8250_LSR_THRE, uart_ptr, and write8().

Referenced by uart_tx_byte().

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

◆ mtk_uart_tx_flush()

static void mtk_uart_tx_flush ( void  )
static

Definition at line 124 of file uart.c.

References mtk_uart::lsr, read8(), UART8250_LSR_TEMT, and uart_ptr.

Referenced by mtk_uart_init(), and uart_tx_flush().

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

◆ uart_fill_lb()

void uart_fill_lb ( void data)

Definition at line 162 of file uart.c.

References get_uart_baudrate(), lb_add_console(), lb_add_serial(), LB_SERIAL_TYPE_MEMORY_MAPPED, LB_TAG_CONSOLE_SERIAL8250MEM, serial, UART0_BASE, and UART_HZ.

Here is the call graph for this function:

◆ uart_init()

void uart_init ( unsigned int  idx)

Definition at line 142 of file uart.c.

References mtk_uart_init().

Here is the call graph for this function:

◆ uart_rx_byte()

unsigned char uart_rx_byte ( unsigned int  idx)

Definition at line 147 of file uart.c.

References mtk_uart_rx_byte().

Here is the call graph for this function:

◆ uart_tx_byte()

void uart_tx_byte ( unsigned int  idx,
unsigned char  data 
)

Definition at line 152 of file uart.c.

References mtk_uart_tx_byte().

Here is the call graph for this function:

◆ uart_tx_flush()

void uart_tx_flush ( unsigned int  idx)

Definition at line 157 of file uart.c.

References mtk_uart_tx_flush().

Here is the call graph for this function:

Variable Documentation

◆ __packed

◆ uart_ptr