iPXE
|
16550-compatible UART More...
Go to the source code of this file.
Macros | |
#define | UART_THRE_TIMEOUT_MS 100 |
Timeout for transmit holding register to become empty. More... | |
#define | UART_TEMT_TIMEOUT_MS 1000 |
Timeout for transmitter to become empty. More... | |
Functions | |
FILE_LICENCE (GPL2_OR_LATER_OR_UBDL) | |
void | uart_transmit (struct uart *uart, uint8_t data) |
Transmit data. More... | |
void | uart_flush (struct uart *uart) |
Flush data. More... | |
int | uart_exists (struct uart *uart) |
Check for existence of UART. More... | |
int | uart_init (struct uart *uart, unsigned int baud, uint8_t lcr) |
Initialise UART. More... | |
16550-compatible UART
Definition in file uart.c.
#define UART_THRE_TIMEOUT_MS 100 |
#define UART_TEMT_TIMEOUT_MS 1000 |
FILE_LICENCE | ( | GPL2_OR_LATER_OR_UBDL | ) |
Transmit data.
uart | UART |
data | Data |
Definition at line 48 of file uart.c.
References data, mdelay(), UART_LSR, UART_LSR_THRE, uart_read(), UART_THR, UART_THRE_TIMEOUT_MS, and uart_write().
Referenced by gdbserial_send(), int21(), and serial_putchar().
void uart_flush | ( | struct uart * | uart | ) |
Flush data.
uart | UART |
Definition at line 69 of file uart.c.
References UART_LSR, UART_LSR_DR, UART_LSR_TEMT, UART_RBR, uart_read(), and UART_TEMT_TIMEOUT_MS.
Referenced by serial_shutdown(), and uart_init().
int uart_exists | ( | struct uart * | uart | ) |
Check for existence of UART.
uart | UART |
rc | Return status code |
Definition at line 88 of file uart.c.
References uart::base, ENODEV, uart_read(), UART_SCR, and uart_write().
Referenced by uart_init(), and uart_select().
Initialise UART.
uart | UART |
baud | Baud rate, or zero to leave unchanged |
lcr | Line control register value, or zero to leave unchanged |
rc | Return status code |
Definition at line 113 of file uart.c.
References uart::divisor, uart::lcr, rc, UART_DLL, UART_DLM, uart_exists(), UART_FCR, UART_FCR_FE, uart_flush(), UART_IER, UART_LCR, UART_LCR_DLAB, UART_MAX_BAUD, UART_MCR, UART_MCR_DTR, UART_MCR_RTS, uart_read(), and uart_write().
Referenced by gdbserial_configure(), and serial_init().