From patchwork Sun Feb 27 17:03:52 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 1598381 X-Patchwork-Delegate: trini@ti.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=2a01:238:438b:c500:173d:9f52:ddab:ee01; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [IPv6:2a01:238:438b:c500:173d:9f52:ddab:ee01]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits)) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4K68xG33n9z9s8q for ; Mon, 28 Feb 2022 04:04:02 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4C8DA83BCD; Sun, 27 Feb 2022 18:03:57 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=csgraf.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Received: by phobos.denx.de (Postfix, from userid 109) id 79B0D83A78; Sun, 27 Feb 2022 18:03:56 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=unavailable autolearn_force=no version=3.4.2 Received: from zulu616.server4you.de (mail.csgraf.de [85.25.223.15]) by phobos.denx.de (Postfix) with ESMTP id A78CF83BCD for ; Sun, 27 Feb 2022 18:03:53 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=csgraf.de Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=agraf@csgraf.de Received: from localhost.localdomain (dynamic-095-118-033-200.95.118.pool.telefonica.de [95.118.33.200]) by csgraf.de (Postfix) with ESMTPSA id EE59F60805C6; Sun, 27 Feb 2022 18:03:52 +0100 (CET) From: Alexander Graf To: u-boot@lists.denx.de Cc: Tuomas Tynkkynen , Simon Glass , Mark Kettenis , Bin Meng , Asherah Connor , Heinrich Schuchardt , Anatolij Gustschin Subject: [PATCH 5/5] qemu-riscv: Enable ramfb by default Date: Sun, 27 Feb 2022 18:03:52 +0100 Message-Id: <20220227170352.49366-1-agraf@csgraf.de> X-Mailer: git-send-email 2.32.0 (Apple Git-132) In-Reply-To: <20220227144043.37359-1-agraf@csgraf.de> References: <20220227144043.37359-1-agraf@csgraf.de> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.39 Precedence: list List-Id: U-Boot discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: u-boot-bounces@lists.denx.de Sender: "U-Boot" X-Virus-Scanned: clamav-milter 0.103.5 at phobos.denx.de X-Virus-Status: Clean 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 --- 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 #include #include +#include #include #include #include @@ -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 #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