From: Tom Rini Date: Fri, 15 Jan 2021 21:33:04 -0500 Subject: [PATCH v3 1/8] spl: fit: Drop 'length' argument to board_spl_fit_post_load() In-Reply-To: <20201223144413.1504522-2-mr.nuke.me@gmail.com> References: <20201222235449.460100-1-mr.nuke.me@gmail.com> <20201223144413.1504522-2-mr.nuke.me@gmail.com> Message-ID: <20210116023304.GA20068@bill-the-cat> List-Id: MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit To: u-boot@lists.denx.de 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 > Reviewed-by: Peng Fan > Reviewed-by: Simon Glass > --- > 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 > #include > #include > +#include > > 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! -- Tom -------------- next part -------------- A non-text attachment was scrubbed... Name: signature.asc Type: application/pgp-signature Size: 659 bytes Desc: not available URL: