mirror of
https://github.com/Fishwaldo/u-boot.git
synced 2025-03-19 05:31:32 +00:00
serial: uartlite: Add support for debug console
Add support for debug console. Signed-off-by: Michal Simek <michal.simek@xilinx.com> Reviewed-by: Thomas Chou <thomas@wytron.com.tw>
This commit is contained in:
parent
93768393d7
commit
4166ba3b23
2 changed files with 33 additions and 0 deletions
|
@ -112,6 +112,13 @@ config DEBUG_UART_S5P
|
||||||
will need to provide parameters to make this work. The driver will
|
will need to provide parameters to make this work. The driver will
|
||||||
be available until the real driver-model serial is running.
|
be available until the real driver-model serial is running.
|
||||||
|
|
||||||
|
config DEBUG_UART_UARTLITE
|
||||||
|
bool "Xilinx Uartlite"
|
||||||
|
help
|
||||||
|
Select this to enable a debug UART using the serial_uartlite driver.
|
||||||
|
You will need to provide parameters to make this work. The driver will
|
||||||
|
be available until the real driver-model serial is running.
|
||||||
|
|
||||||
config DEBUG_UART_ZYNQ
|
config DEBUG_UART_ZYNQ
|
||||||
bool "Xilinx Zynq"
|
bool "Xilinx Zynq"
|
||||||
help
|
help
|
||||||
|
|
|
@ -114,3 +114,29 @@ U_BOOT_DRIVER(serial_uartlite) = {
|
||||||
.ops = &uartlite_serial_ops,
|
.ops = &uartlite_serial_ops,
|
||||||
.flags = DM_FLAG_PRE_RELOC,
|
.flags = DM_FLAG_PRE_RELOC,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
#ifdef CONFIG_DEBUG_UART_UARTLITE
|
||||||
|
|
||||||
|
#include <debug_uart.h>
|
||||||
|
|
||||||
|
static inline void _debug_uart_init(void)
|
||||||
|
{
|
||||||
|
struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
|
||||||
|
|
||||||
|
out_be32(®s->control, 0);
|
||||||
|
out_be32(®s->control, ULITE_CONTROL_RST_RX | ULITE_CONTROL_RST_TX);
|
||||||
|
in_be32(®s->control);
|
||||||
|
}
|
||||||
|
|
||||||
|
static inline void _debug_uart_putc(int ch)
|
||||||
|
{
|
||||||
|
struct uartlite *regs = (struct uartlite *)CONFIG_DEBUG_UART_BASE;
|
||||||
|
|
||||||
|
while (in_be32(®s->status) & SR_TX_FIFO_FULL)
|
||||||
|
;
|
||||||
|
|
||||||
|
out_be32(®s->tx_fifo, ch & 0xff);
|
||||||
|
}
|
||||||
|
|
||||||
|
DEBUG_UART_FUNCS
|
||||||
|
#endif
|
||||||
|
|
Loading…
Add table
Reference in a new issue