From: Alexander Graf <agraf@csgraf.de>
To: u-boot@lists.denx.de
Cc: Tuomas Tynkkynen <tuomas.tynkkynen@iki.fi>,
Simon Glass <sjg@chromium.org>,
Mark Kettenis <mark.kettenis@xs4all.nl>,
Bin Meng <bmeng.cn@gmail.com>, Asherah Connor <ashe@kivikakk.ee>,
Heinrich Schuchardt <xypron.glpk@gmx.de>,
Anatolij Gustschin <agust@denx.de>
Subject: [PATCH 5/5] qemu-riscv: Enable ramfb by default
Date: Sun, 27 Feb 2022 18:03:52 +0100 [thread overview]
Message-ID: <20220227170352.49366-1-agraf@csgraf.de> (raw)
In-Reply-To: <20220227144043.37359-1-agraf@csgraf.de>
Now that we have everything in place to support ramfb, let's wire it up
by default in the RISC-V QEMU targets. That way, you can easily use a
graphical console by just passing -device ramfb to the QEMU command line.
Signed-off-by: Alexander Graf <agraf@csgraf.de>
---
board/emulation/qemu-riscv/Kconfig | 6 ++++++
board/emulation/qemu-riscv/qemu-riscv.c | 15 +++++++++++++++
include/configs/qemu-riscv.h | 9 +++++++++
3 files changed, 30 insertions(+)
diff --git a/board/emulation/qemu-riscv/Kconfig b/board/emulation/qemu-riscv/Kconfig
index 02bf84725b..1967fb3a63 100644
--- a/board/emulation/qemu-riscv/Kconfig
+++ b/board/emulation/qemu-riscv/Kconfig
@@ -67,5 +67,11 @@ config BOARD_SPECIFIC_OPTIONS # dummy
imply MTD_NOR_FLASH
imply CFI_FLASH
imply OF_HAS_PRIOR_STAGE
+ imply BOARD_EARLY_INIT_R
+ imply DM_VIDEO
+ imply VIDEO_RAMFB
+ imply SYS_CONSOLE_IS_IN_ENV
+ imply CMD_QFW
+ imply QFW_MMIO
endif
diff --git a/board/emulation/qemu-riscv/qemu-riscv.c b/board/emulation/qemu-riscv/qemu-riscv.c
index ae3b7a3295..31799b8c3a 100644
--- a/board/emulation/qemu-riscv/qemu-riscv.c
+++ b/board/emulation/qemu-riscv/qemu-riscv.c
@@ -10,6 +10,7 @@
#include <fdtdec.h>
#include <image.h>
#include <log.h>
+#include <qfw.h>
#include <spl.h>
#include <init.h>
#include <virtio_types.h>
@@ -28,6 +29,20 @@ int is_flash_available(void)
}
#endif
+int board_early_init_r(void)
+{
+ struct udevice *qfw_dev;
+
+ /*
+ * Make sure we enumerate the QEMU Firmware device to find ramfb
+ * before console init starts.
+ */
+ if (IS_ENABLED(CONFIG_CMD_QFW))
+ qfw_get_dev(&qfw_dev);
+
+ return 0;
+}
+
int board_init(void)
{
/*
diff --git a/include/configs/qemu-riscv.h b/include/configs/qemu-riscv.h
index 618c3b63d4..663ba50688 100644
--- a/include/configs/qemu-riscv.h
+++ b/include/configs/qemu-riscv.h
@@ -39,6 +39,12 @@
func(SCSI, scsi, 0) \
func(DHCP, dhcp, na)
+#ifdef CONFIG_VIDEO_RAMFB
+# define QEMU_STDOUT "serial,vidconsole"
+#else
+# define QEMU_STDOUT "serial"
+#endif
+
#include <config_distro_bootcmd.h>
#define BOOTENV_DEV_QEMU(devtypeu, devtypel, instance) \
@@ -58,6 +64,9 @@
"scriptaddr=0x88100000\0" \
"pxefile_addr_r=0x88200000\0" \
"ramdisk_addr_r=0x88300000\0" \
+ "stdin=serial\0" \
+ "stdout=" QEMU_STDOUT "\0" \
+ "stderr=" QEMU_STDOUT "\0" \
BOOTENV
#endif
--
2.32.0
prev parent reply other threads:[~2022-02-27 17:03 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-02-27 14:40 [PATCH 0/4] Add support for QEMU's ramfb display Alexander Graf
2022-02-27 14:40 ` [PATCH 1/4] qfw: Add WRITE definition Alexander Graf
2022-03-12 2:25 ` Simon Glass
2022-02-27 14:40 ` [PATCH 2/4] ramfb: Add driver for ramfb display Alexander Graf
2022-03-12 2:25 ` Simon Glass
2022-02-27 14:40 ` [PATCH 3/4] qfw: Spawn ramfb device if its file is present Alexander Graf
2022-02-27 14:40 ` [PATCH 4/4] qemu-arm*: Enable ramfb by default Alexander Graf
2022-02-27 15:35 ` [PATCH 0/4] Add support for QEMU's ramfb display Heinrich Schuchardt
2022-02-27 17:05 ` Alexander Graf
2022-02-27 17:03 ` Alexander Graf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220227170352.49366-1-agraf@csgraf.de \
--to=agraf@csgraf.de \
--cc=agust@denx.de \
--cc=ashe@kivikakk.ee \
--cc=bmeng.cn@gmail.com \
--cc=mark.kettenis@xs4all.nl \
--cc=sjg@chromium.org \
--cc=tuomas.tynkkynen@iki.fi \
--cc=u-boot@lists.denx.de \
--cc=xypron.glpk@gmx.de \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox