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/uart.h>
#include <soc/cdp.h>
#include <stdint.h>
#include <soc/iomap.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

void ipq_configure_gpio (const gpio_func_data_t *gpio, unsigned int count)
 
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_reset (void *base)
 msm_boot_uart_dm_reset - resets UART controller More...
 
unsigned int msm_boot_uart_dm_init (void *uart_dm_base)
 msm_boot_uart_dm_init - initilaizes UART controller More...
 
void uart_init (unsigned int idx)
 qcs405_uart_init - initializes UART More...
 
void qcs405_uart_init (void)
 
void uart_tx_flush (unsigned int idx)
 uart_tx_flush - transmits a string of data More...
 
void uart_fill_lb (void *data)
 

Variables

static const uart_params_t uart_board_param
 

Macro Definition Documentation

◆ FIFO_DATA_SIZE

#define FIFO_DATA_SIZE   4

Definition at line 16 of file uart.c.

Function Documentation

◆ ipq_configure_gpio()

void ipq_configure_gpio ( const gpio_func_data_t gpio,
unsigned int  count 
)

Definition at line 24 of file uart.c.

References count, gpio::func, gpio_configure(), and gpio::pull.

Referenced by uart_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)

◆ 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 60 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 116 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:

◆ qcs405_uart_init()

void qcs405_uart_init ( void  )

Definition at line 224 of file uart.c.

References uart_init().

Here is the call graph for this function:

◆ uart_fill_lb()

void uart_fill_lb ( void data)

Definition at line 260 of file uart.c.

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

Here is the call graph for this function:

◆ uart_init()

void uart_init ( unsigned int  idx)

qcs405_uart_init - initializes UART

ipq40xx_uart_init - initializes UART

Initializes clocks, GPIO and UART controller.

Definition at line 201 of file uart.c.

References clock_configure_uart(), clock_enable_uart(), uart_params_t::dbg_uart_gpio, ipq_configure_gpio(), MSM_BOOT_UART_DM_CSR, msm_boot_uart_dm_init(), NO_OF_DBG_UART_GPIOS, read32(), uart_board_param, uart_params_t::uart_dm_base, and write32().

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

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
Initial value:
= {
.uart_dm_base = UART2_DM_BASE,
.blsp_uart = BLSP1_UART2,
.dbg_uart_gpio = {
{
.gpio = GPIO(17),
.func = 1,
.dir = GPIO_OUTPUT,
.pull = GPIO_PULL_UP,
.enable = GPIO_OUTPUT
},
{
.gpio = GPIO(18),
.func = 1,
.dir = GPIO_INPUT,
.pull = GPIO_NO_PULL,
.enable = GPIO_INPUT
},
},
}
#define GPIO_OUTPUT
Definition: gpio_ftns.h:23
#define GPIO_INPUT
Definition: gpio_ftns.h:24
@ GPIO
Definition: chip.h:84
@ GPIO_NO_PULL
Definition: gpio_common.h:62
@ BLSP1_UART2
Definition: iomap.h:82
#define UART2_DM_BASE
Definition: iomap.h:78
#define GPIO_PULL_UP
Definition: gpio.h:24

Definition at line 35 of file uart.c.

Referenced by uart_init(), and uart_tx_flush().