[PATCH 0/1] virtio: add driver for virtio_console devices

This is an implementation of single-character virtio-console. Part of the patch is based on barebox implementations.
To test the patch, we can build qemu_arm64_defconfig target. Enable CONFIG_VIRTIO_CONSOLE. And run qemu-system-aarch64 with -device virtio-serial-pci,id=virtio-serial0 \ -chardev file,id=charconsole0,path=/tmp/serialconsolelog \ -device virtconsole,chardev=charconsole0,id=console0 \
When in U-boot console, type "dm tree" and we should be able to see the virtio-console device.
A. Cody Schuffelen (1): virtio: add driver for virtio_console devices
drivers/virtio/Kconfig | 8 ++ drivers/virtio/Makefile | 1 + drivers/virtio/virtio-uclass.c | 1 + drivers/virtio/virtio_console.c | 158 ++++++++++++++++++++++++++++++++ include/virtio.h | 2 + 5 files changed, 170 insertions(+) create mode 100644 drivers/virtio/virtio_console.c

From: "A. Cody Schuffelen" schuffelen@google.com
This is an implementation of single-character virtio-console. Part of the patch is based on barebox implementations.
Signed-off-by: A. Cody Schuffelen schuffelen@google.com [ Paul: pick from the Android tree. Rebase to the upstream. Small fixes. ] Signed-off-by: Ying-Chun Liu (PaulLiu) paul.liu@linaro.org Link: https://android.googlesource.com/platform/external/u-boot/+/bc68da98ebf835a5... Link: https://git.pengutronix.de/cgit/barebox/tree/drivers/serial/virtio_console.c... Link: https://android.googlesource.com/platform/external/u-boot/+/4581f7c6e96d7332... Cc: Bin Meng bmeng.cn@gmail.com --- drivers/virtio/Kconfig | 8 ++ drivers/virtio/Makefile | 1 + drivers/virtio/virtio-uclass.c | 1 + drivers/virtio/virtio_console.c | 158 ++++++++++++++++++++++++++++++++ include/virtio.h | 2 + 5 files changed, 170 insertions(+) create mode 100644 drivers/virtio/virtio_console.c
diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig index 852f6735b6..94aaf70ab9 100644 --- a/drivers/virtio/Kconfig +++ b/drivers/virtio/Kconfig @@ -68,6 +68,14 @@ config VIRTIO_BLK This is the virtual block driver for virtio. It can be used with QEMU based targets.
+config VIRTIO_CONSOLE + bool "virtio console driver" + depends on VIRTIO + default y + help + This is the virtual console driver for virtio. It can be used + with QEMU based targets. + config VIRTIO_RNG bool "virtio rng driver" depends on DM_RNG diff --git a/drivers/virtio/Makefile b/drivers/virtio/Makefile index 4c63a6c690..c816f66aa6 100644 --- a/drivers/virtio/Makefile +++ b/drivers/virtio/Makefile @@ -10,4 +10,5 @@ obj-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o obj-$(CONFIG_VIRTIO_SANDBOX) += virtio_sandbox.o obj-$(CONFIG_VIRTIO_NET) += virtio_net.o obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o +obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o obj-$(CONFIG_VIRTIO_RNG) += virtio_rng.o diff --git a/drivers/virtio/virtio-uclass.c b/drivers/virtio/virtio-uclass.c index 31bb21c534..9c54c67572 100644 --- a/drivers/virtio/virtio-uclass.c +++ b/drivers/virtio/virtio-uclass.c @@ -30,6 +30,7 @@ static const char *const virtio_drv_name[VIRTIO_ID_MAX_NUM] = { [VIRTIO_ID_NET] = VIRTIO_NET_DRV_NAME, [VIRTIO_ID_BLOCK] = VIRTIO_BLK_DRV_NAME, + [VIRTIO_ID_CONSOLE] = VIRTIO_CONSOLE_DRV_NAME, [VIRTIO_ID_RNG] = VIRTIO_RNG_DRV_NAME, };
diff --git a/drivers/virtio/virtio_console.c b/drivers/virtio/virtio_console.c new file mode 100644 index 0000000000..1d4b319b08 --- /dev/null +++ b/drivers/virtio/virtio_console.c @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0+ +/* + * Copyright (C) 2018, Tuomas Tynkkynen tuomas.tynkkynen@iki.fi + * Copyright (C) 2018, Bin Meng bmeng.cn@gmail.com + * Copyright (C) 2006, 2007, 2009 Rusty Russell, IBM Corporation + * Copyright (C) 2009, 2010, 2011 Red Hat, Inc. + * Copyright (C) 2009, 2010, 2011 Amit Shah amit.shah@redhat.com + * Copyright (C) 2021 Ahmad Fatoum + * Copyright (C) 2021, Google LLC, schuffelen@google.com (A. Cody Schuffelen) + * Copyright (C) 2023, Linaro + */ + +#include <common.h> +#include <blk.h> +#include <dm.h> +#include <part.h> +#include <serial.h> +#include <virtio_types.h> +#include <virtio.h> +#include <virtio_ring.h> +#include "virtio_blk.h" + +struct virtio_console_priv { + struct virtqueue *receiveq_port0; + struct virtqueue *transmitq_port0; + unsigned char inbuf[1] __aligned(4); +}; + +static int virtio_console_bind(struct udevice *dev) +{ + struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(dev->parent); + + /* Indicate what driver features we support */ + virtio_driver_features_init(uc_priv, NULL, 0, NULL, 0); + + return 0; +} + +/* + * Create a scatter-gather list representing our input buffer and put + * it in the queue. + */ +static void add_inbuf(struct virtio_console_priv *priv) +{ + struct virtio_sg sg; + struct virtio_sg *sgs[1]; + int ret; + + sgs[0] = &sg; + sg.addr = priv->inbuf; + sg.length = sizeof(priv->inbuf); + + ret = virtqueue_add(priv->receiveq_port0, sgs, 0, 1); + /* We should always be able to add one buffer to an empty queue. */ + WARN(ret < 0, "%s: virtqueue_add failed\n", __func__); + + virtqueue_kick(priv->receiveq_port0); +} + +static int virtio_console_probe(struct udevice *dev) +{ + struct virtio_console_priv *priv = dev_get_priv(dev); + int ret; + + struct virtqueue *virtqueues[2]; + + ret = virtio_find_vqs(dev, 2, virtqueues); + if (ret < 0) { + debug("%s: virtio_find_vqs failed\n", __func__); + return ret; + } + + priv->receiveq_port0 = virtqueues[0]; + priv->transmitq_port0 = virtqueues[1]; + + /* Register the input buffer the first time. */ + add_inbuf(priv); + + return 0; +} + +static int virtio_console_serial_setbrg(struct udevice *dev, int baudrate) +{ + return 0; +} + +static int virtio_console_serial_pending(struct udevice *dev, bool input) +{ + struct virtio_console_priv *priv = dev_get_priv(dev); + + return virtqueue_poll(priv->receiveq_port0, + priv->receiveq_port0->last_used_idx); +} + +static int virtio_console_serial_getc(struct udevice *dev) +{ + struct virtio_console_priv *priv = dev_get_priv(dev); + unsigned char *in; + int ch; + unsigned int len = 0; + + in = virtqueue_get_buf(priv->receiveq_port0, &len); + if (!in) + return -EAGAIN; + + WARN(len != 1, "%s: too much data: %d\n", __func__, len); + + ch = *in; + + add_inbuf(priv); + + return ch; +} + +static int virtio_console_serial_putc(struct udevice *dev, const char ch) +{ + struct virtio_console_priv *priv = dev_get_priv(dev); + struct virtio_sg sg; + struct virtio_sg *sgs[1]; + unsigned char buf[1] __aligned(4); + int ret = 0; + + sg.addr = buf; + sg.length = sizeof(buf); + sgs[0] = &sg; + buf[0] = ch; + + ret = virtqueue_add(priv->transmitq_port0, sgs, 1, 0); + if (ret) { + debug("%s: virtqueue_add failed\n", __func__); + return ret; + } + + virtqueue_kick(priv->transmitq_port0); + + while (!virtqueue_get_buf(priv->transmitq_port0, NULL)) + ; + + return 0; +} + +static const struct dm_serial_ops virtio_console_serial_ops = { + .putc = virtio_console_serial_putc, + .pending = virtio_console_serial_pending, + .getc = virtio_console_serial_getc, + .setbrg = virtio_console_serial_setbrg, +}; + +U_BOOT_DRIVER(virtio_console) = { + .name = VIRTIO_CONSOLE_DRV_NAME, + .id = UCLASS_SERIAL, + .ops = &virtio_console_serial_ops, + .bind = virtio_console_bind, + .probe = virtio_console_probe, + .remove = virtio_reset, + .priv_auto = sizeof(struct virtio_console_priv), + .flags = DM_FLAG_ACTIVE_DMA, +}; diff --git a/include/virtio.h b/include/virtio.h index 062a24630c..e36dd41fd1 100644 --- a/include/virtio.h +++ b/include/virtio.h @@ -25,11 +25,13 @@ #include <linux/bug.h> #define VIRTIO_ID_NET 1 /* virtio net */ #define VIRTIO_ID_BLOCK 2 /* virtio block */ +#define VIRTIO_ID_CONSOLE 3 /* virtio console */ #define VIRTIO_ID_RNG 4 /* virtio rng */ #define VIRTIO_ID_MAX_NUM 5
#define VIRTIO_NET_DRV_NAME "virtio-net" #define VIRTIO_BLK_DRV_NAME "virtio-blk" +#define VIRTIO_CONSOLE_DRV_NAME "virtio-console" #define VIRTIO_RNG_DRV_NAME "virtio-rng"
/* Status byte for guest to report progress, and synchronize features */

Hello,
On 06.06.23 15:25, Ying-Chun Liu (PaulLiu) wrote:
From: "A. Cody Schuffelen" schuffelen@google.com
This is an implementation of single-character virtio-console. Part of the patch is based on barebox implementations.
Cool to see others found this useful. I had originally written this for the demo at https://barebox.org/jsbarebox/ :-)
Back then I had trouble getting more than one console to work, whether through multiport consoles or via having one virtio device per console. The original barebox source code has a comment about what I tried. Did you manage to resolve this limitation?
If not, you should add some check into your patch to prevent registering more than one console with the driver.
Cheers, Ahmad
Signed-off-by: A. Cody Schuffelen schuffelen@google.com [ Paul: pick from the Android tree. Rebase to the upstream. Small fixes. ] Signed-off-by: Ying-Chun Liu (PaulLiu) paul.liu@linaro.org Link: https://android.googlesource.com/platform/external/u-boot/+/bc68da98ebf835a5... Link: https://git.pengutronix.de/cgit/barebox/tree/drivers/serial/virtio_console.c... Link: https://android.googlesource.com/platform/external/u-boot/+/4581f7c6e96d7332... Cc: Bin Meng bmeng.cn@gmail.com
drivers/virtio/Kconfig | 8 ++ drivers/virtio/Makefile | 1 + drivers/virtio/virtio-uclass.c | 1 + drivers/virtio/virtio_console.c | 158 ++++++++++++++++++++++++++++++++ include/virtio.h | 2 + 5 files changed, 170 insertions(+) create mode 100644 drivers/virtio/virtio_console.c
diff --git a/drivers/virtio/Kconfig b/drivers/virtio/Kconfig index 852f6735b6..94aaf70ab9 100644 --- a/drivers/virtio/Kconfig +++ b/drivers/virtio/Kconfig @@ -68,6 +68,14 @@ config VIRTIO_BLK This is the virtual block driver for virtio. It can be used with QEMU based targets.
+config VIRTIO_CONSOLE
- bool "virtio console driver"
- depends on VIRTIO
- default y
- help
This is the virtual console driver for virtio. It can be used
with QEMU based targets.
config VIRTIO_RNG bool "virtio rng driver" depends on DM_RNG diff --git a/drivers/virtio/Makefile b/drivers/virtio/Makefile index 4c63a6c690..c816f66aa6 100644 --- a/drivers/virtio/Makefile +++ b/drivers/virtio/Makefile @@ -10,4 +10,5 @@ obj-$(CONFIG_VIRTIO_PCI_LEGACY) += virtio_pci_legacy.o obj-$(CONFIG_VIRTIO_SANDBOX) += virtio_sandbox.o obj-$(CONFIG_VIRTIO_NET) += virtio_net.o obj-$(CONFIG_VIRTIO_BLK) += virtio_blk.o +obj-$(CONFIG_VIRTIO_CONSOLE) += virtio_console.o obj-$(CONFIG_VIRTIO_RNG) += virtio_rng.o diff --git a/drivers/virtio/virtio-uclass.c b/drivers/virtio/virtio-uclass.c index 31bb21c534..9c54c67572 100644 --- a/drivers/virtio/virtio-uclass.c +++ b/drivers/virtio/virtio-uclass.c @@ -30,6 +30,7 @@ static const char *const virtio_drv_name[VIRTIO_ID_MAX_NUM] = { [VIRTIO_ID_NET] = VIRTIO_NET_DRV_NAME, [VIRTIO_ID_BLOCK] = VIRTIO_BLK_DRV_NAME,
- [VIRTIO_ID_CONSOLE] = VIRTIO_CONSOLE_DRV_NAME, [VIRTIO_ID_RNG] = VIRTIO_RNG_DRV_NAME,
};
diff --git a/drivers/virtio/virtio_console.c b/drivers/virtio/virtio_console.c new file mode 100644 index 0000000000..1d4b319b08 --- /dev/null +++ b/drivers/virtio/virtio_console.c @@ -0,0 +1,158 @@ +// SPDX-License-Identifier: GPL-2.0+ +/*
- Copyright (C) 2018, Tuomas Tynkkynen tuomas.tynkkynen@iki.fi
- Copyright (C) 2018, Bin Meng bmeng.cn@gmail.com
- Copyright (C) 2006, 2007, 2009 Rusty Russell, IBM Corporation
- Copyright (C) 2009, 2010, 2011 Red Hat, Inc.
- Copyright (C) 2009, 2010, 2011 Amit Shah amit.shah@redhat.com
- Copyright (C) 2021 Ahmad Fatoum
- Copyright (C) 2021, Google LLC, schuffelen@google.com (A. Cody Schuffelen)
- Copyright (C) 2023, Linaro
- */
+#include <common.h> +#include <blk.h> +#include <dm.h> +#include <part.h> +#include <serial.h> +#include <virtio_types.h> +#include <virtio.h> +#include <virtio_ring.h> +#include "virtio_blk.h"
+struct virtio_console_priv {
- struct virtqueue *receiveq_port0;
- struct virtqueue *transmitq_port0;
- unsigned char inbuf[1] __aligned(4);
+};
+static int virtio_console_bind(struct udevice *dev) +{
- struct virtio_dev_priv *uc_priv = dev_get_uclass_priv(dev->parent);
- /* Indicate what driver features we support */
- virtio_driver_features_init(uc_priv, NULL, 0, NULL, 0);
- return 0;
+}
+/*
- Create a scatter-gather list representing our input buffer and put
- it in the queue.
- */
+static void add_inbuf(struct virtio_console_priv *priv) +{
- struct virtio_sg sg;
- struct virtio_sg *sgs[1];
- int ret;
- sgs[0] = &sg;
- sg.addr = priv->inbuf;
- sg.length = sizeof(priv->inbuf);
- ret = virtqueue_add(priv->receiveq_port0, sgs, 0, 1);
- /* We should always be able to add one buffer to an empty queue. */
- WARN(ret < 0, "%s: virtqueue_add failed\n", __func__);
- virtqueue_kick(priv->receiveq_port0);
+}
+static int virtio_console_probe(struct udevice *dev) +{
- struct virtio_console_priv *priv = dev_get_priv(dev);
- int ret;
- struct virtqueue *virtqueues[2];
- ret = virtio_find_vqs(dev, 2, virtqueues);
- if (ret < 0) {
debug("%s: virtio_find_vqs failed\n", __func__);
return ret;
- }
- priv->receiveq_port0 = virtqueues[0];
- priv->transmitq_port0 = virtqueues[1];
- /* Register the input buffer the first time. */
- add_inbuf(priv);
- return 0;
+}
+static int virtio_console_serial_setbrg(struct udevice *dev, int baudrate) +{
- return 0;
+}
+static int virtio_console_serial_pending(struct udevice *dev, bool input) +{
- struct virtio_console_priv *priv = dev_get_priv(dev);
- return virtqueue_poll(priv->receiveq_port0,
priv->receiveq_port0->last_used_idx);
+}
+static int virtio_console_serial_getc(struct udevice *dev) +{
- struct virtio_console_priv *priv = dev_get_priv(dev);
- unsigned char *in;
- int ch;
- unsigned int len = 0;
- in = virtqueue_get_buf(priv->receiveq_port0, &len);
- if (!in)
return -EAGAIN;
- WARN(len != 1, "%s: too much data: %d\n", __func__, len);
- ch = *in;
- add_inbuf(priv);
- return ch;
+}
+static int virtio_console_serial_putc(struct udevice *dev, const char ch) +{
- struct virtio_console_priv *priv = dev_get_priv(dev);
- struct virtio_sg sg;
- struct virtio_sg *sgs[1];
- unsigned char buf[1] __aligned(4);
- int ret = 0;
- sg.addr = buf;
- sg.length = sizeof(buf);
- sgs[0] = &sg;
- buf[0] = ch;
- ret = virtqueue_add(priv->transmitq_port0, sgs, 1, 0);
- if (ret) {
debug("%s: virtqueue_add failed\n", __func__);
return ret;
- }
- virtqueue_kick(priv->transmitq_port0);
- while (!virtqueue_get_buf(priv->transmitq_port0, NULL))
;
- return 0;
+}
+static const struct dm_serial_ops virtio_console_serial_ops = {
- .putc = virtio_console_serial_putc,
- .pending = virtio_console_serial_pending,
- .getc = virtio_console_serial_getc,
- .setbrg = virtio_console_serial_setbrg,
+};
+U_BOOT_DRIVER(virtio_console) = {
- .name = VIRTIO_CONSOLE_DRV_NAME,
- .id = UCLASS_SERIAL,
- .ops = &virtio_console_serial_ops,
- .bind = virtio_console_bind,
- .probe = virtio_console_probe,
- .remove = virtio_reset,
- .priv_auto = sizeof(struct virtio_console_priv),
- .flags = DM_FLAG_ACTIVE_DMA,
+}; diff --git a/include/virtio.h b/include/virtio.h index 062a24630c..e36dd41fd1 100644 --- a/include/virtio.h +++ b/include/virtio.h @@ -25,11 +25,13 @@ #include <linux/bug.h> #define VIRTIO_ID_NET 1 /* virtio net */ #define VIRTIO_ID_BLOCK 2 /* virtio block */ +#define VIRTIO_ID_CONSOLE 3 /* virtio console */ #define VIRTIO_ID_RNG 4 /* virtio rng */ #define VIRTIO_ID_MAX_NUM 5
#define VIRTIO_NET_DRV_NAME "virtio-net" #define VIRTIO_BLK_DRV_NAME "virtio-blk" +#define VIRTIO_CONSOLE_DRV_NAME "virtio-console" #define VIRTIO_RNG_DRV_NAME "virtio-rng"
/* Status byte for guest to report progress, and synchronize features */

Hi,
On Tue, Jun 6, 2023 at 9:26 PM Ying-Chun Liu (PaulLiu) paulliu@debian.org wrote:
This is an implementation of single-character virtio-console. Part of the patch is based on barebox implementations.
To test the patch, we can build qemu_arm64_defconfig target. Enable CONFIG_VIRTIO_CONSOLE. And run qemu-system-aarch64 with -device virtio-serial-pci,id=virtio-serial0 \ -chardev file,id=charconsole0,path=/tmp/serialconsolelog \ -device virtconsole,chardev=charconsole0,id=console0 \
With this command, it still uses the on-board UART but not virtio-console. Would you please post test instructions on using virtio-console as the U-Boot serial console? Thanks!
When in U-boot console, type "dm tree" and we should be able to see the virtio-console device.
A. Cody Schuffelen (1): virtio: add driver for virtio_console devices
drivers/virtio/Kconfig | 8 ++ drivers/virtio/Makefile | 1 + drivers/virtio/virtio-uclass.c | 1 + drivers/virtio/virtio_console.c | 158 ++++++++++++++++++++++++++++++++ include/virtio.h | 2 + 5 files changed, 170 insertions(+) create mode 100644 drivers/virtio/virtio_console.c
--
Regards, Bin

On 2023/6/9 17:27, Bin Meng wrote:
Hi,
On Tue, Jun 6, 2023 at 9:26 PM Ying-Chun Liu (PaulLiu) paulliu@debian.org wrote:
This is an implementation of single-character virtio-console. Part of the patch is based on barebox implementations.
To test the patch, we can build qemu_arm64_defconfig target. Enable CONFIG_VIRTIO_CONSOLE. And run qemu-system-aarch64 with -device virtio-serial-pci,id=virtio-serial0 \ -chardev file,id=charconsole0,path=/tmp/serialconsolelog \ -device virtconsole,chardev=charconsole0,id=console0 \
With this command, it still uses the on-board UART but not virtio-console. Would you please post test instructions on using virtio-console as the U-Boot serial console? Thanks!
Hi Bin,
Yes. The way to test this is. I compile U-boot for qemu_arm64_defconfig Enable the following configs manually. CONFIG_VIRTIO_CONSOLE=y CONFIG_CONSOLE_MUX=y CONFIG_SYS_CONSOLE_IS_IN_ENV=y
Now run qemu with the following commands. qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic \ -device virtio-serial-pci,id=virtio-serial0 \ -chardev file,id=charconsole0,path=/tmp/serialconsolelog \ -device virtconsole,chardev=charconsole0,id=console0 \ -bios /tmp/uboot-qemu-clang/u-boot.bin
In U-boot prompt, we run 1. virtio scan 2. coninfo In coninfo, we can see there is a new console device called virtio-console#XX Then. 3. setenv stdout pl011@9000000,virtio-console#XX And then all the output will also be output to /tmp/serialconsolelog on host.
This is the minimum example of testing the driver. If we want to test it more then we might need to modify the -chardev to not use a file. For example, we can use a telnet server. -chardev socket,id=charconsole0,host=127.0.0.1,port=10023,telnet=on,server
After set stdin and stdout to pl011@9000000,virtio-console#XX We can use "telnet localhost 10023" to access the U-boot prompt in qemu.
Yours, Paul

Hi Paul,
On Wed, Jun 14, 2023 at 1:36 AM Ying-Chun Liu (PaulLiu) paul.liu@linaro.org wrote:
On 2023/6/9 17:27, Bin Meng wrote:
Hi,
On Tue, Jun 6, 2023 at 9:26 PM Ying-Chun Liu (PaulLiu) paulliu@debian.org wrote:
This is an implementation of single-character virtio-console. Part of the patch is based on barebox implementations.
To test the patch, we can build qemu_arm64_defconfig target. Enable CONFIG_VIRTIO_CONSOLE. And run qemu-system-aarch64 with -device virtio-serial-pci,id=virtio-serial0 \ -chardev file,id=charconsole0,path=/tmp/serialconsolelog \ -device virtconsole,chardev=charconsole0,id=console0 \
With this command, it still uses the on-board UART but not virtio-console. Would you please post test instructions on using virtio-console as the U-Boot serial console? Thanks!
Hi Bin,
Yes. The way to test this is. I compile U-boot for qemu_arm64_defconfig Enable the following configs manually. CONFIG_VIRTIO_CONSOLE=y CONFIG_CONSOLE_MUX=y CONFIG_SYS_CONSOLE_IS_IN_ENV=y
Now run qemu with the following commands. qemu-system-aarch64 -machine virt -cpu cortex-a57 -nographic \ -device virtio-serial-pci,id=virtio-serial0 \ -chardev file,id=charconsole0,path=/tmp/serialconsolelog \ -device virtconsole,chardev=charconsole0,id=console0 \ -bios /tmp/uboot-qemu-clang/u-boot.bin
In U-boot prompt, we run
- virtio scan
- coninfo
In coninfo, we can see there is a new console device called virtio-console#XX Then. 3. setenv stdout pl011@9000000,virtio-console#XX And then all the output will also be output to /tmp/serialconsolelog on host.
This is the minimum example of testing the driver. If we want to test it more then we might need to modify the -chardev to not use a file. For example, we can use a telnet server. -chardev socket,id=charconsole0,host=127.0.0.1,port=10023,telnet=on,server
After set stdin and stdout to pl011@9000000,virtio-console#XX We can use "telnet localhost 10023" to access the U-boot prompt in qemu.
Thanks for the instructions. Is it possible to test the virtio-console driver as the U-Boot boot console?
I suspect we need to add the DM_FLAG_PRE_RELOC flag here and there in the virtio subsystem?
Regards, Bin
participants (4)
-
Ahmad Fatoum
-
Bin Meng
-
Ying-Chun Liu (PaulLiu)
-
Ying-Chun Liu (PaulLiu)