u-boot-imx FIT image support

cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

u-boot-imx FIT image support

238 Views
mprt42
Contributor II

Hi,

I'm a bit confused regarding which u-boot to use (mainline or nxp).

As I can see, the u-boot-imx does not support FIT images. Is that correct?

(see bootm command https://github.com/nxp-imx/uboot-imx/blob/lf_v2022.04/cmd/bootm.c )

Can you confirm this?
What's the reason for that decision? I thought u-boot-nxp was supposed to stay close to mainline?

Thanks a lot!

 

0 Kudos
4 Replies

191 Views
AldoG
NXP TechSupport
NXP TechSupport

Hello,

I cannot find such limitation, could you share where did you see such?

Best regards/Saludos,
Aldo.

0 Kudos

131 Views
mprt42
Contributor II

Hello AldoG,

First of all, this "case IMAGE_FORMAT_FIT" is missing in the do_bootm function:

https://community.nxp.com/t5/i-MX-Processors/Patch-for-u-boot-imx-Using-FIT-and-HAB-in-bootm-command...

And in addition to that, I get some cache alignment errors when the sha256 of my FIT image components are calculated.

## Checking Image at 12000000 ...
FIT image found
FIT description: Kernel fitImage for NXP i.MX Release Distro/5.15.71+gitAUTOINC+50912be386/acp-imx6pos
Created: 2023-09-12 22:17:59 UTC
Image 0 (kernel-1)
Description: Linux kernel
Created: 2023-09-12 22:17:59 UTC
Type: Kernel Image
Compression: uncompressed
Data Start: 0x12000108
Data Size: 9274656 Bytes = 8.8 MiB
Architecture: ARM
OS: Linux
Load Address: 0x10008000
Entry Point: 0x10008000
Hash algo: sha256
Hash value: 3198aa66117966a11ea3c07f3e3d7c613bb9958f70e999c8e8897642d7544c7b
Image 1 (fdt-imx6dl.dtb)
Description: Flattened Device Tree blob
Created: 2023-09-12 22:17:59 UTC
Type: Flat Device Tree
Compression: uncompressed
Data Start: 0x128d873c
Data Size: 44419 Bytes = 43.4 KiB
Architecture: ARM
Hash algo: sha256
Hash value: 50751df99acda6d9bfe27dc0a558216e493c707f9fecce2238adcfb2f6788863
Default Configuration: 'conf-imx6dl.dtb'
Configuration 0 (conf-imx6dl.dtb)
Description: 1 Linux kernel, FDT blob
Kernel: kernel-1
FDT: fdt-imx6dl.dtb
Hash algo: sha256
Hash value: unavailable
## Checking hash(es) for FIT Image at 12000000 ...
Hash(es) for Image 0 (kernel-1): sha256CACHE: Misaligned operation at range [12000108, 128d8648]
CACHE: Misaligned operation at range [4e76b0d8, 4e76b118]
CACHE: Misaligned operation at range [4e76b0d8, 4e76b118]
ERROR: v7_outer_cache_inval_range - start address is not aligned - 0x4e76b0d8
ERROR: v7_outer_cache_inval_range - stop address is not aligned - 0x4e76b118
CACHE: Misaligned operation at range [4e76b0d8, 4e76b118]
CACHE: Misaligned operation at range [4e76b0d8, 4e76b118]
ERROR: v7_outer_cache_inval_range - start address is not aligned - 0x4e76b0d8
ERROR: v7_outer_cache_inval_range - stop address is not aligned - 0x4e76b118
error!
Bad hash value for 'hash-1' hash node in 'kernel-1' image node
Bad hash in FIT image 

It seems to me as if FIT images are not widely used and tested yet.
Is there any "known-good" way to build a FIT-image-based distro and u-boot for example for imx6dlsabresd?

Also, u-boot-imx and mainline (or fslc) have deviated quite a bit, making switching very complicated.
Do you have any plans on getting back closer to mainline? If not, may I learn the motivation behind maintaining your "own u-boot"?

Thanks a lot!

0 Kudos

56 Views
mprt42
Contributor II

I made some further experiments and it turns out that somehow the hardware accellerated SHA256 requires the data to be cache aligned.
If i disable FSL_CAAM, i.e. force software SHA256, it works.

Is there any way to solve this?

0 Kudos

96 Views
mprt42
Contributor II

Furthermore, here hector_delgado states that you don't support FIT images (at all?) on the i.MX 6UL:

https://community.nxp.com/t5/i-MX-Processors/u-boot-crashed-at-caam-hash-while-verifying-sha256-chec...

can you elaborate a bit more on that?
What's the current state?

0 Kudos