From patchwork Sat Jul 22 11:10:33 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Heinrich Schuchardt X-Patchwork-Id: 1811245 X-Patchwork-Delegate: uboot@andestech.com Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@legolas.ozlabs.org Authentication-Results: legolas.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=) Authentication-Results: legolas.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.a=rsa-sha256 header.s=20210705 header.b=LIf99RDW; dkim-atps=neutral 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 ECDSA (P-384) server-digest SHA384) (No client certificate requested) by legolas.ozlabs.org (Postfix) with ESMTPS id 4R7NyJ0Vysz1yYc for ; Sat, 22 Jul 2023 21:10:47 +1000 (AEST) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 3A3C98469B; Sat, 22 Jul 2023 13:10:44 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=pass (2048-bit key; unprotected) header.d=canonical.com header.i=@canonical.com header.b="LIf99RDW"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id 31E33846EE; Sat, 22 Jul 2023 13:10:43 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on phobos.denx.de X-Spam-Level: X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE autolearn=ham autolearn_force=no version=3.4.2 Received: from smtp-relay-canonical-1.canonical.com (smtp-relay-canonical-1.canonical.com [185.125.188.121]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id F40F184698 for ; Sat, 22 Jul 2023 13:10:40 +0200 (CEST) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=canonical.com Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=heinrich.schuchardt@canonical.com Received: from workstation5.fritz.box (ip-062-143-244-162.um16.pools.vodafone-ip.de [62.143.244.162]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by smtp-relay-canonical-1.canonical.com (Postfix) with ESMTPSA id 1425241E38; Sat, 22 Jul 2023 11:10:40 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=canonical.com; s=20210705; t=1690024240; bh=5jvRegZ2BqZvdlrTCHZW1K5wr/cS5SAzIzsbLngNTaE=; h=From:To:Cc:Subject:Date:Message-Id:MIME-Version; b=LIf99RDWiC7+ydTq5Sdz3fxeqkJzBxS3D52vkh+V2NMIK8KexC9jSOSqZPV0JiAaK WM98TgORTTfsM2GqbYi9eK84U7x2MKC6LzWAcr6kdo1LY/IwqtX4tUcG3E63C1m8QA 41qYKFYSAsab2aW2HKRtCrwahAR9U0YmEpOjFi+D0C2g9sADxXTtQkANqYBXBNTHR4 2jGRD7Wbd8h4CHzHlp4JounuSYq8XDVYu0BM6ETErUw1dPpz+Wp4c6DjArdo4ZYd3B SBPupA/QDpk1Yvcm7gHMq02/7Z/xpMpObjXR43miwgCttSM79EUMsPm8JBWwwLFGzG 5+K/avYVJeiEg== From: Heinrich Schuchardt To: Bin Meng Cc: Mayuresh Chitale , u-boot@lists.denx.de, Heinrich Schuchardt Subject: [PATCH 1/1] riscv: qemu: provide more SPL boot methods Date: Sat, 22 Jul 2023 13:10:33 +0200 Message-Id: <20230722111033.55930-1-heinrich.schuchardt@canonical.com> X-Mailer: git-send-email 2.40.1 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.8 at phobos.denx.de X-Virus-Status: Clean QEMU can supply block devices or semihosting to U-Boot SPL. Allow booting from these. Signed-off-by: Heinrich Schuchardt --- board/emulation/qemu-riscv/qemu-riscv.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/board/emulation/qemu-riscv/qemu-riscv.c b/board/emulation/qemu-riscv/qemu-riscv.c index ae3b7a3295..b2fe3e9f0c 100644 --- a/board/emulation/qemu-riscv/qemu-riscv.c +++ b/board/emulation/qemu-riscv/qemu-riscv.c @@ -69,10 +69,21 @@ int board_late_init(void) } #ifdef CONFIG_SPL -u32 spl_boot_device(void) +void board_boot_order(u32 *spl_boot_list) { - /* RISC-V QEMU only supports RAM as SPL boot device */ - return BOOT_DEVICE_RAM; + int index = 0; + + if (IS_ENABLED(CONFIG_SPL_NVME)) + spl_boot_list[index++] = BOOT_DEVICE_NVME; + if (IS_ENABLED(CONFIG_SPL_SATA)) + spl_boot_list[index++] = BOOT_DEVICE_SATA; + if (IS_ENABLED(CONFIG_SPL_USB_STORAGE)) + spl_boot_list[index++] = BOOT_DEVICE_USB; + if (IS_ENABLED(CONFIG_SPL_SEMIHOSTING)) + spl_boot_list[index++] = BOOT_DEVICE_SMH; + /* RAM last as CONFIG_SPL_RAW_IMAGE_SUPPORT=y may lead to crash */ + if (IS_ENABLED(CONFIG_SPL_RAM_SUPPORT)) + spl_boot_list[index++] = BOOT_DEVICE_RAM; } #endif