diff mbox

board-qemu: Add a possibility to use hvterm input instead of USB keyboard

Message ID 1478781503-4579-1-git-send-email-thuth@redhat.com
State Accepted
Headers show

Commit Message

Thomas Huth Nov. 10, 2016, 12:38 p.m. UTC
SLOF automatically switches to USB keyboard input when it detects that
a graphics card and USB keyboard are available. However, for debugging
VGA or USB related issues, or running QEMU with the "-nographic" parameter,
it's more convenient to continue using the hvterm as input.
This patch adds the possibility to continue using hvterm if the user
sets the "direct-serial?" NVRAM variable to true. "direct-serial?" is
currently unused for board-qemu -- it's only used on board-js2x so far
for switching the serial ports there, so using this variable for
selecting the serial input on board-qemu seems to be a good fit, too.

Signed-off-by: Thomas Huth <thuth@redhat.com>
---
 Note: With the latest QEMU version from the master branch, it is
 possible to set NVRAM variables from the command line now, so this
 can now be configured like this:
  qemu-system-ppc64 .... -prom-env "direct-serial?=true"

 board-qemu/slof/OF.fs | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

Comments

Alexey Kardashevskiy Nov. 15, 2016, 2:32 a.m. UTC | #1
On 10/11/16 23:38, Thomas Huth wrote:
> SLOF automatically switches to USB keyboard input when it detects that
> a graphics card and USB keyboard are available. However, for debugging
> VGA or USB related issues, or running QEMU with the "-nographic" parameter,
> it's more convenient to continue using the hvterm as input.
> This patch adds the possibility to continue using hvterm if the user
> sets the "direct-serial?" NVRAM variable to true. "direct-serial?" is
> currently unused for board-qemu -- it's only used on board-js2x so far
> for switching the serial ports there, so using this variable for
> selecting the serial input on board-qemu seems to be a good fit, too.
> 

Thanks, applied.

> Signed-off-by: Thomas Huth <thuth@redhat.com>
> ---
>  Note: With the latest QEMU version from the master branch, it is
>  possible to set NVRAM variables from the command line now, so this
>  can now be configured like this:
>   qemu-system-ppc64 .... -prom-env "direct-serial?=true"
> 
>  board-qemu/slof/OF.fs | 13 ++++++++++---
>  1 file changed, 10 insertions(+), 3 deletions(-)
> 
> diff --git a/board-qemu/slof/OF.fs b/board-qemu/slof/OF.fs
> index 1406506..5959003 100644
> --- a/board-qemu/slof/OF.fs
> +++ b/board-qemu/slof/OF.fs
> @@ -231,9 +231,16 @@ romfs-base 400000 0 ' claim CATCH IF ." claim failed!" cr 2drop THEN drop
>          " screen" find-alias dup IF nip THEN
>          " keyboard" find-alias dup IF nip THEN
>          AND IF
> -            ." using screen & keyboard" cr
> -            " screen" output
> -            " keyboard" input
> +            ." using screen "
> +            s" direct-serial?" evaluate IF
> +                ." & hvterm"
> +                s" hvterm" input
> +            ELSE
> +                ." & keyboard"
> +                s" keyboard" input
> +            THEN
> +            cr
> +            s" screen" output
>          ELSE
>              " hvterm" find-alias IF
>                  drop
>
diff mbox

Patch

diff --git a/board-qemu/slof/OF.fs b/board-qemu/slof/OF.fs
index 1406506..5959003 100644
--- a/board-qemu/slof/OF.fs
+++ b/board-qemu/slof/OF.fs
@@ -231,9 +231,16 @@  romfs-base 400000 0 ' claim CATCH IF ." claim failed!" cr 2drop THEN drop
         " screen" find-alias dup IF nip THEN
         " keyboard" find-alias dup IF nip THEN
         AND IF
-            ." using screen & keyboard" cr
-            " screen" output
-            " keyboard" input
+            ." using screen "
+            s" direct-serial?" evaluate IF
+                ." & hvterm"
+                s" hvterm" input
+            ELSE
+                ." & keyboard"
+                s" keyboard" input
+            THEN
+            cr
+            s" screen" output
         ELSE
             " hvterm" find-alias IF
                 drop