[PATCH v1 1/2] spl_fit. add hook to make fixes after fit header is loaded

2021-10-07 Thread sbabic
> add hook function spl_load_simple_fit_fix_load()
> which is called after fit image header is loaded.
> Signed-off-by: Heiko Schocher 
> Reviewed-by: Simon Glass 
Applied to u-boot-imx, master, thanks !

Best regards,
Stefano Babic

-- 
=
DENX Software Engineering GmbH,  Managing Director: Wolfgang Denk
HRB 165235 Munich, Office: Kirchenstr.5, D-82194 Groebenzell, Germany
Phone: +49-8142-66989-53 Fax: +49-8142-66989-80 Email: sba...@denx.de
=


Re: [PATCH v1 1/2] spl_fit. add hook to make fixes after fit header is loaded

2021-09-29 Thread Simon Glass
Hi Heiko,

On Thu, 5 Aug 2021 at 22:45, Heiko Schocher  wrote:
>
> add hook function spl_load_simple_fit_fix_load()
> which is called after fit image header is loaded.

Please add motivation to the commit message.

>
> Signed-off-by: Heiko Schocher 
> ---
>
>  common/spl/spl_fit.c | 11 +++
>  include/spl.h|  8 
>  2 files changed, 19 insertions(+)
>
Reviewed-by: Simon Glass 


[PATCH v1 1/2] spl_fit. add hook to make fixes after fit header is loaded

2021-08-05 Thread Heiko Schocher
add hook function spl_load_simple_fit_fix_load()
which is called after fit image header is loaded.

Signed-off-by: Heiko Schocher 
---

 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