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

Fabio Estevam festevam at gmail.com
Tue Jun 7 19:27:29 CEST 2022


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
NOTICE:  BL31: Built : 14:12:35, Jun  7 2022


U-Boot 2022.07-rc3-00093-g7d3acf08ec60-dirty (Jun 07 2022 - 14:20:02 -0300)

CPU:   Freescale i.MX8MMQ rev1.0 at 1200 MHz
Reset cause: POR
Model: FSL i.MX8MM EVK board
DRAM:  2 GiB
Core:  154 devices, 20 uclasses, devicetree: separate
WDT:   Started watchdog at 30280000 with servicing (60s timeout)
MMC:   FSL_SDHC: 1, FSL_SDHC: 2
Loading Environment from MMC... OK
In:    serial at 30890000
Out:   serial at 30890000
Err:   serial at 30890000
SEC0:  RNG instantiated
Net:   eth0: ethernet at 30be0000
Hit any key to stop autoboot:  0

u-boot=> setenv autoload no
u-boot=> dhcp
u-boot=> tftp fitImage
Using ethernet at 30be0000 device
TFTP from server 192.168.0.16; our IP address is 192.168.0.41
Filename 'fitImage'.
Load address: 0x40480000
Loading: #################################################################
#################################################################
....
4.3 MiB/s
done
Bytes transferred = 36320884 (22a3674 hex)
u-boot=> bootm ${loadaddr}
## Loading kernel from FIT Image at 40480000 ...
   Using 'conf-freescale_imx8mm-kontron-n801x-s.dtb' configuration
   Trying 'kernel-1' kernel subimage
     Description:  Linux kernel
     Type:         Kernel Image
     Compression:  gzip compressed
     Data Start:   0x40480100
     Data Size:    7609360 Bytes = 7.3 MiB
     Architecture: AArch64
     OS:           Linux
     Load Address: 0x40480000
     Entry Point:  0x40480000
     Hash algo:    sha256
     Hash value:
d20b5d533e123096edb05a6433d850c0fafb4b39a6e6d47e9bade3f6fa7c26ce
   Verifying Hash Integrity ... sha256CAAM was not setup properly or
it is faulty
 error!
Bad hash value for 'hash-1' hash node in 'kernel-1' image node
Bad Data Hash
ERROR: can't get kernel image!

Peng, Ye Li, Gaurav,

Any suggestions?

Thanks


More information about the U-Boot mailing list