From patchwork Sun Feb 27 14:40:43 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Graf X-Patchwork-Id: 1598328 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 4K65mz1917z9sG8 for ; Mon, 28 Feb 2022 01:41:39 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 0719D83C29; Sun, 27 Feb 2022 15:41:08 +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 3120183A6B; Sun, 27 Feb 2022 15:40: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 0906F83C2C for ; Sun, 27 Feb 2022 15:40:47 +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 7D47760806B9; Sun, 27 Feb 2022 15:40:46 +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 4/4] qemu-arm*: Enable ramfb by default Date: Sun, 27 Feb 2022 15:40:43 +0100 Message-Id: <20220227144043.37359-5-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 ARM 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 --- arch/arm/Kconfig | 4 ++++ board/emulation/qemu-arm/qemu-arm.c | 14 ++++++++++++++ include/configs/qemu-arm.h | 9 +++++++++ 3 files changed, 27 insertions(+) diff --git a/arch/arm/Kconfig b/arch/arm/Kconfig index 391a77c2b4..1f8b881c73 100644 --- a/arch/arm/Kconfig +++ b/arch/arm/Kconfig @@ -979,6 +979,10 @@ config ARCH_QEMU imply DM_RTC imply RTC_PL031 imply OF_HAS_PRIOR_STAGE + imply BOARD_EARLY_INIT_R + imply DM_VIDEO + imply VIDEO_RAMFB + imply SYS_CONSOLE_IS_IN_ENV config ARCH_RMOBILE bool "Renesas ARM SoCs" diff --git a/board/emulation/qemu-arm/qemu-arm.c b/board/emulation/qemu-arm/qemu-arm.c index 16d5a97167..c898ea8a14 100644 --- a/board/emulation/qemu-arm/qemu-arm.c +++ b/board/emulation/qemu-arm/qemu-arm.c @@ -9,6 +9,7 @@ #include #include #include +#include #include #include @@ -63,6 +64,19 @@ static struct mm_region qemu_arm64_mem_map[] = { struct mm_region *mem_map = qemu_arm64_mem_map; #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. + */ + qfw_get_dev(&qfw_dev); + + return 0; +} + int board_init(void) { return 0; diff --git a/include/configs/qemu-arm.h b/include/configs/qemu-arm.h index 7ae71e0029..ac67e89a98 100644 --- a/include/configs/qemu-arm.h +++ b/include/configs/qemu-arm.h @@ -58,6 +58,12 @@ BOOT_TARGET_NVME(func) \ BOOT_TARGET_DHCP(func) +#ifdef CONFIG_VIDEO_RAMFB +# define QEMU_STDOUT "serial,vidconsole" +#else +# define QEMU_STDOUT "serial" +#endif + #include #define CONFIG_EXTRA_ENV_SETTINGS \ @@ -68,6 +74,9 @@ "pxefile_addr_r=0x40300000\0" \ "kernel_addr_r=0x40400000\0" \ "ramdisk_addr_r=0x44000000\0" \ + "stdin=serial\0" \ + "stdout=" QEMU_STDOUT "\0" \ + "stderr=" QEMU_STDOUT "\0" \ BOOTENV #define CONFIG_SYS_CBSIZE 512