From mboxrd@z Thu Jan 1 00:00:00 1970 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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 4F15FC433EF for ; Thu, 11 Nov 2021 16:01:11 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B98406124D for ; Thu, 11 Nov 2021 16:01:10 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B98406124D Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=kernel.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=lists.denx.de Received: from h2850616.stratoserver.net (localhost [IPv6:::1]) by phobos.denx.de (Postfix) with ESMTP id 4372B83A6A; Thu, 11 Nov 2021 17:00:43 +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="AZdehHTM"; dkim-atps=neutral Received: by phobos.denx.de (Postfix, from userid 109) id B7C6083A3F; Thu, 11 Nov 2021 17:00:25 +0100 (CET) Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) (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 6EFAE83A4A for ; Thu, 11 Nov 2021 17:00:05 +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: by mail.kernel.org (Postfix) with ESMTPSA id 5FB1C6124C; Thu, 11 Nov 2021 16:00:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1636646402; bh=Xv5oT+h0o0ARyUb6NY3TbPElNyteEfNVqcJT/4fS48M=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=AZdehHTM9d/6SbIp6TfmXq40lRYYLuzcX5xHtTvt8tEcdd5AWcW9AKlxnoXRU1HXz Sh/jItinP6slbeM76LpdceQAYKDX+x+RfZIZpuqdO2o70CFX9PyZcCOJxqlwOjECZR gE0MNGxqf6XL63UYQgbisH+rgy91qEqtWcj85lqwej4V0B0KJJgGDwccT9sX2s6E4I xBU9Sh1O0tqkP1rqHcaXim5BZLQ/e/Bg1aEO/h+t0qm1twvn9O/AoJe5QeFtLaegbY eTaK/Ua4k+V67Wfn+gcdcQ4ihkDtAyQYBdRFcjOVTj0tXS58Xvm7MS2jWOrlcYDFjZ YnkqWEbDDyzHA== From: =?UTF-8?q?Marek=20Beh=C3=BAn?= To: Stefan Roese Cc: u-boot@lists.denx.de, =?UTF-8?q?Pali=20Roh=C3=A1r?= , =?UTF-8?q?Marek=20Beh=C3=BAn?= Subject: [PATCH u-boot-marvell 4/5] SPL: Add support for checking board / BootROM specific image types Date: Thu, 11 Nov 2021 16:59:52 +0100 Message-Id: <20211111155953.31526-5-kabel@kernel.org> X-Mailer: git-send-email 2.32.0 In-Reply-To: <20211111155953.31526-1-kabel@kernel.org> References: <20211111155953.31526-1-kabel@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: u-boot@lists.denx.de X-Mailman-Version: 2.1.34 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 --- 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; } -- 2.32.0