Ok, I have signed "flash" (SD card or USB) target of "imx-mkimage" because that process well described in documentation, and it works - ahab_status prints no security events (OTG USB boot through UUU).
But I found that can`t sign "flash_flexspi" target of "imx-mkimage" using the same CSF (for "flash" target):
破坏者 (高亮显示为已读) [ERROR] CST: Offsets are not consistent with the input binary to be signed
[ERROR] CST: Offsets are not consistent with the input binary to be signed
But offset in CSF correct - they are from imx-mkimage output.
破坏者 (高亮显示为已读) [Header] Target = AHAB Version = 1.0
[Install SRK] # Output of srktool File = "../SRK_1_2_3_4_table.bin" # Public key certificate in PEM or DER format Source = "../crts/SRK1_sha384_secp384r1_v3_ca_crt.der" # Index of SRK in SRK table Source index = 0 # Origin of SRK table Source set = OEM # Revoked SRKs Revocations = 0x0
[Install Certificate] # Public key certificate in PEM or DER format File = "../crts/SGK1_1_sha384_secp384r1_v3_usr_crt.der" Permissions = 0x1
[Authenticate Data] # Output of mkimage File = "flash.bin" # Offsets = Container_header Signature_block (printed out by mkimage) Offsets = 0x400 0x590
[Header]Target = AHABVersion = 1.0[Install SRK]# Output of srktoolFile = "../SRK_1_2_3_4_table.bin"# Public key certificate in PEM or DER formatSource = "../crts/SRK1_sha384_secp384r1_v3_ca_crt.der"# Index of SRK in SRK tableSource index = 0# Origin of SRK tableSource set = OEM# Revoked SRKsRevocations = 0x0[Install Certificate]# Public key certificate in PEM or DER formatFile = "../crts/SGK1_1_sha384_secp384r1_v3_usr_crt.der"Permissions = 0x1[Authenticate Data]# Output of mkimageFile = "flash.bin"# Offsets = Container_header Signature_block (printed out by mkimage)Offsets = 0x400 0x590
破坏者 (高亮显示为已读) Compiling mkimage_imx8 include misc.mak include m4.mak include android.mak include test.mak include autobuild.mak include rev_a.mak include alias.mak ./../mkimage_imx8 -soc QX -rev B0 -dev flexspi -append mx8qxc0-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -out flash.bin SOC: QX REVISION: B0 BOOT DEVICE: flexspi New Container: 0 SCFW: scfw_tcm.bin AP: u-boot-atf.bin core: a35 addr: 0x80000000 Output: flash.bin CONTAINER FUSE VERSION: 0x00 CONTAINER SW VERSION: 0x0000 ivt_offset: 4096 rev: 2 Platform: i.MX8QXP B0 ivt_offset: 4096 container image offset (aligned):12000 flags: 0x10 Hash of the images = sha384 SCFW file_offset = 0x12000 size = 0x25000 Hash of the images = sha384 AP file_offset = 0x37000 size = 0xd3800 CST: CONTAINER 0 offset: 0x400 CST: CONTAINER 0: Signature Block: offset is at 0x590 DONE. Note: Please copy image to offset: IVT_OFFSET + IMAGE_OFFSET ./../scripts/fspi_packer.sh ../scripts/fspi_header F(Q)SPI IMAGE PACKED
Compiling mkimage_imx8include misc.makinclude m4.makinclude android.makinclude test.makinclude autobuild.makinclude rev_a.makinclude alias.mak./../mkimage_imx8 -soc QX -rev B0 -dev flexspi -append mx8qxc0-ahab-container.img -c -scfw scfw_tcm.bin -ap u-boot-atf.bin a35 0x80000000 -out flash.binSOC: QXREVISION: B0BOOT DEVICE: flexspiNew Container: 0SCFW: scfw_tcm.binAP: u-boot-atf.bin core: a35 addr: 0x80000000Output: flash.binCONTAINER FUSE VERSION: 0x00CONTAINER SW VERSION: 0x0000ivt_offset: 4096rev: 2Platform: i.MX8QXP B0ivt_offset: 4096container image offset (aligned):12000flags: 0x10Hash of the images = sha384SCFW file_offset = 0x12000 size = 0x25000Hash of the images = sha384AP file_offset = 0x37000 size = 0xd3800CST: CONTAINER 0 offset: 0x400CST: CONTAINER 0: Signature Block: offset is at 0x590DONE.Note: Please copy image to offset: IVT_OFFSET + IMAGE_OFFSET./../scripts/fspi_packer.sh ../scripts/fspi_headerF(Q)SPI IMAGE PACKED
How to sign "flash_flexspi" image for iMX8QXP C0?