diff options
author | Oliver O'Halloran <oohall@gmail.com> | 2016-12-21 15:52:29 +1100 |
---|---|---|
committer | Stewart Smith <stewart@linux.vnet.ibm.com> | 2017-01-04 17:15:34 +1100 |
commit | 6f7bd78463e051dad239b349caf5dd641e2a4dd7 (patch) | |
tree | 42cc3630d9309c1f88a3beb411fcce7f4289493b /hw | |
parent | aa586d259b58c676d0d90f9981671438442eadbe (diff) | |
download | skiboot-6f7bd78463e051dad239b349caf5dd641e2a4dd7.zip skiboot-6f7bd78463e051dad239b349caf5dd641e2a4dd7.tar.gz skiboot-6f7bd78463e051dad239b349caf5dd641e2a4dd7.tar.bz2 |
console: add opal_con_ops structure
Adds a separate structure to house the operations for the OPAL console.
This is used to define a new API for dealing with the OPAL console in
the next patch.
Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>
Signed-off-by: Stewart Smith <stewart@linux.vnet.ibm.com>
Diffstat (limited to 'hw')
-rw-r--r-- | hw/fsp/fsp-console.c | 15 | ||||
-rw-r--r-- | hw/lpc-uart.c | 17 |
2 files changed, 32 insertions, 0 deletions
diff --git a/hw/fsp/fsp-console.c b/hw/fsp/fsp-console.c index 8fd18d1..8589e8c 100644 --- a/hw/fsp/fsp-console.c +++ b/hw/fsp/fsp-console.c @@ -818,6 +818,21 @@ void fsp_console_init(void) op_display(OP_LOG, OP_MOD_FSPCON, 0x0005); } +static int64_t fsp_console_flush(int64_t terminal __unused) +{ + /* FIXME: There's probably something we can do here... */ + return OPAL_PARAMETER; +} + +struct opal_con_ops fsp_opal_con = { + .name = "FSP OPAL console", + .init = NULL, /* all the required setup is done in fsp_console_init() */ + .read = fsp_console_read, + .write = fsp_console_write, + .space = fsp_console_write_buffer_space, + .flush = fsp_console_flush, +}; + static void flush_all_input(void) { unsigned int i; 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; |