From patchwork Tue Dec 14 13:22:17 2021 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: =?utf-8?q?Marek_Beh=C3=BAn?= X-Patchwork-Id: 1567733 X-Patchwork-Delegate: sr@denx.de Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20201202 header.b=nF9qmLPM; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=pass (sender SPF authorized) smtp.mailfrom=lists.denx.de (client-ip=85.214.62.61; helo=phobos.denx.de; envelope-from=u-boot-bounces@lists.denx.de; receiver=) Received: from phobos.denx.de (phobos.denx.de [85.214.62.61]) (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 4JCzbQ6vpBz9s5P for ; Wed, 15 Dec 2021 00:23:30 +1100 (AEDT) Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 9AD0482F70; Tue, 14 Dec 2021 14:23:09 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org 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=kernel.org header.i=@kernel.org header.b="nF9qmLPM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id E9AB4811BB; Tue, 14 Dec 2021 14:22:44 +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=-2.8 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,SPF_HELO_NONE, SPF_PASS autolearn=unavailable autolearn_force=no version=3.4.2 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by phobos.denx.de (Postfix) with ESMTPS id 25F71812BB for ; Tue, 14 Dec 2021 14:22:35 +0100 (CET) Authentication-Results: phobos.denx.de; dmarc=pass (p=none dis=none) header.from=kernel.org Authentication-Results: phobos.denx.de; spf=pass smtp.mailfrom=kabel@kernel.org Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A0CF3614DC; Tue, 14 Dec 2021 13:22:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 11BABC34605; Tue, 14 Dec 2021 13:22:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1639488153; bh=WE3RxHYqzD/hET72EKP1P7Njmoqp6DYy4jXqJyM+2JI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=nF9qmLPM0rFSIZSt/J6sPOR+fNOQzQ1ZHPNF7dKcahUfj4F3qjgRXlhKeQNWRPETK pMvCjMOIOV7WMySkaHYpdOP/WzRaDaCm4mH4SLaL8AMxMEZ/JMb63ZwivzP6PV0Iex lVTCzd1JBAaigod1USQsPGt+YbuULwxb+Gvp8Ppb8+S97XrboBG6Blkgv4hxB4ne8T b6LxKGFK2yc5A2tgP0b60QAujWyrMcTv4b65zyCSt8TTEMuJfUGBYwZPAbSXQmxgTY ug4IE7jiSzU30mTNe9VRbCNPMqVHDX8ALrKk1prj6rCEp7YVE6IKHCMWf5Qtvi7cE8 2Oi51fo/z8QVw== From: =?utf-8?q?Marek_Beh=C3=BAn?= To: Stefan Roese Cc: u-boot@lists.denx.de, =?utf-8?q?Pali_Roh=C3=A1r?= , =?utf-8?q?Marek_Beh=C3=BAn?= Subject: [PATCH u-boot-marvell v3 4/9] SPL: Add support for checking board / BootROM specific image types Date: Tue, 14 Dec 2021 14:22:17 +0100 Message-Id: <20211214132222.21324-5-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211214132222.21324-1-kabel@kernel.org> References: <20211214132222.21324-1-kabel@kernel.org> MIME-Version: 1.0 X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.38 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.2 at phobos.denx.de X-Virus-Status: Clean From: Pali Rohár Commit 9baab60b8054 ("SPL: Add support for parsing board / BootROM specific image types") added support for loading board specific image types. This commit adds support for a new weak function spl_parse_board_header() which is called after loading boot image. Board may implement this function for checking if loaded board specific image is valid. Signed-off-by: Pali Rohár Signed-off-by: Marek Behún Reviewed-by: Stefan Roese --- common/spl/spl.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/common/spl/spl.c b/common/spl/spl.c index bf2139a058..cc3b3b3438 100644 --- a/common/spl/spl.c +++ b/common/spl/spl.c @@ -589,6 +589,12 @@ static struct spl_image_loader *spl_ll_find_loader(uint boot_device) return NULL; } +__weak int spl_check_board_image(struct spl_image_info *spl_image, + const struct spl_boot_device *bootdev) +{ + return 0; +} + static int spl_load_image(struct spl_image_info *spl_image, struct spl_image_loader *loader) { @@ -610,6 +616,9 @@ static int spl_load_image(struct spl_image_info *spl_image, } } #endif + if (!ret) + ret = spl_check_board_image(spl_image, &bootdev); + return ret; }