From mboxrd@z Thu Jan 1 00:00:00 1970 From: Tom Rini Date: Mon, 18 Jan 2021 11:59:08 -0500 Subject: [PATCH v3 1/8] spl: fit: Drop 'length' argument to board_spl_fit_post_load() In-Reply-To: <94640c35-f180-6116-e0e7-5953e7bda20a@gmail.com> References: <20201222235449.460100-1-mr.nuke.me@gmail.com> <20201223144413.1504522-2-mr.nuke.me@gmail.com> <20210116023304.GA20068@bill-the-cat> <94640c35-f180-6116-e0e7-5953e7bda20a@gmail.com> Message-ID: <20210118165908.GV9782@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 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 > > > 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! > > > > 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: