coreboot
coreboot is an Open Source project aimed at replacing the proprietary BIOS found in most computers.
qupv3_uart.c File Reference
#include <assert.h>
#include <boot/coreboot_tables.h>
#include <console/uart.h>
#include <soc/clock.h>
#include <soc/qcom_qup_se.h>
#include <soc/qup_se_handlers_common.h>
#include <soc/qupv3_config_common.h>
#include <types.h>
Include dependency graph for qupv3_uart.c:

Go to the source code of this file.

Macros

#define GENI_STATUS_M_GENI_CMD_ACTIVE_MASK   0x1
 
#define GENI_STATUS_S_GENI_CMD_ACTIVE_MASK   0x1000
 
#define UART_TX_WATERMARK_MARGIN   4 /* Represented in words */
 
#define UART_RX_WATERMARK_MARGIN   8 /* Represented in words */
 
#define UART_RX_RFR_WATERMARK_MARGIN   4 /* Represented in words */
 
#define UART_TX_BITS_PER_WORD   8
 
#define UART_RX_BITS_PER_WORD   8
 
#define START_UART_TX   0x8000000
 
#define START_UART_RX   0x8000000
 
#define UART_TX_PACK_VECTOR0   0x0E
 
#define UART_TX_PACK_VECTOR1   0x10E
 
#define UART_TX_PACK_VECTOR2   0x20E
 
#define UART_TX_PACK_VECTOR3   0x30F
 
#define UART_RX_PACK_VECTOR0   0xF
 
#define UART_RX_PACK_VECTOR2   0x00
 

Functions

void uart_tx_flush (unsigned int idx)
 
void uart_init (unsigned int idx)
 
unsigned char uart_rx_byte (unsigned int idx)
 
void uart_tx_byte (unsigned int idx, unsigned char data)
 
uintptr_t uart_platform_base (unsigned int idx)
 
void uart_fill_lb (void *data)
 

Macro Definition Documentation

◆ GENI_STATUS_M_GENI_CMD_ACTIVE_MASK

#define GENI_STATUS_M_GENI_CMD_ACTIVE_MASK   0x1

Definition at line 14 of file qupv3_uart.c.

◆ GENI_STATUS_S_GENI_CMD_ACTIVE_MASK

#define GENI_STATUS_S_GENI_CMD_ACTIVE_MASK   0x1000

Definition at line 15 of file qupv3_uart.c.

◆ START_UART_RX

#define START_UART_RX   0x8000000

Definition at line 23 of file qupv3_uart.c.

◆ START_UART_TX

#define START_UART_TX   0x8000000

Definition at line 22 of file qupv3_uart.c.

◆ UART_RX_BITS_PER_WORD

#define UART_RX_BITS_PER_WORD   8

Definition at line 21 of file qupv3_uart.c.

◆ UART_RX_PACK_VECTOR0

#define UART_RX_PACK_VECTOR0   0xF

Definition at line 35 of file qupv3_uart.c.

◆ UART_RX_PACK_VECTOR2

#define UART_RX_PACK_VECTOR2   0x00

Definition at line 36 of file qupv3_uart.c.

◆ UART_RX_RFR_WATERMARK_MARGIN

#define UART_RX_RFR_WATERMARK_MARGIN   4 /* Represented in words */

Definition at line 19 of file qupv3_uart.c.

◆ UART_RX_WATERMARK_MARGIN

#define UART_RX_WATERMARK_MARGIN   8 /* Represented in words */

Definition at line 18 of file qupv3_uart.c.

◆ UART_TX_BITS_PER_WORD

#define UART_TX_BITS_PER_WORD   8

Definition at line 20 of file qupv3_uart.c.

◆ UART_TX_PACK_VECTOR0

#define UART_TX_PACK_VECTOR0   0x0E

Definition at line 27 of file qupv3_uart.c.

◆ UART_TX_PACK_VECTOR1

#define UART_TX_PACK_VECTOR1   0x10E

Definition at line 29 of file qupv3_uart.c.

◆ UART_TX_PACK_VECTOR2

#define UART_TX_PACK_VECTOR2   0x20E

Definition at line 31 of file qupv3_uart.c.

◆ UART_TX_PACK_VECTOR3

#define UART_TX_PACK_VECTOR3   0x30F

Definition at line 33 of file qupv3_uart.c.

◆ UART_TX_WATERMARK_MARGIN

#define UART_TX_WATERMARK_MARGIN   4 /* Represented in words */

Definition at line 17 of file qupv3_uart.c.

Function Documentation

◆ uart_fill_lb()

void uart_fill_lb ( void data)

Definition at line 143 of file qupv3_uart.c.

References get_uart_baudrate(), lb_add_serial(), LB_SERIAL_TYPE_MEMORY_MAPPED, serial, SRC_XO_HZ, and uart_platform_base().

Here is the call graph for this function:

◆ uart_init()

◆ uart_platform_base()

uintptr_t uart_platform_base ( unsigned int  idx)

Definition at line 138 of file qupv3_uart.c.

References qup::regs.

Referenced by uart_fill_lb().

Here is the caller graph for this function:

◆ uart_rx_byte()

unsigned char uart_rx_byte ( unsigned int  idx)

Definition at line 117 of file qupv3_uart.c.

References read32(), qup::regs, and RX_FIFO_WC_MSK.

Here is the call graph for this function:

◆ uart_tx_byte()

void uart_tx_byte ( unsigned int  idx,
unsigned char  data 
)

Definition at line 126 of file qupv3_uart.c.

References qup::regs, START_UART_TX, uart_tx_flush(), and write32().

Here is the call graph for this function:

◆ uart_tx_flush()

void uart_tx_flush ( unsigned int  idx)

Definition at line 38 of file qupv3_uart.c.

References GENI_STATUS_M_GENI_CMD_ACTIVE_MASK, read32(), and qup::regs.

Referenced by uart_tx_byte().

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