U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: "Marek Behún" <kabel@kernel.org>
To: Stefan Roese <sr@denx.de>
Cc: u-boot@lists.denx.de, "Pali Rohár" <pali@kernel.org>,
	"Marek Behún" <marek.behun@nic.cz>
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	[thread overview]
Message-ID: <20211214132222.21324-5-kabel@kernel.org> (raw)
In-Reply-To: <20211214132222.21324-1-kabel@kernel.org>

From: Pali Rohár <pali@kernel.org>

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 <pali@kernel.org>
Signed-off-by: Marek Behún <marek.behun@nic.cz>
Reviewed-by: Stefan Roese <sr@denx.de>
---
 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


  parent reply	other threads:[~2021-12-14 13:23 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-12-14 13:22 [PATCH u-boot-marvell v3 0/9] More verifications for kwbimage in SPL Marek Behún
2021-12-14 13:22 ` [PATCH u-boot-marvell v3 1/9] arm: mvebu: Check that kwbimage offset and blocksize are valid Marek Behún
2021-12-14 13:22 ` [PATCH u-boot-marvell v3 2/9] SPL: Add struct spl_boot_device parameter into spl_parse_board_header() Marek Behún
2021-12-14 13:22 ` [PATCH u-boot-marvell v3 3/9] arm: mvebu: Check that kwbimage blockid matches boot mode Marek Behún
2021-12-14 13:22 ` Marek Behún [this message]
2021-12-14 13:22 ` [PATCH u-boot-marvell v3 5/9] arm: mvebu: Check for kwbimage data checksum Marek Behún
2021-12-14 13:22 ` [PATCH u-boot-marvell v3 6/9] arm: mvebu: spl: Print srcaddr in error message Marek Behún
2021-12-14 13:22 ` [PATCH u-boot-marvell v3 7/9] arm: mvebu: spl: Use preferred types u8/u16/u32 instead of uintN_t Marek Behún
2021-12-14 13:22 ` [PATCH u-boot-marvell v3 8/9] arm: mvebu: spl: Use IS_ENABLED() instead of #ifdef where possible Marek Behún
2021-12-14 13:22 ` [PATCH u-boot-marvell v3 9/9] arm: mvebu: spl: Fix 100 column exceeds Marek Behún
2021-12-18  9:16 ` [PATCH u-boot-marvell v3 0/9] More verifications for kwbimage in SPL Stefan Roese
2022-01-13 14:30   ` Pali Rohár

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20211214132222.21324-5-kabel@kernel.org \
    --to=kabel@kernel.org \
    --cc=marek.behun@nic.cz \
    --cc=pali@kernel.org \
    --cc=sr@denx.de \
    --cc=u-boot@lists.denx.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox