From patchwork Mon Jan 30 09:21:43 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Mario Kicherer X-Patchwork-Id: 1733752 X-Patchwork-Delegate: trini@ti.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=fail reason="signature verification failed" (1024-bit key; secure) header.d=kicherer.org header.i=@kicherer.org header.a=rsa-sha256 header.s=k1 header.b=PEelMBrp; 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 4P52kt1Z6Hz23hg for ; Mon, 30 Jan 2023 20:22:12 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 31B0380F50; Mon, 30 Jan 2023 10:21:55 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kicherer.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=u-boot-bounces@lists.denx.de Authentication-Results: phobos.denx.de; dkim=fail reason="signature verification failed" (1024-bit key; secure) header.d=kicherer.org header.i=@kicherer.org header.b="PEelMBrp"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id A22F380FF7; Mon, 30 Jan 2023 10:21:51 +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=-0.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,FORGED_SPF_HELO, RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,SPF_HELO_PASS,SPF_NONE autolearn=no autolearn_force=no version=3.4.2 Received: from mail.zeus06.de (www.zeus06.de [194.117.254.36]) (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 195CC80F5A for ; Mon, 30 Jan 2023 10:21:48 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=none (p=none dis=none) header.from=kicherer.org Authentication-Results: phobos.denx.de; spf=none smtp.mailfrom=dev@kicherer.org DKIM-Signature: v=1; a=rsa-sha256; c=simple; d=kicherer.org; h=from:to :cc:subject:date:message-id:mime-version :content-transfer-encoding; s=k1; bh=SHu1GnhF2I9uCb2kM3r0Uv85rKo 7mErIO0zuSbOb+gs=; b=PEelMBrplWuzjE0b5KhS/zkXJXGHYTYZZqF6GKGHkIF V6XnT61BzOS0npJjcnaM2k2DkoAfZ/03W2Z335Trpf+Taw7g3xTD1CtAxwfss0Tc dlIKHnl2AeHwDmH8E002dTyj9O1R2CtlfYCpDNMUsRAN6cBdGlB4FsUGa+m2c/3I = Received: (qmail 1569819 invoked from network); 30 Jan 2023 10:21:47 +0100 Received: by mail.zeus06.de with ESMTPSA (TLS_AES_256_GCM_SHA384 encrypted, authenticated); 30 Jan 2023 10:21:47 +0100 X-UD-Smtp-Session: l3s6476p2@9C5vvnfzkRbCtAHJ From: Mario Kicherer To: u-boot@lists.denx.de Cc: sr@denx.de, Mario Kicherer Subject: [PATCH] spl: spl-nor: return error if no valid image was loaded Date: Mon, 30 Jan 2023 10:21:43 +0100 Message-Id: <20230130092143.192282-1-dev@kicherer.org> X-Mailer: git-send-email 2.34.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.6 at phobos.denx.de X-Virus-Status: Clean If only FIT images are enabled and loading the FIT image fails, spl_nor_load_image() should return an error instead of zero. Without this patch: >>SPL: board_init_r() spl_init Trying to boot from NOR Unsupported OS image.. Jumping nevertheless.. image entry point: 0x0 With patch: >>SPL: board_init_r() spl_init Trying to boot from NOR SPL: failed to boot from all boot devices (err=-6) .### ERROR ### Please RESET the board ### Signed-off-by: Mario Kicherer --- common/spl/spl_nor.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/common/spl/spl_nor.c b/common/spl/spl_nor.c index ffb3566d89..e75127b275 100644 --- a/common/spl/spl_nor.c +++ b/common/spl/spl_nor.c @@ -120,6 +120,6 @@ static int spl_nor_load_image(struct spl_image_info *spl_image, &hdr); } - return 0; + return -EINVAL; } SPL_LOAD_IMAGE_METHOD("NOR", 0, BOOT_DEVICE_NOR, spl_nor_load_image);