aboutsummaryrefslogtreecommitdiff
path: root/hw/lpc-uart.c
diff options
context:
space:
mode:
Diffstat (limited to 'hw/lpc-uart.c')
-rw-r--r--hw/lpc-uart.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/hw/lpc-uart.c b/hw/lpc-uart.c
index 2383ff5..cc1c165 100644
--- a/hw/lpc-uart.c
+++ b/hw/lpc-uart.c
@@ -375,6 +375,14 @@ static int64_t uart_opal_read(int64_t term_number, int64_t *length,
return OPAL_SUCCESS;
}
+static int64_t uart_opal_flush(int64_t term_number)
+{
+ if (term_number != 0)
+ return OPAL_PARAMETER;
+
+ return uart_con_flush();
+}
+
static void __uart_do_poll(u8 trace_ctx)
{
if (!in_buf)
@@ -453,6 +461,15 @@ void uart_setup_opal_console(void)
opal_add_poller(uart_console_poll, NULL);
}
+struct opal_con_ops uart_opal_con = {
+ .name = "OPAL UART console",
+ .init = uart_setup_opal_console,
+ .read = uart_opal_read,
+ .write = uart_opal_write,
+ .space = uart_opal_write_buffer_space,
+ .flush = uart_opal_flush,
+};
+
static bool uart_init_hw(unsigned int speed, unsigned int clock)
{
unsigned int dll = (clock / 16) / speed;