public inbox for u-boot@lists.denx.de
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [PATCH v3 1/8] spl: fit: Drop 'length' argument to board_spl_fit_post_load()
Date: Mon, 18 Jan 2021 11:59:08 -0500	[thread overview]
Message-ID: <20210118165908.GV9782@bill-the-cat> (raw)
In-Reply-To: <94640c35-f180-6116-e0e7-5953e7bda20a@gmail.com>

On Mon, Jan 18, 2021 at 10:28:45AM -0600, Alex G. wrote:
> On 1/15/21 8:33 PM, Tom Rini wrote:
> > On Wed, Dec 23, 2020 at 08:44:05AM -0600, Alexandru Gagniuc wrote:
> > 
> > > The size is derived from the FIT image itself. Any alignment
> > > requirements are machine-specific and known by the board code. Thus
> > > the total length can be derived from the FIT image and knowledge of
> > > the platform. The 'length' argument is redundant. Remove it.
> > > 
> > > Signed-off-by: Alexandru Gagniuc <mr.nuke.me@gmail.com>
> > > Reviewed-by: Peng Fan <peng.fan@nxp.com>
> > > Reviewed-by: Simon Glass <sjg@chromium.org>
> > > ---
> > >   arch/arm/mach-imx/spl.c | 5 +++--
> > >   common/spl/spl_fit.c    | 4 ++--
> > >   include/spl.h           | 4 ++--
> > >   3 files changed, 7 insertions(+), 6 deletions(-)
> > > 
> > > diff --git a/arch/arm/mach-imx/spl.c b/arch/arm/mach-imx/spl.c
> > > index aa2686bb92..11255798d3 100644
> > > --- a/arch/arm/mach-imx/spl.c
> > > +++ b/arch/arm/mach-imx/spl.c
> > > @@ -18,6 +18,7 @@
> > >   #include <asm/mach-imx/hab.h>
> > >   #include <asm/mach-imx/boot_mode.h>
> > >   #include <g_dnl.h>
> > > +#include <linux/libfdt.h>
> > >   DECLARE_GLOBAL_DATA_PTR;
> > > @@ -318,9 +319,9 @@ ulong board_spl_fit_size_align(ulong size)
> > >   	return size;
> > >   }
> > > -void board_spl_fit_post_load(ulong load_addr, size_t length)
> > > +void board_spl_fit_post_load(const void *fit)
> > >   {
> > > -	u32 offset = length - CONFIG_CSF_SIZE;
> > > +	u32 offset = ALIGN(fdt_totalsize(fit), 0x1000);
> > >   	if (imx_hab_authenticate_image(load_addr,
> > >   				       offset + IVT_SIZE + CSF_PAD_SIZE,
> > 
> > OK, this is a problem right here.  First, the code no longer compiles as
> > we don't pass in "load_addr", which is what
> > imx_hab_authenticate_image() takes to know where in DDR the image is to
> > validate.  While I could probably work out that value from what we use
> > now for offset, I would rather someone that can test the code do so.
> > Thanks!
> > 
> 
> Hi Tom,
> 
> I'm sorry I missed that. I seemed to have, again, solved the hard problem
> and choked on something simple. Being able to eliminate the 'length'
> argument is essential simplifying the FIT code, and the rest of this series.
> Fixing the compilation issue is trivial, but how do we get this tested? Do
> you know someone with the hardware who'd be willing to give it a shot?

Actually, yes.  Please cc Matt Porter on the next re-spin and he can run
a boot test on fused hardware.  Thanks!

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 659 bytes
Desc: not available
URL: <https://lists.denx.de/pipermail/u-boot/attachments/20210118/ad7ccbb2/attachment.sig>

  reply	other threads:[~2021-01-18 16:59 UTC|newest]

Thread overview: 51+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-12-16  0:09 [PATCH 0/8] spl: fit: Play nicely with OP-TEE and Linux Alexandru Gagniuc
2020-12-16  0:09 ` [PATCH 1/8] spl: fit: Drop 'length' argument to board_spl_fit_post_load() Alexandru Gagniuc
2020-12-16  7:13   ` Peng Fan
2020-12-16 14:32     ` Alex G.
2020-12-19  2:28   ` Simon Glass
2020-12-16  0:09 ` [PATCH 2/8] spl: fit: Factor out FIT parsing and use a context struct Alexandru Gagniuc
2020-12-19  2:28   ` Simon Glass
2020-12-21 19:28     ` Alex G.
2020-12-21 20:23       ` Simon Glass
2020-12-21 22:24         ` Alex G.
2020-12-29  3:33           ` Simon Glass
2020-12-30  0:07             ` Alex G.
2020-12-30 14:15               ` Tom Rini
2020-12-31  2:57               ` Simon Glass
2021-01-31  3:45                 ` Simon Glass
2020-12-16  0:09 ` [PATCH 3/8] spl: fit: Pass FIT context via a structure pointer Alexandru Gagniuc
2020-12-19  2:28   ` Simon Glass
2020-12-16  0:09 ` [PATCH 4/8] spl: fit: Remove useless loop in spl_fit_get_image_name() Alexandru Gagniuc
2020-12-19  2:29   ` Simon Glass
2020-12-16  0:09 ` [PATCH 5/8] spl: fit: Only look up FIT configuration node once Alexandru Gagniuc
2020-12-19  2:29   ` Simon Glass
2020-12-16  0:09 ` [PATCH 6/8] image: Do not #if guard board_fit_config_name_match() prototype Alexandru Gagniuc
2020-12-19  2:29   ` Simon Glass
2020-12-16  0:09 ` [PATCH 7/8] spl: fit: Replace #ifdef blocks with more readable constructs Alexandru Gagniuc
2020-12-19  2:29   ` Simon Glass
2020-12-21 17:43     ` Alex G.
2020-12-21 20:23       ` Simon Glass
2020-12-16  0:09 ` [PATCH 8/8] spl: fit: Load devicetree when a Linux payload is found Alexandru Gagniuc
2020-12-16 17:26   ` Alex G.
2020-12-22 23:54 ` [PATCH v2 0/8] spl: fit: Play nicely with OP-TEE and Linux Alexandru Gagniuc
2020-12-23 14:44   ` [PATCH v3 " Alexandru Gagniuc
2020-12-23 14:44   ` [PATCH v3 1/8] spl: fit: Drop 'length' argument to board_spl_fit_post_load() Alexandru Gagniuc
2021-01-16  2:33     ` Tom Rini
2021-01-18 16:28       ` Alex G.
2021-01-18 16:59         ` Tom Rini [this message]
2020-12-23 14:44   ` [PATCH v3 2/8] spl: fit: Factor out FIT parsing and use a context struct Alexandru Gagniuc
2020-12-23 14:44   ` [PATCH v3 3/8] spl: fit: Pass FIT context via a structure pointer Alexandru Gagniuc
2020-12-23 14:44   ` [PATCH v3 4/8] spl: fit: Remove useless loop in spl_fit_get_image_name() Alexandru Gagniuc
2020-12-23 14:44   ` [PATCH v3 5/8] spl: fit: Only look up FIT configuration node once Alexandru Gagniuc
2020-12-23 14:44   ` [PATCH v3 6/8] image: Do not #if guard board_fit_config_name_match() prototype Alexandru Gagniuc
2020-12-23 14:44   ` [PATCH v3 7/8] spl: fit: Replace #ifdef blocks with more readable constructs Alexandru Gagniuc
2020-12-23 14:44   ` [PATCH v3 8/8] spl: fit: Load devicetree when a Linux payload is found Alexandru Gagniuc
2020-12-22 23:54 ` [PATCH v2 1/8] spl: fit: Drop 'length' argument to board_spl_fit_post_load() Alexandru Gagniuc
2020-12-22 23:54 ` [PATCH v2 2/8] spl: fit: Factor out FIT parsing and use a context struct Alexandru Gagniuc
2020-12-29  3:32   ` Simon Glass
2020-12-22 23:54 ` [PATCH v2 3/8] spl: fit: Pass FIT context via a structure pointer Alexandru Gagniuc
2020-12-22 23:54 ` [PATCH v2 4/8] spl: fit: Remove useless loop in spl_fit_get_image_name() Alexandru Gagniuc
2020-12-22 23:54 ` [PATCH v2 5/8] spl: fit: Only look up FIT configuration node once Alexandru Gagniuc
2020-12-22 23:54 ` [PATCH v2 6/8] image: Do not #if guard board_fit_config_name_match() prototype Alexandru Gagniuc
2020-12-22 23:54 ` [PATCH v2 7/8] spl: fit: Replace #ifdef blocks with more readable constructs Alexandru Gagniuc
2020-12-22 23:54 ` [PATCH v2 8/8] spl: fit: Load devicetree when a Linux payload is found Alexandru Gagniuc

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=20210118165908.GV9782@bill-the-cat \
    --to=trini@konsulko.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