diff options
author | Ye Li <ye.li@nxp.com> | 2018-08-14 03:45:30 -0700 |
---|---|---|
committer | Ye Li <ye.li@nxp.com> | 2018-08-14 20:02:02 -0700 |
commit | 02b9874427beffe6536e38519037e36f76b2ec9e (patch) | |
tree | 880a0bcf5270aef9260a379ad3afc18a3c938e5c /arch/arm/include | |
parent | 9f2ffbe41493fb9233d79e2933e337d7a6c2e20a (diff) |
MLK-19219-2 imx8qm/qxp: Add support to get container image set size
Add relevant functions and files to parse the container image set from mmc/sd
and get the total size of it. So we can get the offset of u-boot-atf.bin image
when it is padded to container image set at 1KB alignment position.
Signed-off-by: Ye Li <ye.li@nxp.com>
Diffstat (limited to 'arch/arm/include')
-rw-r--r-- | arch/arm/include/asm/arch-imx8/image.h | 46 |
1 files changed, 46 insertions, 0 deletions
diff --git a/arch/arm/include/asm/arch-imx8/image.h b/arch/arm/include/asm/arch-imx8/image.h new file mode 100644 index 0000000000..ce9c0959f8 --- /dev/null +++ b/arch/arm/include/asm/arch-imx8/image.h @@ -0,0 +1,46 @@ +/* SPDX-License-Identifier: GPL-2.0+ */ +/* + * Copyright 2018 NXP + */ + +#define IV_MAX_LEN 32 +#define HASH_MAX_LEN 64 + +#define CONTAINER_HDR_ALIGNMENT 0x400 +#define CONTAINER_HDR_MMCSD_OFFSET SZ_32K + + struct container_hdr{ + uint8_t version; + uint8_t length_lsb; + uint8_t length_msb; + uint8_t tag; + uint32_t flags; + uint16_t sw_version; + uint8_t fuse_version; + uint8_t num_images; + uint16_t sig_blk_offset; + uint16_t reserved; + }__attribute__((packed)); + + struct boot_img_t{ + uint32_t offset; + uint32_t size; + uint64_t dst; + uint64_t entry; + uint32_t hab_flags; + uint32_t meta; + uint8_t hash[HASH_MAX_LEN]; + uint8_t iv[IV_MAX_LEN]; + }__attribute__((packed)); + + struct signature_block_hdr{ + uint8_t version; + uint8_t length_lsb; + uint8_t length_msb; + uint8_t tag; + uint16_t srk_table_offset; + uint16_t cert_offset; + uint16_t blob_offset; + uint16_t signature_offset; + uint32_t reserved; + }__attribute__((packed)); |