[PATCH] crypto: fsl_hash: Remove unnecessary alignment check in caam_hash()

ZHIZHIKIN Andrey andrey.zhizhikin at leica-geosystems.com
Wed Jun 8 09:46:58 CEST 2022


Hello Fabio et al.,

> -----Original Message-----
> From: Fabio Estevam <festevam at gmail.com>
> Sent: Wednesday, June 8, 2022 12:50 AM
> To: Heiko Thiery <heiko.thiery at gmail.com>
> Cc: Stefan Roese <sr at denx.de>; U-Boot-Denx <u-boot at lists.denx.de>; Gaurav Jain
> <gaurav.jain at nxp.com>; dullfire at yahoo.com; Rasmus Villemoes
> <rasmus.villemoes at prevas.dk>; Schrempf Frieder <frieder.schrempf at kontron.de>;
> ZHIZHIKIN Andrey <andrey.zhizhikin at leica-geosystems.com>; Horia Geanta Neag
> <horia.geanta at nxp.com>; Thomas Schaefer <thomas.schaefer at kontron.com>; Ye Li
> <ye.li at nxp.com>; Peng Fan <peng.fan at nxp.com>
> Subject: Re: [PATCH] crypto: fsl_hash: Remove unnecessary alignment check in
> caam_hash()
> 
> On Tue, Jun 7, 2022 at 2:27 PM Fabio Estevam <festevam at gmail.com> wrote:
> >
> > Hi Heiko,
> >
> > On Tue, Jun 7, 2022 at 4:48 AM Heiko Thiery <heiko.thiery at gmail.com> wrote:
> >
> > >> Thomas Schäfer sees this behavior also on an imx8mn NXP evk board.
> > >> Thus I added him to this thread.
> >
> > Thanks for the feedback.
> >
> > I managed to reproduce the problem on an imx8mm-evk board.
> >
> > On top of tree U-Boot I added:
> >
> > --- a/configs/imx8mm_evk_defconfig
> > +++ b/configs/imx8mm_evk_defconfig
> > @@ -87,3 +87,4 @@ CONFIG_SYSRESET_PSCI=y
> >  CONFIG_SYSRESET_WATCHDOG=y
> >  CONFIG_DM_THERMAL=y
> >  CONFIG_IMX_WATCHDOG=y
> > +CONFIG_IMX_HAB=y
> >
> > Then I try to load the fitImage and the sha256 calculation via CAAM fails:
> >
> > U-Boot SPL 2022.07-rc3-00093-g7d3acf08ec60-dirty (Jun 07 2022 - 14:20:02 -0300)
> > SEC0:  RNG instantiated
> > Normal Boot
> > WDT:   Started watchdog at 30280000 with servicing (60s timeout)
> > Trying to boot from MMC1
> > hab fuse not enabled
> >
> > Authenticate image from DDR location 0x401fcdc0...
> > bad magic magic=0x0 length=0x00 version=0x0
> > bad length magic=0x0 length=0x00 version=0x0
> > bad version magic=0x0 length=0x00 version=0x0
> > Error: Invalid IVT structure
> > NOTICE:  BL31: v2.4(release):lf-5.15.5-1.0.0-10-gcb51a0faa4b6
> 
> The problem seems to be related to the TF-A version.
> 
> If I use the older imx_5.4.47_2.2.0 TF-A then the sha256 calculation
> via CAAM does not fail.

I just tried the imx8mp_evk and with CONFIG_IMX_HAB=y the board
does not pass the SPL.

I used the upstream TF-A for my build, without HAB support
enabled the board boots:
----
U-Boot SPL 2022.07-rc4-00003-g9eca6cc66a (Jun 08 2022 - 08:21:41 +0200)
SEC0:  RNG instantiated
Normal Boot
WDT:   Started watchdog at 30280000 with servicing (60s timeout)
Trying to boot from BOOTROM
image offset 0x8000, pagesize 0x200, ivt offset 0x0
NOTICE:  BL31: v2.7(release):v2.7.0-17-g65a5e1c04-dirty
NOTICE:  BL31: Built : 06:19:26, Jun  8 2022


U-Boot 2022.07-rc4-00003-g9eca6cc66a (Jun 08 2022 - 08:21:41 +0200)

CPU:   Freescale i.MX8MP[8] rev1.0 at 1200 MHz
Reset cause: POR
Model: NXP i.MX8MPlus EVK board
DRAM:  6 GiB
Core:  176 devices, 22 uclasses, devicetree: separate
WDT:   Started watchdog at 30280000 with servicing (60s timeout)
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... *** Warning - bad CRC, using default environment

In:    serial at 30890000
Out:   serial at 30890000
Err:   serial at 30890000
SEC0:  RNG instantiated
Net:   eth0: ethernet at 30be0000, eth1: ethernet at 30bf0000 [PRIME]
Hit any key to stop autoboot:  0
u-boot=>
----

When HAB in enabled, the only thing that can be observed in the
console is:
----
U-Boot SPL 2022.07-rc4-00003-g9eca6cc66a-dirty (Jun 08 2022 - 09:40:52 +0200)
----

I believe there is a common problem with the CAAM configuration
here and usage of HAB, perhaps due to JR reservations.


Gaurav,

Can you please advise on what could be causing this behavior on i.MX8MP?

Thanks a lot!

> 
> Regards,
> 
> Fabio Estevam

-- andrey


More information about the U-Boot mailing list