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 <soc/clk.h>
#include <soc/cpu.h>
#include <soc/periph.h>
#include <soc/uart.h>
#include <types.h>
Include dependency graph for uart.c:

Go to the source code of this file.

Macros

#define RX_FIFO_COUNT_MASK   0xff
 
#define RX_FIFO_FULL_MASK   (1 << 8)
 
#define TX_FIFO_FULL_MASK   (1 << 24)
 

Functions

static void serial_setbrg_dev (struct s5p_uart *uart)
 
static void exynos5_init_dev (struct s5p_uart *uart)
 
static int exynos5_uart_err_check (struct s5p_uart *uart, int op)
 
static unsigned char exynos5_uart_rx_byte (struct s5p_uart *uart)
 
static void exynos5_uart_tx_byte (struct s5p_uart *uart, unsigned char data)
 
static void exynos5_uart_tx_flush (struct s5p_uart *uart)
 
uintptr_t uart_platform_base (unsigned int idx)
 
void uart_init (unsigned int idx)
 ipq40xx_uart_init - initializes UART More...
 
unsigned char uart_rx_byte (unsigned int idx)
 ipq40xx_serial_getc - reads a character More...
 
void uart_tx_byte (unsigned int idx, unsigned char data)
 msm_boot_uart_dm_read - reads a word from the RX FIFO. More...
 
void uart_tx_flush (unsigned int idx)
 uart_tx_flush - transmits a string of data More...
 
void uart_fill_lb (void *data)
 

Macro Definition Documentation

◆ RX_FIFO_COUNT_MASK

#define RX_FIFO_COUNT_MASK   0xff

Definition at line 12 of file uart.c.

◆ RX_FIFO_FULL_MASK

#define RX_FIFO_FULL_MASK   (1 << 8)

Definition at line 13 of file uart.c.

◆ TX_FIFO_FULL_MASK

#define TX_FIFO_FULL_MASK   (1 << 24)

Definition at line 14 of file uart.c.

Function Documentation

◆ exynos5_init_dev()

static void exynos5_init_dev ( struct s5p_uart uart)
static

Definition at line 32 of file uart.c.

References exynos_pinmux_uart3(), serial_setbrg_dev(), s5p_uart::ucon, s5p_uart::ufcon, s5p_uart::ulcon, s5p_uart::umcon, and write32().

Referenced by uart_init().

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

◆ exynos5_uart_err_check()

static int exynos5_uart_err_check ( struct s5p_uart uart,
int  op 
)
static

Definition at line 48 of file uart.c.

References mask, read32(), and s5p_uart::uerstat.

Referenced by exynos5_uart_rx_byte(), and exynos5_uart_tx_byte().

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

◆ exynos5_uart_rx_byte()

static unsigned char exynos5_uart_rx_byte ( struct s5p_uart uart)
static

Definition at line 72 of file uart.c.

References exynos5_uart_err_check(), read32(), read8(), RX_FIFO_COUNT_MASK, RX_FIFO_FULL_MASK, s5p_uart::ufstat, and s5p_uart::urxh.

Referenced by uart_rx_byte().

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

◆ exynos5_uart_tx_byte()

static void exynos5_uart_tx_byte ( struct s5p_uart uart,
unsigned char  data 
)
static

Definition at line 87 of file uart.c.

References exynos5_uart_err_check(), read32(), TX_FIFO_FULL_MASK, s5p_uart::ufstat, s5p_uart::utxh, and write8().

Referenced by uart_tx_byte().

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

◆ exynos5_uart_tx_flush()

static void exynos5_uart_tx_flush ( struct s5p_uart uart)
static

Definition at line 98 of file uart.c.

References read32(), and s5p_uart::ufstat.

Referenced by uart_tx_flush().

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

◆ serial_setbrg_dev()

static void serial_setbrg_dev ( struct s5p_uart uart)
static

Definition at line 16 of file uart.c.

References clock_get_periph_rate(), get_uart_baudrate(), PERIPH_ID_UART3, s5p_uart::ubrdiv, val, and write32().

Referenced by exynos5_init_dev().

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)

◆ uart_init()

void uart_init ( unsigned int  idx)

ipq40xx_uart_init - initializes UART

Initializes clocks, GPIO and UART controller.

ipq40xx_uart_init - initializes UART

Initializes clocks, GPIO and UART controller.

Definition at line 111 of file uart.c.

References exynos5_init_dev(), and uart_platform_baseptr().

Here is the call graph for this function:

◆ uart_platform_base()

uintptr_t uart_platform_base ( unsigned int  idx)

Definition at line 103 of file uart.c.

◆ uart_rx_byte()

unsigned char uart_rx_byte ( unsigned int  idx)

ipq40xx_serial_getc - reads a character

Returns the character read from serial port.

ipq40xx_serial_getc - reads a character

Returns 1 if data available, 0 otherwise ipq806x_serial_getc - reads a character

Returns the character read from serial port.

Definition at line 117 of file uart.c.

References exynos5_uart_rx_byte(), and uart_platform_baseptr().

Here is the call graph for this function:

◆ uart_tx_byte()

void uart_tx_byte ( unsigned int  idx,
unsigned char  data 
)

msm_boot_uart_dm_read - reads a word from the RX FIFO.

@data: location where the read data is stored @count: no of valid data in the FIFO @wait: indicates blocking call or not blocking call

Reads a word from the RX FIFO. If no data is available blocks if @wait is true, else returns MSM_BOOT_UART_DM_E_RX_NOT_READY.

Definition at line 123 of file uart.c.

References exynos5_uart_tx_byte(), and uart_platform_baseptr().

Here is the call graph for this function:

◆ uart_tx_flush()

void uart_tx_flush ( unsigned int  idx)

uart_tx_flush - transmits a string of data

Parameters
idxstring to transmit

uart_tx_flush - transmits a string of data

Definition at line 129 of file uart.c.

References exynos5_uart_tx_flush(), and uart_platform_baseptr().

Here is the call graph for this function: