Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id 47BF8C433F5 for ; Mon, 10 Oct 2022 17:01:35 +0000 (UTC) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 7BDFC84E35; Mon, 10 Oct 2022 19:01:32 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=fail (p=none dis=none) header.from=arm.com 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 8263E84EEB; Mon, 10 Oct 2022 19:01:30 +0200 (CEST) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by phobos.denx.de (Postfix) with ESMTP id C87E18419C for ; Mon, 10 Oct 2022 19:01:27 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=arm.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=andre.przywara@arm.com Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id 724B511FB; Mon, 10 Oct 2022 10:01:33 -0700 (PDT) Received: from donnerap.arm.com (donnerap.cambridge.arm.com [10.1.197.42]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id 598C33F67D; Mon, 10 Oct 2022 10:01:26 -0700 (PDT) From: Andre Przywara To: Tom Rini , Tuomas Tynkkynen Cc: Simon Glass , Harrison Mutai , u-boot@lists.denx.de Subject: [PATCH 0/3] qemu: allow auto-booting through firmware device Date: Mon, 10 Oct 2022 18:01:19 +0100 Message-Id: <20221010170122.1527138-1-andre.przywara@arm.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 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.6 at phobos.denx.de X-Virus-Status: Clean Hi, when running QEMU and specifying both a firmware binary (--bios) and a kernel (-kernel) on the command line, QEMU will run the firmware, but will also record information about the provided kernel in the QEMU firmware device. U-Boot's "qfw" command can load the kernel to a provided address then. However using a kernel (and initrd) provided this way requires typing some rather generic commands. This series automates this, so that the default boot sequence tries to launch a kernel this way first. If that fails, we gracefully continue with the existing boot locations. This simplifies automated booting, with external firmware: $ qemu-system-aarch64 -machine virt,virtualization=on,gic-version=2 -cpu cortex-a57 -nographic -display none -d unimp --bios u-boot.bin -kernel Image -initrd initrd.gz -append "earlycon" The first two patches clean up some qfw issues, so that the automatic booting becomes smoother, while the third patch adds the new commands to QEMU's distro_boot script. Please have a look! Cheers, Andre Andre Przywara (3): qfw: store loaded file size in environment variable qfw: return failure when no kernel could be loaded qemu: Try to automatically boot from the QEMU firmware device (qfw) cmd/qfw.c | 6 ++++-- include/configs/qemu-arm.h | 12 ++++++++++++ 2 files changed, 16 insertions(+), 2 deletions(-) -- 2.25.1