[PATCH 10/18] riscv: qemu: Enable Bochs video support

Bin Meng bmeng at tinylab.org
Sun Jul 23 06:40:33 CEST 2023


Enable video console using the emulated Bochs VGA card.

Signed-off-by: Bin Meng <bmeng at tinylab.org>
---

 board/emulation/qemu-riscv/Kconfig | 3 +++
 doc/board/emulation/qemu-riscv.rst | 5 +++++
 include/configs/qemu-riscv.h       | 5 +++++
 3 files changed, 13 insertions(+)

diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig
index 6114e1b812..976c350e50 100644
--- a/board/emulation/qemu-riscv/Kconfig
+++ b/board/emulation/qemu-riscv/Kconfig
@@ -68,5 +68,8 @@ config BOARD_SPECIFIC_OPTIONS # dummy
 	imply MTD_NOR_FLASH
 	imply CFI_FLASH
 	imply OF_HAS_PRIOR_STAGE
+	imply VIDEO
+	imply VIDEO_BOCHS
+	imply SYS_WHITE_ON_BLACK
 
 endif
diff --git a/doc/board/emulation/qemu-riscv.rst b/doc/board/emulation/qemu-riscv.rst
index 509bf7c4a6..9d21f3270c 100644
--- a/doc/board/emulation/qemu-riscv.rst
+++ b/doc/board/emulation/qemu-riscv.rst
@@ -133,6 +133,11 @@ An attached disk can be emulated in RISC-V virt machine by adding::
 
 You will have to run 'scsi scan' to use it.
 
+A video console can be emulated in RISC-V virt machine by removing "-nographic"
+and adding::
+
+    -serial stdio -device VGA
+
 Running with KVM
 ----------------
 
diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
index f6d326bda0..7ec3d12ce1 100644
--- a/include/configs/qemu-riscv.h
+++ b/include/configs/qemu-riscv.h
@@ -17,6 +17,10 @@
 
 /* Environment options */
 
+#define CFG_STD_DEVICES_SETTINGS	"stdin=serial\0" \
+					"stdout=serial,vidconsole\0" \
+					"stderr=serial,vidconsole\0"
+
 #define BOOT_TARGET_DEVICES(func) \
 	func(QEMU, qemu, na) \
 	func(VIRTIO, virtio, 0) \
@@ -35,6 +39,7 @@
 	"qemu "
 
 #define CFG_EXTRA_ENV_SETTINGS \
+	CFG_STD_DEVICES_SETTINGS \
 	"fdt_high=0xffffffffffffffff\0" \
 	"initrd_high=0xffffffffffffffff\0" \
 	"kernel_addr_r=0x84000000\0" \
-- 
2.34.1



More information about the U-Boot mailing list