From: Heiko Schocher <hs@denx.de>
To: u-boot@lists.denx.de, Stefano Babic <sbabic@denx.de>
Cc: "Tim Harvey" <tharvey@gateworks.com>,
"Heiko Schocher" <hs@denx.de>,
"Alexandru Gagniuc" <mr.nuke.me@gmail.com>,
"Faiz Abbas" <faiz_abbas@ti.com>,
"Jaehoon Chung" <jh80.chung@samsung.com>,
"Marek Vasut" <marex@denx.de>, "Michael Walle" <michael@walle.cc>,
"Michal Simek" <michal.simek@xilinx.com>,
"Pali Rohár" <pali@kernel.org>,
"Philippe Reynes" <philippe.reynes@softathome.com>,
"Simon Glass" <sjg@chromium.org>, "Stefan Roese" <sr@denx.de>,
"Teresa Remmet" <t.remmet@phytec.de>
Subject: [PATCH v1 1/2] spl_fit. add hook to make fixes after fit header is loaded
Date: Fri, 6 Aug 2021 06:44:26 +0200 [thread overview]
Message-ID: <20210806044427.1958686-2-hs@denx.de> (raw)
In-Reply-To: <20210806044427.1958686-1-hs@denx.de>
add hook function spl_load_simple_fit_fix_load()
which is called after fit image header is loaded.
Signed-off-by: Heiko Schocher <hs@denx.de>
---
common/spl/spl_fit.c | 11 +++++++++++
include/spl.h | 8 ++++++++
2 files changed, 19 insertions(+)
diff --git a/common/spl/spl_fit.c b/common/spl/spl_fit.c
index f41abca0cc..633fac2e6b 100644
--- a/common/spl/spl_fit.c
+++ b/common/spl/spl_fit.c
@@ -548,6 +548,15 @@ __weak bool spl_load_simple_fit_skip_processing(void)
return false;
}
+/*
+ * Weak default function to allow fixes after fit header
+ * is loaded.
+ */
+__weak void *spl_load_simple_fit_fix_load(void *fit)
+{
+ return fit;
+}
+
static void warn_deprecated(const char *msg)
{
printf("DEPRECATED: %s\n", msg);
@@ -685,6 +694,8 @@ int spl_load_simple_fit(struct spl_image_info *spl_image,
if (spl_load_simple_fit_skip_processing())
return 0;
+ ctx.fit = spl_load_simple_fit_fix_load(ctx.fit);
+
ret = spl_simple_fit_parse(&ctx);
if (ret < 0)
return ret;
diff --git a/include/spl.h b/include/spl.h
index afbf39bef4..fd1d47cd05 100644
--- a/include/spl.h
+++ b/include/spl.h
@@ -304,6 +304,14 @@ ulong spl_get_image_text_base(void);
*/
bool spl_load_simple_fit_skip_processing(void);
+/**
+ * spl_load_simple_fit_fix_load() - Hook to make fixes
+ * after fit image header is loaded
+ *
+ * Returns pointer to fit
+ */
+void *spl_load_simple_fit_fix_load(void *fit);
+
/**
* spl_load_simple_fit() - Loads a fit image from a device.
* @spl_image: Image description to set up
--
2.31.1
next prev parent reply other threads:[~2021-08-06 4:45 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-08-06 4:44 [PATCH v1 0/2] imx8m: fix secure boot Heiko Schocher
2021-08-06 4:44 ` Heiko Schocher [this message]
2021-09-30 4:09 ` [PATCH v1 1/2] spl_fit. add hook to make fixes after fit header is loaded Simon Glass
2021-10-07 14:13 ` sbabic
2021-08-06 4:44 ` [PATCH v1 2/2] imx: spl: implement spl_load_simple_fit_fix_load Heiko Schocher
2021-10-07 14:12 ` sbabic
2021-08-06 5:56 ` [PATCH v1 0/2] imx8m: fix secure boot Peng Fan (OSS)
2021-08-06 6:39 ` Heiko Schocher
2021-08-06 7:16 ` [EXT] " Ye Li
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=20210806044427.1958686-2-hs@denx.de \
--to=hs@denx.de \
--cc=faiz_abbas@ti.com \
--cc=jh80.chung@samsung.com \
--cc=marex@denx.de \
--cc=michael@walle.cc \
--cc=michal.simek@xilinx.com \
--cc=mr.nuke.me@gmail.com \
--cc=pali@kernel.org \
--cc=philippe.reynes@softathome.com \
--cc=sbabic@denx.de \
--cc=sjg@chromium.org \
--cc=sr@denx.de \
--cc=t.remmet@phytec.de \
--cc=tharvey@gateworks.com \
--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