diff mbox

[v2,07/14] lpc-uart: add flush opal call handler

Message ID 1482213825-30448-8-git-send-email-oohall@gmail.com
State Superseded
Headers show

Commit Message

Oliver O'Halloran Dec. 20, 2016, 6:03 a.m. UTC
Define a driver specific flush opal call in preperation for removing
the con_ops->flush() operation.

Signed-off-by: Oliver O'Halloran <oohall@gmail.com>
---
 hw/lpc-uart.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

Andrew Donnellan Dec. 20, 2016, 7:24 a.m. UTC | #1
On 20/12/16 17:03, Oliver O'Halloran wrote:
> Define a driver specific flush opal call in preperation for removing

preparation

> the con_ops->flush() operation.
>
> Signed-off-by: Oliver O'Halloran <oohall@gmail.com>

Reviewed-by: Andrew Donnellan <andrew.donnellan@au1.ibm.com>

> ---
>  hw/lpc-uart.c | 9 +++++++++
>  1 file changed, 9 insertions(+)
>
> diff --git a/hw/lpc-uart.c b/hw/lpc-uart.c
> index f91bccf7c716..cc7f808bb920 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)
> @@ -449,6 +457,7 @@ void uart_setup_opal_console(void)
>  	opal_register(OPAL_CONSOLE_WRITE_BUFFER_SPACE,
>  		      uart_opal_write_buffer_space, 2);
>  	opal_register(OPAL_CONSOLE_WRITE, uart_opal_write, 3);
> +	opal_register(OPAL_CONSOLE_FLUSH, uart_opal_flush, 1);

This overrides the opal_call that's still in console.c, right? I assume 
that's how this works.
diff mbox

Patch

diff --git a/hw/lpc-uart.c b/hw/lpc-uart.c
index f91bccf7c716..cc7f808bb920 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)
@@ -449,6 +457,7 @@  void uart_setup_opal_console(void)
 	opal_register(OPAL_CONSOLE_WRITE_BUFFER_SPACE,
 		      uart_opal_write_buffer_space, 2);
 	opal_register(OPAL_CONSOLE_WRITE, uart_opal_write, 3);
+	opal_register(OPAL_CONSOLE_FLUSH, uart_opal_flush, 1);
 
 	opal_add_poller(uart_console_poll, NULL);
 }