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 <delay.h>
#include <gpio.h>
#include <soc/clock.h>
#include <soc/blsp.h>
#include <soc/ipq_uart.h>
#include <stdint.h>
Include dependency graph for uart.c:

Go to the source code of this file.

Data Structures

struct  uart_params_t
 

Macros

#define FIFO_DATA_SIZE   4
 

Functions

static unsigned int msm_boot_uart_dm_init_rx_transfer (void *uart_dm_base)
 msm_boot_uart_dm_init_rx_transfer - Init Rx transfer More...
 
static unsigned int msm_boot_uart_dm_init (void *uart_dm_base)
 msm_boot_uart_dm_init - initilaizes UART controller More...
 
void uart_tx_byte (unsigned int idx, unsigned char data)
 
static unsigned int msm_boot_uart_dm_reset (void *base)
 msm_boot_uart_dm_reset - resets UART controller More...
 
void uart_init (unsigned int idx)
 ipq40xx_uart_init - initializes UART More...
 
void ipq40xx_uart_init (void)
 
void uart_tx_flush (unsigned int idx)
 uart_tx_flush - transmits a string of data More...
 
uint8_t uart_rx_byte (unsigned int idx)
 ipq40xx_serial_getc - reads a character More...
 
void uart_fill_lb (void *data)
 

Variables

static const uart_params_t uart_board_param
 
static int valid_data = 0
 
static unsigned int word = 0
 

Macro Definition Documentation

◆ FIFO_DATA_SIZE

#define FIFO_DATA_SIZE   4

Definition at line 14 of file uart.c.

Function Documentation

◆ ipq40xx_uart_init()

void ipq40xx_uart_init ( void  )

Definition at line 224 of file uart.c.

References uart_init().

Referenced by soc_init().

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

◆ msm_boot_uart_dm_init()

unsigned int msm_boot_uart_dm_init ( void uart_dm_base)
static

◆ msm_boot_uart_dm_init_rx_transfer()

static unsigned int msm_boot_uart_dm_init_rx_transfer ( void uart_dm_base)
static

msm_boot_uart_dm_init_rx_transfer - Init Rx transfer

Parameters
uart_dm_baseUART controller base address

Definition at line 59 of file uart.c.

References MSM_BOOT_UART_DM_CMD_RES_STALE_INT, MSM_BOOT_UART_DM_CMD_RESET_RX, MSM_BOOT_UART_DM_CR, MSM_BOOT_UART_DM_CR_RX_ENABLE, MSM_BOOT_UART_DM_DMRX, MSM_BOOT_UART_DM_DMRX_DEF_VALUE, MSM_BOOT_UART_DM_E_SUCCESS, MSM_BOOT_UART_DM_GCMD_ENA_STALE_EVT, and write32().

Referenced by msm_boot_uart_dm_init().

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

◆ msm_boot_uart_dm_reset()

static unsigned int msm_boot_uart_dm_reset ( void base)
static

msm_boot_uart_dm_reset - resets UART controller

Parameters
baseUART controller base address

Definition at line 113 of file uart.c.

References base, MSM_BOOT_UART_DM_CMD_RES_STALE_INT, MSM_BOOT_UART_DM_CMD_RES_TX_ERR, MSM_BOOT_UART_DM_CMD_RESET_ERR_STAT, MSM_BOOT_UART_DM_CMD_RESET_RX, MSM_BOOT_UART_DM_CMD_RESET_TX, MSM_BOOT_UART_DM_CR, MSM_BOOT_UART_DM_E_SUCCESS, and write32().

Referenced by msm_boot_uart_dm_init().

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 259 of file uart.c.

References get_uart_baudrate(), lb_add_console(), lb_add_serial(), LB_SERIAL_TYPE_MEMORY_MAPPED, LB_TAG_CONSOLE_SERIAL8250MEM, serial, UART1_DM_BASE, and uart_platform_refclk().

Here is the call graph for this function:

◆ uart_init()

◆ uart_rx_byte()

uint8_t uart_rx_byte ( unsigned int  idx)

ipq40xx_serial_getc - reads a character

Returns the character read from serial port.

Definition at line 247 of file uart.c.

References valid_data, and word.

◆ uart_tx_byte()

void uart_tx_byte ( unsigned int  idx,
unsigned char  data 
)

◆ uart_tx_flush()

void uart_tx_flush ( unsigned int  idx)

uart_tx_flush - transmits a string of data

Parameters
idxstring to transmit

Definition at line 233 of file uart.c.

References base, MSM_BOOT_UART_DM_SR, MSM_BOOT_UART_DM_SR_TXEMT, read32(), uart_board_param, and uart_params_t::uart_dm_base.

Here is the call graph for this function:

Variable Documentation

◆ uart_board_param

const uart_params_t uart_board_param
static

Definition at line 23 of file uart.c.

Referenced by uart_init(), uart_tx_byte(), and uart_tx_flush().

◆ valid_data

int valid_data = 0
static

Definition at line 85 of file uart.c.

Referenced by uart_rx_byte().

◆ word